[mbsystem] 01/05: Imported Upstream version 5.5.2252

Andreas Tille tille at debian.org
Thu Aug 20 13:27:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository mbsystem.

commit cd455aa5838dac7d53a1f87984cb3564b2df5a00
Author: Andreas Tille <tille at debian.org>
Date:   Thu Aug 20 10:44:17 2015 +0200

    Imported Upstream version 5.5.2252
---
 ChangeLog                                          |  300 +-
 Makefile.in                                        |   21 +-
 Makefile.template                                  |   55 -
 configure                                          | 3871 ++++++------
 configure.ac                                       | 1027 ++--
 configure.ac => configure.ac.save                  |  172 +-
 configure.cmd                                      |  197 +-
 configureGMT5.cmd                                  |   15 +
 html/ChayesJul2003.gif                             |  Bin 0 -> 19022 bytes
 html/MBTeamJul2003.gif                             |  Bin 0 -> 146993 bytes
 html/ValJul2003.gif                                |  Bin 0 -> 20392 bytes
 html/caress2001.gif                                |  Bin 0 -> 14069 bytes
 html/gpl.html                                      |  604 ++
 {src/html => html}/index.html                      |    2 +-
 {src/html => html}/mbsystem.html                   |    8 +-
 html/mbsystem_capabilities.html                    |  254 +
 {src/html => html}/mbsystem_copyright.html         |    0
 html/mbsystem_faq.html                             |  433 ++
 {src/html => html}/mbsystem_formats.html           |    2 +-
 html/mbsystem_future.html                          |  122 +
 src/html/index.html => html/mbsystem_home.html     |    2 +-
 {src/html => html}/mbsystem_how_to_get.html        |    0
 html/mbsystem_logo.gif                             |  Bin 0 -> 66436 bytes
 html/mbsystem_logo_small.gif                       |  Bin 0 -> 6158 bytes
 {src/html => html}/mbsystem_man_list.html          |    0
 {src/html => html}/mbsystem_whatsnew.html          |    0
 install_makefiles                                  | 1020 ----
 libtool                                            | 6154 ++++++++++++--------
 ltmain.sh                                          | 5528 +++++++++++-------
 src/Makefile.am                                    |    5 +-
 src/Makefile.in                                    |   23 +-
 src/Makefile.template                              |   65 -
 src/bsio/Makefile.in                               |   18 +-
 src/bsio/Makefile.template                         |  109 -
 src/bsio/bs2asc.c                                  |    4 +-
 src/bsio/mbbs.h                                    |    4 +-
 src/bsio/mbbs_defines.h                            |   15 +-
 src/bsio/mbbs_io.c                                 |    7 +-
 src/bsio/mbbs_iomrv1.c                             |    4 +-
 src/bsio/mbbs_iomrv2.c                             |    4 +-
 src/bsio/mbbs_mem.h                                |    6 +-
 src/bsio/mbbs_memalloc.c                           |    8 +-
 src/bsio/mbbs_misc.c                               |   18 +-
 src/bsio/mbbs_swapbytes.c                          |    4 +-
 src/bsio/mbbs_tm.c                                 |    4 +-
 src/bsio/mbbs_utils.c                              |   12 +-
 src/bsio/mbbs_wrhdrfields.c                        |    4 +-
 src/bsio/mbbs_wrsampflags.c                        |    4 +-
 src/gmt/Makefile.am                                |   23 +-
 src/gmt/Makefile.in                                |  256 +-
 src/gmt/Makefile.template                          |  105 -
 src/gmt/common_byteswap.h                          |  135 +
 src/gmt/common_math.h                              |  107 +
 src/gmt/common_runpath.h                           |   59 +
 src/gmt/common_sighandler.h                        |   34 +
 src/gmt/common_string.h                            |   88 +
 src/gmt/gmt_calclock.h                             |   68 +
 src/gmt/gmt_colors.h                               |   60 +
 src/gmt/gmt_common.h                               |  187 +
 src/gmt/gmt_config.h                               |    0
 src/gmt/gmt_constants.h                            |  224 +
 src/gmt/gmt_contour.h                              |  158 +
 src/gmt/gmt_core_module.h                          |  114 +
 src/gmt/gmt_crossing.h                             |   40 +
 src/gmt/gmt_customio.h                             |   55 +
 src/gmt/gmt_dcw.h                                  |   55 +
 src/gmt/gmt_defaults.h                             |  170 +
 src/gmt/gmt_define.h                               |   45 +
 src/gmt/gmt_dev.h                                  |  146 +
 src/gmt/gmt_dimensions.h                           |   29 +
 src/gmt/gmt_error.h                                |  139 +
 src/gmt/gmt_error_codes.h                          |  107 +
 src/gmt/gmt_fft.h                                  |  102 +
 src/gmt/gmt_gdalread.h                             |  177 +
 src/gmt/gmt_grd.h                                  |  193 +
 src/gmt/gmt_grdio.h                                |  157 +
 src/gmt/gmt_hash.h                                 |   48 +
 src/gmt/gmt_init.h                                 |  118 +
 src/gmt/gmt_internals.h                            |  282 +
 src/gmt/gmt_io.h                                   |  350 ++
 src/gmt/gmt_macros.h                               |  109 +
 src/gmt/gmt_map.h                                  |   68 +
 src/gmt/gmt_media_name.h                           |   31 +
 src/gmt/gmt_media_size.h                           |   31 +
 src/gmt/gmt_memory.h                               |   92 +
 src/gmt/gmt_mgg_header2.h                          |   41 +
 src/gmt/gmt_nan.h                                  |   50 +
 src/gmt/gmt_notposix.h                             |  570 ++
 src/gmt/gmt_option.h                               |   87 +
 src/gmt/gmt_pennames.h                             |   12 +
 src/gmt/gmt_plot.h                                 |  188 +
 src/gmt/gmt_private.h                              |  165 +
 src/gmt/gmt_project.h                              |  482 ++
 src/gmt/gmt_prototypes.h                           |  448 ++
 src/gmt/gmt_ps.h                                   |   61 +
 src/gmt/gmt_resources.h                            |  678 +++
 src/gmt/gmt_sharedlibs.h                           |   37 +
 src/gmt/gmt_shore.h                                |  240 +
 src/gmt/gmt_sph.h                                  |   60 +
 src/gmt/gmt_stat.h                                 |   77 +
 src/gmt/gmt_supplements_module.h                   |   73 +
 src/gmt/gmt_support.h                              |   61 +
 src/gmt/gmt_symbol.h                               |  113 +
 src/gmt/gmt_synopsis.h                             |   75 +
 src/gmt/gmt_texture.h                              |   67 +
 src/gmt/gmt_time.h                                 |   48 +
 src/gmt/gmt_types.h                                |  216 +
 src/gmt/gmt_unique.h                               |   69 +
 src/gmt/gmt_version.h                              |   63 +
 src/gmt/mbcontour.c                                | 1419 +++--
 src/gmt/mbgrdtiff.c                                | 1353 +++--
 src/gmt/mbswath.c                                  | 2539 ++++----
 src/gmt/pslib.h                                    |  405 ++
 src/gsf/Makefile.in                                |   18 +-
 src/gsf/Makefile.template                          |  106 -
 src/gsf/gsf.c                                      |    2 +-
 src/gsf/{gsf.c => gsf.c.orig}                      |    0
 src/gsf/gsf.c.rej                                  |   17 +
 src/gsf/gsf.h                                      |   31 +
 src/gsf/{gsf.h => gsf.h.orig}                      |    0
 src/gsf/gsf.h.rej                                  |   65 +
 src/html/ChangeLog.txt                             |  299 +-
 src/html/Makefile.in                               |   18 +-
 src/html/Makefile.template                         |   45 -
 src/html/index.html                                |    2 +-
 src/html/man2html                                  |  Bin 0 -> 78440 bytes
 src/html/mbauvloglist.html                         |   65 +-
 src/html/mbclean.html                              |   19 +-
 src/html/mbcontour.html                            |   36 +-
 src/html/mbdumpesf.html                            |   67 +-
 src/html/mbgrdtiff.html                            |   43 +-
 src/html/mbm_grd3dplot.html                        |   38 +-
 src/html/mbm_grdplot.html                          |   37 +-
 src/html/mbm_histplot.html                         |   21 +-
 src/html/mbm_plot.html                             |   37 +-
 src/html/mbm_route2mission.html                    |   16 +-
 src/html/mbm_xyplot.html                           |   39 +-
 src/html/mbnavadjust.html                          |   46 +-
 src/html/mbnavadjustmerge.html                     |   56 +-
 src/html/mbswath.html                              |   50 +-
 src/html/mbsystem.html                             |    8 +-
 src/html/mbsystem_copyright.html                   |    4 +-
 src/html/mbsystem_formats.html                     |    2 +-
 src/html/mbsystem_how_to_get.html                  |  158 +-
 src/html/mbsystem_man_list.html                    |   28 +-
 src/html/mbsystem_version.txt                      |    4 +-
 src/html/mbsystem_whatsnew.html                    |   18 +-
 src/macros/Makefile.in                             |   18 +-
 src/macros/Makefile.template                       |  198 -
 src/macros/mbm_arc2grd                             |    8 +-
 src/macros/mbm_bpr                                 |   15 +-
 src/macros/mbm_copy                                |    8 +-
 src/macros/mbm_dslnavfix                           |    8 +-
 src/macros/mbm_fmtvel                              |    8 +-
 src/macros/mbm_grd2arc                             |    8 +-
 src/macros/mbm_grd2geovrml                         |    6 +-
 src/macros/mbm_grd3dplot                           |  376 +-
 src/macros/mbm_grdcut                              |    8 +-
 src/macros/mbm_grdinfo                             |    8 +-
 src/macros/mbm_grdplot                             |  485 +-
 src/macros/mbm_grdtiff                             |  150 +-
 src/macros/mbm_grid                                |    8 +-
 src/macros/mbm_histplot                            |  119 +-
 src/macros/mbm_makedatalist                        |    8 +-
 src/macros/mbm_makesvp                             |    8 +-
 src/macros/mbm_multicopy                           |   22 +-
 src/macros/mbm_multidatalist                       |   11 +-
 src/macros/mbm_multiprocess                        |   17 +-
 src/macros/mbm_plot                                |  387 +-
 src/macros/mbm_rollerror                           |    6 +-
 src/macros/mbm_route2mission                       |  133 +-
 src/macros/mbm_stat                                |    8 +-
 src/macros/mbm_utm                                 |    8 +-
 src/macros/mbm_vrefcheck                           |    6 +-
 src/macros/mbm_xbt                                 |    8 +-
 src/macros/mbm_xyplot                              |  232 +-
 src/man/Makefile.in                                |   18 +-
 src/man/Makefile.template                          |   47 -
 src/man/man1/{Makefile.in => Makefile}             |  340 +-
 src/man/man1/Makefile.in                           |   18 +-
 src/man/man1/mbauvloglist.1                        |   57 +-
 src/man/man1/mbclean.1                             |   17 +-
 src/man/man1/mbcontour.1                           |   33 +-
 src/man/man1/mbdumpesf.1                           |   61 +-
 src/man/man1/mbgrdtiff.1                           |   41 +-
 src/man/man1/mbm_grd3dplot.1                       |   36 +-
 src/man/man1/mbm_grdplot.1                         |   35 +-
 src/man/man1/mbm_histplot.1                        |   19 +-
 src/man/man1/mbm_plot.1                            |   35 +-
 src/man/man1/mbm_route2mission.1                   |   12 +-
 src/man/man1/mbm_xyplot.1                          |   35 +-
 src/man/man1/mbnavadjust.1                         |   44 +-
 src/man/man1/mbnavadjustmerge.1                    |   48 +-
 src/man/man1/mbswath.1                             |   47 +-
 src/man/man1/mbsystem.1                            |    6 +-
 src/man/man3/{Makefile.in => Makefile}             |  340 +-
 src/man/man3/Makefile.in                           |   18 +-
 src/mbaux/Makefile.am                              |   12 +-
 src/mbaux/Makefile.in                              |   51 +-
 src/mbaux/Makefile.template                        |  115 -
 src/mbaux/mb_aux.h                                 |   67 +-
 src/mbaux/mb_cheb.c                                |    4 +-
 src/mbaux/mb_delaun.c                              |   44 +-
 src/mbaux/mb_intersectgrid.c                       |    4 +-
 src/mbaux/mb_pslibface.c                           |  389 --
 src/mbaux/mb_readgrd.c                             |  436 --
 src/mbaux/mb_readwritegrd.c                        |  629 ++
 src/mbaux/mb_spline.c                              |   26 +-
 src/mbaux/mb_surface.c                             |   62 +-
 src/mbaux/mb_track.c                               |   65 +-
 src/mbaux/mb_truecont.c                            |    6 +-
 src/mbaux/mb_xgraphics.c                           |   60 +-
 src/mbaux/mb_xgraphics.h                           |    4 +-
 src/mbaux/mb_zgrid.c                               |    4 +-
 src/mbedit/Makefile.am                             |   14 +-
 src/mbedit/Makefile.in                             |   32 +-
 src/mbedit/Makefile.template                       |   91 -
 src/mbedit/mbedit.c                                |    2 +-
 src/mbedit/mbedit.h                                |   50 +-
 src/mbedit/mbedit_callbacks.c                      |  290 +-
 src/mbedit/mbedit_creation.c                       |  293 +-
 src/mbedit/mbedit_prog.c                           |  295 +-
 src/mbeditviz/Makefile.am                          |    9 +-
 src/mbeditviz/Makefile.in                          |   38 +-
 src/mbeditviz/Makefile.template                    |  110 -
 src/mbeditviz/mbeditviz.h                          |   37 +-
 src/mbeditviz/mbeditviz_callbacks.c                |   53 +-
 src/mbeditviz/mbeditviz_creation.c                 |   95 +-
 src/mbeditviz/mbeditviz_main.c                     |   11 +-
 src/mbeditviz/mbeditviz_prog.c                     |   42 +-
 src/mbgrdviz/Makefile.am                           |    9 +-
 src/mbgrdviz/Makefile.in                           |   37 +-
 src/mbgrdviz/Makefile.template                     |  103 -
 src/mbgrdviz/mbgrdviz_callbacks.c                  |  515 +-
 src/mbgrdviz/mbgrdviz_creation.c                   |  141 +-
 src/mbgrdviz/mbgrdviz_main.c                       |   15 +-
 src/mbio/Makefile.am                               |   18 +-
 src/mbio/Makefile.in                               |  337 +-
 src/mbio/Makefile.template                         |  824 ---
 src/mbio/mb_absorption.c                           |    4 +-
 src/mbio/mb_access.c                               |  138 +-
 src/mbio/mb_angle.c                                |   88 +-
 src/mbio/mb_buffer.c                               |    6 +-
 src/mbio/mb_check_info.c                           |    6 +-
 src/mbio/mb_close.c                                |  114 +-
 src/mbio/mb_compare.c                              |    4 +-
 src/mbio/{mb_config.h.in => mb_config.h}           |   83 +-
 src/mbio/mb_config.h.in                            |   18 +-
 src/mbio/mb_coor_scale.c                           |    6 +-
 src/mbio/mb_defaults.c                             |   14 +-
 src/mbio/mb_define.h                               |   80 +-
 src/mbio/mb_error.c                                |    6 +-
 src/mbio/mb_esf.c                                  |   68 +-
 src/mbio/mb_fileio.c                               |    4 +-
 src/mbio/mb_format.c                               |  106 +-
 src/mbio/mb_format.h                               |   10 +-
 src/mbio/mb_get.c                                  |    6 +-
 src/mbio/mb_get_all.c                              |    6 +-
 src/mbio/mb_get_value.c                            |    6 +-
 src/mbio/mb_info.h                                 |    4 +-
 src/mbio/mb_io.h                                   |   54 +-
 src/mbio/mb_mem.c                                  |  179 +-
 src/mbio/mb_navint.c                               |   62 +-
 src/mbio/mb_platform.c                             | 1415 +++++
 src/mbio/mb_process.c                              |  180 +-
 src/mbio/mb_process.h                              |  105 +-
 src/mbio/mb_proj.c                                 |   33 +-
 src/mbio/mb_put_all.c                              |    6 +-
 src/mbio/mb_put_comment.c                          |    4 +-
 src/mbio/mb_read.c                                 |    6 +-
 src/mbio/mb_read_init.c                            |  204 +-
 src/mbio/mb_read_ping.c                            |    6 +-
 src/mbio/mb_rt.c                                   |    6 +-
 src/mbio/mb_segy.c                                 |    6 +-
 src/mbio/mb_segy.h                                 |    4 +-
 src/mbio/mb_status.h                               |    4 +-
 src/mbio/mb_swap.c                                 |   62 +-
 src/mbio/mb_swap.h                                 |    4 +-
 src/mbio/mb_time.c                                 |    6 +-
 src/mbio/mb_write_init.c                           |  170 +-
 src/mbio/mb_write_ping.c                           |    6 +-
 src/mbio/mbf_bchrtunb.h                            |    4 +-
 src/mbio/mbf_bchrxunb.h                            |    4 +-
 src/mbio/mbf_cbat8101.h                            |    4 +-
 src/mbio/mbf_cbat9001.h                            |    4 +-
 src/mbio/mbf_dsl120pf.h                            |    4 +-
 src/mbio/mbf_dsl120sf.h                            |    4 +-
 src/mbio/mbf_elmk2unb.h                            |    4 +-
 src/mbio/mbf_em12darw.h                            |    4 +-
 src/mbio/mbf_em12ifrm.h                            |    4 +-
 src/mbio/mbf_gsfgenmb.h                            |   29 +-
 src/mbio/mbf_hs10jams.h                            |    4 +-
 src/mbio/mbf_hsatlraw.h                            |    4 +-
 src/mbio/mbf_hsldedmb.h                            |    4 +-
 src/mbio/mbf_hsldeoih.h                            |    4 +-
 src/mbio/mbf_hsmdaraw.h                            |    2 +-
 src/mbio/mbf_hsmdldih.h                            |    2 +-
 src/mbio/mbf_hsuricen.h                            |    4 +-
 src/mbio/mbf_hypc8101.h                            |    4 +-
 src/mbio/mbf_mbarirov.h                            |    4 +-
 src/mbio/mbf_mbarrov2.h                            |    4 +-
 src/mbio/mbf_mbpronav.h                            |   27 +-
 src/mbio/mbf_mgd77dat.h                            |    4 +-
 src/mbio/mbf_mr1aldeo.h                            |    4 +-
 src/mbio/mbf_mr1bldeo.h                            |    4 +-
 src/mbio/mbf_mr1prhig.h                            |    4 +-
 src/mbio/mbf_mstiffss.h                            |    4 +-
 src/mbio/mbf_oicgeoda.h                            |    4 +-
 src/mbio/mbf_oicmbari.h                            |    4 +-
 src/mbio/mbf_omghdcsj.h                            |    4 +-
 src/mbio/mbf_sb2100rw.h                            |    4 +-
 src/mbio/mbf_sb2120xs.h                            |    4 +-
 src/mbio/mbf_sbifremr.h                            |    4 +-
 src/mbio/mbf_sbsiocen.h                            |    4 +-
 src/mbio/mbf_sbsiolsi.h                            |    4 +-
 src/mbio/mbf_sbsiomrg.h                            |    4 +-
 src/mbio/mbf_sbsioswb.h                            |    4 +-
 src/mbio/mbf_sburicen.h                            |    4 +-
 src/mbio/mbf_xtfr8101.h                            |    4 +-
 src/mbio/mbr_3ddepthp.c                            |   15 +-
 src/mbio/mbr_asciixyz.c                            |    6 +-
 src/mbio/mbr_bchrtunb.c                            |    6 +-
 src/mbio/mbr_bchrxunb.c                            |    6 +-
 src/mbio/mbr_cbat8101.c                            |    6 +-
 src/mbio/mbr_cbat9001.c                            |    6 +-
 src/mbio/mbr_dsl120pf.c                            |    6 +-
 src/mbio/mbr_dsl120sf.c                            |    6 +-
 src/mbio/mbr_edgjstar.c                            |    6 +-
 src/mbio/mbr_elmk2unb.c                            |    6 +-
 src/mbio/mbr_em12darw.c                            |    6 +-
 src/mbio/mbr_em12ifrm.c                            |   56 +-
 src/mbio/mbr_em300mba.c                            |    6 +-
 src/mbio/mbr_em300raw.c                            |    6 +-
 src/mbio/mbr_em710mba.c                            |    8 +-
 src/mbio/mbr_em710raw.c                            |    6 +-
 src/mbio/mbr_emoldraw.c                            |    6 +-
 src/mbio/mbr_gsfgenmb.c                            |   75 +-
 src/mbio/mbr_hir2rnav.c                            |    2 +-
 src/mbio/mbr_hs10jams.c                            |    6 +-
 src/mbio/mbr_hsatlraw.c                            |    6 +-
 src/mbio/mbr_hsds2lam.c                            |    6 +-
 src/mbio/mbr_hsds2raw.c                            |    6 +-
 src/mbio/mbr_hsldedmb.c                            |    6 +-
 src/mbio/mbr_hsldeoih.c                            |    6 +-
 src/mbio/mbr_hsmdaraw.c                            |    4 +-
 src/mbio/mbr_hsmdldih.c                            |    4 +-
 src/mbio/mbr_hsunknwn.c                            |    6 +-
 src/mbio/mbr_hsuricen.c                            |    6 +-
 src/mbio/mbr_hsurivax.c                            |    6 +-
 src/mbio/mbr_hydrob93.c                            |    6 +-
 src/mbio/mbr_hypc8101.c                            |    6 +-
 src/mbio/mbr_hysweep1.c                            |    6 +-
 src/mbio/mbr_image83p.c                            |    6 +-
 src/mbio/mbr_imagemba.c                            |    6 +-
 src/mbio/mbr_l3xseraw.c                            |    6 +-
 src/mbio/mbr_mbarirov.c                            |    6 +-
 src/mbio/mbr_mbarrov2.c                            |    6 +-
 src/mbio/mbr_mbldeoih.c                            |    6 +-
 src/mbio/mbr_mbnetcdf.c                            |    6 +-
 src/mbio/mbr_mbpronav.c                            |   62 +-
 src/mbio/mbr_mgd77dat.c                            |    6 +-
 src/mbio/mbr_mgd77tab.c                            |    6 +-
 src/mbio/mbr_mgd77txt.c                            |    6 +-
 src/mbio/mbr_mr1aldeo.c                            |    6 +-
 src/mbio/mbr_mr1bldeo.c                            |    6 +-
 src/mbio/mbr_mr1prhig.c                            |    6 +-
 src/mbio/mbr_mr1prvr2.c                            |    6 +-
 src/mbio/mbr_mstiffss.c                            |    6 +-
 src/mbio/mbr_nvnetcdf.c                            |    6 +-
 src/mbio/mbr_oicgeoda.c                            |    6 +-
 src/mbio/mbr_oicmbari.c                            |    6 +-
 src/mbio/mbr_omghdcsj.c                            |    6 +-
 src/mbio/mbr_photgram.c                            |    6 +-
 src/mbio/mbr_reson7kr.c                            |   10 +-
 src/mbio/mbr_samesurf.c                            |    6 +-
 src/mbio/mbr_sb2000sb.c                            |    6 +-
 src/mbio/mbr_sb2000ss.c                            |    6 +-
 src/mbio/mbr_sb2100bi.c                            |    6 +-
 src/mbio/mbr_sb2100rw.c                            |    6 +-
 src/mbio/mbr_sbifremr.c                            |    6 +-
 src/mbio/mbr_sbsiocen.c                            |    6 +-
 src/mbio/mbr_sbsiolsi.c                            |    6 +-
 src/mbio/mbr_sbsiomrg.c                            |    6 +-
 src/mbio/mbr_sbsioswb.c                            |    6 +-
 src/mbio/mbr_sburicen.c                            |    6 +-
 src/mbio/mbr_sburivax.c                            |    6 +-
 src/mbio/mbr_segysegy.c                            |    6 +-
 src/mbio/mbr_swplssxi.c                            |    6 +-
 src/mbio/mbr_swplssxp.c                            |    6 +-
 src/mbio/mbr_tempform.c                            |    6 +-
 src/mbio/mbr_wasspenl.c                            |  554 +-
 src/mbio/mbr_xtfb1624.c                            |    6 +-
 src/mbio/mbr_xtfr8101.c                            |    6 +-
 src/mbio/mbsys_3datdepthlidar.c                    |    6 +-
 src/mbio/mbsys_3datdepthlidar.h                    |    4 +-
 src/mbio/mbsys_atlas.c                             |    6 +-
 src/mbio/mbsys_atlas.h                             |    4 +-
 src/mbio/mbsys_benthos.c                           |    6 +-
 src/mbio/mbsys_benthos.h                           |    4 +-
 src/mbio/mbsys_dsl.c                               |    6 +-
 src/mbio/mbsys_dsl.h                               |    4 +-
 src/mbio/mbsys_elac.c                              |    6 +-
 src/mbio/mbsys_elac.h                              |    4 +-
 src/mbio/mbsys_elacmk2.c                           |    6 +-
 src/mbio/mbsys_elacmk2.h                           |    4 +-
 src/mbio/mbsys_gsf.c                               |   13 +-
 src/mbio/mbsys_gsf.h                               |    4 +-
 src/mbio/mbsys_hdcs.c                              |    8 +-
 src/mbio/mbsys_hdcs.h                              |   40 +-
 src/mbio/mbsys_hs10.c                              |    6 +-
 src/mbio/mbsys_hs10.h                              |    4 +-
 src/mbio/mbsys_hsds.c                              |    6 +-
 src/mbio/mbsys_hsds.h                              |    4 +-
 src/mbio/mbsys_hsmd.c                              |    4 +-
 src/mbio/mbsys_hsmd.h                              |    2 +-
 src/mbio/mbsys_hysweep.c                           |    6 +-
 src/mbio/mbsys_hysweep.h                           |    9 +-
 src/mbio/mbsys_image83p.c                          |    6 +-
 src/mbio/mbsys_image83p.h                          |    4 +-
 src/mbio/mbsys_jstar.c                             |    6 +-
 src/mbio/mbsys_jstar.h                             |    4 +-
 src/mbio/mbsys_ldeoih.c                            |    6 +-
 src/mbio/mbsys_ldeoih.h                            |    4 +-
 src/mbio/mbsys_mr1.c                               |    6 +-
 src/mbio/mbsys_mr1.h                               |    4 +-
 src/mbio/mbsys_mr1b.c                              |    6 +-
 src/mbio/mbsys_mr1b.h                              |    4 +-
 src/mbio/mbsys_mr1v2001.c                          |    6 +-
 src/mbio/mbsys_mr1v2001.h                          |    4 +-
 src/mbio/mbsys_mstiff.c                            |    6 +-
 src/mbio/mbsys_mstiff.h                            |    4 +-
 src/mbio/mbsys_navnetcdf.c                         |    6 +-
 src/mbio/mbsys_navnetcdf.h                         |    4 +-
 src/mbio/mbsys_netcdf.c                            |    6 +-
 src/mbio/mbsys_netcdf.h                            |    4 +-
 src/mbio/mbsys_oic.c                               |    6 +-
 src/mbio/mbsys_oic.h                               |    4 +-
 src/mbio/mbsys_reson.c                             |    6 +-
 src/mbio/mbsys_reson.h                             |    4 +-
 src/mbio/mbsys_reson7k.c                           |    6 +-
 src/mbio/mbsys_reson7k.h                           |    8 +-
 src/mbio/mbsys_reson8k.c                           |    6 +-
 src/mbio/mbsys_reson8k.h                           |    4 +-
 src/mbio/mbsys_sb.c                                |    6 +-
 src/mbio/mbsys_sb.h                                |    4 +-
 src/mbio/mbsys_sb2000.c                            |    6 +-
 src/mbio/mbsys_sb2000.h                            |    4 +-
 src/mbio/mbsys_sb2100.c                            |    6 +-
 src/mbio/mbsys_sb2100.h                            |    4 +-
 src/mbio/mbsys_simrad.c                            |    6 +-
 src/mbio/mbsys_simrad.h                            |    4 +-
 src/mbio/mbsys_simrad2.c                           |    6 +-
 src/mbio/mbsys_simrad2.h                           |    4 +-
 src/mbio/mbsys_simrad3.c                           |    6 +-
 src/mbio/mbsys_simrad3.h                           |    4 +-
 src/mbio/mbsys_singlebeam.c                        |    6 +-
 src/mbio/mbsys_singlebeam.h                        |    4 +-
 src/mbio/mbsys_stereopair.c                        |    6 +-
 src/mbio/mbsys_stereopair.h                        |   14 +-
 src/mbio/mbsys_surf.c                              |    6 +-
 src/mbio/mbsys_surf.h                              |    4 +-
 src/mbio/mbsys_swathplus.c                         |   14 +-
 src/mbio/mbsys_swathplus.h                         |    4 +-
 src/mbio/mbsys_templatesystem.c                    |    6 +-
 src/mbio/mbsys_templatesystem.h                    |    4 +-
 src/mbio/mbsys_wassp.c                             |   63 +-
 src/mbio/mbsys_wassp.h                             |  542 +-
 src/mbio/mbsys_xse.c                               |    6 +-
 src/mbio/mbsys_xse.h                               |    4 +-
 src/mbio/stamp-h1                                  |    1 +
 src/mbnavadjust/Makefile.am                        |   11 +-
 src/mbnavadjust/Makefile.in                        |   31 +-
 src/mbnavadjust/Makefile.template                  |   94 -
 src/mbnavadjust/mbnavadjust.c                      |    7 +-
 src/mbnavadjust/mbnavadjust.h                      |  186 +-
 src/mbnavadjust/mbnavadjust_callbacks.c            |  309 +-
 src/mbnavadjust/mbnavadjust_creation.c             |  324 +-
 src/mbnavadjust/mbnavadjust_creation.h             |    5 +-
 src/mbnavadjust/mbnavadjust_extrawidgets.h         |    4 +-
 src/mbnavadjust/mbnavadjust_io.c                   |  229 +-
 src/mbnavadjust/mbnavadjust_io.h                   |   20 +-
 src/mbnavadjust/mbnavadjust_prog.c                 | 4387 ++++++++++----
 ...{mbnavadjust_prog.c => mbnavadjust_prog.c.orig} | 4383 ++++++++++----
 src/mbnavadjust/mbnavadjustmerge.c                 |  589 +-
 src/mbnavedit/Makefile.am                          |   11 +-
 src/mbnavedit/Makefile.in                          |   28 +-
 src/mbnavedit/Makefile.template                    |   94 -
 src/mbnavedit/mbnavedit.c                          |    2 +-
 src/mbnavedit/mbnavedit.h                          |  145 +-
 src/mbnavedit/mbnavedit_callbacks.c                |  124 +-
 src/mbnavedit/mbnavedit_creation.c                 |  249 +-
 src/mbnavedit/mbnavedit_extrawidgets.h             |   26 +-
 src/mbnavedit/mbnavedit_prog.c                     |  161 +-
 src/mbvelocitytool/Makefile.am                     |    8 +-
 src/mbvelocitytool/Makefile.in                     |   29 +-
 src/mbvelocitytool/Makefile.template               |   93 -
 src/mbvelocitytool/mbvelocity.c                    |    7 +-
 src/mbvelocitytool/mbvelocity.h                    |   29 +-
 src/mbvelocitytool/mbvelocity_callbacks.c          |   71 +-
 src/mbvelocitytool/mbvelocity_creation.c           |  117 +-
 src/mbvelocitytool/mbvelocity_prog.c               |  173 +-
 src/mbview/MB3DNavList.c                           |   23 +-
 src/mbview/MB3DRouteList.c                         |   23 +-
 src/mbview/MB3DSiteList.c                          |   24 +-
 src/mbview/MB3DView.c                              |  349 +-
 src/mbview/MBpedit.c                               |  169 +-
 src/mbview/Makefile.am                             |   10 +-
 src/mbview/Makefile.in                             |   35 +-
 src/mbview/Makefile.template                       |  174 -
 src/mbview/Mb3dsdg.c                               |   89 +-
 src/mbview/mb3dsoundings_callbacks.c               |   15 +-
 src/mbview/mb3dsoundings_creation.c                |   11 +
 src/mbview/mb3dsoundings_main.c                    |    2 +-
 src/mbview/mb3dsoundingsprivate.h                  |   59 +-
 src/mbview/mb_glwdrawa.c                           |   30 +-
 src/mbview/mb_glwdrawa.h                           |   26 +-
 src/mbview/mb_glwdrawap.h                          |    6 +-
 src/mbview/mbpingedit.c                            |    2 +-
 src/mbview/mbpingedit_callbacks.c                  |   15 +-
 src/mbview/mbpingedit_creation.c                   |   11 +
 src/mbview/mbpingeditprivate.h                     |   50 +-
 src/mbview/mbview.h                                |   86 +-
 src/mbview/mbview_callbacks.c                      |  106 +-
 src/mbview/mbview_nav.c                            |   15 +-
 src/mbview/mbview_pick.c                           |   15 +-
 src/mbview/mbview_plot.c                           |   15 +-
 src/mbview/mbview_primary.c                        |   48 +-
 src/mbview/mbview_process.c                        |   15 +-
 src/mbview/mbview_profile.c                        |   15 +-
 src/mbview/mbview_route.c                          |   15 +-
 src/mbview/mbview_secondary.c                      |   15 +-
 src/mbview/mbview_site.c                           |   15 +-
 src/mbview/mbview_vector.c                         |   15 +-
 src/mbview/mbviewprivate.h                         |   81 +-
 src/otps/Makefile.am                               |    7 +-
 src/otps/Makefile.in                               |   25 +-
 src/otps/Makefile.template                         |   76 -
 src/otps/mbotps.c                                  |    6 +-
 src/otps/otps.h                                    |    1 -
 src/proj/Makefile.in                               |   18 +-
 src/proj/Makefile.template                         | 1028 ----
 src/ps/Makefile.in                                 |   18 +-
 src/ps/Makefile.template                           |   40 -
 src/ps/mb7k2jstar.ps                               |    2 +-
 src/ps/mb7k2ss.ps                                  |    4 +-
 src/ps/mb7kpreprocess.ps                           |    2 +-
 src/ps/mbabsorption.ps                             |    4 +-
 src/ps/mbareaclean.ps                              |    4 +-
 src/ps/mbauvloglist.ps                             |  677 ++-
 src/ps/mbauvnavusbl.ps                             |    2 +-
 src/ps/mbbackangle.ps                              |    6 +-
 src/ps/mbclean.ps                                  |  404 +-
 src/ps/mbcontour.ps                                |  709 +--
 src/ps/mbcopy.ps                                   |    2 +-
 src/ps/mbctdlist.ps                                |    2 +-
 src/ps/mbdatalist.ps                               |    2 +-
 src/ps/mbdefaults.ps                               |    2 +-
 src/ps/mbdumpesf.ps                                |  151 +-
 src/ps/mbedit.ps                                   |    2 +-
 src/ps/mbeditviz.ps                                |    2 +-
 src/ps/mbextractsegy.ps                            |    2 +-
 src/ps/mbfilter.ps                                 |    2 +-
 src/ps/mbformat.ps                                 |    2 +-
 src/ps/mbgetesf.ps                                 |    2 +-
 src/ps/mbgrdtiff.ps                                |  281 +-
 src/ps/mbgrdviz.ps                                 |    2 +-
 src/ps/mbgrid.ps                                   |    4 +-
 src/ps/mbhistogram.ps                              |    2 +-
 src/ps/mbhsdump.ps                                 |    2 +-
 src/ps/mbhysweeppreprocess.ps                      |    2 +-
 src/ps/mbinfo.ps                                   |    2 +-
 src/ps/mbio.ps                                     |    2 +-
 src/ps/mbkongsbergpreprocess.ps                    |    2 +-
 src/ps/mblevitus.ps                                |    2 +-
 src/ps/mblist.ps                                   |    2 +-
 src/ps/mbm_arc2grd.ps                              |    2 +-
 src/ps/mbm_bpr.ps                                  |    2 +-
 src/ps/mbm_copy.ps                                 |    2 +-
 src/ps/mbm_dslnavfix.ps                            |    2 +-
 src/ps/mbm_fmtvel.ps                               |    2 +-
 src/ps/mbm_grd2arc.ps                              |    2 +-
 src/ps/mbm_grd2geovrml.ps                          |    2 +-
 src/ps/mbm_grd3dplot.ps                            | 1448 ++---
 src/ps/mbm_grdcut.ps                               |    2 +-
 src/ps/mbm_grdinfo.ps                              |    2 +-
 src/ps/mbm_grdplot.ps                              | 1992 +++----
 src/ps/mbm_grdtiff.ps                              |    2 +-
 src/ps/mbm_grid.ps                                 |    2 +-
 src/ps/mbm_histplot.ps                             |  345 +-
 src/ps/mbm_makedatalist.ps                         |    2 +-
 src/ps/mbm_makesvp.ps                              |    2 +-
 src/ps/mbm_multicopy.ps                            |    2 +-
 src/ps/mbm_multidatalist.ps                        |    6 +-
 src/ps/mbm_multiprocess.ps                         |    6 +-
 src/ps/mbm_plot.ps                                 | 1909 +++---
 src/ps/mbm_route2mission.ps                        |  318 +-
 src/ps/mbm_stat.ps                                 |    2 +-
 src/ps/mbm_utm.ps                                  |    2 +-
 src/ps/mbm_vrefcheck.ps                            |    2 +-
 src/ps/mbm_xbt.ps                                  |    2 +-
 src/ps/mbm_xyplot.ps                               |  959 +--
 src/ps/mbmosaic.ps                                 |    4 +-
 src/ps/mbnavadjust.ps                              | 2139 +++----
 src/ps/mbnavadjustmerge.ps                         |  511 +-
 src/ps/mbnavedit.ps                                |    2 +-
 src/ps/mbnavlist.ps                                |    2 +-
 src/ps/mbneptune2esf.ps                            |    2 +-
 src/ps/mbotps.ps                                   |   10 +-
 src/ps/mbpreprocess.ps                             |    2 +-
 src/ps/mbprocess.ps                                |    8 +-
 src/ps/mbps.ps                                     |    2 +-
 src/ps/mbrollbias.ps                               |    4 +-
 src/ps/mbrolltimelag.ps                            |    2 +-
 src/ps/mbroutetime.ps                              |    2 +-
 src/ps/mbsegygrid.ps                               |    2 +-
 src/ps/mbsegyinfo.ps                               |    2 +-
 src/ps/mbsegylist.ps                               |    2 +-
 src/ps/mbsegypsd.ps                                |    4 +-
 src/ps/mbset.ps                                    |    8 +-
 src/ps/mbstripnan.ps                               |    2 +-
 src/ps/mbsvplist.ps                                |    6 +-
 src/ps/mbsvpselect.ps                              |    2 +-
 src/ps/mbswath.ps                                  |  725 +--
 src/ps/mbswplspreprocess.ps                        |    2 +-
 src/ps/mbsystem.ps                                 |  133 +-
 src/ps/mbtime.ps                                   |    2 +-
 src/ps/mbvelocitytool.ps                           |    2 +-
 src/share/Makefile.in                              |   18 +-
 src/share/Makefile.template                        |   39 -
 src/surf/Makefile.in                               |   18 +-
 src/surf/Makefile.template                         |  110 -
 src/utilities/Makefile.am                          |  246 +-
 src/utilities/Makefile.in                          |  202 +-
 src/utilities/Makefile.template                    |  364 --
 src/utilities/mb7k2jstar.c                         |    6 +-
 src/utilities/mb7k2ss.c                            |   26 +-
 src/utilities/mb7kpreprocess.c                     | 1095 +++-
 .../{mb7kpreprocess.c => mb7kpreprocess.c.new}     | 1133 +++-
 src/utilities/mbabsorption.c                       |    6 +-
 src/utilities/mbareaclean.c                        |    6 +-
 src/utilities/mbauvloglist.c                       |  140 +-
 src/utilities/mbauvnavusbl.c                       |    6 +-
 src/utilities/mbbackangle.c                        |  316 +-
 src/utilities/mbclean.c                            |  534 +-
 src/utilities/mbcopy.c                             |  186 +-
 src/utilities/mbctdlist.c                          |   33 +-
 src/utilities/mbdatalist.c                         |    6 +-
 src/utilities/mbdefaults.c                         |    6 +-
 src/utilities/mbdumpesf.c                          |  240 +-
 src/utilities/mbextractsegy.c                      |   86 +-
 src/utilities/mbfilter.c                           |  104 +-
 src/utilities/mbformat.c                           |    6 +-
 src/utilities/mbgetesf.c                           |    6 +-
 src/utilities/mbgrid.c                             |  340 +-
 src/utilities/mbhistogram.c                        |   78 +-
 src/utilities/mbhsdump.c                           |    6 +-
 src/utilities/mbhysweeppreprocess.c                |    6 +-
 src/utilities/mbinfo.c                             |    6 +-
 src/utilities/mbinsreprocess.c                     |    6 +-
 src/utilities/mbkongsbergpreprocess.c              |    2 +-
 src/utilities/mblevitus.c                          |  143 +-
 src/utilities/mblist.c                             |  290 +-
 src/utilities/mbmosaic.c                           |  408 +-
 src/utilities/mbnavlist.c                          |  102 +-
 src/utilities/mbneptune2esf.c                      |    6 +-
 src/utilities/mbpreprocess.c                       |   63 +-
 src/utilities/mbprocess.c                          |  263 +-
 src/utilities/mbps.c                               |    6 +-
 src/utilities/mbrollbias.c                         |   87 +-
 src/utilities/mbrolltimelag.c                      |    8 +-
 src/utilities/mbroutetime.c                        |    6 +-
 src/utilities/mbrphsbias.c                         |    6 +-
 src/utilities/mbsegygrid.c                         |  219 +-
 src/utilities/mbsegyinfo.c                         |   34 +-
 src/utilities/mbsegylist.c                         |   63 +-
 src/utilities/mbsegypsd.c                          |  165 +-
 src/utilities/mbset.c                              |    6 +-
 src/utilities/mbsslayout.c                         |   12 +-
 src/utilities/mbstripnan.c                         |    4 +-
 src/utilities/mbsvplist.c                          |    6 +-
 src/utilities/mbsvpselect.c                        |    7 +-
 src/utilities/mbswplspreprocess.c                  |    4 +-
 src/utilities/mbtime.c                             |    6 +-
 683 files changed, 49241 insertions(+), 35791 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1fa68b1..bb8f25b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 -------------------------------------------------------------------------------
 MB-SYSTEM CHANGELOG FILE:
 -------------------------------------------------------------------------------
-Version: $Id: ChangeLog 2219 2014-12-11 21:22:25Z caress $
+Version: $Id: ChangeLog 2252 2015-07-01 19:35:37Z caress $
 -------------------------------------------------------------------------------
 
 This file lists changes to the source code of the MB-System open
@@ -16,7 +16,28 @@ Here "*" denotes source distribution release made available for ftp download.
 Releases without an "*" are discrete revisions available from the source code
 archive at http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System.
 
-* Version 5.4.2220       January 22, 2015
+* Version 5.5.2252       July 1, 2015
+* Version 5.5.2251       June 30, 2015
+  Version 5.5.2250       June 29, 2015
+  Version 5.5.2249       June 26, 2015
+* Version 5.5.2248       May 31, 2015
+  Version 5.5.2247       May 29, 2015
+* Version 5.5.2246       May 27, 2015
+* Version 5.5.2243       May 22, 2015
+* Version 5.5.2242       May 16, 2015
+  Version 5.5.2241       May 12, 2015
+  Version 5.5.2240       May 8, 2015
+  Version 5.5.2239       May 6, 2015
+  Version 5.5.2238       April 14, 2015
+  Version 5.5.2237       March 23, 2015
+  Version 5.5.2234       March 5, 2015
+* Version 5.5.2233       February 23, 2015
+  Version 5.5.2232       February 21, 2015
+  Version 5.5.2231       February 20, 2015
+  Version 5.5.2230       February 18, 2015
+  Version 5.5.2229       February 14, 2015
+  Version 5.5.2228       February 6, 2015
+* Version 5.4.2220       January 22, 2015 (Last GMT4-compatible archive revision, released February 27, 2015)
   Version 5.4.2219       December 11, 2014
   Version 5.4.2218       December 4, 2014
   Version 5.4.2217       December 1, 2014
@@ -193,15 +214,284 @@ archive at http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System.
   Version 5.0.beta00     April 6, 2001
 
 -------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.4 RELEASE NOTES:
+MB-SYSTEM VERSION 5.5 RELEASE NOTES:
 -------------------------------------------------------------------------------
 
------> 5.4.2220 (January 22, 2014)
+-----> 5.5.2252 (July 1, 2015)
+
+Mbedit, mbnavedit, mbnavadjust, mbvelocitytool: Fix X11 font initialization
+problem created in the 2251 commit.
+
+-----> 5.5.2251 (June 30, 2015)
+
+Mblist, mbnavlist, mbctdlist: Changed time outputs so that decimal second
+values will be formatted according to the locale (e.g. decimal delineation by
+commas in Europe).
+
+Mbedit, mbnavedit, mbnavadjust, mbvelocitytool, mbgrdviz, mbeditviz: Set up
+preprocessor defines to allow fonts to be defined using the CFLAGS
+environment variable.
+
+-----> 5.5.2250 (June 29, 2015)
+
+Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Removed call to X11
+function XtSetLanguageProc() in all graphical tools. This call apparently
+causes the program locale to be reset according system defaults, even if the
+program implicitly begins in the standard C locale. If the system locale uses
+"," rather than "." as the decimal point marker (e.g. a normal European locale),
+then a GMT 5 initialization will probably fail on reading fonts, at least on
+many if not all Linux distributions. Thanks to Giancarlo Troni for figuring this
+one out.
+
+General: Added mbio/mb_platform.c to the archive. This source file includes the
+functions to read, write, and use platform, sensor, and sensor offset definitions.
+At this time the mb_platform_*() functions are only used in mb7kpreprocess, but
+they will soon be used in mbprocess and all the preprocess programs.
+
+Mbprocess: changed application of tide corrections so that these corrections are
+applied to the platform depth values rather than the bathymetry values. The result
+is the same, but now the navigation (or trajectory) of the processed files is
+corrected in addition to the bathymetry.
+
+-----> 5.5.2249 (June 26, 2015)
+
+Format 121 (MBF_GSFGENMB): Kluge added to the GSF format i/o module to handle
+beam angles incorrectly constructed so that angles from vertical are negative
+for port side beams when all aziumuthal angles are uniformaly zero (=starboard).
+
+General: Added platform, sensor, and sensor offset definitions to mb_io.h for
+use in flexibly defining a platform consisting of many sensors with relative
+positional and angular offsets. Also added functions to read and write
+platform files using these definitions. Have not completed the function to perform
+lever arm calculations using this platform definition. Initially these functions
+will be used in mb7kpreprocess, but ultimately these will be used generally
+in MB-System.
+
+Mb7kpreprocess: initial implementation using the new platform file and structure
+definitions.
+
+-----> 5.5.2248 (May 31, 2015)
+
+Mbgrdviz and mbview: Fixed casts between int and pointer that seem to be
+responsible for mbgrdviz crashes.
+
+-----> 5.5.2247 (May 29, 2015)
+
+General: Cleaned up missing function prototypes through much of the codebase
+(excepting externally written libraries gsf, sapi, bsio) in an effort to fix
+crashes of mbgrdviz and other programs.
+
+-----> 5.5.2246 (May 27, 2015)
+
+Mbswath, mbcontour, mbgrdtiff: Updated GMT5 header files in src/gmt to enable
+building on Ubuntu Linux, CentOs Linux, and CygWin while maintaining
+compatibility with GMT 5.1.2.
+
+Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Incomplete tweaks to
+font handling to enable use of fonts other than Helvetica, Times, and Courier.
+
+-----> 5.5.2243 (May 22, 2015)
+
+Rewrote the configure.ac file to fix logic flaws in the configure script.
+
+-----> 5.5.2242 (May 16, 2015)
+
+Mbswath, mbcontour, mbgrdtiff: Updated files in src/gmt for compatibility with
+GMT 5.1.2.
+
+-----> 5.5.2241 (May 12, 2015)
+
+Format 59 (MBF_EM710MBA): Fixed flag causing erroneous warning that beam flags
+are not supported for this format (beam flags are supported).
+
+Many source files: further changes to precompiler directives suggested by Joaquim Luis
+in order to enable building under Windows.
+
+-----> 5.5.2240 (May 8, 2015)
+
+Format 241 (MBF_WASSPENL): Fixed recognition of *.nwsf suffix.
+
+Mbclean: fixed bug in beam position calculation identified by Joaquim Luis.
+
+-----> 5.5.2239 (May 6, 2015)
+
+Format 241 (MBF_WASSPENL): Now supports WASSP multibeam data conforming to
+the WASSP ICD 2.4. MB-System is storing beam flags in unused bytes in the
+existing CORBATHY data records (specifically the "empty" field in the
+CORBATHY beam data specified in ICD 2.4).
+
+Many source files: changes to precompiler directives suggested by Joaquim Luis
+in order to enable building under Windows.
+
+Mbnavadjust: Modified the inversion to separate the vertical and lateral
+covariance so that lateral offsets do not bleed into the vertical offset
+model.
+
+Mb7kpreprocess: Fixed bug that treated null soundings as good for datasets
+without detection records.
+
+Mbdumpesf: Added capability to output in the edit save file format in addition
+to ASCII text, and to ignore specified types of edit events (e.g. copy an esf
+file while removing all beam null events).
+
+Build system: Fixed bug that caused configure to fail if netCDF has a pkg-config
+installation while GMT5 is in a specified but nonstandard location.
+
+-----> 5.5.2238 (April 15, 2015)
+
+Mbnavadjust: Recast and improved the inversion. Added a "perturbation" model
+display which does not include the average offsets between the individual surveys
+in projects involving multiple surveys.
+
+Mbcontour, mbswath, mbgrdtiff: Included fixes suggested by Joaquim Luis for
+compatibility with the next GMT5 release.
+
+Mbclean: Removed -M3 and -M4 options that previously caused the program to null
+(or zero) rather than flag bad soundings. This is an obsolete feature that only
+made sense prior to existence of mbprocess.
+
+Mbbackangle: Fixed mbm_grdplot call to no longer use an obsolete option.
+
+-----> 5.5.2237 (March 23, 2015)
+
+Mbnavadjust, mbnavedit: Removed references to GMT and netCDF in the Makefile.am
+file in both source directories.
 
-Last version to work with GMT4.
+-----> 5.5.2236 (March 23, 2015)
+
+Mbnavadjust, mbnavadjustmerge: Added a new type of constraint referred to as a
+global tie. Each data section can have one of its navigation points tied to
+the fixed global frame of reference with a specified x, y, z offset (or just x
+and y, or just z) and x, y, and z uncertainties in the offset values. These
+global ties are set using mbnavadjustmerge. The relevant mbnavadjustmerge
+commands are:
+    --set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
+    --set-global-tie-xyz=file:section[:snav]
+    --set-global-tie-xyonly=file:section[:snav]
+    --set-global-tie-zonly=file:section[:snav]
+
+Mbnavadjustmerge: Added ability to unset (delete) global ties and crossing ties.
+The relevant mbnavadjustmerge commands are:
+    --unset-global-tie=file:section
+    --unset-tie=file1:section1/file2:section2
+
+Mbnavadjust, mbnavadjustmerge: Explicitly added references to libgmt and libpsl in
+the src/mbnavadjust/Makefile.am file so that the mbnavadjust and mbnavadjustmerge
+executables are linked to those libraries. This is to solve a mysterious dependency
+of mbnavadjust on libgmt on CentOs6 - the program was failing due inability to find
+libgmt.so.5 even though the code does not reference any GMT or GMT5 function or header
+file. Presumably this change will go away when the mystery is solved.
+
+Mbsslayout: fixed automatically generated plottin script.
+
+Mbm_route2mission: Added multibeam maximum range value.
+
+-----> 5.5.2234 (March 5, 2015)
+
+Plot macros (mbm_grdplot, mbm_grd3dplot, mbm_grdtiff, mbm_histplot, mbm_plot,
+mbm_xyplot): Now generate plotting scripts that will not attempt to display the
+plot on the screen if invoked with a "-N" command line argument.
+
+Format 64 (MBF_MR1PRVR2): Added include of <sys/time.h> in mbbs_defines.h to
+facilitate building under cygwin.
+
+Multi-macros (mbm_multiprocess, mbm_multicopy, mbm_multidatalist): Changed to
+use datalist.mb-1 as default input and to use 4 as the default number of CPUs.
+
+Mbedit: Added fast scroll through a file if the forward or back mouse buttons
+are held down more than 2 seconds.
+
+Mbextractsegy, mbsslayout: Changed output section/line plotting script so that
+it will not attempt to display the plot on the screen if invoked with a "-N"
+command line argument.
+
+Mbprocess: Reduced informational output when not in verbose mode to make the
+output from use of mbm_multiprocess cleaner.
+
+-----> 5.5.2233 (February 23, 2015)
+
+Release 5.5.2233
+
+Mbm_grdplot, mbm_grdtiff: Generated plot scripts now set foregound and background
+colors based on the -D option.
+
+Mbmroute2mission: Now allows the maximum planned climb rate of the AUV to be
+specified with the -U option
+
+-----> 5.5.2232 (February 21, 2015)
+
+Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbhistplot: Changed handling of gmt defaults
+so that any local gmt.conf file is deleted before any gmtset calls are made, and
+the resulting gmt.conf file is deleted before the plot script ends.
+
+Mbswath: fixed calculation of beam or pixel footprints in mode requesting real
+footprint plotting.
+
+-----> 5.5.2231 (February 20, 2015)
+
+Mb7kpreprocess: Switched beam angle calculation to the mb_beaudoin() function
+already used by mbkongsbergpreprocess (contributed by Jonathan Beaudoin).
+
+Mbm_bpr: Made compatible with GMT5.
+
+-----> 5.5.2230 (February 18, 2015)
+
+Mbgrdtiff: Fixed ordering of rows and columns in the output image.
+
+Mbm_route2mission: Added output of a mission alititude profile plot.
+
+Mbauvloglist: Added capability of binary output.
+
+Mb7kpreprocess: Fixed so that bathymetry calculation uses roll merged at
+the bottom detect time for all of the possible combinations of Reson 7k
+data record types.
+
+Mbpreprocess: Fixed to exclude zero longitude or lattitude values from the
+tables used for interpolation onto ping times.
+
+Mbrolltimelag: Fixed automatically generated roll-slope correlation plot.
+
+-----> 5.5.2229 (February 14, 2015)
+
+Format 121 (MBF_GSFGENMB): The i/o module will now allocate and initialize arrays
+of beamflags and alongtrack distance when those are not included in the input file.
+
+Mbfilter: removed failing check for existance of sidescan data.
+
+Mbsegygrid: flipped grid convention for compatibility with GMT5.
+
+Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_histplot: further changes for compatibility
+with GMT5.
+
+Mbm_route2mission: Compatibility with GMT5.
+
+Mbcontour, mbswath: More changes for compatibility with GMT5.
+
+-----> 5.5.2228 (February 6, 2015)
+
+Install_makefiles: the old install_makefiles build system no longer 
+functions and has been removed.
+
+Mbgrid: When using the two-step weighted footprint slope algorithm, mbgrid
+only reads files on the second pass through the input datalist that contained
+useful data in the first pass.
+
+Major changes made to integrate MB-System with GMT5:
+  The code will no longer compile or work with GMT4.5.
+  Changes include:
+    -updating functions in libmbaux  that read and write GMT grids
+    -deletion of src/mbaux/mb_pslibface.c
+    -changes to all programs that read or write GMT grids,
+    -the former programs mbcontour, mbswath, and mbgrdtiff are now GMT5
+      modules built as part of a shared library.
+    -changes to all of the plot macros (e.g. mbm_grdplot) that make use of GMT
 
 Format 88 (MBF_RESON7KR): Update Reson 7k i/o module to handle TVG records.
 
+-------------------------------------------------------------------------------
+MB-SYSTEM VERSION 5.4 RELEASE NOTES:
+-------------------------------------------------------------------------------
+
 -----> 5.4.2219 (December 11, 2014)
 
 Mbnavadjust: Fixed fixed memory management issue related to fbt files.
diff --git a/Makefile.in b/Makefile.in
index 3113b92..532128a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,8 +81,7 @@ subdir = .
 DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
 	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/configure $(am__configure_deps) COPYING ar-lib \
-	compile config.guess config.sub depcomp install-sh missing \
-	ltmain.sh
+	compile config.guess config.sub install-sh missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -222,8 +221,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -240,6 +237,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -303,19 +301,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -328,8 +333,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/Makefile.template b/Makefile.template
deleted file mode 100644
index 9e2ea97..0000000
--- a/Makefile.template
+++ /dev/null
@@ -1,55 +0,0 @@
-#     The MB-system:	Makefile.template	5/24/94
-#     $Id: Makefile.template 2063 2013-05-22 00:05:57Z caress $
-#
-#     Copyright (c) 1993-2013 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and D. N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the top directory level
-# Author:	D. W. Caress
-# Date:		May 24, 1994
-
-# $Log: Makefile.template,v $
-#
-
-all:	bin lib include man man/man1 man/man3 \
-        share share/doc share/doc/mbsystem share/doc/mbsystem/html share/doc/mbsystem/ps share/mbsystem
-	cd src; make all
-bin:
-	mkdir bin
-lib:
-	mkdir lib
-include:
-	mkdir include
-man:
-	mkdir man
-man/man1:
-	mkdir man/man1
-man/man3:
-	mkdir man/man3
-share:
-	mkdir share
-share/doc:
-	mkdir share/doc
-share/doc/mbsystem:
-	mkdir share/doc/mbsystem
-share/doc/mbsystem/html:
-	mkdir share/doc/mbsystem/html
-share/doc/mbsystem/ps:
-	mkdir share/doc/mbsystem/ps
-share/mbsystem:
-	mkdir share/mbsystem
-
-clean:
-	- rm -r -f bin
-	- rm -r -f lib
-	- rm -r -f include
-	- rm -r -f man
-	- rm -r -f share
-	- cd src; make clean
diff --git a/configure b/configure
index a7e3e97..9fab747 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mbsystem 5.4.2220.
+# Generated by GNU Autoconf 2.69 for mbsystem 5.5.2252.
 #
 # Report bugs to <http://listserver.mbari.org/sympa/arc/mbsystem>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mbsystem'
 PACKAGE_TARNAME='mbsystem'
-PACKAGE_VERSION='5.4.2220'
-PACKAGE_STRING='mbsystem 5.4.2220'
+PACKAGE_VERSION='5.5.2252'
+PACKAGE_STRING='mbsystem 5.5.2252'
 PACKAGE_BUGREPORT='http://listserver.mbari.org/sympa/arc/mbsystem'
 PACKAGE_URL='http://www.mbari.org/data/mbsystem/'
 
@@ -640,28 +640,31 @@ mbsystemhtmldir
 mbsystemdatadir
 BUILD_GL_FALSE
 BUILD_GL_TRUE
-GL_CPPFLAGS
-GL_LIBS
+libopengl_CPPFLAGS
+libopengl_LIBS
+libGLU_LIBS
+libGLU_CFLAGS
 BUILD_MOTIF_FALSE
 BUILD_MOTIF_TRUE
-motif_CPPFLAGS
-motif_LIBS
+libmotif_CPPFLAGS
+libmotif_LIBS
+libXm_LIBS
+libXm_CFLAGS
 BUILD_FFTW_FALSE
 BUILD_FFTW_TRUE
 libfftw_CPPFLAGS
-fftw_app
 libfftw_LIBS
-libfftw_CFLAGS
+fftw_app
+libfftw3_LIBS
+libfftw3_CFLAGS
 libgmt_CPPFLAGS
 libpsl_LIBS
 libpsl_CFLAGS
-libgmtps_LIBS
-libgmtps_CFLAGS
 libgmt_LIBS
 libgmt_CFLAGS
 libproj_CPPFLAGS
-libproj_CFLAGS
 libproj_LIBS
+libproj_CFLAGS
 BUILD_PROJ_FALSE
 BUILD_PROJ_TRUE
 libnetcdf_CPPFLAGS
@@ -670,13 +673,12 @@ libnetcdf_CFLAGS
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
-BUILD_GSF_FALSE
-BUILD_GSF_TRUE
 OTPS_DIR
 XDR_LIB
 LIBM
 LIBTOOL_DEPS
 CPP
+LT_SYS_LIBRARY_PATH
 OTOOL64
 OTOOL
 LIPO
@@ -806,11 +808,11 @@ enable_shared
 enable_static
 with_pic
 enable_fast_install
+with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
 with_otps_dir
-with_gsf
 with_netcdf_lib
 with_netcdf_include
 enable_bundledproj
@@ -835,6 +837,7 @@ LIBS
 CPPFLAGS
 CCAS
 CCASFLAGS
+LT_SYS_LIBRARY_PATH
 CPP
 PKG_CONFIG
 PKG_CONFIG_PATH
@@ -845,12 +848,14 @@ libproj_CFLAGS
 libproj_LIBS
 libgmt_CFLAGS
 libgmt_LIBS
-libgmtps_CFLAGS
-libgmtps_LIBS
 libpsl_CFLAGS
 libpsl_LIBS
-libfftw_CFLAGS
-libfftw_LIBS'
+libfftw3_CFLAGS
+libfftw3_LIBS
+libXm_CFLAGS
+libXm_LIBS
+libGLU_CFLAGS
+libGLU_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1391,7 +1396,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mbsystem 5.4.2220 to adapt to many kinds of systems.
+\`configure' configures mbsystem 5.5.2252 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1461,7 +1466,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mbsystem 5.4.2220:";;
+     short | recursive ) echo "Configuration of mbsystem 5.5.2252:";;
    esac
   cat <<\_ACEOF
 
@@ -1490,18 +1495,20 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
+  --with-aix-soname=aix|svr4|both
+                          shared library versioning (aka "SONAME") variant to
+                          provide on AIX, [default=aix].
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot=DIR Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).
-  --with-otps_dir=DIR        Location of OSU Tidal Prediction Software
-  --without-gsf           Disable unlicensed SAIC Generic Sensor Format (GSF)
+  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
+                          compiler's sysroot if not specified).
+ --with-otps_dir=DIR    Location of OSU Tidal Prediction Software
   --with-netcdf-lib=DIR	Location of NetCDF library
   --with-netcdf-include=DIR	Location of NetCDF headers
   --with-proj-lib=DIR	Location of PROJ library
   --with-proj-include=DIR	Location of PROJ headers
-  --with-gmt-lib=DIR	Location of GMT libraries
+  --with-gmt-lib=DIR	Location of GMT libraries libgmt libpsl
   --with-gmt-include=DIR	Location of GMT headers
-  --with-fftw-lib=DIR	Location of FFTW3 library
+  --with-fftw-lib=DIR	Location of FFTW library
   --with-fftw-include=DIR	Location of FFTW headers
   --with-motif-lib=DIR	Location of MOTIF library
   --with-motif-include=DIR	Location of Motif headers
@@ -1518,6 +1525,8 @@ Some influential environment variables:
               you have headers in a nonstandard directory <include dir>
   CCAS        assembler compiler command (defaults to CC)
   CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
+  LT_SYS_LIBRARY_PATH
+              User-defined run-time library search path.
   CPP         C preprocessor
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
@@ -1535,17 +1544,19 @@ Some influential environment variables:
   libgmt_CFLAGS
               C compiler flags for libgmt, overriding pkg-config
   libgmt_LIBS linker flags for libgmt, overriding pkg-config
-  libgmtps_CFLAGS
-              C compiler flags for libgmtps, overriding pkg-config
-  libgmtps_LIBS
-              linker flags for libgmtps, overriding pkg-config
   libpsl_CFLAGS
               C compiler flags for libpsl, overriding pkg-config
   libpsl_LIBS linker flags for libpsl, overriding pkg-config
-  libfftw_CFLAGS
-              C compiler flags for libfftw, overriding pkg-config
-  libfftw_LIBS
-              linker flags for libfftw, overriding pkg-config
+  libfftw3_CFLAGS
+              C compiler flags for libfftw3, overriding pkg-config
+  libfftw3_LIBS
+              linker flags for libfftw3, overriding pkg-config
+  libXm_CFLAGS
+              C compiler flags for libXm, overriding pkg-config
+  libXm_LIBS  linker flags for libXm, overriding pkg-config
+  libGLU_CFLAGS
+              C compiler flags for libGLU, overriding pkg-config
+  libGLU_LIBS linker flags for libGLU, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1614,7 +1625,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mbsystem configure 5.4.2220
+mbsystem configure 5.5.2252
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2059,7 +2070,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mbsystem $as_me 5.4.2220, which was
+It was created by mbsystem $as_me 5.5.2252, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2400,7 +2411,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-$as_echo "#define VERSION_DATE \"22 January 2015\"" >>confdefs.h
+$as_echo "#define VERSION_DATE \"1 July 2015\"" >>confdefs.h
 
 
 ac_aux_dir=
@@ -2507,7 +2518,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 $as_echo " "
 $as_echo "------------------------------------------------------------------------------"
 $as_echo "    The MB-system:	configure	12/7/2011"
-$as_echo "    $Id: configure.ac 2219 2014-12-11 21:22:25Z caress $"
+$as_echo "    $Id: configure 2252 2015-07-01 19:35:37Z caress $"
 $as_echo " "
 $as_echo "    Copyright (c) 2011-2015 by"
 $as_echo "    D. W. Caress (caress at lamont.ldgo.columbia.edu)"
@@ -2548,7 +2559,7 @@ $as_echo " "
 $as_echo "        # Reset the autotools version to 2.65 to accomodate some Linux distributions"[]
 $as_echo "        sed -i.bak s/2\.69/2\.65/ configure.ac"
 $as_echo " "
-$as_echo "    When you run ./configure, a number of configure options are saved  to a"
+$as_echo "    When you run ./configure, a number of configure options are saved to a"
 $as_echo "    header file:"
 $as_echo "        ./src/mbio/mb_config.h"
 $as_echo "    This file has a template:"
@@ -2556,11 +2567,6 @@ $as_echo "        ./src/mbio/mb_config.h.in"
 $as_echo "    This file is conditionally included by:"
 $as_echo "        ./src/mbio/mb_define.h"
 $as_echo "    which is in turn included by essentially every MB-System C source file."
-$as_echo "    The condition under which mb_config.h is used is simply the use of the"
-$as_echo "    configure script to generate the makefiles. If one uses the alternate"
-$as_echo "    install_makefiles build system, then an alternate header file named"
-$as_echo "        ./src/mbio/mb_config2.h"
-$as_echo "    is used instead."
 $as_echo " "
 $as_echo "------------------------------------------------------------------------------"
 $as_echo "    To use the build system..."
@@ -2582,7 +2588,6 @@ $as_echo "        --with-motif-include  - location of Motif headers (optional)"
 $as_echo "        --with-opengl-lib     - location of OpenGL libs (optional)"
 $as_echo "        --with-opengl-include - location of OpenGL headers (optional)"
 $as_echo "        --with-otps-dir       - location of OTPS installation (optional)"
-$as_echo "        --without-gsf         - build without including or supporting GSF"
 $as_echo "        --enable-bundledproj  - build using bundled proj package - default is to link with libproj"
 $as_echo " "
 $as_echo "    After configure you can run the make utility in the usual fashion"
@@ -3086,7 +3091,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='mbsystem'
- VERSION='5.4.2220'
+ VERSION='5.5.2252'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4600,8 +4605,8 @@ esac
 
 
 
-macro_version='2.4.2'
-macro_revision='1.3337'
+macro_version='2.4.6'
+macro_revision='2.4.6'
 
 
 
@@ -4615,7 +4620,7 @@ macro_revision='1.3337'
 
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 # Backslashify metacharacters that are still active within
 # double-quoted strings.
@@ -4664,7 +4669,7 @@ func_echo_all ()
     $ECHO ""
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
 $as_echo "printf" >&6; } ;;
   print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -4987,19 +4992,19 @@ test -z "$GREP" && GREP=grep
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -5013,7 +5018,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -5024,7 +5029,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -5035,32 +5040,32 @@ if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi
 fi
 
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -5103,33 +5108,38 @@ if ${lt_cv_path_NM+:} false; then :
 else
   if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -5140,15 +5150,15 @@ else
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
@@ -5254,9 +5264,9 @@ esac
   fi
 fi
 
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -5264,8 +5274,8 @@ fi
     esac
   fi
 
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -5305,7 +5315,7 @@ if ${lt_cv_sys_max_cmd_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -5345,7 +5355,7 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -5395,22 +5405,23 @@ else
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -5428,7 +5439,7 @@ else
 
 fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
 else
@@ -5446,30 +5457,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
@@ -5592,13 +5579,13 @@ esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -5726,13 +5713,13 @@ lt_cv_deplibs_check_method='unknown'
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[4-9]*)
@@ -5759,8 +5746,7 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -5796,10 +5782,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -5838,7 +5820,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -5860,8 +5842,8 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -5914,6 +5896,9 @@ sysv4 | sysv4.3*)
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 
 fi
@@ -6071,8 +6056,8 @@ else
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -6084,7 +6069,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 
@@ -6238,7 +6223,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
@@ -6246,7 +6231,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -6259,7 +6244,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
 $as_echo "$lt_cv_ar_at_file" >&6; }
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -6476,7 +6461,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -6566,7 +6551,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   symcode='[ABCDGISTW]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[ABCDEGRST]'
   fi
   ;;
@@ -6599,14 +6584,44 @@ case `$NM -V 2>&1` in
   symcode='[ABCDGIRSTW]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -6624,21 +6639,24 @@ for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -6686,11 +6704,11 @@ _LT_EOF
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
@@ -6716,7 +6734,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -6736,13 +6754,13 @@ _LT_EOF
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -6763,7 +6781,7 @@ _LT_EOF
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -6816,6 +6834,16 @@ fi
 
 
 
+
+
+
+
+
+
+
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
 $as_echo_n "checking for sysroot... " >&6; }
 
@@ -6828,9 +6856,9 @@ fi
 
 
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -6840,8 +6868,8 @@ case ${with_sysroot} in #(
  no|'')
    ;; #(
  *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
    as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
    ;;
 esac
@@ -6853,18 +6881,99 @@ $as_echo "${lt_sysroot:-no}" >&6; }
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+  ac_path_lt_DD_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in dd; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+      $ac_path_lt_DD_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_lt_DD"; then
+    :
+  fi
+else
+  ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
 # Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then :
   enableval=$enable_libtool_lock;
 fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -6873,24 +6982,25 @@ ia64-*-hpux*)
   test $ac_status = 0; }; then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '#line '$LINENO' "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -6919,9 +7029,50 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -6935,9 +7086,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
+	    ;;
+	  powerpc64le-*linux*)
+	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -6956,7 +7117,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*linux*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -6974,7 +7138,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
@@ -7014,13 +7178,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
 $as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7032,7 +7197,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -7041,7 +7206,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -7057,7 +7222,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
@@ -7168,7 +7333,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 
@@ -7671,7 +7836,7 @@ if ${lt_cv_apple_cc_single_mod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -7689,7 +7854,7 @@ else
 	  cat conftest.err >&5
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -7728,7 +7893,7 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
@@ -7757,7 +7922,7 @@ _LT_EOF
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&5
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&5
@@ -7770,32 +7935,32 @@ fi
 $as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
 	10.[012][,.]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -7803,6 +7968,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
     ;;
   esac
 
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8106,14 +8306,14 @@ if test "${enable_shared+set}" = set; then :
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8137,14 +8337,14 @@ if test "${enable_static+set}" = set; then :
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8168,14 +8368,14 @@ if test "${with_pic+set}" = set; then :
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8183,8 +8383,6 @@ else
 fi
 
 
-test -z "$pic_mode" && pic_mode=default
-
 
 
 
@@ -8200,14 +8398,14 @@ if test "${enable_fast_install+set}" = set; then :
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8221,11 +8419,63 @@ fi
 
 
 
+  shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+  withval=$with_aix_soname; case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname
+else
+  if ${lt_cv_with_aix_soname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_with_aix_soname=aix
+fi
+
+    with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+
+
+
+
+
+
 
 
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -8274,7 +8524,7 @@ test -z "$LN_S" && LN_S="ln -s"
 
 
 
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -8313,7 +8563,7 @@ aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -8324,14 +8574,14 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -8340,15 +8590,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$LD" && LD=ld
 test -z "$ac_objext" && ac_objext=o
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
 # Only perform the check for file, if the check method requires it
@@ -8363,22 +8606,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+    if test -f "$ac_dir/${ac_tool_prefix}file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8401,13 +8644,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8429,22 +8672,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+    if test -f "$ac_dir/file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8467,13 +8710,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8494,7 +8737,7 @@ esac
 
 # Use C for the default configuration in the libtool script
 
-lt_save_CC="$CC"
+lt_save_CC=$CC
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8556,7 +8799,7 @@ if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -8572,7 +8815,7 @@ else
   lt_cv_prog_compiler_rtti_exceptions=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -8602,7 +8845,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
 else
     :
@@ -8620,17 +8863,18 @@ lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
 
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     lt_prog_compiler_wl='-Wl,'
     lt_prog_compiler_static='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       fi
+      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -8641,8 +8885,8 @@ lt_prog_compiler_static=
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -8658,6 +8902,11 @@ lt_prog_compiler_static=
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -8728,7 +8977,7 @@ lt_prog_compiler_static=
     case $host_os in
     aix*)
       lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       else
@@ -8736,10 +8985,29 @@ lt_prog_compiler_static=
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl='-Wl,-Wl,,'
+        lt_prog_compiler_pic='-PIC'
+        lt_prog_compiler_static='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -8755,7 +9023,7 @@ lt_prog_compiler_static=
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      lt_prog_compiler_static='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -8764,9 +9032,9 @@ lt_prog_compiler_static=
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
@@ -8791,6 +9059,12 @@ lt_prog_compiler_static=
 	lt_prog_compiler_pic='-PIC'
 	lt_prog_compiler_static='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -8888,7 +9162,7 @@ lt_prog_compiler_static=
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	lt_prog_compiler_pic='-Kconform_pic'
 	lt_prog_compiler_static='-Bstatic'
       fi
@@ -8917,7 +9191,7 @@ lt_prog_compiler_static=
   fi
 
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
     ;;
@@ -8949,7 +9223,7 @@ else
   lt_cv_prog_compiler_pic_works=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -8979,7 +9253,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
     case $lt_prog_compiler_pic in
      "" | " "*) ;;
      *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -9011,7 +9285,7 @@ if ${lt_cv_prog_compiler_static_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -9030,13 +9304,13 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works"; then
     :
 else
     lt_prog_compiler_static=
@@ -9156,8 +9430,8 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -9169,9 +9443,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -9214,9 +9488,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # included in the symbol list
   include_expsyms=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -9231,7 +9505,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -9239,7 +9513,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
   esac
@@ -9249,7 +9523,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -9271,24 +9545,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
+    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9301,7 +9575,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     case $host_os in
     aix[3-9]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
@@ -9320,7 +9594,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -9336,7 +9610,7 @@ _LT_EOF
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9346,7 +9620,7 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      export_dynamic_flag_spec='$wl--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
@@ -9354,61 +9628,89 @@ _LT_EOF
       exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	ld_shlibs=no
       fi
       ;;
 
     haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       link_all_deplibs=yes
       ;;
 
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
+      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+      export_dynamic_flag_spec='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -9419,42 +9721,47 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
+	tcc*)
+	  export_dynamic_flag_spec='-rdynamic'
+	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
 	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -9468,8 +9775,8 @@ _LT_EOF
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -9487,8 +9794,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9500,7 +9807,7 @@ _LT_EOF
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -9515,9 +9822,9 @@ _LT_EOF
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -9534,15 +9841,15 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
       ;;
     esac
 
-    if test "$ld_shlibs" = no; then
+    if test no = "$ld_shlibs"; then
       runpath_var=
       hardcode_libdir_flag_spec=
       export_dynamic_flag_spec=
@@ -9558,7 +9865,7 @@ _LT_EOF
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -9566,34 +9873,57 @@ _LT_EOF
       ;;
 
     aix[4-9]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
 	  ;;
 	esac
 
@@ -9612,13 +9942,21 @@ _LT_EOF
       hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
+      file_list_spec='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	hardcode_direct=no
+	hardcode_direct_absolute=no
+	;;
+      esac
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -9637,35 +9975,42 @@ _LT_EOF
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      export_dynamic_flag_spec='${wl}-bexpall'
+      export_dynamic_flag_spec='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
+        if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -9700,7 +10045,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -9708,17 +10053,17 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 if test "${lt_cv_aix_libpath+set}" = set; then
+	 if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -9753,7 +10098,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -9761,21 +10106,33 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  no_undefined_flag=' $wl-bernotok'
+	  allow_undefined_flag=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    whole_archive_flag_spec='$convenience'
 	  fi
 	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) >  [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
 	fi
       fi
       ;;
@@ -9784,7 +10141,7 @@ fi
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -9814,16 +10171,17 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
 	enable_shared_with_static_runtimes=yes
@@ -9832,18 +10190,18 @@ fi
 	# Don't use ranlib
 	old_postinstall_cmds='chmod 644 $oldlib'
 	postlink_cmds='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -9852,7 +10210,7 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -9871,24 +10229,24 @@ fi
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec=''
   fi
   link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
+  allow_undefined_flag=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
 
   else
   ld_shlibs=no
@@ -9930,33 +10288,33 @@ fi
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_direct=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
+      export_dynamic_flag_spec='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='${wl}-E'
+	export_dynamic_flag_spec='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -9964,25 +10322,25 @@ fi
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 
@@ -9994,7 +10352,7 @@ if ${lt_cv_prog_compiler__b+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS -b"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -10013,14 +10371,14 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
 $as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test yes = "$lt_cv_prog_compiler__b"; then
+    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 else
     archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 fi
@@ -10028,8 +10386,8 @@ fi
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 
 	case $host_cpu in
@@ -10040,7 +10398,7 @@ fi
 	*)
 	  hardcode_direct=yes
 	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='${wl}-E'
+	  export_dynamic_flag_spec='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -10051,8 +10409,8 @@ fi
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
@@ -10062,8 +10420,8 @@ $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >
 if ${lt_cv_irix_exported_symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int foo (void) { return 0; }
@@ -10075,24 +10433,34 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS="$save_LDFLAGS"
+           LDFLAGS=$save_LDFLAGS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       inherit_rpath=yes
       link_all_deplibs=yes
       ;;
 
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	ld_shlibs=yes
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
     netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
@@ -10107,7 +10475,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     newsos6)
       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_shlibpath_var=no
       ;;
@@ -10115,27 +10483,19 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
 	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec='${wl}-E'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
 	fi
       else
 	ld_shlibs=no
@@ -10146,33 +10506,53 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -10183,24 +10563,24 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
     solaris*)
       no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -10210,11 +10590,11 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
 	fi
@@ -10224,10 +10604,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -10276,43 +10656,43 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
+      no_undefined_flag='$wl-z,text'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
+      no_undefined_flag='$wl-z,text'
+      allow_undefined_flag='$wl-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_flag_spec='$wl-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
+      export_dynamic_flag_spec='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -10327,10 +10707,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	export_dynamic_flag_spec='$wl-Blargedynsym'
 	;;
       esac
     fi
@@ -10338,7 +10718,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
 $as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
+test no = "$ld_shlibs" && can_build_shared=no
 
 with_gnu_ld=$with_gnu_ld
 
@@ -10364,7 +10744,7 @@ x|xyes)
   # Assume -lc should be added
   archive_cmds_need_lc=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $archive_cmds in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -10579,14 +10959,14 @@ esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -10602,28 +10982,35 @@ if test "$GCC" = yes; then
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -10637,7 +11024,7 @@ BEGIN {RS=" "; FS="/|\n";} {
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -10646,7 +11033,7 @@ fi
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -10663,14 +11050,16 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[4-9]*)
@@ -10678,41 +11067,91 @@ aix[4-9]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a(lib.so.V)'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -10722,18 +11161,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -10741,8 +11180,8 @@ beos*)
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -10754,7 +11193,7 @@ bsdi[45]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -10763,8 +11202,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -10780,17 +11219,17 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
 
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -10799,8 +11238,8 @@ cygwin* | mingw* | pw32* | cegcc*)
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -10827,7 +11266,7 @@ cygwin* | mingw* | pw32* | cegcc*)
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -10840,8 +11279,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -10854,7 +11293,7 @@ cygwin* | mingw* | pw32* | cegcc*)
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -10867,8 +11306,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -10881,8 +11320,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -10900,12 +11339,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -10930,26 +11370,15 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -10967,14 +11396,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -10982,8 +11412,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -10992,8 +11422,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -11006,8 +11436,8 @@ interix[3-9]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -11018,7 +11448,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -11026,8 +11456,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -11046,8 +11476,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -11056,13 +11486,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -11106,7 +11556,12 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -11126,12 +11581,12 @@ netbsd*)
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -11141,7 +11596,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -11150,58 +11605,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -11212,8 +11677,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -11223,11 +11688,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -11235,8 +11700,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -11257,24 +11722,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -11292,7 +11757,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -11300,8 +11765,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -11311,20 +11776,35 @@ uts4*)
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
 
 
 
@@ -11421,15 +11901,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" ||
    test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
+   test yes = "$hardcode_automatic"; then
 
   # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
+  if test no != "$hardcode_direct" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test no != "$hardcode_minus_L"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
   else
@@ -11444,12 +11924,12 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
 $as_echo "$hardcode_action" >&6; }
 
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
+if test relink = "$hardcode_action" ||
+   test yes = "$inherit_rpath"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -11459,7 +11939,7 @@ fi
 
 
 
-  if test "x$enable_dlopen" != xyes; then
+  if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -11469,23 +11949,23 @@ else
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
 if ${ac_cv_lib_dl_dlopen+:} false; then :
@@ -11523,10 +12003,10 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
 
-    lt_cv_dlopen="dyld"
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
 
@@ -11534,10 +12014,18 @@ fi
 
     ;;
 
-  *)
-    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
 if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
+  lt_cv_dlopen=shl_load
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
 $as_echo_n "checking for shl_load in -ldld... " >&6; }
@@ -11576,11 +12064,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
 else
   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
 if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
+  lt_cv_dlopen=dlopen
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
@@ -11619,7 +12107,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
@@ -11658,7 +12146,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
@@ -11697,7 +12185,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
 fi
 
 
@@ -11718,21 +12206,21 @@ fi
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
@@ -11740,7 +12228,7 @@ $as_echo_n "checking whether a program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11787,9 +12275,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -11819,7 +12307,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -11839,14 +12327,14 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
 $as_echo "$lt_cv_dlopen_self" >&6; }
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11893,9 +12381,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -11925,7 +12413,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -11946,9 +12434,9 @@ fi
 $as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -11992,7 +12480,7 @@ else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -12020,7 +12508,7 @@ fi
 
 
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -12028,13 +12516,13 @@ $as_echo "$can_build_shared" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
 $as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -12042,8 +12530,12 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
     ;;
 
   aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
     fi
     ;;
   esac
@@ -12053,7 +12545,7 @@ $as_echo "$enable_shared" >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
 $as_echo_n "checking whether to build static libraries... " >&6; }
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
 $as_echo "$enable_static" >&6; }
 
@@ -12067,7 +12559,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
+CC=$lt_save_CC
 
 
 
@@ -12135,7 +12627,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5
 $as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; }
 if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then :
-  LIBM="-lmw"
+  LIBM=-lmw
 fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
@@ -12217,7 +12709,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
 $as_echo "$ac_cv_lib_m_cos" >&6; }
 if test "x$ac_cv_lib_m_cos" = xyes; then :
-  LIBM="-lm"
+  LIBM=-lm
 fi
 
   ;;
@@ -12941,7 +13433,8 @@ fi
 
 
 
-$as_echo "Check for OSU Tidal Prediction Software"
+
+$as_echo "Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise"
 OTPS_DIR="/usr/local/OTPSnc"
 
 # Check whether --with-otps_dir was given.
@@ -12951,36 +13444,72 @@ fi
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Generic Sensor Format (GSF)" >&5
-$as_echo_n "checking whether to build with Generic Sensor Format (GSF)... " >&6; }
 
-# Check whether --with-gsf was given.
-if test "${with_gsf+set}" = set; then :
-  withval=$with_gsf;
+$as_echo "Check for netCDF library libnetcdf"
+GOT_CDF=no
+CDF_SETTING=no
+
+# Check whether --with-netcdf-lib was given.
+if test "${with_netcdf_lib+set}" = set; then :
+  withval=$with_netcdf_lib; netcdf_libdir="${withval}" GOT_CDF=yes
 else
-  with_gsf=yes
+  GOT_CDF=no
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gsf" >&5
-$as_echo "$with_gsf" >&6; }
-
-if test x"$with_gsf" = xyes; then :
-
-$as_echo "#define WITH_GSF 1" >>confdefs.h
+if test "$GOT_CDF" = "yes" ; then
+        $as_echo "NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there..."
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -L$netcdf_libdir"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nc_open in -lnetcdf" >&5
+$as_echo_n "checking for nc_open in -lnetcdf... " >&6; }
+if ${ac_cv_lib_netcdf_nc_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnetcdf  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nc_open ();
+int
+main ()
+{
+return nc_open ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_netcdf_nc_open=yes
+else
+  ac_cv_lib_netcdf_nc_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
- if test x"$with_gsf" = xyes; then
-  BUILD_GSF_TRUE=
-  BUILD_GSF_FALSE='#'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netcdf_nc_open" >&5
+$as_echo "$ac_cv_lib_netcdf_nc_open" >&6; }
+if test "x$ac_cv_lib_netcdf_nc_open" = xyes; then :
+  CDF_SETTING=yes
 else
-  BUILD_GSF_TRUE='#'
-  BUILD_GSF_FALSE=
+  CDF_SETTING=no
 fi
 
-
-$as_echo "Check for NetCDF"
-GOT_CDF=no
-CDF_SETTING=no
+    LDFLAGS="$save_LDFLAGS"
+    if test "$CDF_SETTING" = "no"; then
+	as_fn_error $? "Did not find libnetcdf according to --with-netcdf-lib - check the installation!" "$LINENO" 5
+    fi
+    libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir -lnetcdf"
+    libnetcdf_LDFLAGS="-L$netcdf_libdir"
+else
+        $as_echo "Look for pkg-config netCDF package..."
 
 
 
@@ -13172,22 +13701,12 @@ else
 $as_echo "yes" >&6; }
 	GOT_CDF=yes
 fi
-
-if test "$GOT_CDF" = "no" ; then
-
-libnetcdf_LIBS="-lnetcdf"
-libnetcdf_LDFLAGS=
-
-
-# Check whether --with-netcdf-lib was given.
-if test "${with_netcdf_lib+set}" = set; then :
-  withval=$with_netcdf_lib; netcdf_libdir="${withval}" GOT_CDF=yes
-else
-  GOT_CDF=no
+    libnetcdf_LIBS="-lnetcdf"
+    libnetcdf_LDFLAGS=""
 fi
-
 if test "$GOT_CDF" = "no" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nc_open in -lnetcdf" >&5
+        $as_echo "Did not find netCDF library pkg-config package, looking in the usual places..."
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nc_open in -lnetcdf" >&5
 $as_echo_n "checking for nc_open in -lnetcdf... " >&6; }
 if ${ac_cv_lib_netcdf_nc_open+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -13229,74 +13748,18 @@ else
   CDF_SETTING=no
 fi
 
-fi
- if test "$CDF_SETTING" = "yes" ; then
-    GOT_CDF=yes
-    $as_echo "Using pre-installed libcdf."
- else
-    if test "$GOT_CDF" = "no" ; then
-	as_fn_error $? "Did not find libnetcdf, use --with-netcdf-lib" "$LINENO" 5
+    if test "$CDF_SETTING" = "yes" ; then
+        GOT_CDF=yes
+        $as_echo "Using pre-installed libnetcdf..."
+        libnetcdf_LIBS="-lnetcdf"
+        libnetcdf_LDFLAGS=""
     else
-	$as_echo "Looking for libnetcdf in $netcdf_libdir ..."
-	save_LDFLAGS=$LDFLAGS
-	LDFLAGS="$LDFLAGS -L$netcdf_libdir"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nc_open in -lnetcdf" >&5
-$as_echo_n "checking for nc_open in -lnetcdf... " >&6; }
-if ${ac_cv_lib_netcdf_nc_open+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnetcdf  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char nc_open ();
-int
-main ()
-{
-return nc_open ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_netcdf_nc_open=yes
-else
-  ac_cv_lib_netcdf_nc_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netcdf_nc_open" >&5
-$as_echo "$ac_cv_lib_netcdf_nc_open" >&6; }
-if test "x$ac_cv_lib_netcdf_nc_open" = xyes; then :
-  CDF_SETTING=yes
-else
-  CDF_SETTING=no
-fi
-
-	LDFLAGS="$save_LDFLAGS"
-	if test "$CDF_SETTING" = "no"; then
-	   as_fn_error $? "Did not find libnetcdf, use --with-netcdf-lib or check installation" "$LINENO" 5
-	fi
-	libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir $libnetcdf_LIBS"
-#
-#       Save the netcdf library path for later gmt tests
-#
-	libnetcdf_LDFLAGS="-L$netcdf_libdir"
+        $as_echo "Did not find netCDF library anywhere, use --with-netcdf-lib to set the location"
+        as_fn_error $? "Did not find netCDF library anywhere, use --with-netcdf-lib to set the location" "$LINENO" 5
     fi
- fi
-  libnetcdf_LIBS="$libnetcdf_LIBS"
-
 fi
 
+$as_echo "Check for netCDF headers"
 GOT_CDF=no
 CDF_SETTING=no
 
@@ -13307,8 +13770,13 @@ else
   GOT_CDF=no
 fi
 
-if test "$GOT_CDF" = "no" ; then
- ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
+if test "$GOT_CDF" = "yes" ; then
+        $as_echo "NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there..."
+    save_CPPFLAGS=$CPPFLAGS
+    save_CFLAGS=$CFLAGS
+    CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
+    CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
+    ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
 if test "x$ac_cv_header_netcdf_h" = xyes; then :
   CDF_SETTING=yes
 else
@@ -13316,20 +13784,14 @@ else
 fi
 
 
-fi
- if test "$CDF_SETTING" = "yes" ; then
-    GOT_CDF=yes
-    $as_echo "Using pre-installed NetCDF headers."
- else
-    if test "$GOT_CDF" = "no" ; then
-	as_fn_error $? "Did not find required NetCDF headers, use --with-netcdf-include" "$LINENO" 5
-    else
-	$as_echo "Checking netcdf.h in $libnetcdf_CPPFLAGS..."
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
-	CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
-	ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
+    CPPFLAGS=$save_CPPFLAGS
+    CFLAGS=$save_CFLAGS
+    if test "$CDF_SETTING" = "no"; then
+	as_fn_error $? "Did not find netcdf.h according to --with-netcdf-include - check the installation!" "$LINENO" 5
+    fi
+else
+        $as_echo "Looking for netCDF headers in the usual places..."
+    ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
 if test "x$ac_cv_header_netcdf_h" = xyes; then :
   CDF_SETTING=yes
 else
@@ -13337,17 +13799,22 @@ else
 fi
 
 
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$CDF_SETTING" = "no"; then
-	   as_fn_error $? "Did not find required NetCDF headers, use --with-netcdf-include" "$LINENO" 5
-	fi
+    if test "$CDF_SETTING" = "yes" ; then
+        GOT_CDF=yes
+        $as_echo "Using pre-installed netCDF headers..."
+    else
+        $as_echo "Did not find netCDF headers anywhere, use --with-netcdf-include to set the location"
+        as_fn_error $? "Did not find netCDF headers anywhere, use --with-netcdf-include to set the location" "$LINENO" 5
     fi
- fi
+fi
+
+libnetcdf_LIBS=$libnetcdf_LIBS
+
 libnetcdf_CPPFLAGS=$libnetcdf_CPPFLAGS
 
 
 
+$as_echo "Check whether to use bundled proj package or link with external libproj"
 # Check whether --enable-bundledproj was given.
 if test "${enable_bundledproj+set}" = set; then :
   enableval=$enable_bundledproj; bundledproj=yes
@@ -13363,19 +13830,76 @@ else
   BUILD_PROJ_FALSE=
 fi
 
-
 if test "$bundledproj" = "yes" ; then
-    $as_echo "Using bundled PROJ lib"
+        $as_echo "Using bundled PROJ library"
     libproj_LIBS="-lproj"
     libproj_LDFLAGS=
-    libproj_LIBS="$libproj_LIBS"
+else
+        $as_echo "Check if proj library location specified on the command line"
+    GOT_PROJ=no
+    PROJ_SETTING=no
 
+# Check whether --with-proj-lib was given.
+if test "${with_proj_lib+set}" = set; then :
+  withval=$with_proj_lib; proj_libdir="${withval}" GOT_PROJ=yes
+else
+  GOT_PROJ=no
+fi
 
+    if test "$GOT_PROJ" = "yes" ; then
+                $as_echo "PROJ library location specified: $proj_libdir - check if libproj is there..."
+        save_LDFLAGS=$LDFLAGS
+        LDFLAGS="$LDFLAGS -L$proj_libdir"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_init_plus in -lproj" >&5
+$as_echo_n "checking for pj_init_plus in -lproj... " >&6; }
+if ${ac_cv_lib_proj_pj_init_plus+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lproj  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-        $as_echo "Check for PROJ"
-    GOT_PROJ=no
-    PROJ_SETTING=no
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pj_init_plus ();
+int
+main ()
+{
+return pj_init_plus ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_proj_pj_init_plus=yes
+else
+  ac_cv_lib_proj_pj_init_plus=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_pj_init_plus" >&5
+$as_echo "$ac_cv_lib_proj_pj_init_plus" >&6; }
+if test "x$ac_cv_lib_proj_pj_init_plus" = xyes; then :
+  PROJ_SETTING=yes
+else
+  PROJ_SETTING=no
+fi
+
+        LDFLAGS="$save_LDFLAGS"
+        if test "$PROJ_SETTING" = "no"; then
+            as_fn_error $? "Did not find libproj according to --with-proj-lib - check the installation!" "$LINENO" 5
+        fi
+        libproj_LIBS="-L$proj_libdir -R $proj_libdir -lproj"
+        libproj_LDFLAGS="-L$proj_libdir"
+    else
+                $as_echo "Look for pkg-config PROJ package..."
 
 pkg_failed=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libproj" >&5
@@ -13447,75 +13971,12 @@ else
 $as_echo "yes" >&6; }
 	GOT_PROJ=yes
 fi
-
-        if test "$GOT_PROJ" = "no" ; then
-
-    libproj_LIBS="-lproj"
-    libproj_LDFLAGS=
-
-
-# Check whether --with-proj-lib was given.
-if test "${with_proj_lib+set}" = set; then :
-  withval=$with_proj_lib; proj_libdir="${withval}" GOT_PROJ=yes
-else
-  GOT_PROJ=no
-fi
-
-        if test "$GOT_PROJ" = "no" ; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_init_plus in -lproj" >&5
-$as_echo_n "checking for pj_init_plus in -lproj... " >&6; }
-if ${ac_cv_lib_proj_pj_init_plus+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lproj  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pj_init_plus ();
-int
-main ()
-{
-return pj_init_plus ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_proj_pj_init_plus=yes
-else
-  ac_cv_lib_proj_pj_init_plus=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_pj_init_plus" >&5
-$as_echo "$ac_cv_lib_proj_pj_init_plus" >&6; }
-if test "x$ac_cv_lib_proj_pj_init_plus" = xyes; then :
-  PROJ_SETTING=yes
-else
-  PROJ_SETTING=no
-fi
-
+        libproj_LIBS="-lproj"
+        libproj_LDFLAGS=""
     fi
-     if test "$PROJ_SETTING" = "yes" ; then
-        GOT_PROJ=yes
-        $as_echo "Using pre-installed libproj."
-     else
-        if test "$GOT_PROJ" = "no" ; then
-            as_fn_error $? "Did not find libproj, use --with-proj-lib" "$LINENO" 5
-        else
-            $as_echo "Looking for libproj in $proj_libdir ..."
-            save_LDFLAGS=$LDFLAGS
-            LDFLAGS="$LDFLAGS -L$proj_libdir"
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_init_plus in -lproj" >&5
+    if test "$GOT_PROJ" = "no" ; then
+                $as_echo "Did not find PROJ library pkg-config package, looking in the usual places..."
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_init_plus in -lproj" >&5
 $as_echo_n "checking for pj_init_plus in -lproj... " >&6; }
 if ${ac_cv_lib_proj_pj_init_plus+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -13557,22 +14018,19 @@ else
   PROJ_SETTING=no
 fi
 
-            LDFLAGS="$save_LDFLAGS"
-            if test "$PROJ_SETTING" = "no"; then
-               as_fn_error $? "Did not find libproj, use --with-proj-lib or check installation" "$LINENO" 5
-            fi
-            libproj_LIBS="-L$proj_libdir -R $proj_libdir $libproj_LIBS"
-    #
-    #       Save the proj library path for later gmt tests
-    #
-            libproj_LDFLAGS="-L$proj_libdir"
+        if test "$PROJ_SETTING" = "yes" ; then
+            GOT_PROJ=yes
+            $as_echo "Using pre-installed libproj..."
+            libproj_LIBS="-lproj"
+            libproj_LDFLAGS=""
+        else
+            $as_echo "Did not find PROJ library anywhere, use --with-proj-lib to set the location"
+            as_fn_error $? "Did not find PROJ library anywhere, use --with-proj-lib to set the location" "$LINENO" 5
         fi
-     fi
-          libproj_LIBS="$libproj_LIBS"
-
     fi
 
-        GOT_PROJ=no
+        $as_echo "Check if proj header location specified on the command line"
+    GOT_PROJ=no
     PROJ_SETTING=no
 
 # Check whether --with-proj-include was given.
@@ -13582,7 +14040,12 @@ else
   GOT_PROJ=no
 fi
 
-        if test "$GOT_PROJ" = "no" ; then
+    if test "$GOT_PROJ" = "yes" ; then
+                $as_echo "PROJ header location specified: $libproj_CPPFLAGS - check if proj_api.h is there..."
+        save_CPPFLAGS=$CPPFLAGS
+        save_CFLAGS=$CFLAGS
+        CPPFLAGS="$CPPFLAGS $libproj_CPPFLAGS"
+        CFLAGS="$CFLAGS $libproj_CPPFLAGS"
         ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default"
 if test "x$ac_cv_header_proj_api_h" = xyes; then :
   PROJ_SETTING=yes
@@ -13591,20 +14054,14 @@ else
 fi
 
 
-    fi
-    if test "$PROJ_SETTING" = "yes" ; then
-        GOT_PROJ=yes
-        $as_echo "Using pre-installed PROJ headers."
+        CPPFLAGS=$save_CPPFLAGS
+        CFLAGS=$save_CFLAGS
+        if test "$PROJ_SETTING" = "no"; then
+           as_fn_error $? "Did not find PROJ headers according to --with-proj-include - check the installation!" "$LINENO" 5
+        fi
     else
-        if test "$GOT_PROJ" = "no" ; then
-            as_fn_error $? "Did not find required PROJ headers, use --with-proj-include" "$LINENO" 5
-        else
-            $as_echo "Checking proj_api.h in $libproj_CPPFLAGS..."
-            save_CPPFLAGS=$CPPFLAGS
-            save_CFLAGS=$CFLAGS
-            CPPFLAGS="$CPPFLAGS $libproj_CPPFLAGS"
-            CFLAGS="$CFLAGS $libproj_CPPFLAGS"
-            ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default"
+                $as_echo "Looking for PROJ headers in the usual places..."
+        ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default"
 if test "x$ac_cv_header_proj_api_h" = xyes; then :
   PROJ_SETTING=yes
 else
@@ -13612,20 +14069,87 @@ else
 fi
 
 
-            CPPFLAGS=$save_CPPFLAGS
-            CFLAGS=$save_CFLAGS
-            if test "$PROJ_SETTING" = "no"; then
-               as_fn_error $? "Did not find required PROJ headers, use --with-proj-include" "$LINENO" 5
-            fi
+        if test "$PROJ_SETTING" = "yes" ; then
+            GOT_PROJ=yes
+            $as_echo "Using pre-installed PROJ headers..."
+        else
+            $as_echo "Did not find PROJ headers anywhere, use --with-proj-include to set the location"
+            as_fn_error $? "Did not find PROJ headers anywhere, use --with-proj-include to set the location" "$LINENO" 5
         fi
     fi
-    libproj_CPPFLAGS=$libproj_CPPFLAGS
+     fi
+
+libproj_LIBS=$libproj_LIBS
 
+libproj_CPPFLAGS=$libproj_CPPFLAGS
 
+
+
+$as_echo "Check for GMT libraries libgmt libpsl"
+GOT_GMT=no
+GMT_SETTING=no
+
+# Check whether --with-gmt-lib was given.
+if test "${with_gmt_lib+set}" = set; then :
+  withval=$with_gmt_lib; gmt_libdir="${withval}" GOT_GMT=yes
+else
+  GOT_GMT=no
 fi
 
-$as_echo "Check for Generic Mapping Tools (GMT)"
-GOT_GMTPKG=no
+if test "$GOT_GMT" = "yes" ; then
+        $as_echo "GMT library location specified: $gmt_libdir - check if libgmt libpsl are there..."
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -L$gmt_libdir"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMT_begin in -lgmt" >&5
+$as_echo_n "checking for GMT_begin in -lgmt... " >&6; }
+if ${ac_cv_lib_gmt_GMT_begin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgmt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char GMT_begin ();
+int
+main ()
+{
+return GMT_begin ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gmt_GMT_begin=yes
+else
+  ac_cv_lib_gmt_GMT_begin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmt_GMT_begin" >&5
+$as_echo "$ac_cv_lib_gmt_GMT_begin" >&6; }
+if test "x$ac_cv_lib_gmt_GMT_begin" = xyes; then :
+  GMT_SETTING=yes
+else
+  GMT_SETTING=no
+fi
+
+    LDFLAGS="$save_LDFLAGS"
+    if test "$GMT_SETTING" = "no"; then
+	as_fn_error $? "Did not find libgmt according to --with-gmt-lib - check the installation!" "$LINENO" 5
+    fi
+    libgmt_LIBS="-L$gmt_libdir -R $gmt_libdir -lgmt -lpsl"
+    libgmt_LDFLAGS="-L$gmt_libdir"
+else
+        $as_echo "Look for pkg-config GMT package..."
 
 pkg_failed=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgmt" >&5
@@ -13699,77 +14223,6 @@ $as_echo "yes" >&6; }
 fi
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgmtps" >&5
-$as_echo_n "checking for libgmtps... " >&6; }
-
-if test -n "$libgmtps_CFLAGS"; then
-    pkg_cv_libgmtps_CFLAGS="$libgmtps_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmt\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gmt") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libgmtps_CFLAGS=`$PKG_CONFIG --cflags "gmt" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libgmtps_LIBS"; then
-    pkg_cv_libgmtps_LIBS="$libgmtps_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmt\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gmt") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libgmtps_LIBS=`$PKG_CONFIG --libs "gmt" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libgmtps_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmt" 2>&1`
-        else
-	        libgmtps_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmt" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libgmtps_PKG_ERRORS" >&5
-
-	GOT_LIBGMTPS=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_LIBGMTPS=no
-else
-	libgmtps_CFLAGS=$pkg_cv_libgmtps_CFLAGS
-	libgmtps_LIBS=$pkg_cv_libgmtps_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_LIBGMTPS=yes
-fi
-
-pkg_failed=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpsl" >&5
 $as_echo_n "checking for libpsl... " >&6; }
 
@@ -13839,31 +14292,18 @@ else
 $as_echo "yes" >&6; }
 	GOT_LIBPSL=yes
 fi
-if test "$GOT_LIBGMT" = "yes" ; then
-	GOT_GMTPKG=yes
-fi
-if test "$GOT_GMTPS" = "no" ; then
-	GOT_GMTPKG=no
-fi
-if test "$GOT_PSL" = "no" ; then
-	GOT_GMTPKG=no
-fi
-
-if test "$GOT_GMTPKG" = "no" ; then
-
-	GMT_SETTING=no
-	GOT_GMTLIBS=no
-	libgmt_LIBS="-lgmt -lgmtps -lpsl"
-
-# Check whether --with-gmt-lib was given.
-if test "${with_gmt_lib+set}" = set; then :
-  withval=$with_gmt_lib; gmt_libdir="${withval}" GOT_GMTLIBS=yes
-else
-  GOT_GMTLIBS=no
+    if test "$GOT_LIBGMT" = "yes" ; then
+            GOT_GMT=yes
+    fi
+    if test "$GOT_PSL" = "no" ; then
+            GOT_GMT=no
+    fi
+    libgmt_LIBS="-lgmt -lpsl"
+    libgmt_LDFLAGS=""
 fi
-
-		if test "$GOT_GMTLIBS" = "no" ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMT_begin in -lgmt" >&5
+if test "$GOT_GMT" = "no" ; then
+        $as_echo "Did not find GMT library pkg-config package, looking in the usual places..."
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMT_begin in -lgmt" >&5
 $as_echo_n "checking for GMT_begin in -lgmt... " >&6; }
 if ${ac_cv_lib_gmt_GMT_begin+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -13905,29 +14345,94 @@ else
   GMT_SETTING=no
 fi
 
-	fi
-	if test "$GMT_SETTING" = "yes" ; then
-		$as_echo "Using pre-installed libgmt."
-	else
-		if test "$GOT_GMTLIBS" = "no" ; then
-			as_fn_error $? "Did not find libgmt, use --with-gmt-lib" "$LINENO" 5
-		else
-			$as_echo "Looking for libgmt in $gmt_libdir ..."
-			save_LDFLAGS=$LDFLAGS
-			save_LIBS=$LIBS
-			LDFLAGS="$LDFLAGS -L$gmt_libdir $libnetcdf_LDFLAGS"
-			LIBS="$LDFLAGS -lnetcdf $LIBM"
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS $LDFLAGS" >&5
-$as_echo "$as_me: LDFLAGS $LDFLAGS" >&6;}
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: LIBS $LIBS" >&5
-$as_echo "$as_me: LIBS $LIBS" >&6;}
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMT_begin in -lgmt" >&5
-$as_echo_n "checking for GMT_begin in -lgmt... " >&6; }
-if ${ac_cv_lib_gmt_GMT_begin+:} false; then :
+    if test "$GMT_SETTING" = "yes" ; then
+        GOT_GMT=yes
+        $as_echo "Using pre-installed libgmt..."
+        libgmt_LIBS="-lgmt -lpsl"
+        libgmt_LDFLAGS=""
+    else
+        $as_echo "Did not find GMT libraries anywhere, use --with-gmt-lib to set the location"
+        as_fn_error $? "Did not find GMT libraries anywhere, use --with-gmt-lib to set the location" "$LINENO" 5
+    fi
+fi
+
+$as_echo "Check for GMT headers"
+GOT_GMT=no
+GMT_SETTING=no
+
+# Check whether --with-gmt-include was given.
+if test "${with_gmt_include+set}" = set; then :
+  withval=$with_gmt_include; libgmt_CPPFLAGS="-I${withval}" GOT_GMT=yes
+else
+  GOT_GMT=no
+fi
+
+if test "$GOT_GMT" = "yes" ; then
+        $as_echo "GMT header location specified: $libgmt_CPPFLAGS - check if gmt.h is there..."
+    save_CPPFLAGS=$CPPFLAGS
+    save_CFLAGS=$CFLAGS
+    CPPFLAGS="$CPPFLAGS $libgmt_CPPFLAGS"
+    CFLAGS="$CFLAGS $libgmt_CPPFLAGS"
+    ac_fn_c_check_header_mongrel "$LINENO" "gmt.h" "ac_cv_header_gmt_h" "$ac_includes_default"
+if test "x$ac_cv_header_gmt_h" = xyes; then :
+  GMT_SETTING=yes
+else
+  GMT_SETTING=no
+fi
+
+
+    CPPFLAGS=$save_CPPFLAGS
+    CFLAGS=$save_CFLAGS
+    if test "$GMT_SETTING" = "no"; then
+	as_fn_error $? "Did not find gmt.h according to --with-gmt-include - check the installation!" "$LINENO" 5
+    fi
+else
+        $as_echo "Looking for GMT headers in the usual places..."
+    ac_fn_c_check_header_mongrel "$LINENO" "gmt.h" "ac_cv_header_gmt_h" "$ac_includes_default"
+if test "x$ac_cv_header_gmt_h" = xyes; then :
+  GMT_SETTING=yes
+else
+  GMT_SETTING=no
+fi
+
+
+    if test "$GMT_SETTING" = "yes" ; then
+        GOT_GMT=yes
+        $as_echo "Using pre-installed GMT headers..."
+    else
+        $as_echo "Did not find GMT headers anywhere, use --with-gmt-include to set the location"
+        as_fn_error $? "Did not find GMT headers anywhere, use --with-gmt-include to set the location" "$LINENO" 5
+    fi
+fi
+
+libgmt_LIBS=$libgmt_LIBS
+
+libgmt_CPPFLAGS=$libgmt_CPPFLAGS
+
+
+
+$as_echo "Check for FFTW library libfftw3"
+GOT_FFTW=no
+FFTW_SETTING=no
+
+# Check whether --with-fftw-lib was given.
+if test "${with_fftw_lib+set}" = set; then :
+  withval=$with_fftw_lib; fftw_libdir="${withval}" GOT_FFTW=yes
+else
+  GOT_FFTW=no
+fi
+
+if test "$GOT_FFTW" = "yes" ; then
+        $as_echo "FFTW library location specified: $fftw_libdir - check if libfftw3 is there..."
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -L$fftw_libdir"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_plan_dft_1d in -lfftw3" >&5
+$as_echo_n "checking for fftw_plan_dft_1d in -lfftw3... " >&6; }
+if ${ac_cv_lib_fftw3_fftw_plan_dft_1d+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgmt  $LIBS"
+LIBS="-lfftw3  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -13937,113 +14442,47 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char GMT_begin ();
+char fftw_plan_dft_1d ();
 int
 main ()
 {
-return GMT_begin ();
+return fftw_plan_dft_1d ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_gmt_GMT_begin=yes
+  ac_cv_lib_fftw3_fftw_plan_dft_1d=yes
 else
-  ac_cv_lib_gmt_GMT_begin=no
+  ac_cv_lib_fftw3_fftw_plan_dft_1d=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmt_GMT_begin" >&5
-$as_echo "$ac_cv_lib_gmt_GMT_begin" >&6; }
-if test "x$ac_cv_lib_gmt_GMT_begin" = xyes; then :
-  GMT_SETTING=yes
-else
-  GMT_SETTING=no
-fi
-
-			LDFLAGS="$save_LDFLAGS"
-			LIBS="$save_LIBS"
-			if test "$GMT_SETTING" = "no"; then
-				as_fn_error $? "Did not find libgmt, use --with-gmt-lib or check installation" "$LINENO" 5
-			fi
-			libgmt_LIBS="-L$gmt_libdir -R$gmt_libdir $libgmt_LIBS"
-		fi
-	fi
-
-		GOT_GMTHEADERS=no
-	GMT_SETTING=no
-	libgmt_CPPFLAGS=
-
-# Check whether --with-gmt-include was given.
-if test "${with_gmt_include+set}" = set; then :
-  withval=$with_gmt_include; libgmt_CPPFLAGS="-I${withval}" GOT_GMTHEADERS=yes
-else
-  GOT_GMTHEADERS=no
-fi
-
-
-			if test "$GOT_GMTHEADERS" = "no" ; then
-		ac_fn_c_check_header_mongrel "$LINENO" "gmt.h" "ac_cv_header_gmt_h" "$ac_includes_default"
-if test "x$ac_cv_header_gmt_h" = xyes; then :
-  GMT_SETTING=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_plan_dft_1d" >&5
+$as_echo "$ac_cv_lib_fftw3_fftw_plan_dft_1d" >&6; }
+if test "x$ac_cv_lib_fftw3_fftw_plan_dft_1d" = xyes; then :
+  FFTW_SETTING=yes
 else
-  GMT_SETTING=no
+  FFTW_SETTING=no
 fi
 
-
-	fi
-
-	if test "$GMT_SETTING" = "yes" ; then
-		GOT_GMTHEADERS=yes
-		$as_echo "Using pre-installed gmt headers."
-	else
-		if test "$GOT_GMTHEADERS" = "no" ; then
-			as_fn_error $? "Did not find required GMT headers, use --with-gmt-include" "$LINENO" 5
-		else
-			$as_echo "Checking gmt.h in $libgmt_CPPFLAGS..."
-			save_CPPFLAGS=$CPPFLAGS
-			save_CFLAGS=$CFLAGS
-			CPPFLAGS="$CPPFLAGS $libgmt_CPPFLAGS $libnetcdf_CPPFLAGS"
-			CFLAGS="$CFLAGS $libgmt_CPPFLAGS $libnetcdf_CPPFLAGS"
-			ac_fn_c_check_header_mongrel "$LINENO" "gmt.h" "ac_cv_header_gmt_h" "$ac_includes_default"
-if test "x$ac_cv_header_gmt_h" = xyes; then :
-  GMT_SETTING=yes
+    LDFLAGS="$save_LDFLAGS"
+    if test "$FFTW_SETTING" = "no"; then
+	as_fn_error $? "Did not find libfftw3 according to --with-fftw-lib - check the installation!" "$LINENO" 5
+    fi
+    libfftw_LIBS="-L$fftw_libdir -R $fftw_libdir -lfftw3"
+    libfftw_LDFLAGS="-L$fftw_libdir"
 else
-  GMT_SETTING=no
-fi
-
-
-			CPPFLAGS=$save_CPPFLAGS
-			CFLAGS=$save_CFLAGS
-			if test "$GMT_SETTING" = "no"; then
-				as_fn_error $? "Did not find required GMT headers, use --with-gmt-include" "$LINENO" 5
-			fi
-		fi
-	fi
-	$as_echo "Setting libgmt_CPPFLAGS=$libgmt_CPPFLAGS"
-	libgmt_CPPFLAGS=$libgmt_CPPFLAGS
-
-	fi
-
-$as_echo "Setting libgmt_LIBS=$libgmt_LIBS"
-libgmt_LIBS="$libgmt_LIBS"
-
-
-
-
-GOT_FFTW=no
-FFTW_SETTING=no
-USE_FFTW=
-libfftw_CPPFLAGS=
+        $as_echo "Look for pkg-config FFTW package..."
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfftw" >&5
-$as_echo_n "checking for libfftw... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfftw3" >&5
+$as_echo_n "checking for libfftw3... " >&6; }
 
-if test -n "$libfftw_CFLAGS"; then
-    pkg_cv_libfftw_CFLAGS="$libfftw_CFLAGS"
+if test -n "$libfftw3_CFLAGS"; then
+    pkg_cv_libfftw3_CFLAGS="$libfftw3_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fftw3\""; } >&5
@@ -14051,7 +14490,7 @@ if test -n "$libfftw_CFLAGS"; then
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_libfftw_CFLAGS=`$PKG_CONFIG --cflags "fftw3" 2>/dev/null`
+  pkg_cv_libfftw3_CFLAGS=`$PKG_CONFIG --cflags "fftw3" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -14059,8 +14498,8 @@ fi
  else
     pkg_failed=untried
 fi
-if test -n "$libfftw_LIBS"; then
-    pkg_cv_libfftw_LIBS="$libfftw_LIBS"
+if test -n "$libfftw3_LIBS"; then
+    pkg_cv_libfftw3_LIBS="$libfftw3_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fftw3\""; } >&5
@@ -14068,7 +14507,7 @@ if test -n "$libfftw_LIBS"; then
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_libfftw_LIBS=`$PKG_CONFIG --libs "fftw3" 2>/dev/null`
+  pkg_cv_libfftw3_LIBS=`$PKG_CONFIG --libs "fftw3" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -14089,12 +14528,12 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        libfftw_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fftw3" 2>&1`
+	        libfftw3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fftw3" 2>&1`
         else
-	        libfftw_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fftw3" 2>&1`
+	        libfftw3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fftw3" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$libfftw_PKG_ERRORS" >&5
+	echo "$libfftw3_PKG_ERRORS" >&5
 
 	GOT_FFTW=no
 elif test $pkg_failed = untried; then
@@ -14102,26 +14541,18 @@ elif test $pkg_failed = untried; then
 $as_echo "no" >&6; }
 	GOT_FFTW=no
 else
-	libfftw_CFLAGS=$pkg_cv_libfftw_CFLAGS
-	libfftw_LIBS=$pkg_cv_libfftw_LIBS
+	libfftw3_CFLAGS=$pkg_cv_libfftw3_CFLAGS
+	libfftw3_LIBS=$pkg_cv_libfftw3_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 	GOT_FFTW=yes
 fi
-
-if test "$GOT_FFTW" = "no" ; then
-
-libfftw_LIBS="-lfftw3"
-
-# Check whether --with-fftw-lib was given.
-if test "${with_fftw_lib+set}" = set; then :
-  withval=$with_fftw_lib; fftw_libdir="${withval}" GOT_FFTW=yes
-else
-  GOT_FFTW=no
+    libfftw_LIBS="-lfftw3"
+    libfftw_LDFLAGS=""
 fi
-
 if test "$GOT_FFTW" = "no" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_plan_dft_1d in -lfftw3" >&5
+        $as_echo "Did not find FFTW library pkg-config package, looking in the usual places..."
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_plan_dft_1d in -lfftw3" >&5
 $as_echo_n "checking for fftw_plan_dft_1d in -lfftw3... " >&6; }
 if ${ac_cv_lib_fftw3_fftw_plan_dft_1d+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -14163,80 +14594,18 @@ else
   FFTW_SETTING=no
 fi
 
-fi
- if test "$FFTW_SETTING" = "yes" ; then
-    GOT_FFTW=yes
-    USE_FFTW=mbsegypsd
-    $as_echo "Using pre-installed FFTW3 lib."
- else
-    if test "$GOT_FFTW" = "no" ; then
-	$as_echo "Did not find libfftw3, use --with-fftw-lib, (FFTW disabled)"
+    if test "$FFTW_SETTING" = "yes" ; then
+        GOT_FFTW=yes
+        $as_echo "Using pre-installed libfftw3..."
+        libfftw_LIBS="-lfftw3"
+        libfftw_LDFLAGS=""
     else
-	$as_echo "Looking for libfftw3 in $libfftw_CFLAGS ..."
-	save_LDFLAGS=$LDFLAGS
-	LDFLAGS="$LDFLAGS -L$fftw_libdir"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_plan_dft_1d in -lfftw3" >&5
-$as_echo_n "checking for fftw_plan_dft_1d in -lfftw3... " >&6; }
-if ${ac_cv_lib_fftw3_fftw_plan_dft_1d+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfftw3  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char fftw_plan_dft_1d ();
-int
-main ()
-{
-return fftw_plan_dft_1d ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_fftw3_fftw_plan_dft_1d=yes
-else
-  ac_cv_lib_fftw3_fftw_plan_dft_1d=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_plan_dft_1d" >&5
-$as_echo "$ac_cv_lib_fftw3_fftw_plan_dft_1d" >&6; }
-if test "x$ac_cv_lib_fftw3_fftw_plan_dft_1d" = xyes; then :
-  FFTW_SETTING=yes
-else
-  FFTW_SETTING=no
-fi
-
-	LDFLAGS="$save_LDFLAGS"
-	if test "$FFTW_SETTING" = "no"; then
-	   	$as_echo "libfftw not found, FFTW support is disabled"
-		GOT_FFTW=no
-		USE_FFTW=
-	else
-		GOT_FFTW=yes
-		USE_FFTW=mbsegypsd
-		libfftw_LIBS="-L$fftw_libdir -R $fftw_libdir $libfftw_LIBS"
-	fi
+        $as_echo "Did not find FFTW library anywhere, use --with-fftw-lib to set the location"
+        as_fn_error $? "Did not find FFTW library anywhere, use --with-fftw-lib to set the location" "$LINENO" 5
     fi
- fi
- if test "$GOT_FFTW" = "yes" ; then
-	libfftw_LIBS="$libfftw_LIBS"
-
- fi
 fi
 
-
-if test "$GOT_FFTW" = "yes" ; then
+$as_echo "Check for FFTW headers"
 GOT_FFTW=no
 FFTW_SETTING=no
 
@@ -14247,9 +14616,13 @@ else
   GOT_FFTW=no
 fi
 
-
-if test "$GOT_FFTW" = "no" ; then
-  ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
+if test "$GOT_FFTW" = "yes" ; then
+        $as_echo "FFTW header location specified: $libfftw_CPPFLAGS - check if fftw3.h is there..."
+    save_CPPFLAGS=$CPPFLAGS
+    save_CFLAGS=$CFLAGS
+    CPPFLAGS="$CPPFLAGS $libfftw_CPPFLAGS"
+    CFLAGS="$CFLAGS $libfftw_CPPFLAGS"
+    ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
 if test "x$ac_cv_header_fftw3_h" = xyes; then :
   FFTW_SETTING=yes
 else
@@ -14257,20 +14630,14 @@ else
 fi
 
 
-fi
- if test "$FFTW_SETTING" = "yes" ; then
-    GOT_FFTW=yes
-    $as_echo "Using pre-installed fftw3 headers."
- else
-    if test "$GOT_FFTW" = "no" ; then
-	$as_echo "Did not find FFTW headers, use --with-fftw-inc, (FFTW Disabled)"
-    else
-	$as_echo "Checking fftw3.h in $libfftw_CPPFLAGS..."
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $libfftw_CPPFLAGS"
-	CFLAGS="$CFLAGS $libfftw_CPPFLAGS"
-	ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
+    CPPFLAGS=$save_CPPFLAGS
+    CFLAGS=$save_CFLAGS
+    if test "$FFTW_SETTING" = "no"; then
+	as_fn_error $? "Did not find fftw3.h according to --with-fftw-include - check the installation!" "$LINENO" 5
+    fi
+else
+        $as_echo "Looking for FFTW headers in the usual places..."
+    ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
 if test "x$ac_cv_header_fftw3_h" = xyes; then :
   FFTW_SETTING=yes
 else
@@ -14278,25 +14645,23 @@ else
 fi
 
 
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$FFTW_SETTING" = "no"; then
-	   $as_echo "Did not find FFTW headers, FFTW support disabled"
-	   GOT_FFTW=no
-	   USE_FFTW=
-	   FFTW_LIB=
-	fi
+    if test "$FFTW_SETTING" = "yes" ; then
+        GOT_FFTW=yes
+        $as_echo "Using pre-installed FFTW headers..."
+    else
+        $as_echo "Did not find FFTW headers anywhere, use --with-fftw-include to set the location"
+        as_fn_error $? "Did not find FFTW headers anywhere, use --with-fftw-include to set the location" "$LINENO" 5
     fi
- fi
+fi
 
 if test "$GOT_FFTW" = "yes" ; then
-	fftw_app=$USE_FFTW
+    fftw_app=$USE_FFTW
 
-	libfftw_CPPFLAGS=$libfftw_CPPFLAGS
+    libfftw_LIBS=$libfftw_LIBS
 
-fi
-fi
+    libfftw_CPPFLAGS=$libfftw_CPPFLAGS
 
+fi
  if test "$GOT_FFTW" = yes; then
   BUILD_FFTW_TRUE=
   BUILD_FFTW_FALSE='#'
@@ -14307,63 +14672,8 @@ fi
 
 
 
-GOT_MOTIF=no
-MOTIF_SETTING=no
-motif_LIBS="-lXm -lXt -lX11"
-motif_CPPFLAGS=
-
-# Check whether --with-motif-lib was given.
-if test "${with_motif_lib+set}" = set; then :
-  withval=$with_motif_lib; motif_libdir="${withval}" GOT_MOTIF=yes
-else
-  GOT_MOTIF=no
-fi
-
-if test "$GOT_MOTIF" = "no" ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreatePushButton in -lXm" >&5
-$as_echo_n "checking for XmCreatePushButton in -lXm... " >&6; }
-if ${ac_cv_lib_Xm_XmCreatePushButton+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XmCreatePushButton ();
-int
-main ()
-{
-return XmCreatePushButton ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xm_XmCreatePushButton=yes
-else
-  ac_cv_lib_Xm_XmCreatePushButton=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmCreatePushButton" >&5
-$as_echo "$ac_cv_lib_Xm_XmCreatePushButton" >&6; }
-if test "x$ac_cv_lib_Xm_XmCreatePushButton" = xyes; then :
-  MOTIF_SETTING=yes
-else
-  MOTIF_SETTING=no
-fi
-
-  if test "$MOTIF_SETTING" = "yes" ; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtAppMainLoop in -lXt" >&5
+$as_echo "Check for X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtAppMainLoop in -lXt" >&5
 $as_echo_n "checking for XtAppMainLoop in -lXt... " >&6; }
 if ${ac_cv_lib_Xt_XtAppMainLoop+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -14400,13 +14710,13 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtAppMainLoop" >&5
 $as_echo "$ac_cv_lib_Xt_XtAppMainLoop" >&6; }
 if test "x$ac_cv_lib_Xt_XtAppMainLoop" = xyes; then :
-  MOTIF_SETTING=yes
+  GOT_X11=yes
 else
-  MOTIF_SETTING=no
+  GOT_X11=no
 fi
 
-	if test "$MOTIF_SETTING" = "yes" ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSendEvent in -lX11" >&5
+if test "$GOT_X11" = "yes" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSendEvent in -lX11" >&5
 $as_echo_n "checking for XSendEvent in -lX11... " >&6; }
 if ${ac_cv_lib_X11_XSendEvent+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -14443,28 +14753,48 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XSendEvent" >&5
 $as_echo "$ac_cv_lib_X11_XSendEvent" >&6; }
 if test "x$ac_cv_lib_X11_XSendEvent" = xyes; then :
-  MOTIF_SETTING=yes
+  GOT_X11=yes
 else
-  MOTIF_SETTING=no
+  GOT_X11=no
 fi
 
-	fi
-  fi
+fi
+if test "$GOT_X11" = "yes" ; then
+    ac_fn_c_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default"
+if test "x$ac_cv_header_X11_Intrinsic_h" = xyes; then :
+  GOT_X11=yes
+else
+  GOT_X11=no
 fi
 
- if test "$MOTIF_SETTING" = "yes" ; then
-    GOT_MOTIF=yes
-    $as_echo "Using pre-installed MOTIF libs."
- else
-    if test "$GOT_MOTIF" = "no" ; then
-	$as_echo "Did not find Motif libs (Xt, Xm, and X11), use --with-motif-lib, (Motif disabled)"
+
+    if test "$GOT_X11" = "yes" ; then
+        $as_echo "Found X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"
     else
-	$as_echo "Looking for Motif Libs in $motif_libdir ..."
-	save_LDFLAGS=$LDFLAGS
-	save_LIBS=$LIBS
-	LDFLAGS="$LDFLAGS -L$motif_libdir"
-	LIBS="$LIBS $motif_LIBS"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreatePushButton in -lXm" >&5
+        $as_echo "Found X11 libraries libX11 libXt but did not find X11 header file X11/Intrinsic.h - graphical tools cannot be built"
+    fi
+else
+    $as_echo "Did not find X11 libraries libX11 libXt - graphical tools cannot be built"
+fi
+
+GOT_MOTIF=no
+MOTIF_SETTING=no
+if test "$GOT_X11" = "yes" ; then
+
+        $as_echo "Check for Motif library libXm"
+
+# Check whether --with-motif-lib was given.
+if test "${with_motif_lib+set}" = set; then :
+  withval=$with_motif_lib; motif_libdir="${withval}" GOT_MOTIF=yes
+else
+  GOT_MOTIF=no
+fi
+
+    if test "$GOT_MOTIF" = "yes" ; then
+                $as_echo "Motif library location specified: $motif_libdir - check if libXm is there..."
+        save_LDFLAGS=$LDFLAGS
+        LDFLAGS="$LDFLAGS -L$motif_libdir"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreatePushButton in -lXm" >&5
 $as_echo_n "checking for XmCreatePushButton in -lXm... " >&6; }
 if ${ac_cv_lib_Xm_XmCreatePushButton+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -14506,57 +14836,97 @@ else
   MOTIF_SETTING=no
 fi
 
-  	if test "$MOTIF_SETTING" = "yes" ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtAppMainLoop in -lXt" >&5
-$as_echo_n "checking for XtAppMainLoop in -lXt... " >&6; }
-if ${ac_cv_lib_Xt_XtAppMainLoop+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXt  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+        LDFLAGS="$save_LDFLAGS"
+        if test "$MOTIF_SETTING" = "no"; then
+            as_fn_error $? "Did not find libXm according to --with-motif-lib - check the installation!" "$LINENO" 5
+        fi
+        libmotif_LIBS="-L$motif_libdir -R $motif_libdir -lXm -lXt -lX11"
+        libmotif_LDFLAGS="-L$motif_libdir"
+    else
+                $as_echo "Look for pkg-config X11 package..."
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XtAppMainLoop ();
-int
-main ()
-{
-return XtAppMainLoop ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xt_XtAppMainLoop=yes
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libXm" >&5
+$as_echo_n "checking for libXm... " >&6; }
+
+if test -n "$libXm_CFLAGS"; then
+    pkg_cv_libXm_CFLAGS="$libXm_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openmotif\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "openmotif") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libXm_CFLAGS=`$PKG_CONFIG --cflags "openmotif" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  ac_cv_lib_Xt_XtAppMainLoop=no
+  pkg_failed=yes
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ else
+    pkg_failed=untried
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtAppMainLoop" >&5
-$as_echo "$ac_cv_lib_Xt_XtAppMainLoop" >&6; }
-if test "x$ac_cv_lib_Xt_XtAppMainLoop" = xyes; then :
-  MOTIF_SETTING=yes
+if test -n "$libXm_LIBS"; then
+    pkg_cv_libXm_LIBS="$libXm_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openmotif\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "openmotif") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libXm_LIBS=`$PKG_CONFIG --libs "openmotif" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  MOTIF_SETTING=no
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
 
-		if test "$MOTIF_SETTING" = "yes" ; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSendEvent in -lX11" >&5
-$as_echo_n "checking for XSendEvent in -lX11... " >&6; }
-if ${ac_cv_lib_X11_XSendEvent+:} false; then :
+
+
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        libXm_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openmotif" 2>&1`
+        else
+	        libXm_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openmotif" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$libXm_PKG_ERRORS" >&5
+
+	GOT_MOTIF=no
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	GOT_MOTIF=no
+else
+	libXm_CFLAGS=$pkg_cv_libXm_CFLAGS
+	libXm_LIBS=$pkg_cv_libXm_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	GOT_MOTIF=yes
+fi
+        libmotif_LIBS="-lXm -lXt -lX11"
+        libmotif_LDFLAGS=""
+    fi
+    if test "$GOT_MOTIF" = "no" ; then
+                $as_echo "Did not find Motif library pkg-config package, looking in the usual places..."
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreatePushButton in -lXm" >&5
+$as_echo_n "checking for XmCreatePushButton in -lXm... " >&6; }
+if ${ac_cv_lib_Xm_XmCreatePushButton+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lX11  $LIBS"
+LIBS="-lXm  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -14566,109 +14936,101 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char XSendEvent ();
+char XmCreatePushButton ();
 int
 main ()
 {
-return XSendEvent ();
+return XmCreatePushButton ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_X11_XSendEvent=yes
+  ac_cv_lib_Xm_XmCreatePushButton=yes
 else
-  ac_cv_lib_X11_XSendEvent=no
+  ac_cv_lib_Xm_XmCreatePushButton=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XSendEvent" >&5
-$as_echo "$ac_cv_lib_X11_XSendEvent" >&6; }
-if test "x$ac_cv_lib_X11_XSendEvent" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmCreatePushButton" >&5
+$as_echo "$ac_cv_lib_Xm_XmCreatePushButton" >&6; }
+if test "x$ac_cv_lib_Xm_XmCreatePushButton" = xyes; then :
   MOTIF_SETTING=yes
 else
   MOTIF_SETTING=no
 fi
 
-		fi
-  	fi
-	LDFLAGS=$save_LDFLAGS
-	LIBS=$save_LIBS
-	if test "$MOTIF_SETTING" = "no"; then
-	   	$as_echo "Motif libs not found, Motif support is disabled"
-		GOT_MOTIF=no
-	else
-		GOT_MOTIF=yes
-		motif_LIBS="-L$motif_libdir -R $motif_libdir $motif_LIBS"
-	fi
+        if test "$MOTIF_SETTING" = "yes" ; then
+            GOT_MOTIF=yes
+            $as_echo "Using pre-installed libXm..."
+            libmotif_LIBS="-lXm -lXt -lX11"
+            libmotif_LDFLAGS=""
+        else
+            $as_echo "Did not find Motif library anywhere, use --with-motif-lib to set the location"
+            as_fn_error $? "Did not find Motif library anywhere, use --with-motif-lib to set the location" "$LINENO" 5
+        fi
     fi
- fi
 
-if test "$GOT_MOTIF" = "yes" ; then
-	motif_LIBS="$motif_LIBS"
-
-fi
-
-if test "$GOT_MOTIF" = "yes" ; then
-GOT_MOTIF=no
-MOTIF_SETTING=no
+    if test "$GOT_MOTIF" = "yes" ; then
+                $as_echo "Check for Motif headers"
+        GOT_MOTIF=no
+        MOTIF_SETTING=no
 
 # Check whether --with-motif-include was given.
 if test "${with_motif_include+set}" = set; then :
-  withval=$with_motif_include; motif_CPPFLAGS="-I${withval}" GOT_MOTIF=yes
+  withval=$with_motif_include; libmotif_CPPFLAGS="-I${withval}" GOT_MOTIF=yes
 else
   GOT_MOTIF=no
 fi
 
-
-if test "$GOT_MOTIF" = "no" ; then
-  ac_fn_c_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_Intrinsic_h" = xyes; then :
+        if test "$GOT_MOTIF" = "yes" ; then
+                        $as_echo "Motif header location specified: $libmotif_CPPFLAGS - check if Xm/Xm.h is there..."
+            save_CPPFLAGS=$CPPFLAGS
+            save_CFLAGS=$CFLAGS
+            CPPFLAGS="$CPPFLAGS $libmotif_CPPFLAGS"
+            CFLAGS="$CFLAGS $libmotif_CPPFLAGS"
+            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
+if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
   MOTIF_SETTING=yes
 else
   MOTIF_SETTING=no
 fi
 
 
-fi
- if test "$MOTIF_SETTING" = "yes" ; then
-    GOT_MOTIF=yes
-    $as_echo "Using pre-installed Motif headers."
- else
-    if test "$GOT_MOTIF" = "no" ; then
-	$as_echo "Did not find Motif headers, use --with-motif-inc, (Motif Disabled)"
-    else
-	$as_echo "Checking X11/Intrinsic.h in $MOTIF_INC_DIR..."
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $motif_CPPFLAGS"
-	CFLAGS="$CFLAGS $motif_CPPFLAGS"
-	ac_fn_c_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_Intrinsic_h" = xyes; then :
+            CPPFLAGS=$save_CPPFLAGS
+            CFLAGS=$save_CFLAGS
+            if test "$MOTIF_SETTING" = "no"; then
+                as_fn_error $? "Did not find Xm/Xm.h according to --with-motif-include - check the installation!" "$LINENO" 5
+            fi
+        else
+                        $as_echo "Looking for Motif headers in the usual places..."
+            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
+if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
   MOTIF_SETTING=yes
 else
   MOTIF_SETTING=no
 fi
 
 
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$MOTIF_SETTING" = "no"; then
-	   $as_echo "Did not find Motif headers, Motif support disabled"
-	   GOT_MOTIF=no
-	fi
-    fi
- fi
+            if test "$MOTIF_SETTING" = "yes" ; then
+                GOT_MOTIF=yes
+                $as_echo "Using pre-installed Motif headers..."
+            else
+                $as_echo "Did not find Motif headers anywhere, use --with-motif-include to set the location"
+                as_fn_error $? "Did not find Motif headers anywhere, use --with-motif-include to set the location" "$LINENO" 5
+            fi
+        fi
+            fi
 
-if test "$GOT_MOTIF" = "yes" ; then
-	motif_CPPFLAGS=$motif_CPPFLAGS
+        libmotif_LIBS=$libmotif_LIBS
 
+    libmotif_CPPFLAGS=$libmotif_CPPFLAGS
 
-$as_echo "#define GOT_MOTIF 1" >>confdefs.h
 
-fi
+else
+        $as_echo "Failed to find X11 libraries and headers - unable to build graphical tools"
 fi
 
  if test "$GOT_MOTIF" = yes; then
@@ -14680,30 +15042,31 @@ else
 fi
 
 
-
-GOT_GL=no
-
+$as_echo "Check for OpenGL libraries libGL libGLU and header files GL/gl.h GL/glu.h GL/glx.h"
+GOT_OPENGL=no
+OPENGL_SETTING=no
 if test "$GOT_MOTIF" = "yes" ; then
 
-GL_SETTING=no
-GL_LIBS="-lGL -lGLU"
-GL_CPPFLAGS=
+        $as_echo "Check for OpenGL libraries libGLU libGL"
 
 # Check whether --with-opengl-lib was given.
 if test "${with_opengl_lib+set}" = set; then :
-  withval=$with_opengl_lib; opengl_libdir="${withval}" GOT_GL=yes
+  withval=$with_opengl_lib; opengl_libdir="${withval}" GOT_OPENGL=yes
 else
-  GOT_GL=no
+  GOT_OPENGL=no
 fi
 
-if test "$GOT_GL" = "no" ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5
-$as_echo_n "checking for main in -lGL... " >&6; }
-if ${ac_cv_lib_GL_main+:} false; then :
+    if test "$GOT_OPENGL" = "yes" ; then
+                $as_echo "OpenGL library location specified: $opengl_libdir - check if libGL libGLU are there..."
+        save_LDFLAGS=$LDFLAGS
+        LDFLAGS="$LDFLAGS -L$opengl_libdir"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5
+$as_echo_n "checking for main in -lGLU... " >&6; }
+if ${ac_cv_lib_GLU_main+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL  $LIBS"
+LIBS="-lGLU  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -14717,30 +15080,30 @@ return main ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GL_main=yes
+  ac_cv_lib_GLU_main=yes
 else
-  ac_cv_lib_GL_main=no
+  ac_cv_lib_GLU_main=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5
-$as_echo "$ac_cv_lib_GL_main" >&6; }
-if test "x$ac_cv_lib_GL_main" = xyes; then :
-  GL_SETTING=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5
+$as_echo "$ac_cv_lib_GLU_main" >&6; }
+if test "x$ac_cv_lib_GLU_main" = xyes; then :
+  OPENGL_SETTING=yes
 else
-  GL_SETTING=no
+  OPENGL_SETTING=no
 fi
 
-  if test "$GL_SETTING" = "yes" ; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5
-$as_echo_n "checking for main in -lGLU... " >&6; }
-if ${ac_cv_lib_GLU_main+:} false; then :
+        if test "$OPENGL_SETTING" = "yes"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5
+$as_echo_n "checking for main in -lGL... " >&6; }
+if ${ac_cv_lib_GL_main+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU -lGL $LIBS"
+LIBS="-lGL  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -14754,44 +15117,114 @@ return main ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GLU_main=yes
+  ac_cv_lib_GL_main=yes
 else
-  ac_cv_lib_GLU_main=no
+  ac_cv_lib_GL_main=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5
-$as_echo "$ac_cv_lib_GLU_main" >&6; }
-if test "x$ac_cv_lib_GLU_main" = xyes; then :
-  GL_SETTING=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5
+$as_echo "$ac_cv_lib_GL_main" >&6; }
+if test "x$ac_cv_lib_GL_main" = xyes; then :
+  OPENGL_SETTING=yes
 else
-  GL_SETTING=no
+  OPENGL_SETTING=no
 fi
 
-  fi
-fi
+        fi
+        LDFLAGS="$save_LDFLAGS"
+        if test "$OPENGL_SETTING" = "no"; then
+            as_fn_error $? "Did not find libGLU libGL according to --with-opengl-lib - check the installation!" "$LINENO" 5
+        fi
+        libopengl_LIBS="-L$opengl_libdir -R $opengl_libdir -lGL -lGLU"
+        libopengl_LDFLAGS="-L$opengl_libdir"
+    else
+                $as_echo "Look for pkg-config OpenGL package..."
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libGLU" >&5
+$as_echo_n "checking for libGLU... " >&6; }
 
- if test "$GL_SETTING" = "yes" ; then
-    GOT_GL=yes
-    $as_echo "Using pre-installed OpenGL libs."
+if test -n "$libGLU_CFLAGS"; then
+    pkg_cv_libGLU_CFLAGS="$libGLU_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opengl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "opengl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libGLU_CFLAGS=`$PKG_CONFIG --cflags "opengl" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
  else
-    if test "$GOT_GL" = "no" ; then
-	$as_echo "Did not find OpenGL libs (GL and GLU), use --with-opengl-lib, (OpenGL disabled)"
-    else
-	$as_echo "Looking for OpenGL Libs in $opengl_libdir ..."
-	save_LDFLAGS=$LDFLAGS
-	save_LIBS=$LIBS
-	LDFLAGS="$LDFLAGS -L$opengl_libdir"
-	LIBS="$LIBS $GL_LIBS"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5
-$as_echo_n "checking for main in -lGL... " >&6; }
-if ${ac_cv_lib_GL_main+:} false; then :
+    pkg_failed=untried
+fi
+if test -n "$libGLU_LIBS"; then
+    pkg_cv_libGLU_LIBS="$libGLU_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opengl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "opengl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libGLU_LIBS=`$PKG_CONFIG --libs "opengl" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        libGLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "opengl" 2>&1`
+        else
+	        libGLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "opengl" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$libGLU_PKG_ERRORS" >&5
+
+	GOT_OPENGL=no
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	GOT_OPENGL=no
+else
+	libGLU_CFLAGS=$pkg_cv_libGLU_CFLAGS
+	libGLU_LIBS=$pkg_cv_libGLU_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	GOT_OPENGL=yes
+fi
+        libopengl_LIBS="-lGL -lGLU"
+        libopengl_LDFLAGS=""
+    fi
+    if test "$GOT_OPENGL" = "no" ; then
+                $as_echo "Did not find OpenGL library pkg-config package, looking in the usual places..."
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5
+$as_echo_n "checking for main in -lGLU... " >&6; }
+if ${ac_cv_lib_GLU_main+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL  $LIBS"
+LIBS="-lGLU  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -14805,30 +15238,30 @@ return main ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GL_main=yes
+  ac_cv_lib_GLU_main=yes
 else
-  ac_cv_lib_GL_main=no
+  ac_cv_lib_GLU_main=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5
-$as_echo "$ac_cv_lib_GL_main" >&6; }
-if test "x$ac_cv_lib_GL_main" = xyes; then :
-  GL_SETTING=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5
+$as_echo "$ac_cv_lib_GLU_main" >&6; }
+if test "x$ac_cv_lib_GLU_main" = xyes; then :
+  OPENGL_SETTING=yes
 else
-  GL_SETTING=no
+  OPENGL_SETTING=no
 fi
 
-  	if test "$GL_SETTING" = "yes" ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5
-$as_echo_n "checking for main in -lGLU... " >&6; }
-if ${ac_cv_lib_GLU_main+:} false; then :
+        if test "$OPENGL_SETTING" = "yes" ; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5
+$as_echo_n "checking for main in -lGL... " >&6; }
+if ${ac_cv_lib_GL_main+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU  $LIBS"
+LIBS="-lGL  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -14842,119 +15275,95 @@ return main ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GLU_main=yes
+  ac_cv_lib_GL_main=yes
 else
-  ac_cv_lib_GLU_main=no
+  ac_cv_lib_GL_main=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5
-$as_echo "$ac_cv_lib_GLU_main" >&6; }
-if test "x$ac_cv_lib_GLU_main" = xyes; then :
-  GL_SETTING=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5
+$as_echo "$ac_cv_lib_GL_main" >&6; }
+if test "x$ac_cv_lib_GL_main" = xyes; then :
+  OPENGL_SETTING=yes
 else
-  GL_SETTING=no
+  OPENGL_SETTING=no
 fi
 
-  	fi
-	LDFLAGS=$save_LDFLAGS
-	LIBS=$save_LIBS
-	if test "$GL_SETTING" = "no"; then
-	   	$as_echo "OpenGL libs not found, OpenGL support is disabled"
-		GOT_GL=no
-	else
-		GOT_GL=yes
-		GL_LIBS="-L$opengl_libdir -R $opengl_libdir $GL_LIBS"
-	fi
+        fi
+        if test "$OPENGL_SETTING" = "yes" ; then
+            GOT_OPENGL=yes
+            $as_echo "Using pre-installed libGLU libGL..."
+            libopengl_LIBS="-lGL -lGLU"
+            libopengl_LDFLAGS=""
+        else
+            $as_echo "Did not find OpenGL library anywhere, use --with-opengl-lib to set the location"
+            as_fn_error $? "Did not find OpenGL library anywhere, use --with-opengl-lib to set the location" "$LINENO" 5
+        fi
     fi
- fi
-
-if test "$GOT_GL" = "yes" ; then
-	GL_LIBS="$GL_LIBS"
-
-fi
 
-
-if test "$GOT_GL" = "yes" ; then
-GOT_GL=no
-GL_SETTING=no
+    if test "$GOT_OPENGL" = "yes" ; then
+                $as_echo "Check for OpenGL headers"
+        GOT_OPENGL=no
+        OPENGL_SETTING=no
 
 # Check whether --with-opengl-include was given.
 if test "${with_opengl_include+set}" = set; then :
-  withval=$with_opengl_include; GL_CPPFLAGS="-I${withval}" GOT_GL=yes
+  withval=$with_opengl_include; libopengl_CPPFLAGS="-I${withval}" GOT_OPENGL=yes
 else
-  GOT_GL=no
+  GOT_OPENGL=no
 fi
 
-
-if test "$GOT_GL" = "no" ; then
-  for ac_header in GL/gl.h GL/glu.h GL/glx.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- GL_SETTING=yes
+        if test "$GOT_OPENGL" = "yes" ; then
+                        $as_echo "OpenGL header location specified: $libopengl_CPPFLAGS - check if Xm/Xm.h is there..."
+            save_CPPFLAGS=$CPPFLAGS
+            save_CFLAGS=$CFLAGS
+            CPPFLAGS="$CPPFLAGS $libopengl_CPPFLAGS"
+            CFLAGS="$CFLAGS $libopengl_CPPFLAGS"
+            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
+if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
+  OPENGL_SETTING=yes
 else
-  GL_SETTING=no
+  OPENGL_SETTING=no
 fi
 
-done
 
-fi
- if test "$GL_SETTING" = "yes" ; then
-    GOT_GL=yes
-    $as_echo "Using pre-installed OpenGL headers."
- else
-    if test "$GOT_GL" = "no" ; then
-	$as_echo "Did not find OpenGL headers, use --with-opengl-inc, (OpenGL Disabled)"
-    else
-	$as_echo "Checking OpenGL Headers in $GL_CPPFLAGS..."
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $GL_CPPFLAGS"
-	CFLAGS="$CFLAGS $GL_CPPFLAGS"
-	for ac_header in GL/gl.h GL/glu.h GL/glx.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- GL_SETTING=yes
+            CPPFLAGS=$save_CPPFLAGS
+            CFLAGS=$save_CFLAGS
+            if test "$OPENGL_SETTING" = "no"; then
+                as_fn_error $? "Did not find Xm/Xm.h according to --with-opengl-include - check the installation!" "$LINENO" 5
+            fi
+        else
+                        $as_echo "Looking for OpenGL headers in the usual places..."
+            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
+if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
+  OPENGL_SETTING=yes
 else
-  GL_SETTING=no
+  OPENGL_SETTING=no
 fi
 
-done
-
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$GL_SETTING" = "no"; then
-	   $as_echo "Did not find OpenGL headers, OpenGL support disabled"
-	   GOT_GL=no
-	fi
-    fi
- fi
-
-if test "$GOT_GL" = "yes" ; then
-	GL_CPPFLAGS=$GL_CPPFLAGS
 
+            if test "$OPENGL_SETTING" = "yes" ; then
+                GOT_OPENGL=yes
+                $as_echo "Using pre-installed OpenGL headers..."
+            else
+                $as_echo "Did not find OpenGL headers anywhere, use --with-opengl-include to set the location"
+                as_fn_error $? "Did not find OpenGL headers anywhere, use --with-opengl-include to set the location" "$LINENO" 5
+            fi
+        fi
+            fi
 
-$as_echo "#define GOT_GL 1" >>confdefs.h
+        libopengl_LIBS=$libopengl_LIBS
 
-fi
+    libopengl_CPPFLAGS=$libopengl_CPPFLAGS
 
-fi
+    if test "$GOT_OPENGL" = "yes" ; then
 
-fi
+$as_echo "#define GOT_GL 1" >>confdefs.h
 
- if test "$GOT_GL" = yes; then
+    fi
+     if test "$GOT_OPENGL" = yes; then
   BUILD_GL_TRUE=
   BUILD_GL_FALSE='#'
 else
@@ -14963,6 +15372,11 @@ else
 fi
 
 
+else
+        $as_echo "Failed to find Motif libraries and headers - did not look for OpenGL libraries and headers - unable to build visualization tools"
+fi
+
+
 mbsystemdatadir="$datadir/$PACKAGE"
 
 mbsystemhtmldir="$docdir/html"
@@ -14970,18 +15384,15 @@ mbsystemhtmldir="$docdir/html"
 mbsystempsdir="$docdir/ps"
 
 
+
 $as_echo " "
 $as_echo "About to create Makefiles..."
-ac_config_files="$ac_config_files Makefile src/Makefile src/mbio/Makefile src/surf/Makefile src/bsio/Makefile src/mbaux/Makefile src/utilities/Makefile src/gmt/Makefile src/macros/Makefile src/mbedit/Makefile src/mbnavedit/Makefile src/mbvelocitytool/Makefile src/mbnavadjust/Makefile src/otps/Makefile src/mbview/Makefile src/mbgrdviz/Makefile src/mbeditviz/Makefile src/man/Makefile src/man/man1/Makefile src/man/man3/Makefile src/html/Makefile src/ps/Makefile src/share/Makefile"
+ac_config_files="$ac_config_files Makefile src/Makefile src/mbio/Makefile src/surf/Makefile src/bsio/Makefile src/gsf/Makefile src/mbaux/Makefile src/utilities/Makefile src/gmt/Makefile src/macros/Makefile src/mbedit/Makefile src/mbnavedit/Makefile src/mbvelocitytool/Makefile src/mbnavadjust/Makefile src/otps/Makefile src/mbview/Makefile src/mbgrdviz/Makefile src/mbeditviz/Makefile src/man/Makefile src/man/man1/Makefile src/man/man3/Makefile src/html/Makefile src/ps/Makefile src/share/Makefile"
 
 if test "$bundledproj" = "yes" ; then
 ac_config_files="$ac_config_files src/proj/Makefile"
 
 fi
-if test "$with_gsf" = "yes" ; then
-ac_config_files="$ac_config_files src/gsf/Makefile"
-
-fi
 
 
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
@@ -15039,10 +15450,6 @@ if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${BUILD_GSF_TRUE}" && test -z "${BUILD_GSF_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_GSF\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${BUILD_PROJ_TRUE}" && test -z "${BUILD_PROJ_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_PROJ\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15456,7 +15863,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mbsystem $as_me 5.4.2220, which was
+This file was extended by mbsystem $as_me 5.5.2252, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15523,7 +15930,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-mbsystem config.status 5.4.2220
+mbsystem config.status 5.5.2252
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -15658,6 +16065,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@@ -15707,10 +16115,13 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
@@ -15775,7 +16186,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -15826,9 +16238,12 @@ CFLAGS \
 compiler \
 lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
 nm_file_list_spec \
+lt_cv_truncate_bin \
 lt_prog_compiler_no_builtin_flag \
 lt_prog_compiler_pic \
 lt_prog_compiler_wl \
@@ -15863,7 +16278,7 @@ old_striplib \
 striplib; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -15890,10 +16305,11 @@ postinstall_cmds \
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec; do
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -15902,19 +16318,16 @@ sys_lib_dlsearch_path_spec; do
 done
 
 ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
 
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
 
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'
 
@@ -15937,6 +16350,7 @@ do
     "src/mbio/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbio/Makefile" ;;
     "src/surf/Makefile") CONFIG_FILES="$CONFIG_FILES src/surf/Makefile" ;;
     "src/bsio/Makefile") CONFIG_FILES="$CONFIG_FILES src/bsio/Makefile" ;;
+    "src/gsf/Makefile") CONFIG_FILES="$CONFIG_FILES src/gsf/Makefile" ;;
     "src/mbaux/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbaux/Makefile" ;;
     "src/utilities/Makefile") CONFIG_FILES="$CONFIG_FILES src/utilities/Makefile" ;;
     "src/gmt/Makefile") CONFIG_FILES="$CONFIG_FILES src/gmt/Makefile" ;;
@@ -15956,7 +16370,6 @@ do
     "src/ps/Makefile") CONFIG_FILES="$CONFIG_FILES src/ps/Makefile" ;;
     "src/share/Makefile") CONFIG_FILES="$CONFIG_FILES src/share/Makefile" ;;
     "src/proj/Makefile") CONFIG_FILES="$CONFIG_FILES src/proj/Makefile" ;;
-    "src/gsf/Makefile") CONFIG_FILES="$CONFIG_FILES src/gsf/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -16647,55 +17060,53 @@ $as_echo X"$file" |
  ;;
     "libtool":C)
 
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 # The names of the tagged configurations supported by this script.
-available_tags=""
+available_tags=''
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
 
 # ### BEGIN LIBTOOL CONFIG
 
@@ -16715,6 +17126,9 @@ pic_mode=$pic_mode
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
 
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
 # Shell to use when invoking shell scripts.
 SHELL=$lt_SHELL
 
@@ -16832,18 +17246,27 @@ global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 # Transform the output of nm in a proper C declaration.
 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
 # Transform the output of nm in a C name address pair.
 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
 # Specify filename containing input files for \$NM.
 nm_file_list_spec=$lt_nm_file_list_spec
 
-# The root where to search for dependent libraries,and in which our libraries should be installed.
+# The root where to search for dependent libraries,and where our libraries should be installed.
 lt_sysroot=$lt_sysroot
 
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
 # The name of the directory that contains temporary libtool files.
 objdir=$objdir
 
@@ -16934,8 +17357,11 @@ hardcode_into_libs=$hardcode_into_libs
 # Compile-time system search path for libraries.
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
 
 # Whether dlopen is supported.
 dlopen_support=$enable_dlopen
@@ -17028,13 +17454,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute
 
@@ -17086,13 +17512,72 @@ hardcode_action=$hardcode_action
 
 _LT_EOF
 
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -17101,7 +17586,7 @@ _LT_EOF
   esac
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 
   # We use sed instead of cat because bash on DJGPP gets confused if
@@ -17111,165 +17596,6 @@ ltmain="$ac_aux_dir/ltmain.sh"
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  if test x"$xsi_shell" = xyes; then
-  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\    # positional parameters, so assign one to ordinary parameter first.\
-\    func_stripname_result=${3}\
-\    func_stripname_result=${func_stripname_result#"${1}"}\
-\    func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\    func_split_long_opt_name=${1%%=*}\
-\    func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\    func_split_short_opt_arg=${1#??}\
-\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\    case ${1} in\
-\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\      *)    func_lo2o_result=${1} ;;\
-\    esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
-    func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
-    func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
-    func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
-    eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\    func_quote_for_eval "${2}"\
-\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -17345,16 +17671,13 @@ if test "$GOT_MOTIF" = "yes" ; then
 else
 	$as_echo "Motif Support: Disabled"
 fi
-if test "$GOT_GL" = "yes" ; then
+if test "$GOT_OPENGL" = "yes" ; then
 	$as_echo "OpenGL Support: Enabled"
 else
 	$as_echo "OpenGL Support: Disabled"
 fi
 $as_echo "Using $OTPS_DIR for OSU Tidal Prediction Software"
 
-$as_echo "Build with Generic Sensor Format (GSF) Support: $with_gsf"
-
-
 if test "$bundledproj" = "yes" ; then
 	$as_echo "Building using bundled proj package"
 else
diff --git a/configure.ac b/configure.ac
index 77fbb1b..9c5ad6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 dnl--------------------------------------------------------------------
 dnl    The MB-system:	configure.ac	12/7/2011
-dnl    $Id: configure.ac 2219 2014-12-11 21:22:25Z caress $
+dnl    $Id: configure.ac 2252 2015-07-01 19:35:37Z caress $
 dnl
 dnl    Copyright (c) 2011-2015 by
 dnl    D. W. Caress (caress at lamont.ldgo.columbia.edu)
@@ -19,11 +19,11 @@ define([AC_CACHE_LOAD], )
 define([AC_CACHE_SAVE], )
 
 dnl Initialize and set version and version date
-AC_INIT([mbsystem],[5.4.2220],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
+AC_INIT([mbsystem],[5.5.2252],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
 
 AC_CONFIG_MACRO_DIR(m4)
 AC_LANG(C)
-AC_DEFINE(VERSION_DATE, "22 January 2015", [Set VERSION_DATE define in mb_config.h])
+AC_DEFINE(VERSION_DATE, "1 July 2015", [Set VERSION_DATE define in mb_config.h])
 
 dnl Check system arch
 AC_CANONICAL_HOST
@@ -31,7 +31,7 @@ AC_CANONICAL_HOST
 AS_ECHO([" "])
 AS_ECHO(["------------------------------------------------------------------------------"])
 AS_ECHO(["    The MB-system:	configure	12/7/2011"])
-AS_ECHO(["    $Id: configure.ac 2219 2014-12-11 21:22:25Z caress $"])
+AS_ECHO(["    $Id: configure.ac 2252 2015-07-01 19:35:37Z caress $"])
 AS_ECHO([" "])
 AS_ECHO(["    Copyright (c) 2011-2015 by"])
 AS_ECHO(["    D. W. Caress (caress at lamont.ldgo.columbia.edu)"])
@@ -72,7 +72,7 @@ AS_ECHO([" "])
 AS_ECHO(["        # Reset the autotools version to 2.65 to accomodate some Linux distributions"])
 AS_ECHO(["        sed -i.bak s/2\.69/2\.65/ configure.ac"])
 AS_ECHO([" "])
-AS_ECHO(["    When you run ./configure, a number of configure options are saved  to a"])
+AS_ECHO(["    When you run ./configure, a number of configure options are saved to a"])
 AS_ECHO(["    header file:"])
 AS_ECHO(["        ./src/mbio/mb_config.h"])
 AS_ECHO(["    This file has a template:"])
@@ -80,11 +80,6 @@ AS_ECHO(["        ./src/mbio/mb_config.h.in"])
 AS_ECHO(["    This file is conditionally included by:"])
 AS_ECHO(["        ./src/mbio/mb_define.h"])
 AS_ECHO(["    which is in turn included by essentially every MB-System C source file."])
-AS_ECHO(["    The condition under which mb_config.h is used is simply the use of the"])
-AS_ECHO(["    configure script to generate the makefiles. If one uses the alternate"])
-AS_ECHO(["    install_makefiles build system, then an alternate header file named"])
-AS_ECHO(["        ./src/mbio/mb_config2.h"])
-AS_ECHO(["    is used instead."])
 AS_ECHO([" "])
 AS_ECHO(["------------------------------------------------------------------------------"])
 AS_ECHO(["    To use the build system..."])
@@ -106,7 +101,6 @@ AS_ECHO(["        --with-motif-include  - location of Motif headers (optional)"]
 AS_ECHO(["        --with-opengl-lib     - location of OpenGL libs (optional)"])
 AS_ECHO(["        --with-opengl-include - location of OpenGL headers (optional)"])
 AS_ECHO(["        --with-otps-dir       - location of OTPS installation (optional)"])
-AS_ECHO(["        --without-gsf         - build without including or supporting GSF"])
 AS_ECHO(["        --enable-bundledproj  - build using bundled proj package - default is to link with libproj"])
 AS_ECHO([" "])
 AS_ECHO(["    After configure you can run the make utility in the usual fashion"])
@@ -204,604 +198,588 @@ AC_CHECK_FUNC(xdrmem_create, XDR_LIB=, [
 ], -lws2_32 )])])])])
 AC_SUBST(XDR_LIB)
 
-dnl check for OTPS arg
-dnl TODO add actual check and disable if not found
-AS_ECHO(["Check for OSU Tidal Prediction Software"])
-dnl initialize with defaut
+dnl--------------------------------------------------------------------
+dnl OTPS Section
+dnl--------------------------------------------------------------------
+
+dnl Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise
+AS_ECHO(["Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise"])
 OTPS_DIR="/usr/local/OTPSnc"
-dnl check for command line option and reset
-AC_ARG_WITH(otps_dir, [  --with-otps_dir=DIR        Location of OSU Tidal Prediction Software], [OTPS_DIR=${withval}])
+AC_ARG_WITH(otps_dir, [ --with-otps_dir=DIR    Location of OSU Tidal Prediction Software], [OTPS_DIR=${withval}])
 AC_SUBST(OTPS_DIR)
 
-AC_MSG_CHECKING([whether to build with Generic Sensor Format (GSF)])
-AC_ARG_WITH([gsf], AS_HELP_STRING([--without-gsf], [Disable unlicensed SAIC Generic Sensor Format (GSF)]), [ ], [with_gsf=yes])
-AC_MSG_RESULT([$with_gsf])
-
-AS_IF([test x"$with_gsf" = xyes], [AC_DEFINE(WITH_GSF, 1, [Build with GSF])])
-AM_CONDITIONAL([BUILD_GSF], [test x"$with_gsf" = xyes])
+dnl--------------------------------------------------------------------
+dnl NetCDF Section
+dnl--------------------------------------------------------------------
 
-dnl Check for NetCDF lib
-AS_ECHO(["Check for NetCDF"])
+dnl Check for netCDF library
+AS_ECHO(["Check for netCDF library libnetcdf"])
 GOT_CDF=no
 CDF_SETTING=no
-dnl first check for package
-PKG_CHECK_MODULES([libnetcdf], [netcdf], [GOT_CDF=yes], [GOT_CDF=no])
-
-dnl Package check failed so check manually
-if test "$GOT_CDF" = "no" ; then
-
-libnetcdf_LIBS="-lnetcdf"
-libnetcdf_LDFLAGS=
-
-dnl arg for command line
+dnl First check if netcdf location specified on the command line
 AC_ARG_WITH(netcdf-lib, [  --with-netcdf-lib=DIR	Location of NetCDF library],
 	[netcdf_libdir="${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-dnl First check if lib installed
-if test "$GOT_CDF" = "no" ; then
- AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no],)
+if test "$GOT_CDF" = "yes" ; then
+    dnl NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there...
+    AS_ECHO(["NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there..."])
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -L$netcdf_libdir"
+    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no], )
+    LDFLAGS="$save_LDFLAGS"
+    if test "$CDF_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find libnetcdf according to --with-netcdf-lib - check the installation!])
+    fi
+    libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir -lnetcdf"
+    libnetcdf_LDFLAGS="-L$netcdf_libdir"
+else
+    dnl Look for pkg-config netCDF package...
+    AS_ECHO(["Look for pkg-config netCDF package..."])
+    PKG_CHECK_MODULES([libnetcdf], [netcdf], [GOT_CDF=yes], [GOT_CDF=no])
+    libnetcdf_LIBS="-lnetcdf"
+    libnetcdf_LDFLAGS=""
 fi
- if test "$CDF_SETTING" = "yes" ; then
-    GOT_CDF=yes
-    AS_ECHO(["Using pre-installed libcdf."])
- else
-    if test "$GOT_CDF" = "no" ; then
-	AC_MSG_ERROR([Did not find libnetcdf, use --with-netcdf-lib])
+if test "$GOT_CDF" = "no" ; then
+    dnl Did not find netCDF library pkg-config package, looking in the usual places...
+    AS_ECHO(["Did not find netCDF library pkg-config package, looking in the usual places..."])
+    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no],)
+    if test "$CDF_SETTING" = "yes" ; then
+        GOT_CDF=yes
+        AS_ECHO(["Using pre-installed libnetcdf..."])
+        libnetcdf_LIBS="-lnetcdf"
+        libnetcdf_LDFLAGS=""
     else
-	AS_ECHO(["Looking for libnetcdf in $netcdf_libdir ..."])
-	save_LDFLAGS=$LDFLAGS
-	LDFLAGS="$LDFLAGS -L$netcdf_libdir"
-	AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no], )
-	LDFLAGS="$save_LDFLAGS"
-	if test "$CDF_SETTING" = "no"; then
-	   AC_MSG_ERROR([Did not find libnetcdf, use --with-netcdf-lib or check installation])
-	fi
-	libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir $libnetcdf_LIBS"
-#
-#       Save the netcdf library path for later gmt tests
-#
-	libnetcdf_LDFLAGS="-L$netcdf_libdir"
+        AS_ECHO(["Did not find netCDF library anywhere, use --with-netcdf-lib to set the location"])
+        AC_MSG_ERROR([Did not find netCDF library anywhere, use --with-netcdf-lib to set the location])
     fi
- fi
- dnl Use ac_subst to set vars that would be set by pkg_check
- AC_SUBST([libnetcdf_LIBS], ["$libnetcdf_LIBS"])
 fi
-dnl done with CDF lib
+dnl Done checking for netCDF library libnetcdf
 
-dnl Now check CDF headers
+dnl Check for netCDF headers
+AS_ECHO(["Check for netCDF headers"])
 GOT_CDF=no
 CDF_SETTING=no
-dnl add command line option
+dnl First check if netcdf location specified on the command line
 AC_ARG_WITH(netcdf-include, [  --with-netcdf-include=DIR	Location of NetCDF headers],
 	[libnetcdf_CPPFLAGS="-I${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-dnl First check if cdf headers installed
-if test "$GOT_CDF" = "no" ; then
- AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no])
-fi
- if test "$CDF_SETTING" = "yes" ; then
-    GOT_CDF=yes
-    AS_ECHO(["Using pre-installed NetCDF headers."])
- else
-    if test "$GOT_CDF" = "no" ; then
-	AC_MSG_ERROR([Did not find required NetCDF headers, use --with-netcdf-include])
+if test "$GOT_CDF" = "yes" ; then
+    dnl NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there...
+    AS_ECHO(["NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there..."])
+    save_CPPFLAGS=$CPPFLAGS
+    save_CFLAGS=$CFLAGS
+    CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
+    CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
+    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no],)
+    CPPFLAGS=$save_CPPFLAGS
+    CFLAGS=$save_CFLAGS
+    if test "$CDF_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find netcdf.h according to --with-netcdf-include - check the installation!])
+    fi
+else
+    dnl Looking for netCDF headers in the usual places...
+    AS_ECHO(["Looking for netCDF headers in the usual places..."])
+    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no])
+    if test "$CDF_SETTING" = "yes" ; then
+        GOT_CDF=yes
+        AS_ECHO(["Using pre-installed netCDF headers..."])
     else
-	AS_ECHO(["Checking netcdf.h in $libnetcdf_CPPFLAGS..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
-	CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
-	AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no],)
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$CDF_SETTING" = "no"; then
-	   AC_MSG_ERROR([Did not find required NetCDF headers, use --with-netcdf-include])
-	fi
+        AS_ECHO(["Did not find netCDF headers anywhere, use --with-netcdf-include to set the location"])
+        AC_MSG_ERROR([Did not find netCDF headers anywhere, use --with-netcdf-include to set the location])
     fi
- fi
+fi
+dnl Done checking for netCDF headers
+
+dnl Substitute netCDF library and header arguments
+AC_SUBST([libnetcdf_LIBS], [$libnetcdf_LIBS])
 AC_SUBST([libnetcdf_CPPFLAGS], [$libnetcdf_CPPFLAGS])
-dnl done with CDF headers
 
+dnl--------------------------------------------------------------------
+dnl PROJ Section
+dnl--------------------------------------------------------------------
 
-dnl check whether to use bundled proj package or link with external libproj
+dnl Check whether to use bundled proj package or link with external libproj
+AS_ECHO(["Check whether to use bundled proj package or link with external libproj"])
 AC_ARG_ENABLE(bundledproj, [AS_HELP_STRING([--enable-bundledproj], [build and use the bundled proj package])],
         [bundledproj=yes], [bundledproj=no])
 AM_CONDITIONAL([BUILD_PROJ], [test x"$bundledproj" = xyes])
-        
-dnl Using bundled PROJ
 if test "$bundledproj" = "yes" ; then
-    AS_ECHO(["Using bundled PROJ lib"])
+    dnl Using bundled PROJ library
+    AS_ECHO(["Using bundled PROJ library"])
     libproj_LIBS="-lproj"
     libproj_LDFLAGS=
-    AC_SUBST([libproj_LIBS], ["$libproj_LIBS"])
-
-dnl Linking with external PROJ
 else
-
-    dnl Check for PROJ lib
-    AS_ECHO(["Check for PROJ"])
+    dnl Check if proj library location specified on the command line
+    AS_ECHO(["Check if proj library location specified on the command line"])
     GOT_PROJ=no
     PROJ_SETTING=no
-    dnl first check for package
-    PKG_CHECK_MODULES([libproj], [proj], [GOT_PROJ=yes], [GOT_PROJ=no])
-    
-    dnl Package check failed so check manually
-    if test "$GOT_PROJ" = "no" ; then
-    
-    libproj_LIBS="-lproj"
-    libproj_LDFLAGS=
-    
-    dnl arg for command line
     AC_ARG_WITH(proj-lib, [  --with-proj-lib=DIR	Location of PROJ library],
-            [proj_libdir="${withval}"] [GOT_PROJ=yes], [GOT_PROJ=no])
-    dnl First check if lib installed
-    if test "$GOT_PROJ" = "no" ; then
-     AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no],)
+        [proj_libdir="${withval}"] [GOT_PROJ=yes], [GOT_PROJ=no])
+    if test "$GOT_PROJ" = "yes" ; then
+        dnl PROJ library location specified: $proj_libdir - check if libproj is there...
+        AS_ECHO(["PROJ library location specified: $proj_libdir - check if libproj is there..."])
+        save_LDFLAGS=$LDFLAGS
+        LDFLAGS="$LDFLAGS -L$proj_libdir"
+        AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no], )
+        LDFLAGS="$save_LDFLAGS"
+        if test "$PROJ_SETTING" = "no"; then
+            AC_MSG_ERROR([Did not find libproj according to --with-proj-lib - check the installation!])
+        fi
+        libproj_LIBS="-L$proj_libdir -R $proj_libdir -lproj"
+        libproj_LDFLAGS="-L$proj_libdir"
+    else
+        dnl Look for pkg-config PROJ package...
+        AS_ECHO(["Look for pkg-config PROJ package..."])
+        PKG_CHECK_MODULES([libproj], [proj], [GOT_PROJ=yes], [GOT_PROJ=no])
+        libproj_LIBS="-lproj"
+        libproj_LDFLAGS=""
     fi
-     if test "$PROJ_SETTING" = "yes" ; then
-        GOT_PROJ=yes
-        AS_ECHO(["Using pre-installed libproj."])
-     else
-        if test "$GOT_PROJ" = "no" ; then
-            AC_MSG_ERROR([Did not find libproj, use --with-proj-lib])
+    if test "$GOT_PROJ" = "no" ; then
+        dnl Did not find PROJ library pkg-config package, looking in the usual places...
+        AS_ECHO(["Did not find PROJ library pkg-config package, looking in the usual places..."])
+        AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no],)
+        if test "$PROJ_SETTING" = "yes" ; then
+            GOT_PROJ=yes
+            AS_ECHO(["Using pre-installed libproj..."])
+            libproj_LIBS="-lproj"
+            libproj_LDFLAGS=""
         else
-            AS_ECHO(["Looking for libproj in $proj_libdir ..."])
-            save_LDFLAGS=$LDFLAGS
-            LDFLAGS="$LDFLAGS -L$proj_libdir"
-            AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no], )
-            LDFLAGS="$save_LDFLAGS"
-            if test "$PROJ_SETTING" = "no"; then
-               AC_MSG_ERROR([Did not find libproj, use --with-proj-lib or check installation])
-            fi
-            libproj_LIBS="-L$proj_libdir -R $proj_libdir $libproj_LIBS"
-    #
-    #       Save the proj library path for later gmt tests
-    #
-            libproj_LDFLAGS="-L$proj_libdir"
+            AS_ECHO(["Did not find PROJ library anywhere, use --with-proj-lib to set the location"])
+            AC_MSG_ERROR([Did not find PROJ library anywhere, use --with-proj-lib to set the location])
         fi
-     fi
-     dnl Use ac_subst to set vars that would be set by pkg_check
-     AC_SUBST([libproj_LIBS], ["$libproj_LIBS"])
     fi
-    dnl done with PROJ lib
-
-    dnl Now check PROJ headers
+    
+    dnl Check if proj header location specified on the command line
+    AS_ECHO(["Check if proj header location specified on the command line"])
     GOT_PROJ=no
     PROJ_SETTING=no
-    dnl add command line option
     AC_ARG_WITH(proj-include, [  --with-proj-include=DIR	Location of PROJ headers],
             [libproj_CPPFLAGS="-I${withval}"] [GOT_PROJ=yes], [GOT_PROJ=no])
-    dnl First check if PROJ headers installed
-    if test "$GOT_PROJ" = "no" ; then
-        AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no])
-    fi
-    if test "$PROJ_SETTING" = "yes" ; then
-        GOT_PROJ=yes
-        AS_ECHO(["Using pre-installed PROJ headers."])
+    if test "$GOT_PROJ" = "yes" ; then
+        dnl PROJ header location specified: $libproj_CPPFLAGS - check if proj_api.h is there...
+        AS_ECHO(["PROJ header location specified: $libproj_CPPFLAGS - check if proj_api.h is there..."])
+        save_CPPFLAGS=$CPPFLAGS
+        save_CFLAGS=$CFLAGS
+        CPPFLAGS="$CPPFLAGS $libproj_CPPFLAGS"
+        CFLAGS="$CFLAGS $libproj_CPPFLAGS"
+        AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no],)
+        CPPFLAGS=$save_CPPFLAGS
+        CFLAGS=$save_CFLAGS
+        if test "$PROJ_SETTING" = "no"; then
+           AC_MSG_ERROR([Did not find PROJ headers according to --with-proj-include - check the installation!])
+        fi
     else
-        if test "$GOT_PROJ" = "no" ; then
-            AC_MSG_ERROR([Did not find required PROJ headers, use --with-proj-include])
+        dnl Looking for PROJ headers in the usual places...
+        AS_ECHO(["Looking for PROJ headers in the usual places..."])
+        AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no])
+        if test "$PROJ_SETTING" = "yes" ; then
+            GOT_PROJ=yes
+            AS_ECHO(["Using pre-installed PROJ headers..."])
         else
-            AS_ECHO(["Checking proj_api.h in $libproj_CPPFLAGS..."])
-            save_CPPFLAGS=$CPPFLAGS
-            save_CFLAGS=$CFLAGS
-            CPPFLAGS="$CPPFLAGS $libproj_CPPFLAGS"
-            CFLAGS="$CFLAGS $libproj_CPPFLAGS"
-            AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no],)
-            CPPFLAGS=$save_CPPFLAGS
-            CFLAGS=$save_CFLAGS
-            if test "$PROJ_SETTING" = "no"; then
-               AC_MSG_ERROR([Did not find required PROJ headers, use --with-proj-include])
-            fi
+            AS_ECHO(["Did not find PROJ headers anywhere, use --with-proj-include to set the location"])
+            AC_MSG_ERROR([Did not find PROJ headers anywhere, use --with-proj-include to set the location])
         fi
     fi
-    AC_SUBST([libproj_CPPFLAGS], [$libproj_CPPFLAGS])
-    dnl done with PROJ headers
-    
-fi
-dnl Done linking with external PROJ
-
-dnl Check for Generic Mapping Tools (GMT) libs
-dnl - these are libgmt, libpsl, and libgmtps
-dnl Would certainly be nice if GMT had pkg-config file (gmt.pc)...
-AS_ECHO(["Check for Generic Mapping Tools (GMT)"])
-GOT_GMTPKG=no
-dnl first check for package
-PKG_CHECK_MODULES([libgmt], [gmt], [GOT_LIBGMT=yes], [GOT_LIBGMT=no])
-PKG_CHECK_MODULES([libgmtps], [gmt], [GOT_LIBGMTPS=yes], [GOT_LIBGMTPS=no])
-PKG_CHECK_MODULES([libpsl], [gmt], [GOT_LIBPSL=yes], [GOT_LIBPSL=no])
-if test "$GOT_LIBGMT" = "yes" ; then
-	GOT_GMTPKG=yes
-fi
-if test "$GOT_GMTPS" = "no" ; then
-	GOT_GMTPKG=no
-fi
-if test "$GOT_PSL" = "no" ; then
-	GOT_GMTPKG=no
+     dnl Done checking for PROJ headers
 fi
+dnl Done checking for PROJ library libproj and PROJ headers
 
-dnl pkg-config check failed so try to find libraries and headers manually
-if test "$GOT_GMTPKG" = "no" ; then
-
-	GMT_SETTING=no
-	GOT_GMTLIBS=no
-	libgmt_LIBS="-lgmt -lgmtps -lpsl"
-	dnl arg for command line
-	AC_ARG_WITH(gmt-lib, [  --with-gmt-lib=DIR	Location of GMT libraries],
-	       [gmt_libdir="${withval}"] [GOT_GMTLIBS=yes], [GOT_GMTLIBS=no])
-	dnl First check if lib installed
-	if test "$GOT_GMTLIBS" = "no" ; then
-		AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no],)
-	fi
-	if test "$GMT_SETTING" = "yes" ; then
-		AS_ECHO(["Using pre-installed libgmt."])
-	else
-		if test "$GOT_GMTLIBS" = "no" ; then
-			AC_MSG_ERROR([Did not find libgmt, use --with-gmt-lib])
-		else
-			AS_ECHO(["Looking for libgmt in $gmt_libdir ..."])
-			save_LDFLAGS=$LDFLAGS
-			save_LIBS=$LIBS
-			LDFLAGS="$LDFLAGS -L$gmt_libdir $libnetcdf_LDFLAGS"
-			LIBS="$LDFLAGS -lnetcdf $LIBM"
-			AC_MSG_NOTICE(LDFLAGS $LDFLAGS)
-			AC_MSG_NOTICE(LIBS $LIBS)
-			AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no], )
-			LDFLAGS="$save_LDFLAGS"
-			LIBS="$save_LIBS"
-			if test "$GMT_SETTING" = "no"; then
-				AC_MSG_ERROR([Did not find libgmt, use --with-gmt-lib or check installation])
-			fi
-			libgmt_LIBS="-L$gmt_libdir -R$gmt_libdir $libgmt_LIBS"
-		fi
-	fi
-
-	dnl Now look for GMT headers
-	GOT_GMTHEADERS=no
-	GMT_SETTING=no
-	libgmt_CPPFLAGS=
-	dnl add command line option
-	AC_ARG_WITH(gmt-include, [  --with-gmt-include=DIR	Location of GMT headers],
-		[libgmt_CPPFLAGS="-I${withval}"] [GOT_GMTHEADERS=yes], [GOT_GMTHEADERS=no])
-
-	dnl First check if gmt headers installed
-	dnl Only if no arg given
-	if test "$GOT_GMTHEADERS" = "no" ; then
-		AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no])
-	fi
-
-	if test "$GMT_SETTING" = "yes" ; then
-		GOT_GMTHEADERS=yes
-		AS_ECHO(["Using pre-installed gmt headers."])
-	else
-		if test "$GOT_GMTHEADERS" = "no" ; then
-			AC_MSG_ERROR([Did not find required GMT headers, use --with-gmt-include])
-		else
-			AS_ECHO(["Checking gmt.h in $libgmt_CPPFLAGS..."])
-			save_CPPFLAGS=$CPPFLAGS
-			save_CFLAGS=$CFLAGS
-			CPPFLAGS="$CPPFLAGS $libgmt_CPPFLAGS $libnetcdf_CPPFLAGS"
-			CFLAGS="$CFLAGS $libgmt_CPPFLAGS $libnetcdf_CPPFLAGS"
-			AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no])
-			CPPFLAGS=$save_CPPFLAGS
-			CFLAGS=$save_CFLAGS
-			if test "$GMT_SETTING" = "no"; then
-				AC_MSG_ERROR([Did not find required GMT headers, use --with-gmt-include])
-			fi
-		fi
-	fi
-	AS_ECHO(["Setting libgmt_CPPFLAGS=$libgmt_CPPFLAGS"])
-	AC_SUBST([libgmt_CPPFLAGS], [$libgmt_CPPFLAGS])
-	dnl done with GMT headers
-fi
+dnl Substitute PROJ library and header arguments
+AC_SUBST([libproj_LIBS], [$libproj_LIBS])
+AC_SUBST([libproj_CPPFLAGS], [$libproj_CPPFLAGS])
 
-AS_ECHO(["Setting libgmt_LIBS=$libgmt_LIBS"])
-AC_SUBST([libgmt_LIBS], ["$libgmt_LIBS"])
+dnl--------------------------------------------------------------------
+dnl GMT Section
+dnl--------------------------------------------------------------------
+
+dnl Check for GMT libraries libgmt libpsl
+AS_ECHO(["Check for GMT libraries libgmt libpsl"])
+GOT_GMT=no
+GMT_SETTING=no
+dnl First check if GMT library location specified on the command line
+AC_ARG_WITH(gmt-lib, [  --with-gmt-lib=DIR	Location of GMT libraries libgmt libpsl],
+	[gmt_libdir="${withval}"] [GOT_GMT=yes], [GOT_GMT=no])
+if test "$GOT_GMT" = "yes" ; then
+    dnl GMT library location specified: $gmt_libdir - check if libgmt libpsl are there...
+    AS_ECHO(["GMT library location specified: $gmt_libdir - check if libgmt libpsl are there..."])
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -L$gmt_libdir"
+    AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no], )
+    LDFLAGS="$save_LDFLAGS"
+    if test "$GMT_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find libgmt according to --with-gmt-lib - check the installation!])
+    fi
+    libgmt_LIBS="-L$gmt_libdir -R $gmt_libdir -lgmt -lpsl"
+    libgmt_LDFLAGS="-L$gmt_libdir"
+else
+    dnl Look for pkg-config GMT package...
+    AS_ECHO(["Look for pkg-config GMT package..."])
+    PKG_CHECK_MODULES([libgmt], [gmt], [GOT_LIBGMT=yes], [GOT_LIBGMT=no])
+    PKG_CHECK_MODULES([libpsl], [gmt], [GOT_LIBPSL=yes], [GOT_LIBPSL=no])
+    if test "$GOT_LIBGMT" = "yes" ; then
+            GOT_GMT=yes
+    fi
+    if test "$GOT_PSL" = "no" ; then
+            GOT_GMT=no
+    fi
+    libgmt_LIBS="-lgmt -lpsl"
+    libgmt_LDFLAGS=""
+fi
+if test "$GOT_GMT" = "no" ; then
+    dnl Did not find GMT library pkg-config package, looking in the usual places...
+    AS_ECHO(["Did not find GMT library pkg-config package, looking in the usual places..."])
+    AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no],)
+    if test "$GMT_SETTING" = "yes" ; then
+        GOT_GMT=yes
+        AS_ECHO(["Using pre-installed libgmt..."])
+        libgmt_LIBS="-lgmt -lpsl"
+        libgmt_LDFLAGS=""
+    else
+        AS_ECHO(["Did not find GMT libraries anywhere, use --with-gmt-lib to set the location"])
+        AC_MSG_ERROR([Did not find GMT libraries anywhere, use --with-gmt-lib to set the location])
+    fi
+fi
+dnl Done checking for GMT libraries libgmt libpsl
+
+dnl Check for GMT headers
+AS_ECHO(["Check for GMT headers"])
+GOT_GMT=no
+GMT_SETTING=no
+dnl First check if GMT header location specified on the command line
+AC_ARG_WITH(gmt-include, [  --with-gmt-include=DIR	Location of GMT headers],
+	[libgmt_CPPFLAGS="-I${withval}"] [GOT_GMT=yes], [GOT_GMT=no])
+if test "$GOT_GMT" = "yes" ; then
+    dnl GMT header location specified: $libgmt_CPPFLAGS - check if gmt.h is there...
+    AS_ECHO(["GMT header location specified: $libgmt_CPPFLAGS - check if gmt.h is there..."])
+    save_CPPFLAGS=$CPPFLAGS
+    save_CFLAGS=$CFLAGS
+    CPPFLAGS="$CPPFLAGS $libgmt_CPPFLAGS"
+    CFLAGS="$CFLAGS $libgmt_CPPFLAGS"
+    AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no],)
+    CPPFLAGS=$save_CPPFLAGS
+    CFLAGS=$save_CFLAGS
+    if test "$GMT_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find gmt.h according to --with-gmt-include - check the installation!])
+    fi
+else
+    dnl Looking for GMT headers in the usual places...
+    AS_ECHO(["Looking for GMT headers in the usual places..."])
+    AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no])
+    if test "$GMT_SETTING" = "yes" ; then
+        GOT_GMT=yes
+        AS_ECHO(["Using pre-installed GMT headers..."])
+    else
+        AS_ECHO(["Did not find GMT headers anywhere, use --with-gmt-include to set the location"])
+        AC_MSG_ERROR([Did not find GMT headers anywhere, use --with-gmt-include to set the location])
+    fi
+fi
+dnl Done checking for GMT headers
 
-dnl done with GMT
+dnl Substitute PROJ library and header arguments
+AC_SUBST([libgmt_LIBS], [$libgmt_LIBS])
+AC_SUBST([libgmt_CPPFLAGS], [$libgmt_CPPFLAGS])
 
+dnl--------------------------------------------------------------------
+dnl FFTW Section
+dnl--------------------------------------------------------------------
 
-dnl Deal with FFTW for mbsegypsd
-dnl seems to want fftw3 ... do not check for older fftw?
+dnl Check for FFTW library libfftw3
+AS_ECHO(["Check for FFTW library libfftw3"])
 GOT_FFTW=no
 FFTW_SETTING=no
-USE_FFTW=
-libfftw_CPPFLAGS=
-dnl first check for package
-PKG_CHECK_MODULES([libfftw], [fftw3], [GOT_FFTW=yes], [GOT_FFTW=no])
-
-dnl Package check failed so check manually
-if test "$GOT_FFTW" = "no" ; then
-
-libfftw_LIBS="-lfftw3"
-dnl arg for command line
-AC_ARG_WITH(fftw-lib, [  --with-fftw-lib=DIR	Location of FFTW3 library],
+dnl First check if fftw location specified on the command line
+AC_ARG_WITH(fftw-lib, [  --with-fftw-lib=DIR	Location of FFTW library],
 	[fftw_libdir="${withval}"] [GOT_FFTW=yes], [GOT_FFTW=no])
-dnl First check if lib installed
-if test "$GOT_FFTW" = "no" ; then
- AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no])
+if test "$GOT_FFTW" = "yes" ; then
+    dnl FFTW library location specified: $fftw_libdir - check if libfftw3 is there...
+    AS_ECHO(["FFTW library location specified: $fftw_libdir - check if libfftw3 is there..."])
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -L$fftw_libdir"
+    AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no], )
+    LDFLAGS="$save_LDFLAGS"
+    if test "$FFTW_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find libfftw3 according to --with-fftw-lib - check the installation!])
+    fi
+    libfftw_LIBS="-L$fftw_libdir -R $fftw_libdir -lfftw3"
+    libfftw_LDFLAGS="-L$fftw_libdir"
+else
+    dnl Look for pkg-config FFTW package...
+    AS_ECHO(["Look for pkg-config FFTW package..."])
+    PKG_CHECK_MODULES([libfftw3], [fftw3], [GOT_FFTW=yes], [GOT_FFTW=no])
+    libfftw_LIBS="-lfftw3"
+    libfftw_LDFLAGS=""
 fi
- if test "$FFTW_SETTING" = "yes" ; then
-    GOT_FFTW=yes
-    USE_FFTW=mbsegypsd
-    AS_ECHO(["Using pre-installed FFTW3 lib."])
- else
-    if test "$GOT_FFTW" = "no" ; then
-	AS_ECHO(["Did not find libfftw3, use --with-fftw-lib, (FFTW disabled)"])
+if test "$GOT_FFTW" = "no" ; then
+    dnl Did not find FFTW library pkg-config package, looking in the usual places...
+    AS_ECHO(["Did not find FFTW library pkg-config package, looking in the usual places..."])
+    AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no],)
+    if test "$FFTW_SETTING" = "yes" ; then
+        GOT_FFTW=yes
+        AS_ECHO(["Using pre-installed libfftw3..."])
+        libfftw_LIBS="-lfftw3"
+        libfftw_LDFLAGS=""
     else
-	AS_ECHO(["Looking for libfftw3 in $libfftw_CFLAGS ..."])
-	save_LDFLAGS=$LDFLAGS
-	LDFLAGS="$LDFLAGS -L$fftw_libdir"
-	AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no])
-	LDFLAGS="$save_LDFLAGS"
-	if test "$FFTW_SETTING" = "no"; then
-	   	AS_ECHO(["libfftw not found, FFTW support is disabled"])
-		GOT_FFTW=no
-		USE_FFTW=
-	else
-		GOT_FFTW=yes
-		USE_FFTW=mbsegypsd
-		libfftw_LIBS="-L$fftw_libdir -R $fftw_libdir $libfftw_LIBS"
-	fi
+        AS_ECHO(["Did not find FFTW library anywhere, use --with-fftw-lib to set the location"])
+        AC_MSG_ERROR([Did not find FFTW library anywhere, use --with-fftw-lib to set the location])
     fi
- fi
- if test "$GOT_FFTW" = "yes" ; then
-	AC_SUBST([libfftw_LIBS], ["$libfftw_LIBS"])
- fi
 fi
-dnl done with FFTW lib
-
+dnl Done checking for FFTW library libfftw3
 
-dnl Now check FFTW headers
-dnl Only check for headers if lib check pass
-if test "$GOT_FFTW" = "yes" ; then
+dnl Check for FFTW headers
+AS_ECHO(["Check for FFTW headers"])
 GOT_FFTW=no
 FFTW_SETTING=no
-dnl add command line option
+dnl First check if fftw3 location specified on the command line
 AC_ARG_WITH(fftw-include, [  --with-fftw-include=DIR	Location of FFTW headers],
 	[libfftw_CPPFLAGS="-I${withval}"] [GOT_FFTW=yes], [GOT_FFTW=no])
-
-dnl First check if fftw headers installed
-if test "$GOT_FFTW" = "no" ; then
-  AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no],)
-fi
- if test "$FFTW_SETTING" = "yes" ; then
-    GOT_FFTW=yes
-    AS_ECHO(["Using pre-installed fftw3 headers."])
- else
-    if test "$GOT_FFTW" = "no" ; then
-	AS_ECHO(["Did not find FFTW headers, use --with-fftw-inc, (FFTW Disabled)"])
+if test "$GOT_FFTW" = "yes" ; then
+    dnl FFTW header location specified: $libfftw_CPPFLAGS - check if fftw3.h is there...
+    AS_ECHO(["FFTW header location specified: $libfftw_CPPFLAGS - check if fftw3.h is there..."])
+    save_CPPFLAGS=$CPPFLAGS
+    save_CFLAGS=$CFLAGS
+    CPPFLAGS="$CPPFLAGS $libfftw_CPPFLAGS"
+    CFLAGS="$CFLAGS $libfftw_CPPFLAGS"
+    AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no],)
+    CPPFLAGS=$save_CPPFLAGS
+    CFLAGS=$save_CFLAGS
+    if test "$FFTW_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find fftw3.h according to --with-fftw-include - check the installation!])
+    fi
+else
+    dnl Looking for FFTW headers in the usual places...
+    AS_ECHO(["Looking for FFTW headers in the usual places..."])
+    AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no])
+    if test "$FFTW_SETTING" = "yes" ; then
+        GOT_FFTW=yes
+        AS_ECHO(["Using pre-installed FFTW headers..."])
     else
-	AS_ECHO(["Checking fftw3.h in $libfftw_CPPFLAGS..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $libfftw_CPPFLAGS"
-	CFLAGS="$CFLAGS $libfftw_CPPFLAGS"
-	AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no],)
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$FFTW_SETTING" = "no"; then
-	   AS_ECHO(["Did not find FFTW headers, FFTW support disabled"])
-	   GOT_FFTW=no
-	   USE_FFTW=
-	   FFTW_LIB=
-	fi
+        AS_ECHO(["Did not find FFTW headers anywhere, use --with-fftw-include to set the location"])
+        AC_MSG_ERROR([Did not find FFTW headers anywhere, use --with-fftw-include to set the location])
     fi
- fi
+fi
+dnl Done checking for FFTW headers
 
+dnl Substitute FFTW library and header arguments
 if test "$GOT_FFTW" = "yes" ; then
-	AC_SUBST([fftw_app], [$USE_FFTW])
-	AC_SUBST([libfftw_CPPFLAGS], [$libfftw_CPPFLAGS])
-fi
-dnl done with FFTW headers
+    AC_SUBST([fftw_app], [$USE_FFTW])
+    AC_SUBST([libfftw_LIBS], [$libfftw_LIBS])
+    AC_SUBST([libfftw_CPPFLAGS], [$libfftw_CPPFLAGS])
 fi
-
 AM_CONDITIONAL([BUILD_FFTW], [test "$GOT_FFTW" = yes])
 
+dnl--------------------------------------------------------------------
+dnl X11/Motif & OpenGL Section
+dnl--------------------------------------------------------------------
 
-dnl Deal with Motif for GUI
-dnl Xm, Xt and X11
-GOT_MOTIF=no
-MOTIF_SETTING=no
-motif_LIBS="-lXm -lXt -lX11"
-motif_CPPFLAGS=
-dnl arg for command line
-AC_ARG_WITH(motif-lib, [  --with-motif-lib=DIR	Location of MOTIF library],
-	[motif_libdir="${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
-dnl First check if lib installed
-if test "$GOT_MOTIF" = "no" ; then
-  AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-  if test "$MOTIF_SETTING" = "yes" ; then
-	AC_CHECK_LIB([Xt], [XtAppMainLoop], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-	if test "$MOTIF_SETTING" = "yes" ; then
-		AC_CHECK_LIB([X11], [XSendEvent], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-	fi
-  fi
+dnl Check for X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h
+AS_ECHO(["Check for X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"])
+AC_CHECK_LIB([Xt], [XtAppMainLoop], [GOT_X11=yes], [GOT_X11=no])
+if test "$GOT_X11" = "yes" ; then
+    AC_CHECK_LIB([X11], [XSendEvent], [GOT_X11=yes], [GOT_X11=no])
 fi
-
-dnl Now try from args
- if test "$MOTIF_SETTING" = "yes" ; then
-    GOT_MOTIF=yes
-    AS_ECHO(["Using pre-installed MOTIF libs."])
- else
-    if test "$GOT_MOTIF" = "no" ; then
-	AS_ECHO(["Did not find Motif libs (Xt, Xm, and X11), use --with-motif-lib, (Motif disabled)"])
+if test "$GOT_X11" = "yes" ; then
+    AC_CHECK_HEADER(X11/Intrinsic.h, [GOT_X11=yes], [GOT_X11=no],)
+    if test "$GOT_X11" = "yes" ; then
+        AS_ECHO(["Found X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"])
     else
-	AS_ECHO(["Looking for Motif Libs in $motif_libdir ..."])
-	save_LDFLAGS=$LDFLAGS
-	save_LIBS=$LIBS
-	LDFLAGS="$LDFLAGS -L$motif_libdir"
-	LIBS="$LIBS $motif_LIBS"
-	AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-  	if test "$MOTIF_SETTING" = "yes" ; then
-		AC_CHECK_LIB([Xt], [XtAppMainLoop], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-		if test "$MOTIF_SETTING" = "yes" ; then
-			AC_CHECK_LIB([X11], [XSendEvent], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-		fi
-  	fi
-	LDFLAGS=$save_LDFLAGS
-	LIBS=$save_LIBS
-	if test "$MOTIF_SETTING" = "no"; then
-	   	AS_ECHO(["Motif libs not found, Motif support is disabled"])
-		GOT_MOTIF=no
-	else
-		GOT_MOTIF=yes
-		motif_LIBS="-L$motif_libdir -R $motif_libdir $motif_LIBS"
-	fi
+        AS_ECHO(["Found X11 libraries libX11 libXt but did not find X11 header file X11/Intrinsic.h - graphical tools cannot be built"])
     fi
- fi
-
-if test "$GOT_MOTIF" = "yes" ; then
-	AC_SUBST([motif_LIBS], ["$motif_LIBS"])
+else
+    AS_ECHO(["Did not find X11 libraries libX11 libXt - graphical tools cannot be built"])
 fi
-dnl done with Motif libs
 
-dnl Now check Motif headers only if lib check passed
-if test "$GOT_MOTIF" = "yes" ; then
 GOT_MOTIF=no
 MOTIF_SETTING=no
-dnl add command line option
-AC_ARG_WITH(motif-include, [  --with-motif-include=DIR	Location of Motif headers],
-	[motif_CPPFLAGS="-I${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
-
-dnl First check if Motif headers installed
-if test "$GOT_MOTIF" = "no" ; then
-  AC_CHECK_HEADER(X11/Intrinsic.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
-fi
- if test "$MOTIF_SETTING" = "yes" ; then
-    GOT_MOTIF=yes
-    AS_ECHO(["Using pre-installed Motif headers."])
- else
-    if test "$GOT_MOTIF" = "no" ; then
-	AS_ECHO(["Did not find Motif headers, use --with-motif-inc, (Motif Disabled)"])
+if test "$GOT_X11" = "yes" ; then
+    
+    dnl Check for Motif library libXm
+    AS_ECHO(["Check for Motif library libXm"])
+    AC_ARG_WITH(motif-lib, [  --with-motif-lib=DIR	Location of MOTIF library],
+            [motif_libdir="${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
+    if test "$GOT_MOTIF" = "yes" ; then
+        dnl Motif library location specified: $motif_libdir - check if libXm is there...
+        AS_ECHO(["Motif library location specified: $motif_libdir - check if libXm is there..."])
+        save_LDFLAGS=$LDFLAGS
+        LDFLAGS="$LDFLAGS -L$motif_libdir"
+        AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no], )
+        LDFLAGS="$save_LDFLAGS"
+        if test "$MOTIF_SETTING" = "no"; then
+            AC_MSG_ERROR([Did not find libXm according to --with-motif-lib - check the installation!])
+        fi
+        libmotif_LIBS="-L$motif_libdir -R $motif_libdir -lXm -lXt -lX11"
+        libmotif_LDFLAGS="-L$motif_libdir"
     else
-	AS_ECHO(["Checking X11/Intrinsic.h in $MOTIF_INC_DIR..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $motif_CPPFLAGS"
-	CFLAGS="$CFLAGS $motif_CPPFLAGS"
-	AC_CHECK_HEADER(X11/Intrinsic.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$MOTIF_SETTING" = "no"; then
-	   AS_ECHO(["Did not find Motif headers, Motif support disabled"])
-	   GOT_MOTIF=no
-	fi
+        dnl Look for pkg-config X11 package...
+        AS_ECHO(["Look for pkg-config X11 package..."])
+        PKG_CHECK_MODULES([libXm], [openmotif], [GOT_MOTIF=yes], [GOT_MOTIF=no])
+        libmotif_LIBS="-lXm -lXt -lX11"
+        libmotif_LDFLAGS=""
+    fi
+    if test "$GOT_MOTIF" = "no" ; then
+        dnl Did not find Motif library pkg-config package, looking in the usual places...
+        AS_ECHO(["Did not find Motif library pkg-config package, looking in the usual places..."])
+        AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
+        if test "$MOTIF_SETTING" = "yes" ; then
+            GOT_MOTIF=yes
+            AS_ECHO(["Using pre-installed libXm..."])
+            libmotif_LIBS="-lXm -lXt -lX11"
+            libmotif_LDFLAGS=""
+        else
+            AS_ECHO(["Did not find Motif library anywhere, use --with-motif-lib to set the location"])
+            AC_MSG_ERROR([Did not find Motif library anywhere, use --with-motif-lib to set the location])
+        fi
+    fi
+    dnl Done checking for Motif library libmotif
+
+    if test "$GOT_MOTIF" = "yes" ; then
+        dnl Check for Motif headers
+        AS_ECHO(["Check for Motif headers"])
+        GOT_MOTIF=no
+        MOTIF_SETTING=no
+        dnl First check if Motif location specified on the command line
+        AC_ARG_WITH(motif-include, [  --with-motif-include=DIR	Location of Motif headers],
+                [libmotif_CPPFLAGS="-I${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
+        if test "$GOT_MOTIF" = "yes" ; then
+            dnl Motif header location specified: $libmotif_CPPFLAGS - check if Xm/Xm.h is there...
+            AS_ECHO(["Motif header location specified: $libmotif_CPPFLAGS - check if Xm/Xm.h is there..."])
+            save_CPPFLAGS=$CPPFLAGS
+            save_CFLAGS=$CFLAGS
+            CPPFLAGS="$CPPFLAGS $libmotif_CPPFLAGS"
+            CFLAGS="$CFLAGS $libmotif_CPPFLAGS"
+            AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
+            CPPFLAGS=$save_CPPFLAGS
+            CFLAGS=$save_CFLAGS
+            if test "$MOTIF_SETTING" = "no"; then
+                AC_MSG_ERROR([Did not find Xm/Xm.h according to --with-motif-include - check the installation!])
+            fi
+        else
+            dnl Looking for Motif headers in the usual places...
+            AS_ECHO(["Looking for Motif headers in the usual places..."])
+            AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
+            if test "$MOTIF_SETTING" = "yes" ; then
+                GOT_MOTIF=yes
+                AS_ECHO(["Using pre-installed Motif headers..."])
+            else
+                AS_ECHO(["Did not find Motif headers anywhere, use --with-motif-include to set the location"])
+                AC_MSG_ERROR([Did not find Motif headers anywhere, use --with-motif-include to set the location])
+            fi
+        fi
+        dnl Done checking for Motif headers
     fi
- fi
+    
+    dnl Substitute Motif library and header arguments
+    AC_SUBST([libmotif_LIBS], [$libmotif_LIBS])
+    AC_SUBST([libmotif_CPPFLAGS], [$libmotif_CPPFLAGS])
 
-if test "$GOT_MOTIF" = "yes" ; then
-	AC_SUBST([motif_CPPFLAGS], [$motif_CPPFLAGS])
-	AC_DEFINE(GOT_MOTIF, 1, [Turned on Motif define in config])
-fi
-dnl done with Motif headers
+else
+    dnl Failed to find X11 libraries and headers - unable to build graphical tools
+    AS_ECHO(["Failed to find X11 libraries and headers - unable to build graphical tools"])
 fi
 
 AM_CONDITIONAL([BUILD_MOTIF], [test "$GOT_MOTIF" = yes])
+dnl End check for Motif library and headers
 
-
-dnl OpenGL Check
-dnl Libs GL and GLU
-GOT_GL=no
-
-dnl Only check for GL if Motif Passed
+dnl Check for OpenGL libraries libGL libGLU and header files GL/gl.h GL/glu.h GL/glx.h
+AS_ECHO(["Check for OpenGL libraries libGL libGLU and header files GL/gl.h GL/glu.h GL/glx.h"])
+GOT_OPENGL=no
+OPENGL_SETTING=no
 if test "$GOT_MOTIF" = "yes" ; then
-
-GL_SETTING=no
-GL_LIBS="-lGL -lGLU"
-GL_CPPFLAGS=
-dnl arg for command line
-AC_ARG_WITH(opengl-lib, [  --with-opengl-lib=DIR	Location of OpenGL library],
-	[opengl_libdir="${withval}"] [GOT_GL=yes], [GOT_GL=no])
-dnl First check if lib installed
-if test "$GOT_GL" = "no" ; then
-  AC_CHECK_LIB([GL], [main], [GL_SETTING=yes], [GL_SETTING=no])
-  if test "$GL_SETTING" = "yes" ; then
-	AC_CHECK_LIB([GLU], [main], [GL_SETTING=yes], [GL_SETTING=no], -lGL)
-  fi
-fi
-
-dnl Now try from args
- if test "$GL_SETTING" = "yes" ; then
-    GOT_GL=yes
-    AS_ECHO(["Using pre-installed OpenGL libs."])
- else
-    if test "$GOT_GL" = "no" ; then
-	AS_ECHO(["Did not find OpenGL libs (GL and GLU), use --with-opengl-lib, (OpenGL disabled)"])
+    
+    dnl Check for OpenGL libraries libGLU libGL
+    AS_ECHO(["Check for OpenGL libraries libGLU libGL"])
+    AC_ARG_WITH(opengl-lib, [  --with-opengl-lib=DIR	Location of OpenGL library],
+            [opengl_libdir="${withval}"] [GOT_OPENGL=yes], [GOT_OPENGL=no])
+    if test "$GOT_OPENGL" = "yes" ; then
+        dnl OpenGL library location specified: $opengl_libdir - check if libGLU libGL is there...
+        AS_ECHO(["OpenGL library location specified: $opengl_libdir - check if libGL libGLU are there..."])
+        save_LDFLAGS=$LDFLAGS
+        LDFLAGS="$LDFLAGS -L$opengl_libdir"
+        AC_CHECK_LIB([GLU], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no], )
+        if test "$OPENGL_SETTING" = "yes"; then
+            AC_CHECK_LIB([GL], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no], )
+        fi
+        LDFLAGS="$save_LDFLAGS"
+        if test "$OPENGL_SETTING" = "no"; then
+            AC_MSG_ERROR([Did not find libGLU libGL according to --with-opengl-lib - check the installation!])
+        fi
+        libopengl_LIBS="-L$opengl_libdir -R $opengl_libdir -lGL -lGLU"
+        libopengl_LDFLAGS="-L$opengl_libdir"
     else
-	AS_ECHO(["Looking for OpenGL Libs in $opengl_libdir ..."])
-	save_LDFLAGS=$LDFLAGS
-	save_LIBS=$LIBS
-	LDFLAGS="$LDFLAGS -L$opengl_libdir"
-	LIBS="$LIBS $GL_LIBS"
-	AC_CHECK_LIB([GL], [main], [GL_SETTING=yes], [GL_SETTING=no])
-  	if test "$GL_SETTING" = "yes" ; then
-		AC_CHECK_LIB([GLU], [main], [GL_SETTING=yes], [GL_SETTING=no])
-  	fi
-	LDFLAGS=$save_LDFLAGS
-	LIBS=$save_LIBS
-	if test "$GL_SETTING" = "no"; then
-	   	AS_ECHO(["OpenGL libs not found, OpenGL support is disabled"])
-		GOT_GL=no
-	else
-		GOT_GL=yes
-		GL_LIBS="-L$opengl_libdir -R $opengl_libdir $GL_LIBS"
-	fi
+        dnl Look for pkg-config X11 package...
+        AS_ECHO(["Look for pkg-config OpenGL package..."])
+        PKG_CHECK_MODULES([libGLU], [opengl], [GOT_OPENGL=yes], [GOT_OPENGL=no])
+        libopengl_LIBS="-lGL -lGLU"
+        libopengl_LDFLAGS=""
     fi
- fi
-
-if test "$GOT_GL" = "yes" ; then
-	AC_SUBST([GL_LIBS], ["$GL_LIBS"])
-fi
-dnl done with GL libs
-
-
-dnl Now check OpenGL headers
-dnl Only check for headers if lib passed
-if test "$GOT_GL" = "yes" ; then
-GOT_GL=no
-GL_SETTING=no
-dnl add command line option
-AC_ARG_WITH(opengl-include, [  --with-opengl-include=DIR	Location of OpenGL headers],
-	[GL_CPPFLAGS="-I${withval}"] [GOT_GL=yes], [GOT_GL=no])
-
-dnl First check if OpenGL headers installed
-if test "$GOT_GL" = "no" ; then
-  AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glx.h, [GL_SETTING=yes], [GL_SETTING=no])
-fi
- if test "$GL_SETTING" = "yes" ; then
-    GOT_GL=yes
-    AS_ECHO(["Using pre-installed OpenGL headers."])
- else
-    if test "$GOT_GL" = "no" ; then
-	AS_ECHO(["Did not find OpenGL headers, use --with-opengl-inc, (OpenGL Disabled)"])
-    else
-	AS_ECHO(["Checking OpenGL Headers in $GL_CPPFLAGS..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $GL_CPPFLAGS"
-	CFLAGS="$CFLAGS $GL_CPPFLAGS"
-	AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glx.h, [GL_SETTING=yes], [GL_SETTING=no])
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$GL_SETTING" = "no"; then
-	   AS_ECHO(["Did not find OpenGL headers, OpenGL support disabled"])
-	   GOT_GL=no
-	fi
+    if test "$GOT_OPENGL" = "no" ; then
+        dnl Did not find OpenGL library pkg-config package, looking in the usual places...
+        AS_ECHO(["Did not find OpenGL library pkg-config package, looking in the usual places..."])
+        AC_CHECK_LIB([GLU], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no],)
+        if test "$OPENGL_SETTING" = "yes" ; then
+            AC_CHECK_LIB([GL], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no],)
+        fi
+        if test "$OPENGL_SETTING" = "yes" ; then
+            GOT_OPENGL=yes
+            AS_ECHO(["Using pre-installed libGLU libGL..."])
+            libopengl_LIBS="-lGL -lGLU"
+            libopengl_LDFLAGS=""
+        else
+            AS_ECHO(["Did not find OpenGL library anywhere, use --with-opengl-lib to set the location"])
+            AC_MSG_ERROR([Did not find OpenGL library anywhere, use --with-opengl-lib to set the location])
+        fi
     fi
- fi
-
-if test "$GOT_GL" = "yes" ; then
-	AC_SUBST([GL_CPPFLAGS], [$GL_CPPFLAGS])
-	AC_DEFINE(GOT_GL, 1, [Turned on OpenGL define in config])
-fi
-dnl done with OpenGL headers
-
-fi
-dnl done check for GL lib pass
+    dnl Done checking for OpenGL libraries libGLU libGL
+
+    if test "$GOT_OPENGL" = "yes" ; then
+        dnl Check for OpenGL headers
+        AS_ECHO(["Check for OpenGL headers"])
+        GOT_OPENGL=no
+        OPENGL_SETTING=no
+        dnl First check if OpenGL location specified on the command line
+        AC_ARG_WITH(opengl-include, [  --with-opengl-include=DIR	Location of OpenGL headers],
+                [libopengl_CPPFLAGS="-I${withval}"] [GOT_OPENGL=yes], [GOT_OPENGL=no])
+        if test "$GOT_OPENGL" = "yes" ; then
+            dnl OpenGL header location specified: $libopengl_CPPFLAGS - check if Xm/Xm.h is there...
+            AS_ECHO(["OpenGL header location specified: $libopengl_CPPFLAGS - check if Xm/Xm.h is there..."])
+            save_CPPFLAGS=$CPPFLAGS
+            save_CFLAGS=$CFLAGS
+            CPPFLAGS="$CPPFLAGS $libopengl_CPPFLAGS"
+            CFLAGS="$CFLAGS $libopengl_CPPFLAGS"
+            AC_CHECK_HEADER(Xm/Xm.h, [OPENGL_SETTING=yes], [OPENGL_SETTING=no],)
+            CPPFLAGS=$save_CPPFLAGS
+            CFLAGS=$save_CFLAGS
+            if test "$OPENGL_SETTING" = "no"; then
+                AC_MSG_ERROR([Did not find Xm/Xm.h according to --with-opengl-include - check the installation!])
+            fi
+        else
+            dnl Looking for OpenGL headers in the usual places...
+            AS_ECHO(["Looking for OpenGL headers in the usual places..."])
+            AC_CHECK_HEADER(Xm/Xm.h, [OPENGL_SETTING=yes], [OPENGL_SETTING=no])
+            if test "$OPENGL_SETTING" = "yes" ; then
+                GOT_OPENGL=yes
+                AS_ECHO(["Using pre-installed OpenGL headers..."])
+            else
+                AS_ECHO(["Did not find OpenGL headers anywhere, use --with-opengl-include to set the location"])
+                AC_MSG_ERROR([Did not find OpenGL headers anywhere, use --with-opengl-include to set the location])
+            fi
+        fi
+        dnl Done checking for OpenGL headers
+    fi
+    
+    dnl Substitute OpenGL library and header arguments
+    AC_SUBST([libopengl_LIBS], [$libopengl_LIBS])
+    AC_SUBST([libopengl_CPPFLAGS], [$libopengl_CPPFLAGS])
+    if test "$GOT_OPENGL" = "yes" ; then
+        AC_DEFINE(GOT_GL, 1, [Turned on OpenGL define in config])
+    fi
+    AM_CONDITIONAL([BUILD_GL], [test "$GOT_OPENGL" = yes])
 
+else
+    dnl Failed to find Motif libraries and headers - did not look for OpenGL libraries and headers - unable to build visualization tools
+    AS_ECHO(["Failed to find Motif libraries and headers - did not look for OpenGL libraries and headers - unable to build visualization tools"])
 fi
-dnl Close Motif check for OpenGL
 
-AM_CONDITIONAL([BUILD_GL], [test "$GOT_GL" = yes])
+dnl--------------------------------------------------------------------
+dnl Shared Data Section
+dnl--------------------------------------------------------------------
 
 dnl variables for shared data
 mbsystemdatadir="$datadir/$PACKAGE"
@@ -811,11 +789,16 @@ AC_SUBST(mbsystemhtmldir)
 mbsystempsdir="$docdir/ps"
 AC_SUBST(mbsystempsdir)
 
+dnl--------------------------------------------------------------------
+dnl Generate Makefiles
+dnl--------------------------------------------------------------------
+
 AS_ECHO([" "])
 AS_ECHO(["About to create Makefiles..."])
 AC_CONFIG_FILES([Makefile src/Makefile src/mbio/Makefile \
 	  src/surf/Makefile \
 	  src/bsio/Makefile \
+          src/gsf/Makefile \
           src/mbaux/Makefile \
 	  src/utilities/Makefile src/gmt/Makefile \
 	  src/macros/Makefile src/mbedit/Makefile src/mbnavedit/Makefile \
@@ -827,9 +810,6 @@ AC_CONFIG_FILES([Makefile src/Makefile src/mbio/Makefile \
 if test "$bundledproj" = "yes" ; then
 AC_CONFIG_FILES([src/proj/Makefile])
 fi
-if test "$with_gsf" = "yes" ; then
-AC_CONFIG_FILES([src/gsf/Makefile])
-fi
 AC_OUTPUT
 
 dnl Summary Report
@@ -864,16 +844,13 @@ if test "$GOT_MOTIF" = "yes" ; then
 else
 	AS_ECHO(["Motif Support: Disabled"])
 fi
-if test "$GOT_GL" = "yes" ; then
+if test "$GOT_OPENGL" = "yes" ; then
 	AS_ECHO(["OpenGL Support: Enabled"])
 else
 	AS_ECHO(["OpenGL Support: Disabled"])
 fi
 AS_ECHO(["Using $OTPS_DIR for OSU Tidal Prediction Software"])
 
-AS_ECHO(["Build with Generic Sensor Format (GSF) Support: $with_gsf"])
-
-
 if test "$bundledproj" = "yes" ; then
 	AS_ECHO(["Building using bundled proj package"])
 else
diff --git a/configure.ac b/configure.ac.save
similarity index 87%
copy from configure.ac
copy to configure.ac.save
index 77fbb1b..4adc479 100644
--- a/configure.ac
+++ b/configure.ac.save
@@ -1,6 +1,6 @@
 dnl--------------------------------------------------------------------
 dnl    The MB-system:	configure.ac	12/7/2011
-dnl    $Id: configure.ac 2219 2014-12-11 21:22:25Z caress $
+dnl    $Id: configure.ac 2242 2015-05-16 05:21:28Z caress $
 dnl
 dnl    Copyright (c) 2011-2015 by
 dnl    D. W. Caress (caress at lamont.ldgo.columbia.edu)
@@ -19,11 +19,11 @@ define([AC_CACHE_LOAD], )
 define([AC_CACHE_SAVE], )
 
 dnl Initialize and set version and version date
-AC_INIT([mbsystem],[5.4.2220],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
+AC_INIT([mbsystem],[5.5.2242],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
 
 AC_CONFIG_MACRO_DIR(m4)
 AC_LANG(C)
-AC_DEFINE(VERSION_DATE, "22 January 2015", [Set VERSION_DATE define in mb_config.h])
+AC_DEFINE(VERSION_DATE, "16 May 2015", [Set VERSION_DATE define in mb_config.h])
 
 dnl Check system arch
 AC_CANONICAL_HOST
@@ -31,7 +31,7 @@ AC_CANONICAL_HOST
 AS_ECHO([" "])
 AS_ECHO(["------------------------------------------------------------------------------"])
 AS_ECHO(["    The MB-system:	configure	12/7/2011"])
-AS_ECHO(["    $Id: configure.ac 2219 2014-12-11 21:22:25Z caress $"])
+AS_ECHO(["    $Id: configure.ac 2242 2015-05-16 05:21:28Z caress $"])
 AS_ECHO([" "])
 AS_ECHO(["    Copyright (c) 2011-2015 by"])
 AS_ECHO(["    D. W. Caress (caress at lamont.ldgo.columbia.edu)"])
@@ -72,7 +72,7 @@ AS_ECHO([" "])
 AS_ECHO(["        # Reset the autotools version to 2.65 to accomodate some Linux distributions"])
 AS_ECHO(["        sed -i.bak s/2\.69/2\.65/ configure.ac"])
 AS_ECHO([" "])
-AS_ECHO(["    When you run ./configure, a number of configure options are saved  to a"])
+AS_ECHO(["    When you run ./configure, a number of configure options are saved to a"])
 AS_ECHO(["    header file:"])
 AS_ECHO(["        ./src/mbio/mb_config.h"])
 AS_ECHO(["    This file has a template:"])
@@ -80,11 +80,6 @@ AS_ECHO(["        ./src/mbio/mb_config.h.in"])
 AS_ECHO(["    This file is conditionally included by:"])
 AS_ECHO(["        ./src/mbio/mb_define.h"])
 AS_ECHO(["    which is in turn included by essentially every MB-System C source file."])
-AS_ECHO(["    The condition under which mb_config.h is used is simply the use of the"])
-AS_ECHO(["    configure script to generate the makefiles. If one uses the alternate"])
-AS_ECHO(["    install_makefiles build system, then an alternate header file named"])
-AS_ECHO(["        ./src/mbio/mb_config2.h"])
-AS_ECHO(["    is used instead."])
 AS_ECHO([" "])
 AS_ECHO(["------------------------------------------------------------------------------"])
 AS_ECHO(["    To use the build system..."])
@@ -106,7 +101,6 @@ AS_ECHO(["        --with-motif-include  - location of Motif headers (optional)"]
 AS_ECHO(["        --with-opengl-lib     - location of OpenGL libs (optional)"])
 AS_ECHO(["        --with-opengl-include - location of OpenGL headers (optional)"])
 AS_ECHO(["        --with-otps-dir       - location of OTPS installation (optional)"])
-AS_ECHO(["        --without-gsf         - build without including or supporting GSF"])
 AS_ECHO(["        --enable-bundledproj  - build using bundled proj package - default is to link with libproj"])
 AS_ECHO([" "])
 AS_ECHO(["    After configure you can run the make utility in the usual fashion"])
@@ -204,102 +198,88 @@ AC_CHECK_FUNC(xdrmem_create, XDR_LIB=, [
 ], -lws2_32 )])])])])
 AC_SUBST(XDR_LIB)
 
-dnl check for OTPS arg
-dnl TODO add actual check and disable if not found
-AS_ECHO(["Check for OSU Tidal Prediction Software"])
-dnl initialize with defaut
+dnl Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise
+AS_ECHO(["Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise"])
 OTPS_DIR="/usr/local/OTPSnc"
-dnl check for command line option and reset
 AC_ARG_WITH(otps_dir, [  --with-otps_dir=DIR        Location of OSU Tidal Prediction Software], [OTPS_DIR=${withval}])
 AC_SUBST(OTPS_DIR)
 
-AC_MSG_CHECKING([whether to build with Generic Sensor Format (GSF)])
-AC_ARG_WITH([gsf], AS_HELP_STRING([--without-gsf], [Disable unlicensed SAIC Generic Sensor Format (GSF)]), [ ], [with_gsf=yes])
-AC_MSG_RESULT([$with_gsf])
-
-AS_IF([test x"$with_gsf" = xyes], [AC_DEFINE(WITH_GSF, 1, [Build with GSF])])
-AM_CONDITIONAL([BUILD_GSF], [test x"$with_gsf" = xyes])
-
-dnl Check for NetCDF lib
-AS_ECHO(["Check for NetCDF"])
+dnl Check for netCDF library
+AS_ECHO(["Check for netCDF library libnetcdf"])
 GOT_CDF=no
 CDF_SETTING=no
-dnl first check for package
-PKG_CHECK_MODULES([libnetcdf], [netcdf], [GOT_CDF=yes], [GOT_CDF=no])
-
-dnl Package check failed so check manually
-if test "$GOT_CDF" = "no" ; then
-
-libnetcdf_LIBS="-lnetcdf"
-libnetcdf_LDFLAGS=
-
-dnl arg for command line
+dnl First check if netcdf location specified on the command line
 AC_ARG_WITH(netcdf-lib, [  --with-netcdf-lib=DIR	Location of NetCDF library],
 	[netcdf_libdir="${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-dnl First check if lib installed
-if test "$GOT_CDF" = "no" ; then
- AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no],)
+if test "$GOT_CDF" = "yes" ; then
+    dnl NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there...
+    AS_ECHO(["NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there..."])
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -L$netcdf_libdir"
+    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no], )
+    LDFLAGS="$save_LDFLAGS"
+    if test "$CDF_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find libnetcdf according to --with-netcdf-lib - check the installation!])
+    fi
+    libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir -lnetcdf"
+    libnetcdf_LDFLAGS="-L$netcdf_libdir"
+else
+    dnl Look for pkg-config netCDF package...
+    AS_ECHO(["Look for pkg-config netCDF package..."])
+    PKG_CHECK_MODULES([libnetcdf], [netcdf], [GOT_CDF=yes], [GOT_CDF=no])
+    libnetcdf_LIBS="-lnetcdf"
+    libnetcdf_LDFLAGS=""
 fi
- if test "$CDF_SETTING" = "yes" ; then
-    GOT_CDF=yes
-    AS_ECHO(["Using pre-installed libcdf."])
- else
-    if test "$GOT_CDF" = "no" ; then
-	AC_MSG_ERROR([Did not find libnetcdf, use --with-netcdf-lib])
+if test "$GOT_CDF" = "no" ; then
+    dnl Did not find netCDF library pkg-config package, looking in the usual places...
+    AS_ECHO(["Did not find netCDF library pkg-config package, looking in the usual places..."])
+    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no],)
+    if test "$CDF_SETTING" = "yes" ; then
+        GOT_CDF=yes
+        AS_ECHO(["Using pre-installed libnetcdf..."])
+        libnetcdf_LIBS="-lnetcdf"
+        libnetcdf_LDFLAGS=""
     else
-	AS_ECHO(["Looking for libnetcdf in $netcdf_libdir ..."])
-	save_LDFLAGS=$LDFLAGS
-	LDFLAGS="$LDFLAGS -L$netcdf_libdir"
-	AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no], )
-	LDFLAGS="$save_LDFLAGS"
-	if test "$CDF_SETTING" = "no"; then
-	   AC_MSG_ERROR([Did not find libnetcdf, use --with-netcdf-lib or check installation])
-	fi
-	libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir $libnetcdf_LIBS"
-#
-#       Save the netcdf library path for later gmt tests
-#
-	libnetcdf_LDFLAGS="-L$netcdf_libdir"
+        AS_ECHO(["Did not find netCDF library anywhere, use --with-netcdf-lib to set the location"])
+        AC_MSG_ERROR([Did not find netCDF library anywhere, use --with-netcdf-lib to set the location])
     fi
- fi
- dnl Use ac_subst to set vars that would be set by pkg_check
- AC_SUBST([libnetcdf_LIBS], ["$libnetcdf_LIBS"])
 fi
-dnl done with CDF lib
+dnl Done checking for netCDF library libnetcdf
 
-dnl Now check CDF headers
+dnl Check for netCDF headers
+AS_ECHO(["Check for netCDF headers"])
 GOT_CDF=no
 CDF_SETTING=no
-dnl add command line option
+dnl First check if netcdf location specified on the command line
 AC_ARG_WITH(netcdf-include, [  --with-netcdf-include=DIR	Location of NetCDF headers],
 	[libnetcdf_CPPFLAGS="-I${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-dnl First check if cdf headers installed
-if test "$GOT_CDF" = "no" ; then
- AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no])
-fi
- if test "$CDF_SETTING" = "yes" ; then
-    GOT_CDF=yes
-    AS_ECHO(["Using pre-installed NetCDF headers."])
- else
-    if test "$GOT_CDF" = "no" ; then
-	AC_MSG_ERROR([Did not find required NetCDF headers, use --with-netcdf-include])
+if test "$GOT_CDF" = "yes" ; then
+    dnl NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there...
+    AS_ECHO(["NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there..."])
+    save_CPPFLAGS=$CPPFLAGS
+    save_CFLAGS=$CFLAGS
+    CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
+    CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
+    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no],)
+    CPPFLAGS=$save_CPPFLAGS
+    CFLAGS=$save_CFLAGS
+    if test "$CDF_SETTING" = "no"; then
+	AC_MSG_ERROR([Did not find netcdf.h according to --with-netcdf-include - check the installation!])
+    fi
+else
+    dnl Looking for netCDF headers in the usual places...
+    AS_ECHO(["Looking for netCDF headers in the usual places..."])
+    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no])
+    if test "$CDF_SETTING" = "yes" ; then
+        GOT_CDF=yes
+        AS_ECHO(["Using pre-installed netCDF headers..."])
     else
-	AS_ECHO(["Checking netcdf.h in $libnetcdf_CPPFLAGS..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
-	CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
-	AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no],)
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$CDF_SETTING" = "no"; then
-	   AC_MSG_ERROR([Did not find required NetCDF headers, use --with-netcdf-include])
-	fi
+        AS_ECHO(["Did not find netCDF headers anywhere, use --with-netcdf-include to set the location"])
+        AC_MSG_ERROR([Did not find netCDF headers anywhere, use --with-netcdf-include to set the location])
     fi
- fi
+fi
 AC_SUBST([libnetcdf_CPPFLAGS], [$libnetcdf_CPPFLAGS])
-dnl done with CDF headers
-
+dnl Done checking for netCDF headers
 
 dnl check whether to use bundled proj package or link with external libproj
 AC_ARG_ENABLE(bundledproj, [AS_HELP_STRING([--enable-bundledproj], [build and use the bundled proj package])],
@@ -352,9 +332,6 @@ else
                AC_MSG_ERROR([Did not find libproj, use --with-proj-lib or check installation])
             fi
             libproj_LIBS="-L$proj_libdir -R $proj_libdir $libproj_LIBS"
-    #
-    #       Save the proj library path for later gmt tests
-    #
             libproj_LDFLAGS="-L$proj_libdir"
         fi
      fi
@@ -400,20 +377,16 @@ fi
 dnl Done linking with external PROJ
 
 dnl Check for Generic Mapping Tools (GMT) libs
-dnl - these are libgmt, libpsl, and libgmtps
+dnl - these are libgmt, libpsl
 dnl Would certainly be nice if GMT had pkg-config file (gmt.pc)...
 AS_ECHO(["Check for Generic Mapping Tools (GMT)"])
 GOT_GMTPKG=no
 dnl first check for package
 PKG_CHECK_MODULES([libgmt], [gmt], [GOT_LIBGMT=yes], [GOT_LIBGMT=no])
-PKG_CHECK_MODULES([libgmtps], [gmt], [GOT_LIBGMTPS=yes], [GOT_LIBGMTPS=no])
 PKG_CHECK_MODULES([libpsl], [gmt], [GOT_LIBPSL=yes], [GOT_LIBPSL=no])
 if test "$GOT_LIBGMT" = "yes" ; then
 	GOT_GMTPKG=yes
 fi
-if test "$GOT_GMTPS" = "no" ; then
-	GOT_GMTPKG=no
-fi
 if test "$GOT_PSL" = "no" ; then
 	GOT_GMTPKG=no
 fi
@@ -423,7 +396,7 @@ if test "$GOT_GMTPKG" = "no" ; then
 
 	GMT_SETTING=no
 	GOT_GMTLIBS=no
-	libgmt_LIBS="-lgmt -lgmtps -lpsl"
+	libgmt_LIBS="-lgmt -lpsl"
 	dnl arg for command line
 	AC_ARG_WITH(gmt-lib, [  --with-gmt-lib=DIR	Location of GMT libraries],
 	       [gmt_libdir="${withval}"] [GOT_GMTLIBS=yes], [GOT_GMTLIBS=no])
@@ -816,6 +789,7 @@ AS_ECHO(["About to create Makefiles..."])
 AC_CONFIG_FILES([Makefile src/Makefile src/mbio/Makefile \
 	  src/surf/Makefile \
 	  src/bsio/Makefile \
+          src/gsf/Makefile \
           src/mbaux/Makefile \
 	  src/utilities/Makefile src/gmt/Makefile \
 	  src/macros/Makefile src/mbedit/Makefile src/mbnavedit/Makefile \
@@ -827,9 +801,6 @@ AC_CONFIG_FILES([Makefile src/Makefile src/mbio/Makefile \
 if test "$bundledproj" = "yes" ; then
 AC_CONFIG_FILES([src/proj/Makefile])
 fi
-if test "$with_gsf" = "yes" ; then
-AC_CONFIG_FILES([src/gsf/Makefile])
-fi
 AC_OUTPUT
 
 dnl Summary Report
@@ -871,9 +842,6 @@ else
 fi
 AS_ECHO(["Using $OTPS_DIR for OSU Tidal Prediction Software"])
 
-AS_ECHO(["Build with Generic Sensor Format (GSF) Support: $with_gsf"])
-
-
 if test "$bundledproj" = "yes" ; then
 	AS_ECHO(["Building using bundled proj package"])
 else
diff --git a/configure.cmd b/configure.cmd
index 7be7e03..9f895d2 100755
--- a/configure.cmd
+++ b/configure.cmd
@@ -1,6 +1,7 @@
+#-------------------------------------------------------------------------
+# Version: $Id: configure.cmd 2251 2015-07-01 01:02:06Z caress $
 #------------------------------------------------------------------------------
-# Notes on using an autotools based build system with the MB-System source
-# code archive.
+# Notes on using the MB-System autotools based build system 
 #------------------------------------------------------------------------------
 #
 # David W. Caress
@@ -15,9 +16,16 @@
 #------------------------------------------------------------------------------
 # To use the build system...
 #------------------------------------------------------------------------------
-# To generate the makefiles needed to build MB-System, run ./configure
-# with the options appropriate for your situation. Some examples are
-# given below.
+#
+# Obtain the MB-System source tree by either downloading and unpacking an
+# MB-System source distribution tarball (e.g. mbsystem-5.5.2245.tar.gz) from:
+#   ftp://ftp.ldeo.columbia.edu/pub/mbsystem/
+# or by downloading directly from the source code archive at:
+#   http://svn.mb-system.org/listing.php?repname=MB-System
+#
+# To generate the makefiles needed to build MB-System, in a shell cd to the
+# top of the MB-System source tree and run ./configure with the options
+# appropriate for your situation. Some examples are given below.
 #
 # After configure you can run the make utility in the usual fashion
 make
@@ -27,7 +35,7 @@ make install
 make clean (to clean up compiled code)
 make distclean (to clean up compiled code and configure output)
 make uninstall (to remove a previously installed version)
-
+#
 #------------------------------------------------------------------------------
 # Configure script command line options:
 #------------------------------------------------------------------------------
@@ -72,38 +80,38 @@ make uninstall (to remove a previously installed version)
 #------------------------
 #   Installation option:
 #------------------------
-#    --without-gsf         - build without including or supporting GSF
-#                            The default is to build the bundled 
-#                                gsf library as libmbgsf and link with it
 #    --enable-bundledproj  - build using bundled proj package - the
 #				default is to link with libproj
-#                                
+#
 #------------------------------------------------------------------------------
-# Configure script command line examples:
+# Setting X11 fonts used by mbgrdviz, mbeditviz, mbedit, mbnavedit, mbnavadjust
+# and mbvelocitytool:
 #------------------------------------------------------------------------------
-
-# Build in place on a Mac 10.9 with prerequisites installed through Fink in /sw:
-sudo CFLAGS="-I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
-./configure \
-    --prefix=/Users/caress/sandbox/mbsystem \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
-    --with-gmt-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib
-
+# By default the graphical utilities use three fonts: Helvetica, Times New
+# Roman, and Courier. This can be set in the CFLAGS environment variable by
+# including options of the form:
+#       -DSANS='\"helvetica\"' -DSERIF='\"times\"' -DMONO='\"courier\"'
+# In the examples below, the CFLAGS environment value is set for the configure
+# script by setting it on the same command line as ./configure. To set the
+# fonts to Lucida, one might add:
+#       -DSANS='\"lucida\"' -DSERIF='\"lucida\"' -DMONO='\"lucidatypewriter\"'
+# to the CFLAGS definition
+#
 #------------------------------------------------------------------------------
-
-# Build in /usr/local on a Mac 10.9 with prerequisites installed through Fink in /sw:
+# Mac Os X configure script command line examples:
+#------------------------------------------------------------------------------
+#
+# Build in /usr/local on a Mac 10.9 or 10.10 with most prerequisites installed
+# through Fink in /sw, and the OTPS program predict_time located
+# in /usr/local/OTPS2.
+# Prerequisite Fink packages include gmt, netcdf, proj, fftw3, and gv:
+#
 sudo CFLAGS="-I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
 ./configure \
     --prefix=/usr/local \
     --with-netcdf-include=/sw/include \
     --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
+    --with-gmt-include=/sw/include/gmt \
     --with-gmt-lib=/sw/lib \
     --with-proj-include=/sw/include \
     --with-proj-lib=/sw/lib \
@@ -111,84 +119,86 @@ sudo CFLAGS="-I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
     --with-fftw-lib=/sw/lib \
     --with-motif-include=/sw/include \
     --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/tides/OTPS2
-
+    --with-otps-dir=/usr/local/OTPS2
+#
 #------------------------------------------------------------------------------
-
-# Build in ~/buildtest on a Mac 10.9 with prerequisites installed through Fink in /sw:
-sudo CFLAGS="-I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
-./configure \
-    --prefix=/Users/caress/buildtest \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
-    --with-gmt-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib
-
+# Ubuntu Linux configure script command line examples:
 #------------------------------------------------------------------------------
 
-# Install on Ubuntu 12.04.02LTS using only apt-get for prerequisites
-
-# Required environment variables to be set in ~/.bashrc
-export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
-export PATH=/usr/lib/gmt/bin:$PATH
+# Install on Ubuntu (12.04.02LTS or 14.04LTS) 
+#
+# At present (June 2015), GMT 5 is not available on Ubuntu as a standard package.
+# Consequently, one can use apt-get for all prerequisites except GMT 5.1.2,
+# which must be built locally from source and installed into /usr/local
 
-# Prerequisites
+# Prerequisites for 64-bit installation excluding GMT
+# (for 32-bit replace libgdal-dev with gdal1-dev)
 sudo apt-get install xorg-dev libmotif-dev libmotif4 libxp-dev mesa-common-dev \
     libsdl1.2-dev libsdl-image1.2-dev build-essential gfortran \
     nautilus-open-terminal libfftw3-3 libfftw3-dev \
-    libnetcdf-dev netcdf-bin gdal-bin gdal1-dev gmt libgmt-dev gv
-
-# The GMT installation does not include a pkg-config *.pc file, but it is
-# simple to construct one. On Ubuntu pkg-config looks in /usr/lib/pkgconfig,
-# so one can put a file there called gmt.pc with the contents:
-#---------------
-# <start gmt.pc>
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include/gmt
-ccompiler=gcc
-cppcompiler=g++
-
-Name: gmt
-Description: GMT Libraries
-Version: 4.5.6
-Libs: -L${libdir} -lgmt -lgmtps -lpsl
-Cflags: -I${includedir}
-# <end gmt.pc>
-#---------------
-
-# If the GMT installation has been augmented with a /usr/lib/pkgconfig/gmt.pc
-# file so that pkg-config knows about GMT, then the configure call is just:
-sudo ./configure --prefix=/usr/local
-
-# If the GMT installation is not known to pkg-config, then the installation
-# points of the libraries and the header files must be specified:
-sudo ./configure --prefix=/usr/local \
-    --with-gmt-include=/usr/include/gmt \
-    --with-gmt-lib=/usr/lib
-
-# Either way, once configure has been run, build and install MB-System
-# into /usr/local/bin, /usr/local/lib, etc with the simple make commands:
+    libnetcdf-dev netcdf-bin gdal-bin libgdal-dev libproj-dev libproj0 \
+    gv cmake
+    
+# GMT 5.1.2 is built from source using cmake and by default installs into
+# /usr/local in Ubuntu. Follow the directions in the GMT Wiki.
+# The specific installation points of the libraries and the header files will
+# vary according to the architecture.
+
+# In order for the shared libraries to work, one must either set the 
+# LD_LIBRARY_PATH environment variable in ~/.profile or ~/.bashrc
+export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
+# or one must set the CFLAGS environment variable during building to include
+# "-Wl,-rpath -Wl,LIBDIR"
+
+# On a machine with a 64-bit processor,
+# the following configure options are required to build MB-System:
+sudo CFLAGS="-Wl,-rpath -Wl,/usr/local/lib" \
+    ./configure --prefix=/usr/local \
+    --with-gmt-include=/usr/local/include/gmt \
+    --with-gmt-lib=/usr/local/lib/x86_64-linux-gnu
+
+# On a machine with a 32-bit processor,
+# the following configure options are required to build MB-System:
+sudo CFLAGS="-Wl,-rpath -Wl,/usr/local/lib" \
+    ./configure --prefix=/usr/local \
+    --with-gmt-include=/usr/local/include/gmt \
+    --with-gmt-lib=/usr/local/lib/i386-linux-gnu
+
+# Once configure has been run, build and install MB-System into /usr/local/bin,
+# /usr/local/lib, etc with the simple make commands:
 sudo make
 sudo make install
+
+#------------------------------------------------------------------------------
+# CentOs configure script command line examples:
 #------------------------------------------------------------------------------
 
-# Install on CentOs 6 using only yum for prerequisites
+# Install on CentOs 6 or 7 using only yum for prerequisites
 
 # Prerequisites
 sudo yum install openmotif openmotif-devel fftw fftw-devel netcdf netcdf-devel \
-		proj proj-devel gdal-devel gmt gmt-devel gv nedit
+		proj proj-devel gdal-devel gmt gmt-devel gv
 
 # If the prerequisites have all been installed with yum and it is desired to
 # install MB-System in /usr/local, then only a simple call to configure is required:
 sudo ./configure
 #
 #------------------------------------------------------------------------------
+
+# Install on CentOs 6 or 7 using yum for prerequisites other than GMT
+#
+# Prerequisites
+sudo yum install openmotif openmotif-devel fftw fftw-devel netcdf netcdf-devel \
+		proj proj-devel gdal-devel gv
+
+# If GMT 5.1.2 has been installed from source into /usr/local, and it is desired to
+# install MB-System in /usr/local, then only the call to configure must specify
+# the location of the GMT libraries and header files:
+sudo ./configure --prefix=/usr/local \
+    --with-gmt-include=/usr/local/include/gmt \
+    --with-gmt-lib=/usr/local/lib64
+#
+#------------------------------------------------------------------------------
 # To modify the build system...
 #------------------------------------------------------------------------------
 #
@@ -211,7 +221,7 @@ autoreconf --force --install --warnings=all
 # Reset the autotools version to 2.65 to accomodate some Linux distributions
 sed -i.bak s/2\.69/2\.65/ configure.ac
 
-# When you run ./configure, a number of configure options are saved  to a
+# When you run ./configure, a number of configure options are saved to a
 # header file:
 #     ./src/mbio/mb_config.h
 # This file has a template:
@@ -219,11 +229,6 @@ sed -i.bak s/2\.69/2\.65/ configure.ac
 # This file is conditionally included by:
 #     ./src/mbio/mb_define.h
 # which is in turn included by essentially every MB-System C source file.
-# The condition under which mb_config.h is used is simply the use of the
-# configure script to generate the makefiles. If one uses the alternate
-# "install_makefiles" build system, then an alternate header file named
-#     ./src/mbio/mb_config2.h
-# is used instead.
 #
 #------------------------------------------------------------------------------
 #
@@ -249,22 +254,22 @@ autoreconf --force --install --warnings=all
 # Force configure.ac to reduce the automake version requirement from 2.69 to 2.65
 sed -i.bak s/2\.69/2\.65/ configure.ac
 
-CFLAGS="-g -Wall -I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
+CFLAGS="-g -Wall -Wmissing-prototypes -I/opt/X11/include " LDFLAGS="-L/opt/X11/lib" \
 ./configure \
     --prefix=/Users/caress/sandbox/mbsystem \
+    --disable-static \
+    --enable-shared \
     --with-netcdf-include=/sw/include \
     --with-netcdf-lib=/sw/lib \
     --with-proj-include=/sw/include \
     --with-proj-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
+    --with-gmt-include=/sw/include/gmt \
     --with-gmt-lib=/sw/lib \
     --with-fftw-include=/sw/include \
     --with-fftw-lib=/sw/lib \
     --with-motif-include=/sw/include \
     --with-motif-lib=/sw/lib \
     --with-otps-dir=/usr/local/OTPS2
-#    --without-gsf \
-#    --enable-bundledproj
 
 make -j
 
diff --git a/configureGMT5.cmd b/configureGMT5.cmd
new file mode 100644
index 0000000..fe79c24
--- /dev/null
+++ b/configureGMT5.cmd
@@ -0,0 +1,15 @@
+
+CFLAGS="-g -Wall -I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
+./configure \
+    --prefix=/Users/caress/sandbox/mbsystem \
+    --with-netcdf-include=/sw/include \
+    --with-netcdf-lib=/sw/lib \
+    --with-proj-include=/sw/include \
+    --with-proj-lib=/sw/lib \
+    --with-gmt-include=/usr/local/gmt/include \
+    --with-gmt-lib=/usr/local/gmt/lib \
+    --with-fftw-include=/sw/include \
+    --with-fftw-lib=/sw/lib \
+    --with-motif-include=/sw/include \
+    --with-motif-lib=/sw/lib \
+    --with-otps-dir=/usr/local/OTPS2
diff --git a/html/ChayesJul2003.gif b/html/ChayesJul2003.gif
new file mode 100644
index 0000000..1b60b9b
Binary files /dev/null and b/html/ChayesJul2003.gif differ
diff --git a/html/MBTeamJul2003.gif b/html/MBTeamJul2003.gif
new file mode 100644
index 0000000..64f1493
Binary files /dev/null and b/html/MBTeamJul2003.gif differ
diff --git a/html/ValJul2003.gif b/html/ValJul2003.gif
new file mode 100644
index 0000000..834fb52
Binary files /dev/null and b/html/ValJul2003.gif differ
diff --git a/html/caress2001.gif b/html/caress2001.gif
new file mode 100644
index 0000000..9ccc97e
Binary files /dev/null and b/html/caress2001.gif differ
diff --git a/html/gpl.html b/html/gpl.html
new file mode 100644
index 0000000..34b70e4
--- /dev/null
+++ b/html/gpl.html
@@ -0,0 +1,604 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+   <TITLE>GNU General Public License</TITLE>
+  <meta http-equiv="Content-Type" content="text/html">
+  <meta name="Title" content="MB-System: Mapping the Seafloor">
+  <meta name="Author" content="David Caress, Dale Chayes">
+  <meta name="Description" content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
+  <meta name="Keywords" content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
+</HEAD>
+<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
+<BODY>
+
+<CENTER>
+  <h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
+  <p style="text-align: center;">Version 3, 29 June 2007</p>
+  <p>Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/></p>
+  <p> Everyone is permitted to copy and distribute verbatim copies
+    of this license document, but changing it is not allowed.</p>
+  <h3 align="center"><a name="preamble"></a>Preamble</h3>
+  <p align="left">The GNU General Public License is a free, copyleft license for
+    software and other kinds of works.</p>
+  <p align="left">The licenses for most software and other practical works are designed
+    to take away your freedom to share and change the works.  By contrast,
+    the GNU General Public License is intended to guarantee your freedom to
+    share and change all versions of a program--to make sure it remains free
+    software for all its users.  We, the Free Software Foundation, use the
+    GNU General Public License for most of our software; it applies also to
+    any other work released this way by its authors.  You can apply it to
+    your programs, too.</p>
+  <p align="left">When we speak of free software, we are referring to freedom, not
+    price.  Our General Public Licenses are designed to make sure that you
+    have the freedom to distribute copies of free software (and charge for
+    them if you wish), that you receive source code or can get it if you
+    want it, that you can change the software or use pieces of it in new
+    free programs, and that you know you can do these things.</p>
+  <p align="left">To protect your rights, we need to prevent others from denying you
+    these rights or asking you to surrender the rights.  Therefore, you have
+    certain responsibilities if you distribute copies of the software, or if
+    you modify it: responsibilities to respect the freedom of others.</p>
+  <p align="left">For example, if you distribute copies of such a program, whether
+    gratis or for a fee, you must pass on to the recipients the same
+    freedoms that you received.  You must make sure that they, too, receive
+    or can get the source code.  And you must show them these terms so they
+    know their rights.</p>
+  <p align="left">Developers that use the GNU GPL protect your rights with two steps:
+    (1) assert copyright on the software, and (2) offer you this License
+    giving you legal permission to copy, distribute and/or modify it.</p>
+  <p align="left">For the developers' and authors' protection, the GPL clearly explains
+    that there is no warranty for this free software.  For both users' and
+    authors' sake, the GPL requires that modified versions be marked as
+    changed, so that their problems will not be attributed erroneously to
+    authors of previous versions.</p>
+  <p align="left">Some devices are designed to deny users access to install or run
+    modified versions of the software inside them, although the manufacturer
+    can do so.  This is fundamentally incompatible with the aim of
+    protecting users' freedom to change the software.  The systematic
+    pattern of such abuse occurs in the area of products for individuals to
+    use, which is precisely where it is most unacceptable.  Therefore, we
+    have designed this version of the GPL to prohibit the practice for those
+    products.  If such problems arise substantially in other domains, we
+    stand ready to extend this provision to those domains in future versions
+    of the GPL, as needed to protect the freedom of users.</p>
+  <p align="left">Finally, every program is threatened constantly by software patents.
+    States should not allow patents to restrict development and use of
+    software on general-purpose computers, but in those that do, we wish to
+    avoid the special danger that patents applied to a free program could
+    make it effectively proprietary.  To prevent this, the GPL assures that
+    patents cannot be used to render the program non-free.</p>
+  <p align="left">The precise terms and conditions for copying, distribution and
+    modification follow.</p>
+  <h3 align="center"><a name="terms"></a>TERMS AND CONDITIONS</h3>
+  <h4 align="left"><a name="section0"></a>0. Definitions.</h4>
+  <p align="left">“This License” refers to version 3 of the GNU General Public License.</p>
+  <p align="left">“Copyright” also means copyright-like laws that apply to other kinds of
+    works, such as semiconductor masks.</p>
+  <p align="left">“The Program” refers to any copyrightable work licensed under this
+    License.  Each licensee is addressed as “you”.  “Licensees” and
+  “recipients” may be individuals or organizations.</p>
+  <p align="left">To “modify” a work means to copy from or adapt all or part of the work
+    in a fashion requiring copyright permission, other than the making of an
+    exact copy.  The resulting work is called a “modified version” of the
+    earlier work or a work “based on” the earlier work.</p>
+  <p align="left">A “covered work” means either the unmodified Program or a work based
+    on the Program.</p>
+  <p align="left">To “propagate” a work means to do anything with it that, without
+    permission, would make you directly or secondarily liable for
+    infringement under applicable copyright law, except executing it on a
+    computer or modifying a private copy.  Propagation includes copying,
+    distribution (with or without modification), making available to the
+    public, and in some countries other activities as well.</p>
+  <p align="left">To “convey” a work means any kind of propagation that enables other
+    parties to make or receive copies.  Mere interaction with a user through
+    a computer network, with no transfer of a copy, is not conveying.</p>
+  <p align="left">An interactive user interface displays “Appropriate Legal Notices”
+    to the extent that it includes a convenient and prominently visible
+    feature that (1) displays an appropriate copyright notice, and (2)
+    tells the user that there is no warranty for the work (except to the
+    extent that warranties are provided), that licensees may convey the
+    work under this License, and how to view a copy of this License.  If
+    the interface presents a list of user commands or options, such as a
+    menu, a prominent item in the list meets this criterion.</p>
+  <h4 align="left"><a name="section1"></a>1. Source Code.</h4>
+  <p align="left">The “source code” for a work means the preferred form of the work
+    for making modifications to it.  “Object code” means any non-source
+    form of a work.</p>
+  <p align="left">A “Standard Interface” means an interface that either is an official
+    standard defined by a recognized standards body, or, in the case of
+    interfaces specified for a particular programming language, one that
+    is widely used among developers working in that language.</p>
+  <p align="left">The “System Libraries” of an executable work include anything, other
+    than the work as a whole, that (a) is included in the normal form of
+    packaging a Major Component, but which is not part of that Major
+    Component, and (b) serves only to enable use of the work with that
+    Major Component, or to implement a Standard Interface for which an
+    implementation is available to the public in source code form.  A
+  “Major Component”, in this context, means a major essential component
+    (kernel, window system, and so on) of the specific operating system
+    (if any) on which the executable work runs, or a compiler used to
+    produce the work, or an object code interpreter used to run it.</p>
+  <p align="left">The “Corresponding Source” for a work in object code form means all
+    the source code needed to generate, install, and (for an executable
+    work) run the object code and to modify the work, including scripts to
+    control those activities.  However, it does not include the work's
+    System Libraries, or general-purpose tools or generally available free
+    programs which are used unmodified in performing those activities but
+    which are not part of the work.  For example, Corresponding Source
+    includes interface definition files associated with source files for
+    the work, and the source code for shared libraries and dynamically
+    linked subprograms that the work is specifically designed to require,
+    such as by intimate data communication or control flow between those
+    subprograms and other parts of the work.</p>
+  <p align="left">The Corresponding Source need not include anything that users
+    can regenerate automatically from other parts of the Corresponding
+    Source.</p>
+  <p align="left">The Corresponding Source for a work in source code form is that
+    same work.</p>
+  <h4 align="left"><a name="section2"></a>2. Basic Permissions.</h4>
+  <p align="left">All rights granted under this License are granted for the term of
+    copyright on the Program, and are irrevocable provided the stated
+    conditions are met.  This License explicitly affirms your unlimited
+    permission to run the unmodified Program.  The output from running a
+    covered work is covered by this License only if the output, given its
+    content, constitutes a covered work.  This License acknowledges your
+    rights of fair use or other equivalent, as provided by copyright law.</p>
+  <p align="left">You may make, run and propagate covered works that you do not
+    convey, without conditions so long as your license otherwise remains
+    in force.  You may convey covered works to others for the sole purpose
+    of having them make modifications exclusively for you, or provide you
+    with facilities for running those works, provided that you comply with
+    the terms of this License in conveying all material for which you do
+    not control copyright.  Those thus making or running the covered works
+    for you must do so exclusively on your behalf, under your direction
+    and control, on terms that prohibit them from making any copies of
+    your copyrighted material outside their relationship with you.</p>
+  <p align="left">Conveying under any other circumstances is permitted solely under
+    the conditions stated below.  Sublicensing is not allowed; section 10
+    makes it unnecessary.</p>
+  <h4 align="left"><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
+  <p align="left">No covered work shall be deemed part of an effective technological
+    measure under any applicable law fulfilling obligations under article
+    11 of the WIPO copyright treaty adopted on 20 December 1996, or
+    similar laws prohibiting or restricting circumvention of such
+    measures.</p>
+  <p align="left">When you convey a covered work, you waive any legal power to forbid
+    circumvention of technological measures to the extent such circumvention
+    is effected by exercising rights under this License with respect to
+    the covered work, and you disclaim any intention to limit operation or
+    modification of the work as a means of enforcing, against the work's
+    users, your or third parties' legal rights to forbid circumvention of
+    technological measures.</p>
+  <h4 align="left"><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
+  <p align="left">You may convey verbatim copies of the Program's source code as you
+    receive it, in any medium, provided that you conspicuously and
+    appropriately publish on each copy an appropriate copyright notice;
+    keep intact all notices stating that this License and any
+    non-permissive terms added in accord with section 7 apply to the code;
+    keep intact all notices of the absence of any warranty; and give all
+    recipients a copy of this License along with the Program.</p>
+  <p align="left">You may charge any price or no price for each copy that you convey,
+    and you may offer support or warranty protection for a fee.</p>
+  <h4 align="left"><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
+  <p align="left">You may convey a work based on the Program, or the modifications to
+    produce it from the Program, in the form of source code under the
+    terms of section 4, provided that you also meet all of these conditions:</p>
+  <div align="left">
+    <ul>
+      <li>a) The work must carry prominent notices stating that you modified
+        it, and giving a relevant date.</li>
+      <li>b) The work must carry prominent notices stating that it is
+        released under this License and any conditions added under section
+        7.  This requirement modifies the requirement in section 4 to
+        “keep intact all notices”.</li>
+      <li>c) You must license the entire work, as a whole, under this
+        License to anyone who comes into possession of a copy.  This
+        License will therefore apply, along with any applicable section 7
+        additional terms, to the whole of the work, and all its parts,
+        regardless of how they are packaged.  This License gives no
+        permission to license the work in any other way, but it does not
+        invalidate such permission if you have separately received it.</li>
+      <li>d) If the work has interactive user interfaces, each must display
+        Appropriate Legal Notices; however, if the Program has interactive
+        interfaces that do not display Appropriate Legal Notices, your
+        work need not make them do so.</li>
+    </ul>
+  </div>
+  <p align="left">A compilation of a covered work with other separate and independent
+    works, which are not by their nature extensions of the covered work,
+    and which are not combined with it such as to form a larger program,
+    in or on a volume of a storage or distribution medium, is called an
+  “aggregate” if the compilation and its resulting copyright are not
+    used to limit the access or legal rights of the compilation's users
+    beyond what the individual works permit.  Inclusion of a covered work
+    in an aggregate does not cause this License to apply to the other
+    parts of the aggregate.</p>
+  <h4 align="left"><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
+  <p align="left">You may convey a covered work in object code form under the terms
+    of sections 4 and 5, provided that you also convey the
+    machine-readable Corresponding Source under the terms of this License,
+    in one of these ways:</p>
+  <div align="left">
+    <ul>
+      <li>a) Convey the object code in, or embodied in, a physical product
+        (including a physical distribution medium), accompanied by the
+        Corresponding Source fixed on a durable physical medium
+        customarily used for software interchange.</li>
+      <li>b) Convey the object code in, or embodied in, a physical product
+        (including a physical distribution medium), accompanied by a
+        written offer, valid for at least three years and valid for as
+        long as you offer spare parts or customer support for that product
+        model, to give anyone who possesses the object code either (1) a
+        copy of the Corresponding Source for all the software in the
+        product that is covered by this License, on a durable physical
+        medium customarily used for software interchange, for a price no
+        more than your reasonable cost of physically performing this
+        conveying of source, or (2) access to copy the
+        Corresponding Source from a network server at no charge.</li>
+      <li>c) Convey individual copies of the object code with a copy of the
+        written offer to provide the Corresponding Source.  This
+        alternative is allowed only occasionally and noncommercially, and
+        only if you received the object code with such an offer, in accord
+        with subsection 6b.</li>
+      <li>d) Convey the object code by offering access from a designated
+        place (gratis or for a charge), and offer equivalent access to the
+        Corresponding Source in the same way through the same place at no
+        further charge.  You need not require recipients to copy the
+        Corresponding Source along with the object code.  If the place to
+        copy the object code is a network server, the Corresponding Source
+        may be on a different server (operated by you or a third party)
+        that supports equivalent copying facilities, provided you maintain
+        clear directions next to the object code saying where to find the
+        Corresponding Source.  Regardless of what server hosts the
+        Corresponding Source, you remain obligated to ensure that it is
+        available for as long as needed to satisfy these requirements.</li>
+      <li>e) Convey the object code using peer-to-peer transmission, provided
+        you inform other peers where the object code and Corresponding
+        Source of the work are being offered to the general public at no
+        charge under subsection 6d.</li>
+    </ul>
+  </div>
+  <p align="left">A separable portion of the object code, whose source code is excluded
+    from the Corresponding Source as a System Library, need not be
+    included in conveying the object code work.</p>
+  <p align="left">A “User Product” is either (1) a “consumer product”, which means any
+    tangible personal property which is normally used for personal, family,
+    or household purposes, or (2) anything designed or sold for incorporation
+    into a dwelling.  In determining whether a product is a consumer product,
+    doubtful cases shall be resolved in favor of coverage.  For a particular
+    product received by a particular user, “normally used” refers to a
+    typical or common use of that class of product, regardless of the status
+    of the particular user or of the way in which the particular user
+    actually uses, or expects or is expected to use, the product.  A product
+    is a consumer product regardless of whether the product has substantial
+    commercial, industrial or non-consumer uses, unless such uses represent
+    the only significant mode of use of the product.</p>
+  <p align="left">“Installation Information” for a User Product means any methods,
+    procedures, authorization keys, or other information required to install
+    and execute modified versions of a covered work in that User Product from
+    a modified version of its Corresponding Source.  The information must
+    suffice to ensure that the continued functioning of the modified object
+    code is in no case prevented or interfered with solely because
+    modification has been made.</p>
+  <p align="left">If you convey an object code work under this section in, or with, or
+    specifically for use in, a User Product, and the conveying occurs as
+    part of a transaction in which the right of possession and use of the
+    User Product is transferred to the recipient in perpetuity or for a
+    fixed term (regardless of how the transaction is characterized), the
+    Corresponding Source conveyed under this section must be accompanied
+    by the Installation Information.  But this requirement does not apply
+    if neither you nor any third party retains the ability to install
+    modified object code on the User Product (for example, the work has
+    been installed in ROM).</p>
+  <p align="left">The requirement to provide Installation Information does not include a
+    requirement to continue to provide support service, warranty, or updates
+    for a work that has been modified or installed by the recipient, or for
+    the User Product in which it has been modified or installed.  Access to a
+    network may be denied when the modification itself materially and
+    adversely affects the operation of the network or violates the rules and
+    protocols for communication across the network.</p>
+  <p align="left">Corresponding Source conveyed, and Installation Information provided,
+    in accord with this section must be in a format that is publicly
+    documented (and with an implementation available to the public in
+    source code form), and must require no special password or key for
+    unpacking, reading or copying.</p>
+  <h4 align="left"><a name="section7"></a>7. Additional Terms.</h4>
+  <p align="left">“Additional permissions” are terms that supplement the terms of this
+    License by making exceptions from one or more of its conditions.
+    Additional permissions that are applicable to the entire Program shall
+    be treated as though they were included in this License, to the extent
+    that they are valid under applicable law.  If additional permissions
+    apply only to part of the Program, that part may be used separately
+    under those permissions, but the entire Program remains governed by
+    this License without regard to the additional permissions.</p>
+  <p align="left">When you convey a copy of a covered work, you may at your option
+    remove any additional permissions from that copy, or from any part of
+    it.  (Additional permissions may be written to require their own
+    removal in certain cases when you modify the work.)  You may place
+    additional permissions on material, added by you to a covered work,
+    for which you have or can give appropriate copyright permission.</p>
+  <p align="left">Notwithstanding any other provision of this License, for material you
+    add to a covered work, you may (if authorized by the copyright holders of
+    that material) supplement the terms of this License with terms:</p>
+  <div align="left">
+    <ul>
+      <li>a) Disclaiming warranty or limiting liability differently from the
+        terms of sections 15 and 16 of this License; or</li>
+      <li>b) Requiring preservation of specified reasonable legal notices or
+        author attributions in that material or in the Appropriate Legal
+        Notices displayed by works containing it; or</li>
+      <li>c) Prohibiting misrepresentation of the origin of that material, or
+        requiring that modified versions of such material be marked in
+        reasonable ways as different from the original version; or</li>
+      <li>d) Limiting the use for publicity purposes of names of licensors or
+        authors of the material; or</li>
+      <li>e) Declining to grant rights under trademark law for use of some
+        trade names, trademarks, or service marks; or</li>
+      <li>f) Requiring indemnification of licensors and authors of that
+        material by anyone who conveys the material (or modified versions of
+        it) with contractual assumptions of liability to the recipient, for
+        any liability that these contractual assumptions directly impose on
+        those licensors and authors.</li>
+    </ul>
+  </div>
+  <p align="left">All other non-permissive additional terms are considered “further
+    restrictions” within the meaning of section 10.  If the Program as you
+    received it, or any part of it, contains a notice stating that it is
+    governed by this License along with a term that is a further
+    restriction, you may remove that term.  If a license document contains
+    a further restriction but permits relicensing or conveying under this
+    License, you may add to a covered work material governed by the terms
+    of that license document, provided that the further restriction does
+    not survive such relicensing or conveying.</p>
+  <p align="left">If you add terms to a covered work in accord with this section, you
+    must place, in the relevant source files, a statement of the
+    additional terms that apply to those files, or a notice indicating
+    where to find the applicable terms.</p>
+  <p align="left">Additional terms, permissive or non-permissive, may be stated in the
+    form of a separately written license, or stated as exceptions;
+    the above requirements apply either way.</p>
+  <h4 align="left"><a name="section8"></a>8. Termination.</h4>
+  <p align="left">You may not propagate or modify a covered work except as expressly
+    provided under this License.  Any attempt otherwise to propagate or
+    modify it is void, and will automatically terminate your rights under
+    this License (including any patent licenses granted under the third
+    paragraph of section 11).</p>
+  <p align="left">However, if you cease all violation of this License, then your
+    license from a particular copyright holder is reinstated (a)
+    provisionally, unless and until the copyright holder explicitly and
+    finally terminates your license, and (b) permanently, if the copyright
+    holder fails to notify you of the violation by some reasonable means
+    prior to 60 days after the cessation.</p>
+  <p align="left">Moreover, your license from a particular copyright holder is
+    reinstated permanently if the copyright holder notifies you of the
+    violation by some reasonable means, this is the first time you have
+    received notice of violation of this License (for any work) from that
+    copyright holder, and you cure the violation prior to 30 days after
+    your receipt of the notice.</p>
+  <p align="left">Termination of your rights under this section does not terminate the
+    licenses of parties who have received copies or rights from you under
+    this License.  If your rights have been terminated and not permanently
+    reinstated, you do not qualify to receive new licenses for the same
+    material under section 10.</p>
+  <h4 align="left"><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
+  <p align="left">You are not required to accept this License in order to receive or
+    run a copy of the Program.  Ancillary propagation of a covered work
+    occurring solely as a consequence of using peer-to-peer transmission
+    to receive a copy likewise does not require acceptance.  However,
+    nothing other than this License grants you permission to propagate or
+    modify any covered work.  These actions infringe copyright if you do
+    not accept this License.  Therefore, by modifying or propagating a
+    covered work, you indicate your acceptance of this License to do so.</p>
+  <h4 align="left"><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
+  <p align="left">Each time you convey a covered work, the recipient automatically
+    receives a license from the original licensors, to run, modify and
+    propagate that work, subject to this License.  You are not responsible
+    for enforcing compliance by third parties with this License.</p>
+  <p align="left">An “entity transaction” is a transaction transferring control of an
+    organization, or substantially all assets of one, or subdividing an
+    organization, or merging organizations.  If propagation of a covered
+    work results from an entity transaction, each party to that
+    transaction who receives a copy of the work also receives whatever
+    licenses to the work the party's predecessor in interest had or could
+    give under the previous paragraph, plus a right to possession of the
+    Corresponding Source of the work from the predecessor in interest, if
+    the predecessor has it or can get it with reasonable efforts.</p>
+  <p align="left">You may not impose any further restrictions on the exercise of the
+    rights granted or affirmed under this License.  For example, you may
+    not impose a license fee, royalty, or other charge for exercise of
+    rights granted under this License, and you may not initiate litigation
+    (including a cross-claim or counterclaim in a lawsuit) alleging that
+    any patent claim is infringed by making, using, selling, offering for
+    sale, or importing the Program or any portion of it.</p>
+  <h4 align="left"><a name="section11"></a>11. Patents.</h4>
+  <p align="left">A “contributor” is a copyright holder who authorizes use under this
+    License of the Program or a work on which the Program is based.  The
+    work thus licensed is called the contributor's “contributor version”.</p>
+  <p align="left">A contributor's “essential patent claims” are all patent claims
+    owned or controlled by the contributor, whether already acquired or
+    hereafter acquired, that would be infringed by some manner, permitted
+    by this License, of making, using, or selling its contributor version,
+    but do not include claims that would be infringed only as a
+    consequence of further modification of the contributor version.  For
+    purposes of this definition, “control” includes the right to grant
+    patent sublicenses in a manner consistent with the requirements of
+    this License.</p>
+  <p align="left">Each contributor grants you a non-exclusive, worldwide, royalty-free
+    patent license under the contributor's essential patent claims, to
+    make, use, sell, offer for sale, import and otherwise run, modify and
+    propagate the contents of its contributor version.</p>
+  <p align="left">In the following three paragraphs, a “patent license” is any express
+    agreement or commitment, however denominated, not to enforce a patent
+    (such as an express permission to practice a patent or covenant not to
+    sue for patent infringement).  To “grant” such a patent license to a
+    party means to make such an agreement or commitment not to enforce a
+    patent against the party.</p>
+  <p align="left">If you convey a covered work, knowingly relying on a patent license,
+    and the Corresponding Source of the work is not available for anyone
+    to copy, free of charge and under the terms of this License, through a
+    publicly available network server or other readily accessible means,
+    then you must either (1) cause the Corresponding Source to be so
+    available, or (2) arrange to deprive yourself of the benefit of the
+    patent license for this particular work, or (3) arrange, in a manner
+    consistent with the requirements of this License, to extend the patent
+    license to downstream recipients.  “Knowingly relying” means you have
+    actual knowledge that, but for the patent license, your conveying the
+    covered work in a country, or your recipient's use of the covered work
+    in a country, would infringe one or more identifiable patents in that
+    country that you have reason to believe are valid.</p>
+  <p align="left">If, pursuant to or in connection with a single transaction or
+    arrangement, you convey, or propagate by procuring conveyance of, a
+    covered work, and grant a patent license to some of the parties
+    receiving the covered work authorizing them to use, propagate, modify
+    or convey a specific copy of the covered work, then the patent license
+    you grant is automatically extended to all recipients of the covered
+    work and works based on it.</p>
+  <p align="left">A patent license is “discriminatory” if it does not include within
+    the scope of its coverage, prohibits the exercise of, or is
+    conditioned on the non-exercise of one or more of the rights that are
+    specifically granted under this License.  You may not convey a covered
+    work if you are a party to an arrangement with a third party that is
+    in the business of distributing software, under which you make payment
+    to the third party based on the extent of your activity of conveying
+    the work, and under which the third party grants, to any of the
+    parties who would receive the covered work from you, a discriminatory
+    patent license (a) in connection with copies of the covered work
+    conveyed by you (or copies made from those copies), or (b) primarily
+    for and in connection with specific products or compilations that
+    contain the covered work, unless you entered into that arrangement,
+    or that patent license was granted, prior to 28 March 2007.</p>
+  <p align="left">Nothing in this License shall be construed as excluding or limiting
+    any implied license or other defenses to infringement that may
+    otherwise be available to you under applicable patent law.</p>
+  <h4 align="left"><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
+  <p align="left">If conditions are imposed on you (whether by court order, agreement or
+    otherwise) that contradict the conditions of this License, they do not
+    excuse you from the conditions of this License.  If you cannot convey a
+    covered work so as to satisfy simultaneously your obligations under this
+    License and any other pertinent obligations, then as a consequence you may
+    not convey it at all.  For example, if you agree to terms that obligate you
+    to collect a royalty for further conveying from those to whom you convey
+    the Program, the only way you could satisfy both those terms and this
+    License would be to refrain entirely from conveying the Program.</p>
+  <h4 align="left"><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
+  <p align="left">Notwithstanding any other provision of this License, you have
+    permission to link or combine any covered work with a work licensed
+    under version 3 of the GNU Affero General Public License into a single
+    combined work, and to convey the resulting work.  The terms of this
+    License will continue to apply to the part which is the covered work,
+    but the special requirements of the GNU Affero General Public License,
+    section 13, concerning interaction through a network will apply to the
+    combination as such.</p>
+  <h4 align="left"><a name="section14"></a>14. Revised Versions of this License.</h4>
+  <p align="left">The Free Software Foundation may publish revised and/or new versions of
+    the GNU General Public License from time to time.  Such new versions will
+    be similar in spirit to the present version, but may differ in detail to
+    address new problems or concerns.</p>
+  <p align="left">Each version is given a distinguishing version number.  If the
+    Program specifies that a certain numbered version of the GNU General
+    Public License “or any later version” applies to it, you have the
+    option of following the terms and conditions either of that numbered
+    version or of any later version published by the Free Software
+    Foundation.  If the Program does not specify a version number of the
+    GNU General Public License, you may choose any version ever published
+    by the Free Software Foundation.</p>
+  <p align="left">If the Program specifies that a proxy can decide which future
+    versions of the GNU General Public License can be used, that proxy's
+    public statement of acceptance of a version permanently authorizes you
+    to choose that version for the Program.</p>
+  <p align="left">Later license versions may give you additional or different
+    permissions.  However, no additional obligations are imposed on any
+    author or copyright holder as a result of your choosing to follow a
+    later version.</p>
+  <h4 align="left"><a name="section15"></a>15. Disclaimer of Warranty.</h4>
+  <p align="left">THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+    APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+    HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
+    OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+    IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+    ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
+  <h4 align="left"><a name="section16"></a>16. Limitation of Liability.</h4>
+  <p align="left">IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+    THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+    GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+    USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+    DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+    PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+    EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGES.</p>
+  <h4 align="left"><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
+  <p align="left">If the disclaimer of warranty and limitation of liability provided
+    above cannot be given local legal effect according to their terms,
+    reviewing courts shall apply local law that most closely approximates
+    an absolute waiver of all civil liability in connection with the
+    Program, unless a warranty or assumption of liability accompanies a
+    copy of the Program in return for a fee.</p>
+  <p align="center">END OF TERMS AND CONDITIONS</p>
+  <h3 align="center"><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
+  <p align="left">If you develop a new program, and you want it to be of the greatest
+    possible use to the public, the best way to achieve this is to make it
+    free software which everyone can redistribute and change under these terms.</p>
+  <p align="left">To do so, attach the following notices to the program.  It is safest
+    to attach them to the start of each source file to most effectively
+    state the exclusion of warranty; and each file should have at least
+    the “copyright” line and a pointer to where the full notice is found.</p>
+  <div align="left">
+    <pre>    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  </pre>
+  </div>
+  <p align="left">Also add information on how to contact you by electronic and paper mail.</p>
+  <p align="left">If the program does terminal interaction, make it output a short
+    notice like this when it starts in an interactive mode:</p>
+  <div align="left">
+    <pre>    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+  </pre>
+  </div>
+  <p align="left">The hypothetical commands `show w' and `show c' should show the appropriate
+    parts of the General Public License.  Of course, your program's commands
+    might be different; for a GUI interface, you would use an “about box”.</p>
+  <p align="left">You should also get your employer (if you work as a programmer) or school,
+    if any, to sign a “copyright disclaimer” for the program, if necessary.
+    For more information on this, and how to apply and follow the GNU GPL, see
+  <http://www.gnu.org/licenses/>.</p>
+  <p align="left">The GNU General Public License does not permit incorporating your program
+    into proprietary programs.  If your program is a subroutine library, you
+    may consider it more useful to permit linking proprietary applications with
+    the library.  If this is what you want to do, use the GNU Lesser General
+    Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.</p></CENTER>
+
+<CENTER>
+  <P>The above license was obtained from the <A HREF="http://www.gnu.org/">Free
+Software Foundation</A> in July, 2009.<BR>
+  Previous MB-System releases were licensed using the GNU General Public License version 2.<BR><BR>
+    Last Updated: $Date: 2004/12/18 01:29:20 $ $Revision: 5.3 $</P>
+</CENTER>
+
+<P>
+<HR WIDTH="67%"></P>
+
+<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
+to MB-System Home Page...</A></P>
+
+</BODY>
+</HTML>
diff --git a/src/html/index.html b/html/index.html
similarity index 99%
copy from src/html/index.html
copy to html/index.html
index 3a7e5c0..e1c1169 100644
--- a/src/html/index.html
+++ b/html/index.html
@@ -300,7 +300,7 @@ University</a></dt>
   </dt>
 </dl>
 <center>
-<p>Last Updated: $Id: index.html 2180 2014-04-02 20:58:34Z caress $</p>
+<p>Last Updated: $Id: mbsystem_home.html 2180 2014-04-02 20:58:34Z caress $</p>
 </center>
 <p></p>
 <div align="center">
diff --git a/src/html/mbsystem.html b/html/mbsystem.html
similarity index 99%
copy from src/html/mbsystem.html
copy to html/mbsystem.html
index 5105409..2b09590 100644
--- a/src/html/mbsystem.html
+++ b/html/mbsystem.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbsystem</H1>
-Section:  MB-System 5.3  (1)<BR>Updated:  7 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.5  (1)<BR>Updated:  26 January 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -23,7 +23,7 @@ processing swath sonar bathymetry, amplitude, and sidescan data.
 <A NAME="lbAC"> </A>
 <H2>VERSION</H2>
 
-Version 5.3
+Version 5.5
 <P>
 <A NAME="lbAD"> </A>
 <H2>AUTHORSHIP</H2>
@@ -72,7 +72,7 @@ GMT and netCDF), all of which are freely available as source code.
 <A NAME="lbAF"> </A>
 <H2>COPYRIGHT AND LICENSING</H2>
 
-<B>MB-System</B> Copyright (C) 1993-2012 by
+<B>MB-System</B> Copyright (C) 1993-2015 by
 <BR>
 
 David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
@@ -1670,7 +1670,7 @@ breaks.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 7 June 2013</P></CENTER>
+Last Updated: 26 January 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/html/mbsystem_capabilities.html b/html/mbsystem_capabilities.html
new file mode 100644
index 0000000..fb41b5e
--- /dev/null
+++ b/html/mbsystem_capabilities.html
@@ -0,0 +1,254 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+  <title>MB-System Capabilities</title>
+  <meta content="text/html" http-equiv="Content-Type">
+  <meta content="MB-System: Mapping the Seafloor" name="Title">
+  <meta content="David Caress, Dale Chayes" name="Author">
+  <meta
+ content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
+ name="Description">
+  <meta
+ content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
+ name="Keywords">
+</head>
+<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
+ vlink="#997040">
+<center>
+<h4><u>Short List of MB-System Capabilities:</u></h4>
+</center>
+<ul>
+  <li>General Documentation</li>
+  <ul>
+    <li>MB-System manual page: <a href="mbsystem.html">mbsystem</a></li>
+    <li>MB-System I/O library manual page: <a href="mbio.html">mbio</a></li>
+  </ul>
+</ul>
+<ul>
+  <li>Version 5 Programs and Macros:</li>
+These are the programs and macros that are used in the version 5
+parallel processing
+scheme. Those programs that are also relevant to the older serial
+processing
+scheme are marked with an *.
+  <ul>
+    <li>General Functions</li>
+    <ul>
+      <li>List swath data formats supported by MB-System: <a
+ href="mbformat.html">mbformat</a>*</li>
+      <li>Get swath data file information and statistics: <a
+ href="mbinfo.html">mbinfo</a>*</li>
+      <li>Produce arbitrary ascii tables from swath data: <a
+ href="mblist.html">mblist</a>*</li>
+      <li>Copy swath data with optional time/space windowing and format
+change: <a href="mbcopy.html">mbcopy</a>*</li>
+      <li>Translate groups of swath data files between formats: <a
+ href="mbm_copy.html">mbm_copy</a></li>
+      <li>Translate groups of swath data files between formats using parallel processes: <a
+ href="mbm_multicopy.html">mbm_multicopy</a></li>
+      <li>Set MB-System default parameters: <a href="mbdefaults.html">mbdefaults</a>*</li>
+      <li>List files referenced in a recursive datalist file tree: <a
+ href="mbdatalist.html">mbdatalist</a></li>
+      <li>Generate ancilliary files used in data managment: <a
+ href="mbdatalist.html">mbdatalist</a></li>
+      <li>Generate ancilliary files used in data managment using parallel processes: <a
+ href="mbm_multidatalist.html">mbm_multidatalist</a></li>
+      <li>Generate an MB-System datalist file referencing all
+identifiable swath files in the specified target directory.: <a
+ href="mbm_makedatalist.html">mbm_makedatalist</a></li>
+      <li>Create or modify parameter files used to control mbprocess: <a
+ href="mbset.html">mbset</a></li>
+      <li>Apply specified processing tasks to a swath data file: <a
+ href="mbprocess.html">mbprocess</a></li>
+      <li>Apply specified processing tasks to a swath data file using parallel processes: <a
+ href="mbm_multiprocess.html">mbm_multiprocess</a></li>
+      <li>Convert between calendar time and unix time: <a href="mbtime.html">mbtime</a></li>
+    </ul>
+    <li>Water Properties Utilities</li>
+    <ul>
+      <li>Obtain reference water sound velocity profile (SVP): <a
+ href="mblevitus.html">mblevitus</a>*</li>
+      <li>Calculate water sound absorption from water properties: <a href="mbabsorption.html">mbabsorption</a></li>
+      <li>List CTD data in swath sonar data files: <a href="mbctdlist.html">mbctdlist</a></li>
+      <li>Process data from a Seabird SBE53 pressure sensor into a tidal model for
+       use by mbprocess: <a href="mbm_bpr.html">mbm_bpr</a></li>
+      <li>Generate a sound velocity profile model from sound speed and depth values in swath files: <a href="mbm_makesvp.html">mbm_makesvp</a></li>
+      <li>Extract water sound velocity profiles
+(SVPs) from swath data files: <a href="mbsvplist.html">mbsvplist</a></li>
+  	  <li>Select the best
+available sound speed model for each swath file in a survey according to 
+user specified criteria: <a href="mbsvpselect.html">mbsvpselect</a></li>
+    </ul>
+    <li>Navigation Data Processing</li>
+    <ul>
+      <li>Interactive navigation editor: <a href="mbnavedit.html">mbnavedit</a></li>
+      <li>List navigation from ping records in a swath data file: <a
+ href="mblist.html">mblist</a></li>
+      <li>List navigation from navigation records in a swath data file:
+        <a href="mbnavlist.html">mbnavlist</a></li>
+      <li>Create or modify parameter files used to control mbprocess: <a
+ href="mbset.html">mbset</a></li>
+      <li>Merge navigation with swath data file (among other tasks): <a
+ href="mbprocess.html">mbprocess</a></li>
+      <li>Adjust navigation to match bathymetric features in
+overlapping swathes: <a href="mbnavadjust.html">mbnavadjust</a></li>
+      <li>Merge two MBnavadjust projects: <a href="mbnavadjustmerge.html">mbnavadjustmerge</a></li>
+      <li> Merge inertial
+and surface tracking navigation for
+submerged sonar platforms (e.g. ROVs and AUVs): <a
+ href="mbauvnavusbl.html">mbauvnavusbl</a></li>
+  <li> Output a list of the times when a survey passes the waypoints of a planned survey route: <a href="mbroutetime.html">mbroutetime</a></li>
+    </ul>
+
+    <li>Patch Test Analyis
+      <ul>
+        <li>Interactive 3D visualization data cleaning and attitude bias patch test: <a href="mbeditviz.html">mbeditviz</a></li>
+      </ul>
+    </li>
+    <li>Bathymetry Data Processing</li>
+    <ul>
+      <li>Automatic bathymetry data cleaning: <a
+ href="mbareaclean.html">mbareaclean</a></li>
+      <li>Automatic bathymetry data cleaning: <a href="mbclean.html">mbclean</a></li>
+      <li>Interactive bathymetry data cleaning: <a href="mbedit.html">mbedit</a></li>
+      <li>Interactive 3D visualization data cleaning and attitude bias patch test: <a href="mbeditviz.html">mbeditviz</a></li>
+      <li>Extract bathymetry edits in edit save file format: <a
+ href="mbgetesf.html">mbgetesf</a></li>
+      <li>Extract bathymetry edits from Simrad Neptune software into
+edit save file format: <a href="mbneptune2esf.html">mbneptune2esf</a></li>
+      <li>Obtain reference water sound velocity profile (SVP): <a
+ href="mblevitus.html">mblevitus</a>*</li>
+      <li>Interactive modeling of SVP effects on bathymetry: <a
+ href="mbvelocitytool.html">mbvelocitytool</a>*</li>
+      <li>Extract water sound velocity profiles
+(SVPs) from swath data files: <a href="mbsvplist.html">mbsvplist</a></li>
+  	  <li>Select the best
+available sound speed model for each swath file in a survey according to 
+user specified criteria: <a href="mbsvpselect.html">mbsvpselect</a></li>
+      <li>Create or modify parameter files used to control mbprocess: <a
+ href="mbset.html">mbset</a></li>
+      <li>Recalculate or correct swath bathymetry and apply bathymetry
+edits from
+mbedit and mbclean: <a href="mbprocess.html">mbprocess</a></li>
+      <li>Obtain histogram of bathymetry data: <a
+ href="mbhistogram.html">mbhistogram</a>*</li>
+      <li>Automatically grid bathymetry data: <a href="mbm_grid.html">mbm_grid</a>*</li>
+      <li>Grid bathymetry data: <a href="mbgrid.html">mbgrid</a>*</li>
+      <li>Extract subarea of GMT grid file: <a href="mbm_grdcut.html">mbm_grdcut</a>*</li>
+      <li>Perform forward and inverse UTM projections of ASCII data
+triples: <a href="mbm_utm.html">mbm_utm</a>*</li>
+      <li>Estimate attitude time lag by cross correlation of apparent
+bottom slope with the roll time series: <a href="mbrolltimelag.html">mbrolltimelag</a></li>
+    </ul>
+    <li>Sidescan and Amplitude Data Processing</li>
+    <ul>
+      <li>Obtain grazing angle correction tables from
+sidescan/amplitude data for
+use by mbprocess: <a href="mbbackangle.html">mbbackangle</a></li>
+      <li>Create or modify parameter files used to control mbprocess: <a
+ href="mbset.html">mbset</a></li>
+      <li>Correct sidescan/amplitude data using tables generated by
+mbbackangle: <a href="mbprocess.html">mbprocess</a></li>
+      <li>Automatically mosaic sidescan/amplitude data: <a
+ href="mbm_grid.html">mbm_grid</a>*</li>
+      <li>Mosaic sidescan/amplitude data: <a href="mbmosaic.html">mbmosaic</a>*</li>
+      <li>Grid sidescan/amplitude data: <a href="mbgrid.html">mbgrid</a>*</li>
+      <li>Extract subarea of GMT grid file: <a href="mbm_grdcut.html">mbm_grdcut</a>*</li>
+    </ul>
+    <li>Grid Vizualization</li>
+    <ul>
+      <li>GMT grid vizualization and survey planning: <a
+ href="mbgrdviz.html">mbgrdviz</a>*</li>
+    </ul>
+    <li>Survey planning</li>
+    <ul>
+      <li>GMT grid vizualization and survey planning: <a
+ href="mbgrdviz.html">mbgrdviz</a>*</li>
+      <li>Translate an mbgrdviz survey route file into an MBARI AUV
+mission script: <a href="mbm_route2mission.html">mbm_route2mission</a>*</li>
+    </ul>
+    <li>Postscript Graphics</li>
+    <ul>
+      <li>GMT compatible swath contouring: <a href="mbcontour.html">mbcontour</a>*</li>
+      <li>GMT compatible swath color fill plotting: <a
+ href="mbswath.html">mbswath</a>*</li>
+      <li>Macro to generate GMT map of swath data:<a
+ href="mbm_plot.html">
+mbm_plot</a>*</li>
+      <li>Macro to generate GMT map of gridded data: <a
+ href="mbm_grdplot.html">mbm_grdplot</a>*</li>
+      <li>Macro to generate GMT perspective view of gridded data: <a
+ href="mbm_grd3dplot.html">mbm_grd3dplot</a>*</li>
+      <li>Macro to generate GMT plot of xy data: <a
+ href="mbm_xyplot.html">mbm_xyplot</a>*</li>
+      <li>Macro to generate GMT histogram plot of data: <a
+ href="mbm_histplot.html">mbm_histplot</a>*</li>
+    </ul>
+    <li>Exporting Data Products to GIS and Visualization Packages</li>
+    <ul>
+      <li>Generate GeoTIFF image from GMT grid files: <a
+ href="mbgrdtiff.html">mbgrdtiff</a>*</li>
+      <li>Macro to generate GeoTIFF image of gridded data: <a
+ href="mbm_grdtiff.html">mbm_grdtiff</a>*</li>
+      <li>Convert GMT grid file to ArcView ASCII grid file: <a
+ href="mbm_grd2arc.html">mbm_grd2arc</a>*</li>
+      <li>Convert ArcView ASCII grid file to GMT grid file: <a
+ href="mbm_arc2grd.html">mbm_arc2grd</a>*</li>
+      <li>Convert GMT grid file to a set of tiled GeoVRML files: <a
+ href="mbm_arc2grd.html">mbm_grd2geovrml</a>*</li>
+    </ul>
+    <li>Subbottom profiler (and center beam reflection) data processing</li>
+    <ul>
+      <li>Extract subbottom profiler data to segy files: <a
+ href="mbextractsegy.html">mbextractsegy</a></li>
+      <li>Get segy data file information and statistics: <a
+ href="mbsegyinfo.html">mbsegyinfo</a></li>
+      <li>Produce arbitrary ascii tables from segy data files: <a
+ href="mbsegylist.html">mbsegylist</a></li>
+      <li>Grid seismic data from segy data files: <a
+ href="mbsegygrid.html">mbsegygrid</a></li>
+      <li>Generate Power Spectral Density (PSD) estimates from segy data files: <a href="mbsegypsd.html">mbsegypsd</a></li>
+    </ul>
+    <li>Tide modeling and correction</li>
+    <ul>
+      <li>Generate open ocean tidal model using the Oregon State Ocean Tide Prediction Software (OTPSnc) package: <a href="mbotps.html">mbotps</a><br>
+      </li>
+    </ul>
+    <li>Format-specific processing, extraction, or translation</li>
+    <ul>
+      <li>Preprocess Reson 7k data (format 88), including applying time
+        lag and biases to attitude and navigation data: <a
+ href="mb7kpreprocess.html">mb7kpreprocess</a></li>
+      <li> Preprocess data from third generation Kongsberg
+    multibeam sonars (e.g. EM122, EM302, EM710): <a href="mbkongsbergpreprocess.html">mbkongsbergpreprocess</a></li>
+      <li>List raw information contained in Hydrosweep DS data files (formats 21 and 24): <a href="mbhsdump.html">mbhsdump</a></li>
+      <li>Preprocess HYSWEEP HSX data (format 201), including applying time
+        lag and biases to attitude and navigation data: <a
+ href="mbhysweeppreprocess.html">mbhysweeppreprocess</a></li>
+      <li>Preprocess SwathPlus SXP data (format 222), including applying time
+        lag and biases to attitude and navigation data: <a
+ href="mbswplspreprocess.html">mbswplspreprocess</a></li>
+  <li>Scan a Hydrosweep swath sonar data file using the  program  mbhsdump  and generate a list in columnar format with time, date, latitude, longitude, C-mean, and C-keel entrys: <a href="mbm_fmtvel.html">mbm_fmtvel</a></li>
+      <li>Extract Jstar format (format 132) sidescan and subbottom data
+      from Reson 7k (format 88) data files: <a href="mb7k2jstar.html">mb7k2jstar</a>      </li>
+  <li> Extract Edgetech sidescan sonar data from Reson 7k format data, bin and lay the sidescan
+onto the seafloor, and output data in the MBF_MBLDEOIH formst (MBIO
+format id 71): <a href="mb7k2ss.html">mb7k2ss</a></li>
+  <li> <a href="mbauvloglist.html">mbauvloglist</a>: Generate
+    arbitrary text lists of values from MBARI AUV mission log files.<br>
+  </li>
+  </ul>
+  </ul>
+</ul>
+<center>
+  Last Updated: $Id: mbsystem_capabilities.html 2187 2014-05-28 23:56:32Z caress $
+</center>
+<ul>
+  <hr width="100%">
+  <p><a href="mbsystem_home.html"><img src="mbsystem_logo_small.gif"
+ align="bottom" border="0" height="55" width="158"></a><a
+ href="mbsystem_home.html">Back
+    to MB-System Home Page...</a> </p>
+</ul>
+</body>
+</html>
diff --git a/src/html/mbsystem_copyright.html b/html/mbsystem_copyright.html
similarity index 100%
copy from src/html/mbsystem_copyright.html
copy to html/mbsystem_copyright.html
diff --git a/html/mbsystem_faq.html b/html/mbsystem_faq.html
new file mode 100644
index 0000000..2aaeff0
--- /dev/null
+++ b/html/mbsystem_faq.html
@@ -0,0 +1,433 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+<head>
+  <title>MB-System Frequently Asked Questions</title>
+  <meta content="text/html" http-equiv="Content-Type">
+  <meta content="MB-System: Mapping the Seafloor" name="Title">
+  <meta content="David Caress, Dale Chayes" name="Author">
+  <meta
+ content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
+ name="Description">
+  <meta
+ content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
+ name="Keywords">
+</head>
+<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
+ text="#000000">
+<center>
+<p><b><font size="+2">Frequently Asked Questions About MB-System</font></b></p>
+</center>
+<ul>
+  <li><b><a href="#MB-FAQ-whatis">What is MB-System?</a></b></li>
+  <li><b><a href="#MB-FAQ-cost">How much does MB-System cost?</a></b></li>
+  <li><b><a href="#MB-FAQ-creators">Who created MB-System?</a></b></li>
+  <li><b><a href="#MB-FAQ-computers">On which computers will MB-System
+work?</a></b></li>
+  <li><b><a href="#MB-FAQ-formats">What data formats are supported by 
+MB-System?</a></b></li>
+  <li><b><a href="mbsystem_faq.html#MB-FAQ-formatdoc">Where do I find
+data format documentation?</a></b></li>
+  <li><b><a href="#MB-FAQ-obtain">How do I obtain the MB-System source
+code?</a></b></li>
+  <li><b><a href="#MB-FAQ-licensing">How is the MB-System software
+licensed?</a></b></li>
+  <li><b><a href="#MB-FAQ-required">What other software is required for
+MB-System
+to work?</a></b></li>
+  <li><b><a href="#MB-FAQ-install">How do I install MB-System on my
+computer?</a></b></li>
+  <li><b><a href="#MB-FAQ-problems">How do I report problems with
+MB-System?</a></b></li>
+  <li><b><a href="#MB-FAQ-newformats">How do I arrange to have new data
+formats
+supported by MB-System?</a></b></li>
+  <li><b><a href="#MB-FAQ-updates">How are MB-System updates handled?</a></b></li>
+  <li><b><a href="#MB-FAQ-discussionlist">Is there an MB-System
+discussion list?</a></b></li>
+  <li><b><a href="#MB-FAQ-announcementlist">Is there an MB-System
+announcement list?</a></b></li>
+  <li><b><a href="#MB-FAQ-examples">Where can I find examples of how to
+use
+MB-System?</a></b></li>
+  <li><b><a href="#MB-FAQ-references">Are there any MB-System
+References?</a></b></li>
+  <li><b><a href="#MB-FAQ-future">What are the plans for future
+MB-System
+Development?</a></b></li>
+   <li><b><a href="#MB-FAQ-whopays">Who pays for MB-System development?</a></b></li>
+  <li><b><a href="#MB-FAQ-seamount">What seamount is shown in the
+MB-System
+logo?</a></b></li>
+  <li><b><a href="#MB-FAQ-history">What is the history of MB-System?</a></b></li>
+  <li><b><a href="#MB-FAQ-credit">Who else deserves credit for
+contributions
+to MB-System?</a></b></li>
+ <li><b><a href="#MB-FAQ-y2k">Is MB-System Y2K compliant?</a></b></li>
+</ul>
+<p>
+</p>
+<hr width="67%">
+<p></p>
+<center>
+<p><b><font size="+2">Answers to Frequently Asked Questions</font></b></p>
+</center>
+<ul>
+  <li><a name="MB-FAQ-whatis"></a><b>What is MB-System?</b></li>
+  <p>MB-System is a software package consisting of programs which
+manipulate,
+process, list, or display swath sonar bathymetry, amplitude, and
+sidescan
+data. This software is distributed freely (and for free) in the form of
+source code for Unix platforms. The heart of the system is an
+input/output
+library called MBIO which allows programs to work transparently with
+any
+of a number of supported swath sonar data formats. This approach has
+allowed
+the creation of "generic" utilities which can be applied in a
+uniform manner to sonar data from a variety of sources.</p>
+  <li><a name="MB-FAQ-cost"></a><b>How much does MB-System cost?</b></li>
+  <p>The source code is freely available for free. The package can
+  also be installed via package managers for free on MacOSX, Ubuntu Linux,
+  Red Hat/CentOs Linux, and Debian Linux.</p>
+  <li><a name="MB-FAQ-creators"></a><b>Who created and maintains
+MB-System?</b></li>
+  <p>The originators and primary developers of MB-System are David W. Caress of the Monterey Bay
+Aquarium Research Institute (MBARI) and
+Dale N. Chayes of the Lamont-Doherty Earth Observatory (L-DEO) of
+Columbia
+University. The core MB-System development team also includes Christian dos Santos Ferreira of the Center for Marine Environmental Sciences (MARUM) at the University of Bremen. Krystle Anderson of MBARI is currently assisting the team in writing MB-System documentation. Val
+    Schmidt, formerly an engineer at L-DEO,and now now a research engineer at the <a href="http://ccom.unh.edu/">Center for Coastal and Ocean Mapping at the University of New Hampshire</a>, was the primary author of the first version of the MB-System Cookbook. See the home
+  page for <a href="mbsystem_home.html#MB-authors">pictures and addresses</a>.</p>
+  <li><a name="MB-FAQ-computers"></a><b>On which computers will
+    MB-System
+  work?</b></li>
+  <p>The source code for MB-System is written in ANSI C and Perl and should
+be
+portable to all unix-like platforms.  MB-System has been
+successfully
+installed on PC's and Macintoshes running Linux, Macintoshes running
+MacOS X,
+Sun workstations running
+under SunOS4.1 and Solaris, Silicon Graphics (SGI) workstations running
+under IRIX, Hewlett Packard workstations, Dec Alpha workstations, and
+PC's
+running under the Lynx realtime operating system.</p>
+  <li><a name="MB-FAQ-formats"></a><b>What data formats are supported
+by
+MB-System?</b></li>
+  <p><a href="mbsystem_formats.html">Click here </a>for a list of
+supported
+sonars and data formats.</p>
+  <li><b><a name="MB-FAQ-formatdoc"></a>Where do I find data format
+documentation?</b></li>
+</ul>
+<p style="margin-left: 40px;">Some of the swath mapping data formats
+supported by MB-System are documented on the main MB-System websites:<br>
+</p>
+<div style="margin-left: 80px;"><a
+ href="http://www.mbari.org/data/mbsystem/formatdoc/">http://www.mbari.org/data/mbsystem/formatdoc/</a><br>
+<a href="http://www.ldeo.columbia.edu/MB-System/formatdoc/">http://www.ldeo.columbia.edu/MB-System/formatdoc/</a><br>
+</div>
+<ul>
+  <li><a name="MB-FAQ-obtain"></a><b>How do I obtain the MB-System
+source
+code?</b></li>
+  <p><a href="mbsystem_how_to_get.html#MB-get">Click here</a> for
+instructions
+on obtaining the MB-System source code distribution.</p>
+  <li><a name="MB-FAQ-licensing"></a><b>How is the MB-System software
+licensed?</b></li>
+  <p><a href="mbsystem_copyright.html">Click here</a> for information
+on
+MB-System copyright and licensing.</p>
+  <li><a name="MB-FAQ-required"></a><b>What other software is required
+for
+MB-System to work?</b></li>
+  <p><a href="mbsystem_how_to_get.html#MB-required">Click here</a> for
+information
+on other software required for an MB-System installation.</p>
+  <li><a name="MB-FAQ-install"></a><b>How do I install MB-System on my
+computer?</b></li>
+  <p><a href="mbsystem_how_to_get.html#MB-install">Click here</a> for
+MB-System
+installation information.</p>
+  <li><a name="MB-FAQ-problems"></a><b>How do I report problems with
+MB-System?</b></li>
+  <p>Although we make no promises about how rapidly problems will be
+fixed,
+we strongly encourage users to notify us of bugs (and fixes!).</p>
+  <p>Problems should be reported by posts to the <a
+ href="#MB-FAQ-discussionlist">MB-System discussion list</a>.
+You will have to subscribe to the list in order to post to it (one can
+always unsubscribe at any time).
+If you are unable to access the MB-System Discussion List, you can
+email <a href="mailto:caress at mbari.org,dale at ldeo.columbia.edu">both
+David W, Caress and Dale N. Chayes</a> directly. However, due to our
+frequent travel, using the discussion list
+makes timely responses more likely.</p>
+  <li><a name="MB-FAQ-newformats"></a><b>How do I arrange to have new
+data
+formats supported by MB-System</b></li>
+  <p>In order to support a new data format, we will require a data
+format
+specification document and a data sample. We make no promises about how
+rapidly
+new formats can be supported. Format support requests by NSF-funded
+scientists
+are given priority. </p>
+  <p>We encourage users with data in unsupported formats to write the
+input/output
+modules themselves, and contribute the code to the MB-System project. </p>
+  <li><a name="MB-FAQ-updates"></a><b>How are MB-System updates handled?</b></li>
+  <p>Incremental bug fixes and code changes often occur between the
+    source code releases. These updates to individual source files are reflected in the source code archive, which can be accessed at:</p>
+  <dd><a href="http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System">http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System</a></dd>
+  <p>Periodically, we construct full source code distributions and make them available on the ftp site:</p>
+    <dd><a href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/">ftp.ldeo.columbia.edu/pub/MB-System/</a></dd>
+  <p>These source code distributions consist of gzipped tarfiles with names of the form "MB-System5.3.1906.tar.gz", 
+  where 5.3 indicates the incrementing major and minor release id's, and
+  the third number indicates the corresponding revision level in the source code archive.</p>
+  <li><a name="MB-FAQ-discussionlist"></a><b>Is there an MB-System
+discussion list?</b></li>
+  <dt><br>
+We maintain an MB-System discussion email list to facillitate
+communication
+among MB-System developers and users. We encourage users with questions
+and/or problems
+to use this list rather than emailing the developers directly.
+One must subscribe to the list in order
+to post messages, but the message archive is publically viewable and
+searchable
+over a web interface. The maximum message size in this list is 100K.
+Please do not attempt to attach data samples
+to discussion list posts.</dt>
+  <br>
+  <dt>To read the archives go to:</dt>
+  <ul>
+    <dt><a href="http://listserver.mbari.org/sympa/arc/mbsystem">http://listserver.mbari.org/sympa/arc/mbsystem</a></dt>
+  </ul>
+  <dt>To subscribe go to:</dt>
+  <ul>
+    <dt><a
+ href="http://listserver.mbari.org/sympa/subscribe/mbsystem">http://listserver.mbari.org/sympa/subscribe/mbsystem</a></dt>
+  </ul>
+  <br>
+  <li><a name="MB-FAQ-announcementlist"></a><b>Is there an MB-System
+announcement list?</b></li>
+  <dt><br>
+We maintain a second, very low traffic list of email addresses which is
+used solely for providing notification
+of major updates. If you would like to be notified when new releases
+are available, but do not
+wish to join the discussion list described above,
+please send an email message to:</dt>
+  <ul>
+    <dt>majordomo at ldeo.columbia.edu</dt>
+  </ul>
+  <dt>with a single line in the body of the message that says:</dt>
+  <ul>
+    <dt>subscribe mbsystem-l</dt>
+  </ul>
+  <dt>to be automatically added to the announcement list. <br>
+    <br>
+  </dt>
+  <li><a name="MB-FAQ-examples"></a><b>Where can I find examples of how
+to
+use MB-System?</b></li>
+  <dt><br>
+The MB-System Cookbook tutorial documentation by Val Schmidt,
+Dale N. Chayes,
+and David W. Caress is available from the Lamont-Doherty web site both
+as web pages and as a downloadable pdf document: </dt>
+  <ul>
+    <dt><a
+ href="http://www.ldeo.columbia.edu/MB-System/mb-cookbook/index.html">MB-System
+5.0 Cookbook web pages</a></dt>
+  
+    <dt><a
+ href="http://www.ldeo.columbia.edu/MB-System/mbcookbook.pdf">MB-System
+    5.0 Cookbook pdf file</a></dt>
+  </ul>
+  <br>
+  <li><a name="MB-FAQ-references"></a><b>Are there any MB-System
+References?</b></li>
+  <p>Papers specifically about MB-System:</p>
+  <blockquote>
+    <p><a href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=528558">Caress, D. W., and D. N. Chayes, New software for processing
+      sidescan
+      data from sidescan-capable multibeam sonars, <i>Proceedings of the
+        IEEE
+        Oceans 95 Conference</i>, 997-1000, 1995.</a></p>
+    <p><a href="http://link.springer.com/article/10.1007/BF00313878">Caress, D. W., and D. N. Chayes, Improved processing of Hydrosweep
+      DS
+      multibeam data on the R/V Maurice Ewing, <i>Mar. Geophys. Res.</i>,
+      18,
+      631-650, 1996.</a></p>
+  </blockquote>
+  <p>This paper on high-resolution autonomous mapping features some of the more recent MB-System capabilities:</p>
+  <blockquote>
+    <p><a href="http://doc.nprb.org/web/research/research%20pubs/615_habitat_mapping_workshop/Individual%20Chapters%20High-Res/Ch4%20Caress%20et%20al.pdf">Caress, D.W., H. Thomas, W. J. Kirkwood, R. McEwen, R. Henthorn, E. A. Clague, C. K. Paull,  J. Paduan, and K. L. Maier, "High-Resolution Multibeam, Sidescan, and Subbottom Surveys Using the MBARI AUV D. Allan B.",  <em>Marine Habitat Mapping Technology for Alaska</em>, J.R. Reynolds and H.G. Greene (eds.) Alaska Sea Grant College Prog [...]
+  </blockquote>
+  <p>References to the software distributions:</p>
+  <blockquote>
+    <p>Caress, D. W., and D. N. Chayes, MB-System: Mapping the Seafloor, <a href="http://www.mbari.org/data/mbsystem/"> http://www.mbari.org/data/mbsystem</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/"> http://www.ldeo.columbia.edu/res/pi/MB-System</a>, 2014.</p>
+  </blockquote>
+  <li><a name="MB-FAQ-future"></a><b>What are the plans for future
+    MB-System
+  Development?</b></li>
+  <p><a href="mbsystem_future.html">Click here</a> for some notions
+regarding
+future MB-System development.</p>
+  <li><a name="MB-FAQ-whopays"></a><b>Who pays for MB-System
+development?</b></li>
+  <p>MB-System is primarily supported by the Packard Foundation and the National Science Foundation. The Marine Geology and Geophysics program of the Ocean
+Sciences Division of NSF provides support through active grants (2013-2017) to the Monterey Bay Aquarium Research Institute (principal
+investigator
+David W. Caress) and the Lamont-Doherty Earth Observatory of Columbia
+University
+(principal investigator Dale N. Chayes). The Monterey Bay Aquarium
+Research
+Institute, funded by the Packard Foundation, matches 
+the NSF support for David W. Caress as part of its
+seafloor
+mapping program, and provides additional support as part of internal MBARI development projects and operations. Additional support also occasionally comes in the form
+of contract work for various government agencies and companies.</p>
+  <li><a name="MB-FAQ-seamount"></a><b>What seamount is shown in the
+MB-System
+logo?</b></li>
+  <p>The seamount shown in illuminated color 3D perspective in the
+MB-System
+logo is the northern Urville Seamount (or Dumont d'Urville du Nord, as
+it appears on French charts). This seamount is located in the Marquesas
+Islands at 9 35'S, 139 47'W. It was surveyed in 1991 and 1992 using the
+Hydrosweep DS multibeam sonar on the R/V Maurice Ewing.</p>
+  <li><a name="MB-FAQ-history"></a><b>What is the history of MB-System?</b></li>
+  <p>The development of MB-System began in 1990 as part of ongoing
+research
+at L-DEO involving swath bathymetry data collected with SeaBeam
+multibeam
+sonars. Development was accelerated in 1991 as part of the effort to
+support
+the STN-Atlas Hydrosweep DS multibeam sonar on L-DEO's ship, the R/V
+Maurice
+Ewing. The Marine Geology and Geophysics Program (Ocean Sciences Division) of the National Science Foundation (NSF) provided support in 1993 and
+1994
+to improve and extend MB-System. The intent of this initial grant was
+to
+provide a standard "generic" set of tools for processing and
+display of swath sonar data that could be used by the U.S. academic
+community.
+The first generally released version of MB-System (3.0) was made
+available
+in the Spring of 1993. This was followed by versions 3.1 and 3.2 in
+July,
+1993, version 3.3 in November, 1993, and version 3.4 in December 1993.
+All of these early releases supported only SeaBeam and Hydrosweep data.</p>
+  <p>SeaBeam Instruments and Antarctic Support Associates provided
+additional
+support in 1994 for the development of MB-System, with particular
+emphasis
+on capabilities related to the new SeaBeam 2100 series of sonars. A
+considerably
+enhanced MB-System version 4.0 was released on October 22, 1994; this
+release
+followed an almost complete rewrite of the underlying source code. The
+new capabilities included support for sidescan as well as bathymetry
+data
+and support for data from a number of very different sonars. </p>
+  <p>The NSF funded a five year effort begun in
+1995
+to maintain and further develop MB-System. From 1994 to 1997, SeaBeam
+Instruments
+(a major multibeam sonar manufacturer and, at the time, the principal
+employer
+of David W. Caress) provided significant support for MB-System
+development
+and maintenance. Similarly, the Newport, RI office of the Science
+Applications
+International Corporation (SAIC) supported some MB-System development
+during
+1997-1998, when David W. Caress worked there. Version 4.1 was released
+in November, 1994, followed by 4.2 in February 1995, 4.3 on March 12,
+1996,
+4.4 on August 27, 1996, and 4.5 on September 23, 1997.</p>
+  <p>David W. Caress joined the Monterey Bay Aquarium Research
+Institute
+(MBARI) in September, 1998. Version 4.6 was released on April 16, 1999.
+The final update to version 4.6 (4.6.10) was announced on March 8,
+2000.
+The primary innovations during this period included support for the new
+generation of Simrad multibeam sonars and tools for generating data
+products
+that could be imported directly into GIS software packages.</p>
+  <p>The NSF has funded additional five year grants
+to MBARI and L-DEO which have supported the MB-System project from 2001-2006, 2006-2011, and now from 2013-2017. The Packard Foundation, through its support of MBARI, has matched the NSF support and provided considerable additional support as part of MBARI's efforts to achieve high resolution seafloor mapping in the deep ocean using autonomous underwater vehicles (AUVs).The version 5.0 release incorporated
+a substantial rewrite of the underlying code as well as
+providing
+significant new capabilities
+The initial version 5.0 development took nearly three years. A first
+"beta" release was made on April 6, 2001, followed by thirty more beta
+releases, the last on April 29, 2003. Version 5.0.0 was finally 
+released on December 5, 2003. 
+The software has evolved considerably since that time, and now includes tools for 2D/3D visualization, 3D interactive data editing, navigation adjustment of surveys from submerged platforms, processing and display of subbottom profiler data, and many other features.
+
+Version 5.1 was released on November 26, 2006, version 5.2 on December 30, 2010, and version 5.3 on September 28, 2011. Dozens of incremental releases have been made before and since 5.3, and public access to the code archive allows users to be up to date with respect to development and maintenance regardless of the release schedule.</p>
+  <p>In January 2012 an <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.html">MB-System planning meeting</a> was held at the Lamont-Doherty Earth Observatory to lay out long range plans for MB-System development. With the renewal of NSF support in 2013, the MB-System team is now working to implement the <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.pdf">priorities from the planning meeting </a>as part of a major code rewrite [...]
+
+  <li><a name="MB-FAQ-credit"></a><b>Who else deserves credit for
+contributions
+to MB-System?</b></li>
+  <p>In addition to the core team (David Caress, Dale Chayes, Christian dos Santos Ferreira), a number of people have made contributions to the code included in
+MB-System.
+These include: </p>
+  <ul>
+    <li>Val Schmidt (University of New Hampshire, formerly Lamont-Doherty Earth Observatory) </li>
+    <li>Gordon Keith (CSIRO Marine and Atmospheric Research, Australia)</li>
+    <li>Kurt Schwehr (Google, formerly University of New Hampshire)</li>
+    <li>Suzanne O'Hara (Lamont-Doherty Earth Observatory) </li>
+    <li>Bob Covill (Tekmap Consulting, Nova Scotia)</li>
+    <li>Peter Lemmond (Woods Hole Oceanographic Institution)</li>
+    <li>Jonathan Beaudoin (CCOM/JHC, University of New Hamphsire)</li>
+    <li>John Hughes Clarke (OMG, University of New Brunswick)</li>
+    <li>Hamish Bowman (University of Otago, New Zealand)</li>
+    <li>Roger Davis (University of Hawaii) </li>
+    <li>Ammar Aljuhne (MARUM, University of Bremen, Germany)</li>
+    <li>Mike McCann (MBARI) </li>
+    <li>Hans Thomas (MBARI) </li>
+    <li>Daniel Scheirer (USGS, formerly Brown University)</li>
+    <li>Paul Cohen (formerly at SeaBeam Instruments)</li>
+    <li>Steve Dzurenko (formerly at SeaBeam Instruments, more recently at University of Texas)</li>
+    <li>David Brock (formerly with Antarctic Support Associates) </li>
+    <li>Alberto Malinverno (Lamont-Doherty Earth Observatory, later at
+    Schlumberger-Doll, now back at Lamont) </li>
+    <li>Russ Alexander (formerly with UCSB) </li>
+  </ul>
+  <p>Numerous users and vendors have provided information regarding
+data
+file formats and sonar system specific characteristics.</p>
+<li><a name="MB-FAQ-y2k"></a><b>Is MB-System Y2K compliant?</b></li>
+  <p>Remember when Y2K was a buzz word? If so, you are old like us. Not that it matters anymore, but MB-System became fully Y2K 
+compliant as of the final release of version 4.6. Surprisingly,
+a number of data formats associated with current commercial products
+still use two digits to represent the year. MB-System treats two digit year
+values as being in the 1900's if the year value is greater than or equal to
+62,
+and in the 2000's if the year value is less than 62. The use of 1962
+derives
+from the invention of the multibeam sonar in that year - there are no
+digital
+swath mapping data available from an earlier time.</p></ul>
+<center>
+<p><br>
+Last Updated: $Id: mbsystem_faq.html 2208 2014-10-29 08:18:46Z caress $</p>
+</center>
+<p>
+</p>
+<hr width="67%">
+<p></p>
+<p><a href="mbsystem_home.html"><img width="158" height="55" border="0"
+ src="mbsystem_logo_small.gif"></a><a href="mbsystem_home.html">Back
+to MB-System Home Page...</a></p>
+</body>
+</html>
diff --git a/src/html/mbsystem_formats.html b/html/mbsystem_formats.html
similarity index 99%
copy from src/html/mbsystem_formats.html
copy to html/mbsystem_formats.html
index d642d41..69eff1a 100644
--- a/src/html/mbsystem_formats.html
+++ b/html/mbsystem_formats.html
@@ -1129,7 +1129,7 @@ sonars are supported: </P>
 </UL>
 
 <CENTER><P><BR>
-Last Updated: $Id: mbsystem_formats.html 2215 2014-11-29 22:21:19Z caress $ $Revision: $</P></CENTER>
+Last Updated: $Id: mb_format.h 2215 2014-11-29 22:21:19Z caress $ $Revision: $</P></CENTER>
 
 <P>
 <HR WIDTH="100%"></P>
diff --git a/html/mbsystem_future.html b/html/mbsystem_future.html
new file mode 100644
index 0000000..edefb40
--- /dev/null
+++ b/html/mbsystem_future.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+  <title>MB-System Development Plan</title>
+  <meta content="text/html" http-equiv="Content-Type">
+  <meta content="MB-System: Mapping the Seafloor" name="Title">
+  <meta content="David Caress, Dale Chayes" name="Author">
+  <meta
+ content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
+ name="Description">
+  <meta
+ content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
+ name="Keywords">
+</head>
+<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
+ text="#000000">
+<center>
+<h1>MB-System Development Plan</h1>
+</center>
+<p>On January 17-18, 2012, an MB-System planning meeting was held at the Lamont-Doherty Earth Observatory to define the priorities for the next five years of MB-System development. This meeting brought together  a small group composed of the core MB-System developers, users that have substantially contributed to the project over the past few years, and representatives of organizations that have expressed interest in parallel development efforts contributing to MB-System.The priorities id [...]
+<p>Full notes from this meeting have been posted <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.html">here</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/2012NSFProposal/20120117MBPlanning.html">here</a>.
+<br>The proposal has been posted <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120815MB-SystemNSFProposal.pdf">here</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/2012NSFProposal/20120815MB-SystemNSFProposal.pdf">here</a>.</p>
+<p>The focus of the NSF-funded software development efforts at MBARI and L-DEO will be:</p>
+<ul>
+  <li><strong>Re-architect underlying MBIO library</strong><br>The scope of requested new capabilities require substantially recasting the MBIO application programming interface (API) and the associated functions:</li>
+  <ul>
+    <li>Store and pass beam quality information needed for determining if soundings meet IHO (International Hydrographic Organization) quality standards.</li>
+    <li>Recast the internal coordinate systems consistently through the code.</li>
+    <li>Handle corrections to sensor offsets and biases for all sensors.</li>
+  </ul>
+</ul>
+<ul>
+  <li><strong>Support new and important data formats</strong></li>
+  <ul>
+    <li>Keep up to date with data from Kongsberg multibeam installations on UNOLS vessels</li>
+    <li>Keep up to date ith data from Reson multibeam installations on WHOI NSDF platforms (Sentry, Jason, Alvin)</li>
+    <li>Support input from Bathymetry Attributed Grid (BAG) files</li>
+    <li>Support other data formats associated with NSF-supported projects as they become relevant.</li>
+  </ul>
+</ul>
+<ul>
+  <li><strong>Improve performance of common tasks</strong>
+<br>Several straightforward improvements have been identified that can substantially reduce the time required for analysis and processing:</li>
+  <ul>
+    <li>Augmenting the datalist scheme so that surveys as well as individual files have .inf metadata files, and thus data trees outside bounds of interest can be skipped.</li>
+    <li>Recasting ancillary files (esp. fbt) for improved read performance.</li>
+    <li>Allow raw files and processed files to be located on different filesystems to improve processing performance.</li>
+  </ul>
+</ul>
+<ul>
+  <li><strong>Fix existing problems with support of current generation Kongsberg data</strong>
+  <br>The beam angles for current generation Kongsberg multibeam sonar data are not calculated correctly, and an iterative method used to estimate these angles in an optional pre-processing stage is slow. Fixing this issue is high priority.<strong></strong></li>
+</ul>
+<ul>
+  <li><strong>Improve <em>mbeditivz</em></strong>
+<br>Improve patch test calibration capability of <em>mbeditviz</em> by allowing the soundings to be colored according to a variety of parameters.</li>
+</ul>
+<ul>
+  <li><strong>Add capability to generate additional data products:</strong></li>
+  <ul>
+    <li>Shapefiles for ESRI and other GIS</li>
+    <li>KML file for Google Earth</li>
+    <li>Bathymetry Attributed Grid (BAG) files</li>
+  </ul>
+</ul>
+<ul>
+  <li><strong>Support reading from compressed files in gzip format.</strong>
+<br>This will reduce data storage requirements, and is a priority of NGDC, MGDS, and R2R.</li>
+</ul>
+<ul>
+  <li><strong>Rewrite the graphical utilities to use Qt graphics </strong>
+  <br>The interactive programs currently use obsolete Motif/X11 graphics. In addition to improving performance and moving MB to a modern graphics context, switching to Qt will enable true cross-platform portability, including to Windows computers. </li>
+</ul>
+<ul>
+  <li><strong>Develop tools for working with multibeam water column data</strong>
+  <br>The use of recorded beamformed time series data from multibeam sonars to image biological and other water column targets is of great interest to many users. This issue was the highest ranked desired capability at the MB-System planning meeting. Water column data are also an asset in troubleshooting interference in multibeam sonar systems. We will develop a new MB-System tool to display water column data and to identify and display targets. <strong><u></u></strong></li>
+</ul>
+<ul>
+  <li><strong>Implement the CHRT algorithm as an MB-System tool. </strong>
+  <br>CUBE is an algorithm developed by Brian Calder [Calder and Mayer, 2003] that automatically processes swath bathymetry soundings and provides depth estimates and uncertainties at defined points and identifies soundings inconsistent with the best estimates. Thus, CUBE can be used both to identify bad (or suspect) soundings and to generate gridded bathymetry models. This is a particularly useful feature in shallow water data sets with very large numbers of tracks and soundings. The CU [...]
+</ul>
+<ul>
+  <li><strong>Develop real-time display tool</strong>
+  <br>We will implement a display tool that reads swath data from real-time streams, updates a gridded representation of the bathymetry, and displays the current grid and tracklines in a 2D/3D view using the new, Qt-based <em>mbview</em> visualization library.</li>
+</ul>
+<ul>
+  <li><strong>Develop a “test suite” to allow automatic determination that an MB-System installation is successful. </strong>
+  <br>As MB-System has become more complex it has become clear that we need an automated method to verify new builds. Using our existing example data set, we will develop a test procedure implemented in a script that will exercise a new build of MB-System and compare the results against a pre-defined set of results. </li>
+</ul>
+<p>The participants of the MB-System planning meeting also identified updating documentation and improving training resources for both users and developers as significant priorities. We plan to:</p>
+<ul>
+  <li><strong>Rewrite the MB-System Cookbook to reflect the current software. </strong>
+  <br>We will rewrite the cookbook to reflect the current state of the software.<strong></strong></li>
+</ul>
+<ul>
+  <li><strong>Create an MB-System Wiki to store and disseminate user-created documentation and training materials. </strong>
+  <br>A number of users have created their own MB-System presentations, how-to documents, and even some quite good how-to videos. </li>
+</ul>
+<ul>
+  <li><strong>Hold MB-System workshops to assist groups that want to develop data format modules and applications and for user training. </strong>
+    <br>
+    We proposed to hold annual workshops intended for 10-20 participants each. During years 1, 3, and 5 we intended to hold developer workshops at MBARI. During years 2 and 4 we intended to hold user workshops at LDEO.
+    <ul>
+      <li>NSF was unable to fund these workshops</li>
+      <li>We are looking for alternative support for at least some workshops.</li>
+    </ul>
+  </li>
+</ul>
+<center>
+  <p><br>
+Last Updated: $Id: mbsystem_future.html 2135 2013-08-07 23:29:13Z caress $</p>
+</center>
+<p>
+</p>
+<hr width="67%">
+<p><a href="mbsystem_home.html"><img align="bottom" width="158"
+ height="55" border="0" src="mbsystem_logo_small.gif"></a><a
+ href="mbsystem_home.html">Back
+to MB-System Home Page...</a>
+</p>
+</body>
+</html>
diff --git a/src/html/index.html b/html/mbsystem_home.html
similarity index 99%
copy from src/html/index.html
copy to html/mbsystem_home.html
index 3a7e5c0..e1c1169 100644
--- a/src/html/index.html
+++ b/html/mbsystem_home.html
@@ -300,7 +300,7 @@ University</a></dt>
   </dt>
 </dl>
 <center>
-<p>Last Updated: $Id: index.html 2180 2014-04-02 20:58:34Z caress $</p>
+<p>Last Updated: $Id: mbsystem_home.html 2180 2014-04-02 20:58:34Z caress $</p>
 </center>
 <p></p>
 <div align="center">
diff --git a/src/html/mbsystem_how_to_get.html b/html/mbsystem_how_to_get.html
similarity index 100%
copy from src/html/mbsystem_how_to_get.html
copy to html/mbsystem_how_to_get.html
diff --git a/html/mbsystem_logo.gif b/html/mbsystem_logo.gif
new file mode 100644
index 0000000..d07c130
Binary files /dev/null and b/html/mbsystem_logo.gif differ
diff --git a/html/mbsystem_logo_small.gif b/html/mbsystem_logo_small.gif
new file mode 100644
index 0000000..780b161
Binary files /dev/null and b/html/mbsystem_logo_small.gif differ
diff --git a/src/html/mbsystem_man_list.html b/html/mbsystem_man_list.html
similarity index 100%
copy from src/html/mbsystem_man_list.html
copy to html/mbsystem_man_list.html
diff --git a/src/html/mbsystem_whatsnew.html b/html/mbsystem_whatsnew.html
similarity index 100%
copy from src/html/mbsystem_whatsnew.html
copy to html/mbsystem_whatsnew.html
diff --git a/install_makefiles b/install_makefiles
deleted file mode 100755
index 2cb3990..0000000
--- a/install_makefiles
+++ /dev/null
@@ -1,1020 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
-                    & eval 'exec perl -S $0 $argv:q'
-                         if 0;
-#--------------------------------------------------------------------
-#    The MB-System:	install_makefiles	5/20/94
-#    $Id: install_makefiles 2158 2014-01-18 08:43:11Z caress $
-#
-#    Copyright (c) 1993-2013 by
-#    D. W. Caress (caress at lamont.ldgo.columbia.edu)
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#    Lamont-Doherty Earth Observatory
-#    Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   install_makefiles [-Ppreset]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   May 20, 1994
-#
-# Purpose:
-#   Perl shellscript to create makefiles appropriate to a particular
-#   MB-System installation.  Before running this script, the
-#   installer should edit the variable declarations below (where
-#   indicated) so that these values are appropriate for the system
-#   on which MB-System is being installed.  At execution the script
-#   will read template makefiles in the MB-System source directories
-#   and create makefiles with the correct attributes.
-#   This enables users to install MB-System without having to edit
-#   the makefiles.  Instead of editing the makefiles directly, the
-#   installer should edit this script so that the locations of
-#   important libraries and include files are accurate and so that
-#   the compile and link flags are correct.
-#
-#   The required and optional installation parameters are:
-#
-#   REQUIRED:
-#	MBSYSTEM_HOME	Absolute path to the directory containing this file.
-#	OS		Operating system (Recognized options are:
-#				DARWIN, LINUX, CYGWIN, SUN, IRIX, IRIX64,
-#				SOLARIS, HPUX, LYNX, CYGWIN or OTHER).
-#	CFLAGS		Compile flags for C source files. These vary with
-#				different operating systems and installations.
-#	LFLAGS		Load flags for all object files.
-#	NETCDFLIBDIR	Location of NetCDF library libnetcdf.a
-#	NETCDFINCDIR	Location of NetCDF include file netcdf.h
-#	GMTLIBDIR	Location of GMT libraries libgmt.a and libpsl.a
-#	GMTINCDIR	Location of GMT include files gmt.h, grd.h, and pslib.h
-#	LEVITUS		Path of Levitus global water properties data file. This is usually
-#                               $MBSYSTEM_HOME/share/annual.
-#	PROJECTIONS	Path of PROJ4 projections database. This is usually
-#                               $MBSYSTEM_HOME/share/mbsystem/Projections.dat.
-#   REQUIRED for spectrogram tool mbsegypsd..
-#	FFTWLIBDIR	Location of FFTW library libfftw.a
-#	FFTWINCDIR	Location of FFTW include file fftw.h
-#			If these parameters are not both set, mbsegypsd will
-#			not be built.
-#   REQUIRED for openGL tools mbgrdviz and mbeditviz:
-#       OPENGLLIBS	OpenGL libraries required for new graphical tools,
-#.                              including mbgrdviz and mbeditviz. If this
-#                               parameter is not set, mbgrdviz and mbeditviz
-#                               will not be built
-#   REQUIRED for tidal prediction program mbotps:
-#       OTPSDIR		Location of OTPSnc package, including executable
-#.                              predict_tide and batch files used by
-#                               predict_tide. If this is not specified
-#				correction mbotps will build but not run
-#				correctly
-#   OPTIONAL - use non-default C compiler:
-#	CC		C compiler to be used (optional).
-#   OPTIONAL - use independent installation of the PROJ4 library:
-#       PROJLIB         Path to PROJ4 library (usually libproj.a)
-#       PROJINCDIR      Location of PROJ4 include file proj_api.h
-#   OPTIONAL - use independent installation of the GSF library:
-#       GSFLIB          Path to GSF library (usually libgsf.a)
-#       GSFINCDIR       Location of GSF include file gsf.h
-#
-#   A few preset variable configurations are defined and can be
-#   specified using the -P option. These include:
-#	macosxfink 	-install on MacOs X using fink
-#				- assumes installation in /sw
-#				- assumes use of Apple's X11
-#				- assumes netCDF, GMT, and OpenMotif installe
-#					using fink
-#       macosxusrlocal - install manually on MacOs X 10.5 (Leopard)
-#				- assumes installation in /usr/local/mbsystem
-#				- assumes use of Apple's X11
-#				- assumes netCDF, GMT, and OpenMotif installe
-#					using fink
-#       irixusrlocal - install manually on SGI IRIX
-#				- assumes installation in /usr/local/mbsystem
-#				- assumes netCDF and GMT installs in /usr/local
-#
-#--------------------------------------------------------------------
-# EDIT THE PARAMETERS HERE IF NO APPROPRIATE PRESET CONFIGURATION IS DEFINED
-# Set the configuration parameters manually:
-#--------------------------------------------------------------------
-#
-# Required parameters:
-$MBSYSTEM_HOME = "/usr/local/mbsystem";
-$OS = "DARWIN";
-$CFLAGS = "-Wall -g -I/opt/X11/include ";
-$LFLAGS = "-Wall -g -lm -L/sw/lib -lgdal";
-$NETCDFLIBDIR = "/sw/lib";
-$NETCDFINCDIR = "/sw/include";
-$GMTLIBDIR = "/usr/local/gmt/lib";
-$GMTINCDIR = "/usr/local/gmt/include";
-$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#
-# Required parameters for spectrogram program mbsegypsd
-#   - mbsegypsd will not be built if these are commented out
-$FFTWLIBDIR = "/usr/local/fftw/lib";
-$FFTWINCDIR = "/usr/local/fftw/include";
-#
-# Required parameters for graphical tools
-#   - graphical tools will not be built if these
-#     are commented out
-$MOTIFINCDIR = "/sw/include";
-$MOTIFLIBS = "-L/sw/lib -L/opt/X11/lib -lXm -lXt -lX11";
-#
-# Required parameter for visualization tools
-#   - visualization tools will not be built if this
-#     is commented out
-$OPENGLLIBS = "-lGLU -lGL";
-#
-# Required parameter for mblevitus program
-$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-#
-# Required parameter for mbotps program
-$OTPSDIR = "/usr/local/OTPSnc";
-#
-# Optional parameter for use of non-default C compiler
-#$CC = "cc";
-#
-# Optional parameters for use of independent GSF library installation
-#   - GSF library included with MB-System will be used
-#     if these are commented out
-#$GSFLIB = "/usr/local/gsf/lib/libgsf.a";
-#$GSFINCDIR = "/usr/local/gsf/include/";
-#
-# Optional parameters for use of independent PROJ4 library installation
-#   - PROJ4 library included with MB-System will be used
-#     if these are commented out
-#$PROJLIB = "/usr/local/proj/lib/libproj.a";
-#$PROJINCDIR = "/usr/local/proj/include/";
-#
-#--------------------------------------------------------------------
-# END OF PARAMETER EDITING SECTION
-#--------------------------------------------------------------------
-#
-# Version:
-#   $Id: install_makefiles 2158 2014-01-18 08:43:11Z caress $
-#
-# Revisions:
-#   $Log: install_makefiles,v $
-#
-#--------------------------------------------------------------------
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('P:p:');
-$preset = 	($opt_P || $opt_p);
-
-
-#--------------------------------------------------------------------
-# USE PARAMETERS SET ABOVE IF NO APPROPRIATE PRESET CONFIGURATION IS DEFINED
-#--------------------------------------------------------------------
-if (!$preset)
-	{
-	print "\nUsing manually defined configuration...\n";
-	}
-#--------------------------------------------------------------------
-# ELSE RESET PARAMETERS USING SPECIFIED PRESET CONFIGURATION
-#--------------------------------------------------------------------
-#
-# Preset configuration for MacOs X when building through fink
-elsif ($preset eq "macosxfink")
-	{
-	print "\nUsing preset configuration for MacOs X by fink in /sw...\n";
-	$FINKPREFIX = "\@FINKPREFIX@";
-	$MBSYSTEM_HOME = "$FINKPREFIX";
-	$OS = "DARWIN";
-	$CC = "cc";
-	$MOTIFINCDIR = "$FINKPREFIX/include";
-	$MOTIFLIBS = "-L$FINKPREFIX/lib -L/opt/X11/lib -lXm -lXt -lX11";
-	$OPENGLLIBS = "-lGLU -lGL";
-	$GMTLIBDIR = "$FINKPREFIX/lib";
-	$GMTINCDIR = "$FINKPREFIX/include";
-	$NETCDFLIBDIR = "$FINKPREFIX/lib";
-	$NETCDFINCDIR = "$FINKPREFIX/include";
-	$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-	$FFTWLIBDIR = "$FINKPREFIX/lib";
-	$FFTWINCDIR = "$FINKPREFIX/include";
-	$OTPSDIR = "/usr/local/OTPSnc";
-	$CFLAGS = "-O3 -funroll-loops -fexpensive-optimizations -I/opt/X11/include -Wall -Wimplicit -pedantic -W -Wstrict-prototypes -Wredundant-decls  -Wimplicit-int -Wimplicit-function-declaration -Wnested-externs";
-	$LFLAGS = "-Wl -lm -bind_at_load";
-	}
-#
-# Preset configuration for MacOs X 10.6 (Snow Leopard) when building in /usr/local
-#       assumes that GMT, netCDF, and OpenMotif are installed using fink in 32 bit mode
-elsif ($preset eq "macosxusrlocal")
-	{
-	print "\nUsing preset configuration for MacOs X in /usr/local/...\n";
-	$FINKPREFIX = "/sw";
-	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-	$OS = "DARWIN";
-	$CC = "cc";
-	$MOTIFINCDIR = "$FINKPREFIX/include";
-	$MOTIFLIBS = "-L$FINKPREFIX/lib -L/usr/X11R6/lib -lXm -lXt -lX11";
-	$OPENGLLIBS = "-lGLU -lGL";
-	$GMTLIBDIR = "$FINKPREFIX/lib";
-	$GMTINCDIR = "$FINKPREFIX/include";
-	$NETCDFLIBDIR = "$FINKPREFIX/lib";
-	$NETCDFINCDIR = "$FINKPREFIX/include";
-	$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-	$FFTWLIBDIR = "$FINKPREFIX/lib";
-	$FFTWINCDIR = "$FINKPREFIX/include";
-	$OTPSDIR = "/usr/local/OTPSnc";
-	$CFLAGS = "-m32 -g -I/usr/X11R6/include";
-	$LFLAGS = "-m32 -Wl -lm";
-	}
-#
-# Preset configuration for MacOs X 10.5 (Leopard) when building in /usr/local
-#       assumes that GMT, netCDF, and OpenMotif are installed using fink
-elsif ($preset eq "macosx10.5usrlocal")
-	{
-	print "\nUsing preset configuration for MacOs X in /usr/local/...\n";
-	$FINKPREFIX = "/sw";
-	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-	$OS = "DARWIN";
-	$CC = "cc";
-	$MOTIFINCDIR = "$FINKPREFIX/include";
-	$MOTIFLIBS = "-L$FINKPREFIX/lib -L/usr/X11R6/lib -lXm -lXt -lX11";
-	$OPENGLLIBS = "-lGLU -lGL";
-	$GMTLIBDIR = "$FINKPREFIX/lib";
-	$GMTINCDIR = "$FINKPREFIX/include";
-	$NETCDFLIBDIR = "$FINKPREFIX/lib";
-	$NETCDFINCDIR = "$FINKPREFIX/include";
-	$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-	$FFTWLIBDIR = "$FINKPREFIX/lib";
-	$FFTWINCDIR = "$FINKPREFIX/include";
-	$OTPSDIR = "/usr/local/OTPSnc";
-	$CFLAGS = "-g -I/usr/X11R6/include";
-	$LFLAGS = "-Wl -lm -bind_at_load -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/LibGL.dylib";
-	}
-#
-# Preset configuration for Cygwin on Windows when building in /usr/local
-#       assumes that GMT and netCDF are also installed in /usr/local
-elsif ($preset eq "CYGWIN")
-	{
-	print "\nUsing preset configuration for Cygwin on Windows in /usr/local...\n";
-	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-	$OS = "CYGWIN";
-	$CC = "gcc";
-	$MOTIFINCDIR = "/usr/X11R6/include/Xm";
-	$MOTIFLIBS = "-L/usr/X11R6/lib -lXm -lXt -lX11";
-	$OPENGLLIBS = "-lGLU -lGL";
-	$GMTLIBDIR = "/usr/local/gmt/lib";
-	$GMTINCDIR = "/usr/local/gmt/include";
-	$NETCDFLIBDIR = "/usr/local/netcdf/lib";
-	$NETCDFINCDIR = "/usr/local/netcdf/include";
-	$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-	$FFTWLIBDIR = "/usr/local/fftw/lib";
-	$FFTWINCDIR = "/usr/local/fftw/include";
-	$OTPSDIR = "/usr/local/OTPSnc";
-	$CFLAGS = "-g -fdata-sections -I/usr/X11R6/include";
-	$LFLAGS = "-lrpc -lrpclib -lm -Wl,--enable-runtime-pseudo-reloc";
-	}
-#
-# Preset configuration for SGI Irix when building in /usr/local
-#       assumes that GMT and netCDF are installed in /usr/local
-elsif ($preset eq "irixusrlocal")
-	{
-	print "\nUsing preset configuration for SGI Irix in /usr/local/...\n";
-	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-	$OS = "IRIX64";
-	$CC = "cc";
-	$MOTIFINCDIR = "/usr/include/Xm";
-	$MOTIFLIBS = "-lXm -lXt -lX11";
-	$OPENGLLIBS = "-lGLU -lGL";
-	$GMTLIBDIR = "/usr/local/gmt/src";
-	$GMTINCDIR = "/usr/local/gmt/src";
-	$NETCDFLIBDIR = "/usr/local/netcdf/lib";
-	$NETCDFINCDIR = "/usr/local/netcdf/include";
-	$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-	$FFTWLIBDIR = "/usr/local/fftw/lib";
-	$FFTWINCDIR = "/usr/local/fftw/include";
-	$OTPSDIR = "/usr/local/OTPSnc";
-	$CFLAGS = "-O2";
-	$LFLAGS = "-lm -lsun";
-	}
-
-# Quit because preset not recognized:
-else
-	{
-	print "\nUnrecognized preset $preset specified...\n";
-	print "The currently supported preset configurations include:\n\tmacosfink\n\tmacosusrlocal\n";
-	die "Exiting without creating new Makefiles...\n";
-	}
-
-#--------------------------------------------------------------------
-# HERE ARE SOME EXAMPLE CONFIGURATION SETTINGS FOR VARIOUS SYSTEMS
-#--------------------------------------------------------------------
-#
-# Example for installing on Apple Macintosh Computers
-# running MacOS X version 10.2 to 10.4. Here I am using the
-# Apple X11 distribution and the OpenMotif (www.openmotif.org)
-# port provided by Fink (www.fink.org). GMT and netCDF have
-# also been installed using fink (note: current versions of
-# GMT are only available through the "unstable" fink tree).
-# The "-force_flat_namespace" linker flag was
-# required in $LFLAGS prior to 10.2.6
-#	$MBSYSTEM_HOME = "cmbsystem";
-#	$OS = "DARWIN";
-#	$CC = "cc";
-#	$MOTIFINCDIR = "/sw/include";
-#	$MOTIFLIBS = "-L/sw/lib -L/usr/X11R6/lib -lXm -lXt -lX11";
-#	$GMTLIBDIR = "/sw/lib";
-#	$GMTINCDIR = "/sw/include";
-#	$NETCDFLIBDIR = "/sw/lib";
-#	$NETCDFINCDIR = "/sw/include";
-#	$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$CFLAGS = "-g -I/usr/X11R6/include";
-#	$LFLAGS = "-Wl -lm -bind_at_load";
-#
-# Example for installing on Apple Macintosh Computers
-# running MacOS X version 10.5 ("Leopard"). Here I am using the
-# Apple X11 distribution and the OpenMotif (www.openmotif.org)
-# port provided by Fink (www.fink.org). GMT and netCDF have
-# also been installed using fink (note: current versions of
-# GMT are only available through the "unstable" fink tree).
-#	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-#	$OS = "DARWIN";
-#	$CC = "cc";
-#	$MOTIFINCDIR = "/sw/include";
-#	$MOTIFLIBS = "-L/sw/lib -L/usr/X11R6/lib -lXm -lXt -lX11";
-#	$GMTLIBDIR = "/sw/lib";
-#	$GMTINCDIR = "/sw/include";
-#	$NETCDFLIBDIR = "/sw/lib";
-#	$NETCDFINCDIR = "/sw/include";
-#	$LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$CFLAGS = "-g -I/usr/X11R6/include";
-#	$LFLAGS = "-Wl -lm -bind_at_load -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/LibGL.dylib";
-#
-# Example for installing on L-DEO Sun workstations running SunOs 4.1.x:
-#	$MBSYSTEM_HOME = "/home/hs/caress/dev/mbsystem";
-#	$OS = "SUN";
-#	$CFLAGS = "-O2";
-#	$LFLAGS = "-lm";
-#	$MOTIFINCDIR = "/usr/include/Xm";
-#	$MOTIFLIBS = "-lXm -lXt -lX11";
-#	$GMTLIBDIR = "/ocean/mgg/gmt2/sun4/lib";
-#	$GMTINCDIR = "/ocean/mgg/gmt2/src";
-#	$NETCDFLIBDIR = "/ocean/mgg/netcdf/sun4/lib";
-#	$NETCDFINCDIR = "/ocean/mgg/netcdf/include";
-#	$LEVITUS = "/ocean/mgg/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$CFLAGS = "-O2";
-#	$LFLAGS = "-lm";
-#
-# Example for installing on R/V Ewing Sun workstations:
-#	$MBSYSTEM_HOME = "/net/heezen/packages/mbsystem";
-#	$OS = "SUN";
-#	$CFLAGS = "-O2";
-#	$LFLAGS = "-lm";
-#	$MOTIFINCDIR = "/usr/include/Xm";
-#	$MOTIFLIBS = "-lXm -lXt -lX11";
-#	$GMTLIBDIR = "/net/heezen/packages/gmt2/bin";
-#	$GMTINCDIR = "/net/heezen/packages/gmt2/src";
-#	$NETCDFLIBDIR = "/net/heezen/packages/netcdf/lib";
-#	$NETCDFINCDIR = "/net/heezen/packages/netcdf/include";
-#	$LEVITUS = "/net/heezen/packages/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#
-# Example for installing on Sun workstations running Solaris 2.4:
-#
-#	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-#	$OS = "SOLARIS";
-#	$CFLAGS = "-O -I/usr/openwin/include -I/usr/ucbinclude";
-#	$LFLAGS = "-lnsl -lm";
-#	$MOTIFINCDIR = "/usr/dt/include";
-#	$MOTIFLIBS = "-L/usr/openwin/lib -L/usr/dt/lib -lXm -lXt -lX11";
-#	$GMTLIBDIR = "/usr/local/gmt/src";
-#	$GMTINCDIR = "/usr/local/gmt/src";
-#	$NETCDFLIBDIR = "/usr/local/netcdf/lib";
-#	$NETCDFINCDIR = "/usr/local/netcdf/include";
-#	$LEVITUS = "/usr/local/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#
-# Example for installing on Sun workstations running Solaris 2.6
-#   with GMT built to utilize sincos() - add -lsunmath to $LFLAGS:
-#
-#	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-#	$OS = "SOLARIS";
-#	$CC = "cc";
-#	$MOTIFINCDIR = "/usr/dt/include";
-#	$MOTIFLIBS = "-L/usr/openwin/lib -L/usr/dt/lib -lXm -lXt -lX11";
-#	$GMTLIBDIR = "/usr/local/gmt/src";
-#	$GMTINCDIR = "/usr/local/gmt/src";
-#	$NETCDFLIBDIR = "/usr/local/netcdf/lib";
-#	$NETCDFINCDIR = "/usr/local/netcdf/include";
-#	$LEVITUS = "/usr/local/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$CFLAGS = "-O -I/usr/openwin/include -I/usr/ucbinclude";
-#	$LFLAGS = "-lnsl -lm -lsunmath";
-#
-# Example for installing on Sun workstations running Solaris 2.7
-#
-#	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-#	$OS = "SOLARIS";
-#	$CC = "gcc";
-#	$MOTIFINCDIR = "/usr/dt/include/Xm";
-#	$MOTIFLIBS = "-L/usr/dt/lib -lXm -lXt -lX11";
-#	$OPENGLLIBS = "-lGLU -lGL";
-#	$GMTLIBDIR = "/usr/local/GMT4.1/lib";
-#	$GMTINCDIR = "/usr/local/GMT4.1/include";
-#	$NETCDFLIBDIR = "/usr/local/netcdf-3.4/lib";
-#	$NETCDFINCDIR = "/usr/local/netcdf-3.4/include";
-#	$LEVITUS = "/usr/local/mbsystem/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$CFLAGS = "-O -I/usr/openwin/share/include";
-#	$LFLAGS = "-lnsl -lm";
-#
-# Example for installing on SeaBeam Instruments SGI IRIX workstations:
-#	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-#	$OS = "IRIX";
-#	$CFLAGS = "-O2";
-#	$LFLAGS = "-lm -lsun";
-#	$MOTIFINCDIR = "/usr/include/Xm";
-#	$MOTIFLIBS = "-lXm -lXt -lX11";
-#	$GMTLIBDIR = "/usr/local/gmt/src";
-#	$GMTINCDIR = "/usr/local/gmt/src";
-#	$NETCDFLIBDIR = "/usr/local/netcdf/lib";
-#	$NETCDFINCDIR = "/usr/local/netcdf/include";
-#	$LEVITUS = "/usr/local/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#
-# Example for installing on SeaBeam Instruments SGI IRIX 6.4 workstations:
-#	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-#	$OS = "IRIX64";
-#	$CFLAGS = "-O2";
-#	$LFLAGS = "-lm -lsun";
-#	$MOTIFINCDIR = "/usr/include/Xm";
-#	$MOTIFLIBS = "-lXm -lXt -lX11";
-#	$GMTLIBDIR = "/usr/local/gmt/src";
-#	$GMTINCDIR = "/usr/local/gmt/src";
-#	$NETCDFLIBDIR = "/usr/local/netcdf/lib";
-#	$NETCDFINCDIR = "/usr/local/netcdf/include";
-#	$LEVITUS = "/usr/local/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#
-# Example for installing on PC running LINUX:
-#       $MBSYSTEM_HOME = "/usr/local/mbsystem";
-#       $OS = "LINUX";
-#       $CC = "cc";
-#       $CFLAGS = "-g -w";
-#       $LFLAGS = "-L$NETCDFLIBDIR -lm -lnetcdf";
-#       $GRAPHICAL = "YES";
-#       $MOTIFINCDIR = "/usr/X11R6/LessTif/Motif1.2/include";
-#       $MOTIFLIBS = "-L/usr/X11R6/LessTif/Motif1.2/lib -lXm -L/usr/X11R6/lib -lXt -lX11";
-#       $GMTLIBDIR = "/usr/local/GMT4.1/lib";
-#       $GMTINCDIR = "/usr/local/GMT4.1/include";
-#       $NETCDFLIBDIR = "/usr/local/netcdf-3.5.0/lib";
-#       $NETCDFINCDIR = "/usr/local/netcdf-3.5.0/include";
-#       $LEVITUS = "/usr/local/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#
-# Example for installing on Hewlett Packard workstations
-# running HPUX version 9.0X or later:
-#	$MBSYSTEM_HOME = "/usr/local/mbsystem";
-#	$OS = "HPUX";
-#	$CFLAGS = "-Ae +O3 -I/usr/include/X11R5 -I/usr/include/Motif1.2";
-#	$LFLAGS = "-lm ";
-#	$MOTIFINCDIR = "/usr/lib/Motif1.2/Xm";
-#	$MOTIFLIBS = "-Wl,-L/usr/lib/Motif1.2 -Wl, -Wl,-lXm -Wl,-L/usr/lib/X11R5 -Wl,-lX11 -Wl,-lXt";
-#	$GMTLIBDIR = "/usr/local/gmt/src";
-#	$GMTINCDIR = "/usr/local/gmt/src";
-#	$NETCDFLIBDIR = "/usr/local/gmt/lib";
-#	$NETCDFINCDIR = "/usr/local/gmt/include";
-#	$LEVITUS = "/usr/local/levitus/annual";
-#	$PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-#	$FFTWLIBDIR = "/usr/local/fftw/lib";
-#	$FFTWINCDIR = "/usr/local/fftw/include";
-#	$OTPSDIR = "/usr/local/OTPSnc";
-#
-#--------------------------------------------------------------------
-#
-# **** LEAVE EVERYTHING ELSE BELOW ALONE ****
-
-# Program Name:
-$program_name = "install_makefiles";
-
-# check for recognized operating system
-if (!$OS)
-	{
-	$OS = "OTHER";
-	}
-elsif ($OS ne "IRIX"
-	&& $OS ne "IRIX64"
-	&& $OS ne "SOLARIS"
-	&& $OS ne "LINUX"
-	&& $OS ne "LYNX"
-	&& $OS ne "SUN"
-	&& $OS ne "HPUX"
-	&& $OS ne "DARWIN"
-	&& $OS ne "CYGWIN"
-	&& $OS ne "OTHER")
-	{
-	$OS = "OTHER";
-	}
-
-# add operating system to CFLAGS
-$CFLAGS = "$CFLAGS -D$OS";
-
-# add netcdf libraries to LFLAGS
-$LFLAGS = "$LFLAGS -L$NETCDFLIBDIR -lnetcdf";
-
-# add byte swapping to CFLAGS if necessary
-$BYTESWAPTESTSTRING = join(" ", map { sprintf "%#02x", $_ } unpack("C*",pack("L",0x12345678))), "\n";
-if ($BYTESWAPTESTSTRING eq "0x78 0x56 0x34 0x12")
-	{
-	$BYTESWAPPED = "YES";
-	$CFLAGS = "$CFLAGS -DBYTESWAPPED";
-	}
-
-# add __APPLE__ flag to CFLAGS to allow GSF code to build under OSX
-if ($OS eq "DARWIN" || $OS eq "CYGWIN")
-	{
-	$CFLAGS = "$CFLAGS -D__APPLE__";
-	}
-
-# set archiver
-if ($OS eq "LYNX")
-	{
-	$ARCHIVE = "libr rcv";
-	}
-else
-	{
-	$ARCHIVE = "ar rcv";
-	}
-
-# set $GRAPHICAL according to Motif settings
-if ($MOTIFINCDIR && $MOTIFLIBS)
-	{
-	$GRAPHICAL = "YES";
-	}
-else
-	{
-	$GRAPHICAL = "NO";
-	}
-
-# set $BIGFLAG for compiling mbgrid.c under IRIX
-if ($OS eq "IRIX")
-	{
-	$BIGFLAG = "-Olimit 2000";
-	}
-elsif ($OS eq "IRIX64")
-	{
-	$BIGFLAG = "-OPT:Olimit=5000";
-	$OS = "IRIX";
-	}
-else
-	{
-	$BIGFLAG = "";
-	}
-
-# outputting attributes:
-print "\nParameters defined for Makefiles:\n";
-print "Mb-System Home:            $MBSYSTEM_HOME\n";
-print "Operating System:          $OS\n";
-print join(" ", map { sprintf "%#02x", $_ } unpack("C*",pack("L",0x12345678))), "\n";
-if ($BYTESWAPPED eq "YES")
-	{
-	print "Byte swapping:             enabled\n";
-	}
-else
-	{
-	print "Byte swapping:             disabled\n";
-	}
-if ($CC)
-	{
-	print "C Compiler:                $CC\n";
-	}
-print "C Compile Flags:           $CFLAGS\n";
-print "Load Flags:                $LFLAGS\n";
-print "Library Archiver:          $ARCHIVE\n";
-if ($GRAPHICAL eq "YES")
-	{
-	print "Graphical Utilities:       enabled\n";
-	}
-else
-	{
-	print "Graphical Utilities:       disabled\n";
-	}
-print "Motif Include Location:    $MOTIFINCDIR\n";
-print "Motif Libraries:           $MOTIFLIBS\n";
-print "OpenGL Libraries:          $OPENGLLIBS\n";
-print "GMT Library Location:      $GMTLIBDIR\n";
-print "GMT Include Location:      $GMTINCDIR\n";
-print "NetCDF Library Location:   $NETCDFLIBDIR\n";
-print "NetCDF Include Location:   $NETCDFINCDIR\n";
-if ($FFTWLIBDIR)
-	{
-	print "FFTW Library Location:     $FFTWLIBDIR\n";
-	}
-else
-	{
-	print "FFTW Library Location:     Undefined - mbsegypsd will not be built!\n";
-	}
-if ($FFTWINCDIR)
-	{
-	print "FFTW Include Location:     $FFTWINCDIR\n";
-	}
-else
-	{
-	print "FFTW Include Location:     Undefined - mbsegypsd will not be built!\n";
-	}
-if ($OTPSDIR)
-	{
-	print "OTPSnc Installation:       $OTPSDIR\n";
-	}
-else
-	{
-	print "OTPSnc Installation:       Undefined - mbotps will not work!\n";
-	}
-print "Levitus Data Location:     $LEVITUS\n";
-print "Projections Data Location: $PROJECTIONS\n";
-
-# make sure that that the following directories exist:
-#      mbsystem/bin mbsystem/lib mbsystem/include
-#      mbsystem/man mbsystem/man/man1 mbsystem/man/man3
-#      mbsystem/share mbsystem/share/doc mbsystem/share/doc/mbsystem
-#      mbsystem/share/doc/mbsystem/html mbsystem/share/doc/mbsystem/ps
-if (! -d "bin")
-	{
-	`mkdir bin`;
-	print "Created directory: $MBSYSTEM_HOME/bin\n";
-	}
-if (! -d "lib")
-	{
-	`mkdir lib`;
-	print "Created directory: $MBSYSTEM_HOME/lib\n";
-	}
-if (! -d "include")
-	{
-	`mkdir include`;
-	print "Created directory: $MBSYSTEM_HOME/include\n";
-	}
-if (! -d "man")
-	{
-	`mkdir man`;
-	print "Created directory: $MBSYSTEM_HOME/man\n";
-	}
-if (! -d "man/man1")
-	{
-	`mkdir man/man1`;
-	print "Created directory: $MBSYSTEM_HOME/man/man1\n";
-	}
-if (! -d "man/man3")
-	{
-	`mkdir man/man3`;
-	print "Created directory: $MBSYSTEM_HOME/man/man3\n";
-	}
-if (! -d "share")
-	{
-	`mkdir share`;
-	print "Created directory: $MBSYSTEM_HOME/share\n";
-	}
-if (! -d "share/mbsystem")
-	{
-	`mkdir share/mbsystem`;
-	print "Created directory: $MBSYSTEM_HOME/share/mbsystem\n";
-	}
-if (! -d "share/doc")
-	{
-	`mkdir share/doc`;
-	print "Created directory: $MBSYSTEM_HOME/share/doc\n";
-	}
-if (! -d "share/doc/mbsystem")
-	{
-	`mkdir share/doc/mbsystem`;
-	print "Created directory: $MBSYSTEM_HOME/share/doc/mbsystem\n";
-	}
-if (! -d "share/doc/mbsystem/html")
-	{
-	`mkdir share/doc/mbsystem/html`;
-	print "Created directory: $MBSYSTEM_HOME/share/doc/mbsystem/html\n";
-	}
-if (! -d "share/doc/mbsystem/ps")
-	{
-	`mkdir share/doc/mbsystem/ps`;
-	print "Created directory: $MBSYSTEM_HOME/share/doc/mbsystem/ps\n";
-	}
-
-# get filenames
- at files = `ls Makefile.template src/Makefile.template src/*/Makefile.template`;
-while (@files)
-	{
-	# get files
-	$template = shift @files;
-	chop($template);
-	print "\nMakefile Template: $template\n";
-	$pos = 0;
-	while (($tpos = index($template,"/",$pos)) >= 0)
-		{
-		$pos = $tpos + 1;
-		}
-	$path = substr($template,0,$pos);
-	chop($path);
-	if (length($path) == 0)
-		{
-		$path = ".";
-		}
-	$makefile = "$path/Makefile";
-	print "Output Makefile:   $makefile\n";
-
-	# open files
-	open(TMP,"<$template") || die "Cannot open template Makefile $template\nMacro $program_name aborted.\n";
-	open(MAK,">$makefile") || die "Cannot open output Makefile $makefile\nMacro $program_name aborted.\n";
-
-	# loop through the file
-	while (<TMP>)
-		{
-		if (index($_,"MBSYSTEM_HOME",0) == 0)
-			{
-			print MAK "MBSYSTEM_HOME = $MBSYSTEM_HOME\n";
-			}
-		elsif (index($_,"OS",0) == 0)
-			{
-			print MAK "OS = $OS\n";
-			}
-		elsif (index($_,"CC",0) == 0)
-			{
-			if ($CC)
-				{
-				print MAK "CC = $CC\n";
-				}
-			else
-				{
-				print MAK "# C compiler left as default\n";
-				}
-			}
-		elsif (index($_,"CFLAGS",0) == 0)
-			{
-			print MAK "CFLAGS = $CFLAGS\n";
-			}
-		elsif (index($_,"LFLAGS",0) == 0)
-			{
-			print MAK "LFLAGS = $LFLAGS\n";
-			}
-		elsif (index($_,"MOTIFINCDIR",0) == 0)
-			{
-			print MAK "MOTIFINCDIR = $MOTIFINCDIR\n";
-			}
-		elsif (index($_,"MOTIFLIBS",0) == 0)
-			{
-			print MAK "MOTIFLIBS = $MOTIFLIBS\n";
-			}
-		elsif (index($_,"OPENGLLIBS",0) == 0)
-			{
-			print MAK "OPENGLLIBS = $OPENGLLIBS\n";
-			}
-		elsif (index($_,"GMTLIBDIR",0) == 0)
-			{
-			print MAK "GMTLIBDIR = $GMTLIBDIR\n";
-			}
-		elsif (index($_,"GMTINCDIR",0) == 0)
-			{
-			print MAK "GMTINCDIR = $GMTINCDIR\n";
-			}
-		elsif (index($_,"NETCDFLIBDIR",0) == 0)
-			{
-			print MAK "NETCDFLIBDIR = $NETCDFLIBDIR\n";
-			}
-		elsif (index($_,"NETCDFINCDIR",0) == 0)
-			{
-			print MAK "NETCDFINCDIR = $NETCDFINCDIR\n";
-			}
-		elsif (index($_,"FFTWLIBDIR",0) == 0)
-			{
-			if ($FFTWLIBDIR)
-				{
-				print MAK "FFTWLIBDIR = $FFTWLIBDIR\n";
-				}
-			}
-		elsif (index($_,"FFTWINCDIR",0) == 0)
-			{
-			if ($FFTWINCDIR)
-				{
-				print MAK "FFTWINCDIR = $FFTWINCDIR\n";
-				}
-			}
-		elsif (index($_,"OTPSDIR",0) == 0)
-			{
-			if ($OTPSDIR)
-				{
-				print MAK "OTPSDIR = $OTPSDIR\n";
-				}
-			}
-		elsif ($GSFINCDIR && index($_,"GSFINCDIR",0) == 0)
-			{
-			print MAK "GSFINCDIR = $GSFINCDIR\n";
-			}
-		elsif ($GSFLIB && index($_,"GSFLIB",0) == 0)
-			{
-			print MAK "GSFLIB = $GSFLIB\n";
-			}
-		elsif ($PROJINCDIR && index($_,"PROJINCDIR",0) == 0)
-			{
-			print MAK "PROJINCDIR = $PROJINCDIR\n";
-			}
-		elsif ($PROJLIB && index($_,"PROJLIB",0) == 0)
-			{
-			print MAK "PROJLIB = $PROJLIB\n";
-			}
-		elsif (index($_,"LEVITUS",0) == 0)
-			{
-			print MAK "LEVITUS = $LEVITUS\n";
-			}
-		elsif (index($_,"PROJECTIONS",0) == 0)
-			{
-			print MAK "PROJECTIONS = $PROJECTIONS\n";
-			}
-		elsif (index($_,"ARCHIVE",0) == 0)
-			{
-			print MAK "ARCHIVE = $ARCHIVE\n";
-			}
-		elsif (index($_,"BIGFLAG",0) == 0)
-			{
-			print MAK "BIGFLAG = $BIGFLAG\n";
-			}
-		elsif (index($_,"mbsegypsd",0) >= 0 && (!$FFTWLIBDIR || !$FFTWINCDIR))
-			{
-			}
-		elsif (index($_,"fftw",0) >= 0 && (!$FFTWLIBDIR || !$FFTWINCDIR))
-			{
-			}
-		elsif (index($_,"ranlib",0) >= 0 && $OS ne "SUN" && $OS ne "DARWIN")
-			{
-			}
-		elsif (index($_,"catman",0) >= 0 && $OS ne "SUN")
-			{
-			}
-		elsif (index($_,"cd gsf",0) >= 0 && $GSFLIB && $GSFINCDIR)
-			{
-			}
-		elsif (index($_,"cd proj",0) >= 0 && $PROJLIB && $PROJINCDIR)
-			{
-			}
-		elsif (index($_,"cd mbedit",0) >= 0 && $GRAPHICAL ne "YES")
-			{
-			}
-		elsif (index($_,"cd mbeditold",0) >= 0 && $GRAPHICAL ne "YES")
-			{
-			}
-		elsif (index($_,"cd mbvelocitytool",0) >= 0 && $GRAPHICAL ne "YES")
-			{
-			}
-		elsif (index($_,"cd mbnavedit",0) >= 0 && $GRAPHICAL ne "YES")
-			{
-			}
-		elsif (index($_,"cd mbnaveditold",0) >= 0 && $GRAPHICAL ne "YES")
-			{
-			}
-		elsif (index($_,"cd mbnavadjust",0) >= 0 && $GRAPHICAL ne "YES")
-			{
-			}
-		elsif (index($_,"cd mbview",0) >= 0
-					&& ($GRAPHICAL ne "YES"
-						|| !$OPENGLLIBS
-						|| ! -e "src/mbview"))
-			{
-			}
-		else
-			{
-			print MAK "$_";
-			}
-		}
-
-	# close files
-	close TMP;
-	close MAK;
-
-	}
-
-
-print "\nAll done!\n";
-exit 0;
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-    local($[) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/libtool b/libtool
index 1df1aee..34f737e 100755
--- a/libtool
+++ b/libtool
@@ -1,53 +1,51 @@
 #! /bin/sh
-
-# libtool - Provide generalized library-building support services.
-# Generated automatically by config.status (mbsystem) 5.4.2219
+# Generated automatically by config.status (mbsystem) 5.5.2252
 # Libtool was configured on host tharp.shore.mbari.org:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 # The names of the tagged configurations supported by this script.
-available_tags=""
+available_tags=''
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: ${LT_SYS_LIBRARY_PATH=""}
 
 # ### BEGIN LIBTOOL CONFIG
 
 # Which release of libtool.m4 was used?
-macro_version=2.4.2
-macro_revision=1.3337
+macro_version=2.4.6
+macro_revision=2.4.6
 
 # Whether or not to build shared libraries.
 build_libtool_libs=yes
 
 # Whether or not to build static libraries.
-build_old_libs=yes
+build_old_libs=no
 
 # What type of objects to build.
 pic_mode=default
@@ -55,6 +53,9 @@ pic_mode=default
 # Whether or not to optimize for fast installation.
 fast_install=needless
 
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=
+
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
 
@@ -81,13 +82,13 @@ SED="/sw/bin/sed"
 Xsed="$SED -e 1s/^X//"
 
 # A grep program that handles long lines.
-GREP="/usr/bin/grep"
+GREP="/sw/bin/grep"
 
 # An ERE matcher.
-EGREP="/usr/bin/grep -E"
+EGREP="/sw/bin/grep -E"
 
 # A literal string matcher.
-FGREP="/usr/bin/grep -F"
+FGREP="/sw/bin/grep -F"
 
 # A BSD- or MS-compatible name lister.
 NM="/usr/bin/nm"
@@ -164,26 +165,35 @@ lock_old_archive_extraction=yes
 LTCC="gcc"
 
 # LTCC compiler flags.
-LTCFLAGS="-g -Wall -I/opt/X11/include"
+LTCFLAGS="-g -Wall -Wmissing-prototypes -I/opt/X11/include "
 
 # Take the output of nm and produce a listing of raw symbols and C names.
 global_symbol_pipe="sed -n -e 's/^.*[	 ]\\([BCDEGRST][BCDEGRST]*\\)[	 ][	 ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p' | sed '/ __gnu_lto/d'"
 
 # Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[BCDEGRST]* .* \\(.*\\)\$/extern char \\1;/p'"
+global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(.*\\)\$/extern char \\1;/p'"
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=""
 
 # Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[BCDEGRST]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p'"
+global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p'"
 
 # Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[BCDEGRST]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p' -e 's/^[BCDEGRST]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"lib\\2\", (void *) \\&\\2},/p'"
+global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(lib.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(.*\\)\$/  {\"lib\\1\", (void *) \\&\\1},/p'"
+
+# The name lister interface.
+nm_interface="BSD nm"
 
 # Specify filename containing input files for $NM.
 nm_file_list_spec=""
 
-# The root where to search for dependent libraries,and in which our libraries should be installed.
+# The root where to search for dependent libraries,and where our libraries should be installed.
 lt_sysroot=
 
+# Command to truncate a binary pipe.
+lt_truncate_bin="/bin/dd bs=4096 count=1"
+
 # The name of the directory that contains temporary libtool files.
 objdir=.libs
 
@@ -247,10 +257,10 @@ libname_spec="lib\$name"
 
 # List of archive names.  First name is the real one, the rest are links.
 # The last name is the one that the linker finds with -lNAME
-library_names_spec="\${libname}\${release}\${major}\$shared_ext \${libname}\$shared_ext"
+library_names_spec="\$libname\$release\$major\$shared_ext \$libname\$shared_ext"
 
 # The coded name of the library, if different from the real name.
-soname_spec="\${libname}\${release}\${major}\$shared_ext"
+soname_spec="\$libname\$release\$major\$shared_ext"
 
 # Permission mode override for installation of shared libraries.
 install_override_mode=""
@@ -274,9 +284,12 @@ hardcode_into_libs=no
 # Compile-time system search path for libraries.
 sys_lib_search_path_spec="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.0  /usr/local/lib"
 
-# Run-time system search path for libraries.
+# Detected run-time system search path for libraries.
 sys_lib_dlsearch_path_spec="/usr/local/lib /lib /usr/lib"
 
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=""
+
 # Whether dlopen is supported.
 dlopen_support=unknown
 
@@ -296,7 +309,7 @@ LD="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha
 
 # How to create reloadable object files.
 reload_flag=" -r"
-reload_cmds="\$LTCC \$LTCFLAGS -nostdlib \${wl}-r -o \$output\$reload_objs"
+reload_cmds="\$LTCC \$LTCFLAGS -nostdlib \$wl-r -o \$output\$reload_objs"
 
 # Commands used to build an old-style archive.
 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
@@ -332,7 +345,7 @@ allow_libtool_libs_with_static_runtimes=no
 export_dynamic_flag_spec=""
 
 # Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec="\`for conv in \$convenience\\\"\\\"; do test  -n \\\"\$conv\\\" && new_convenience=\\\"\$new_convenience \${wl}-force_load,\$conv\\\"; done; func_echo_all \\\"\$new_convenience\\\"\`"
+whole_archive_flag_spec="\`for conv in \$convenience\\\"\\\"; do test  -n \\\"\$conv\\\" && new_convenience=\\\"\$new_convenience \$wl-force_load,\$conv\\\"; done; func_echo_all \\\"\$new_convenience\\\"\`"
 
 # Whether the compiler copes with passing no objects directly.
 compiler_needs_object="no"
@@ -345,18 +358,18 @@ old_archive_from_expsyms_cmds=""
 
 # Commands used to build a shared archive.
 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module"
-archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module \${wl}-exported_symbols_list,\$output_objdir/\${libname}-symbols.expsym"
+archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module \$wl-exported_symbols_list,\$output_objdir/\$libname-symbols.expsym"
 
 # Commands used to build a loadable module if different from building
 # a shared archive.
 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags"
-module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags \${wl}-exported_symbols_list,\$output_objdir/\${libname}-symbols.expsym"
+module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags \$wl-exported_symbols_list,\$output_objdir/\$libname-symbols.expsym"
 
 # Whether we are building with GNU ld or not.
 with_gnu_ld="no"
 
 # Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag="\${wl}-undefined \${wl}dynamic_lookup"
+allow_undefined_flag="\$wl-undefined \${wl}dynamic_lookup"
 
 # Flag that enforces no undefined symbols.
 no_undefined_flag=""
@@ -368,13 +381,13 @@ hardcode_libdir_flag_spec=""
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=""
 
-# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=no
 
-# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting $shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=no
 
@@ -425,11 +438,70 @@ hardcode_action=immediate
 # ### END LIBTOOL CONFIG
 
 
-# libtool (GNU libtool) 2.4.2
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
+
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -449,874 +521,2112 @@ hardcode_action=immediate
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.2
-TIMESTAMP=""
-package_revision=1.3337
+VERSION=2.4.6
+package_revision=2.4.6
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
 
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
 	fi"
 done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
 
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
 
 
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
 
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
 
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
 
-exit_status=$EXIT_SUCCESS
 
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+		   func_path_progs_result=$func_check_prog_result
+		   ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
 
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
 
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-} # Extended-shell func_dirname implementation
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
 
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
 
-# func_basename file
-func_basename ()
-{
-    func_basename_result="${1##*/}"
-} # Extended-shell func_basename implementation
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
 
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
 
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"
-} # Extended-shell func_dirname_and_basename implementation
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
 
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}
-} # Extended-shell func_stripname implementation
-
-
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
 
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-#             value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
       fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
-      "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
 }
 
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
-        ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
-        ;;
-      *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
-        ;;
-    esac
-  done
 
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
 
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
-}
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
 
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
+: ${CP="cp -f"}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 
-# Make sure we have an absolute path for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=$func_dirname_result
-     progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
-     ;;
-  *)
-     save_IFS="$IFS"
-     IFS=${PATH_SEPARATOR-:}
-     for progdir in $PATH; do
-       IFS="$save_IFS"
-       test -x "$progdir/$progname" && break
-     done
-     IFS="$save_IFS"
-     test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
-     ;;
-esac
+
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
+
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
 
 # Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
 # Sed substitution that turns a string into a regex matching for the
 # string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
 
 # Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
+# that contains forward slashes, into one that contains
 # (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
 sed_double_backslash="\
-  s/$bs4/&\\
+  s/$_G_bs4/&\\
 /g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
   s/\n//g"
 
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
 
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
 
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
 
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
 
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
+
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
+
+# Make sure we have an absolute progpath for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
+     progdir=`cd "$progdir" && pwd`
+     progpath=$progdir/$progname
+     ;;
+  *)
+     _G_IFS=$IFS
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS=$_G_IFS
+       test -x "$progdir/$progname" && break
+     done
+     IFS=$_G_IFS
+     test -n "$progdir" || progdir=`pwd`
+     progpath=$progdir/$progname
+     ;;
+esac
+
+
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
+
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
+
+opt_dry_run=false
+opt_quiet=false
+opt_verbose=false
+
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
 {
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
+
+    require_term_colors=:
 }
 
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
 {
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+    $debug_cmd
 
-    # bash bug again:
-    :
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
 }
 
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
 {
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
 }
 
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
 {
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
 }
-help="Try \`$progname --help' for more information."  ## default
 
 
-# func_grep expression filename
+# func_grep EXPRESSION FILENAME
+# -----------------------------
 # Check whether EXPRESSION matches any line of FILENAME, without output.
 func_grep ()
 {
+    $debug_cmd
+
     $GREP "$1" "$2" >/dev/null 2>&1
 }
 
 
-# func_mkdir_p directory-path
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
 # Make sure the entire path to DIRECTORY-PATH is available.
 func_mkdir_p ()
 {
-    my_directory_path="$1"
-    my_dir_list=
+    $debug_cmd
 
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+    _G_directory_path=$1
+    _G_dir_list=
 
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
       esac
 
       # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
+      while test ! -d "$_G_directory_path"; do
         # ...make a list in topmost first order.  Use a colon delimited
 	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
+        _G_dir_list=$_G_directory_path:$_G_dir_list
 
         # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
+        case $_G_directory_path in */*) ;; *) break ;; esac
 
         # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
       done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
 
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
         # try to create one of the directories concurrently.  Don't
         # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
+        $MKDIR "$_G_dir" 2>/dev/null || :
       done
-      IFS="$save_mkdir_p_IFS"
+      IFS=$func_mkdir_p_IFS
 
       # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
     fi
 }
 
 
-# func_mktempdir [string]
+# func_mktempdir [BASENAME]
+# -------------------------
 # Make a temporary directory that won't clash with other running
 # libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
+# given, BASENAME is the basename for that directory.
 func_mktempdir ()
 {
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
 
-    if test "$opt_dry_run" = ":"; then
+    if test : = "$opt_dry_run"; then
       # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
+      _G_tmpdir=$_G_template-$$
     else
 
       # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
 
-      if test ! -d "$my_tmpdir"; then
+      if test ! -d "$_G_tmpdir"; then
         # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
 
-        save_mktempdir_umask=`umask`
+        func_mktempdir_umask=`umask`
         umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
+      "")
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
+        ;;
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
+        ;;
+      *)
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+        ;;
+    esac
+
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
+
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
     fi
 
-    $ECHO "$my_tmpdir"
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
+    fi
+
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
 }
 
 
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
 func_quote_for_eval ()
 {
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    $debug_cmd
+
     case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *[\\\`\"]*)
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
-        func_quote_for_eval_unquoted_result="$1" ;;
+        _G_arg=$1 ;;
     esac
 
-    case $func_quote_for_eval_unquoted_result in
+    case $_G_arg in
       # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
+      # word splitting and command substitution for a subsequent eval.
       # Many Bourne shells cannot handle close brackets correctly
       # in scan sets, so we specify it separately.
       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        _G_arg=\"$_G_arg\"
         ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
     esac
+
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
 }
 
 
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
 {
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
+    $debug_cmd
 
-    case $my_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
-        ;;
-    esac
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
 
-    func_quote_for_expand_result="$my_arg"
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
 }
 
 
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
 }
 
 
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    func_parse_options_result=
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
 
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
+
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
+
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
+
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
 }
 
 
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+    func_run_hooks func_validate_options ${1+"$@"}
+
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
 }
 
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+
+
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
 }
 
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
 func_help ()
 {
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
 }
 
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
 # Echo program name prefixed message to standard error and set global
 # exit_cmd.
 func_missing_arg ()
 {
-    $opt_debug
+    $debug_cmd
 
-    func_error "missing argument for $1."
+    func_error "Missing argument for '$1'."
     exit_cmd=exit
 }
 
 
-# func_split_short_opt shortopt
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
 # Set func_split_short_opt_name and func_split_short_opt_arg shell
 # variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
 {
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
-} # Extended-shell func_split_short_opt implementation
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
 
 
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
 {
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}
-} # Extended-shell func_split_long_opt implementation
+    $debug_cmd
 
-exit_cmd=:
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
 
 
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
 
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
 
+    exit $?
+}
 
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
 
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
 
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
 
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-    eval "${1}+=\${2}"
-} # Extended-shell func_append implementation
 
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
 {
-    func_quote_for_eval "${2}"
-    eval "${1}+=\\ \$func_quote_for_eval_result"
-} # Extended-shell func_append_quoted implementation
+    $debug_cmd
 
+    _G_message=$*
 
-# func_arith arithmetic-term...
-func_arith ()
-{
-    func_arith_result=$(( $* ))
-} # Extended-shell func_arith implementation
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
 
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
 {
-    func_len_result=${#1}
-} # Extended-shell func_len implementation
+    $debug_cmd
 
+    $warning_func ${1+"$@"}
+}
 
-# func_lo2o object
-func_lo2o ()
-{
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac
-} # Extended-shell func_lo2o implementation
 
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
 
-# func_xform libobj-or-source
-func_xform ()
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
 {
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname (GNU libtool) 2.4.6
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool at gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
     func_xform_result=${1%.*}.lo
-} # Extended-shell func_xform implementation
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
 
 
-# func_fatal_configuration arg...
+# func_fatal_configuration ARG...
+# -------------------------------
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
 func_fatal_configuration ()
 {
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
 }
 
 
 # func_config
+# -----------
 # Display the configuration for all the tags in this script.
 func_config ()
 {
@@ -1334,17 +2644,19 @@ func_config ()
     exit $?
 }
 
+
 # func_features
+# -------------
 # Display the features supported by this script.
 func_features ()
 {
     echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       echo "enable shared libraries"
     else
       echo "disable shared libraries"
     fi
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       echo "enable static libraries"
     else
       echo "disable static libraries"
@@ -1353,314 +2665,350 @@ func_features ()
     exit $?
 }
 
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
 # Verify that TAGNAME is valid, and either flag an error and exit, or
 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
 # variable here.
 func_enable_tag ()
 {
-  # Global variable:
-  tagname="$1"
+    # Global variable:
+    tagname=$1
 
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
 
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
 
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
     *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
+
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
 }
 
+
 # func_check_version_match
+# ------------------------
 # Ensure that we are using m4 macros, and libtool script from the same
 # release of libtool.
 func_check_version_match ()
 {
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from an older release.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      else
-        cat >&2 <<_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
 $progname: of $PACKAGE $VERSION and run autoconf again.
 _LT_EOF
-    fi
+      fi
 
-    exit $EXIT_MISMATCH
-  fi
+      exit $EXIT_MISMATCH
+    fi
 }
 
 
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
 
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
 
+    nonopt=
+    preserve_args=
 
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
+    esac
+
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
 
 
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
 {
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-preserve_args+=" $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-preserve_args+=" $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-preserve_args+=" $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-preserve_args+=" $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-preserve_args+=" $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-preserve_args+=" $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
-
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
-
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-    esac
-  done
+    $debug_cmd
 
-  # Validate options:
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+	# An option not handled by this hook function:
+        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+      esac
+    done
 
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
 
-  # preserve --debug
-  test "$opt_debug" = : || preserve_args+=" --debug"
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
 
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
 
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
 
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
     fi
 
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
 
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
 
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
 
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
+
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
 
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
 }
+func_add_hook func_validate_options libtool_validate_options
 
 
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
 
 
 ## ----------- ##
 ##    Main.    ##
 ## ----------- ##
 
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
 # func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function is only a basic sanity check; it will hardly flush out
 # determined imposters.
 func_lalib_p ()
 {
     test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function implements the same check as func_lalib_p without
 # resorting to external programs.  To this end, it redirects stdin and
 # closes it afterwards, without saving the original file descriptor.
 # As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
+# fatal anyway.  Works if 'file' does not exist.
 func_lalib_unsafe_p ()
 {
     lalib_p=no
@@ -1668,13 +3016,13 @@ func_lalib_unsafe_p ()
 	for lalib_p_l in 1 2 3 4
 	do
 	    read lalib_p_line
-	    case "$lalib_p_line" in
+	    case $lalib_p_line in
 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
 	    esac
 	done
 	exec 0<&5 5<&-
     fi
-    test "$lalib_p" = yes
+    test yes = "$lalib_p"
 }
 
 # func_ltwrapper_script_p file
@@ -1683,7 +3031,8 @@ func_lalib_unsafe_p ()
 # determined imposters.
 func_ltwrapper_script_p ()
 {
-    func_lalib_p "$1"
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_ltwrapper_executable_p file
@@ -1708,7 +3057,7 @@ func_ltwrapper_scriptname ()
 {
     func_dirname_and_basename "$1" "" "."
     func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
 }
 
 # func_ltwrapper_p file
@@ -1727,11 +3076,13 @@ func_ltwrapper_p ()
 # FAIL_CMD may read-access the current command in variable CMD!
 func_execute_cmds ()
 {
-    $opt_debug
+    $debug_cmd
+
     save_ifs=$IFS; IFS='~'
     for cmd in $1; do
-      IFS=$save_ifs
+      IFS=$sp$nl
       eval cmd=\"$cmd\"
+      IFS=$save_ifs
       func_show_eval "$cmd" "${2-:}"
     done
     IFS=$save_ifs
@@ -1743,10 +3094,11 @@ func_execute_cmds ()
 # Note that it is not necessary on cygwin/mingw to append a dot to
 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
 func_source ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $1 in
     */* | *\\*)	. "$1" ;;
     *)		. "./$1" ;;
@@ -1773,10 +3125,10 @@ func_resolve_sysroot ()
 # store the result into func_replace_sysroot_result.
 func_replace_sysroot ()
 {
-  case "$lt_sysroot:$1" in
+  case $lt_sysroot:$1 in
   ?*:"$lt_sysroot"*)
     func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
+    func_replace_sysroot_result='='$func_stripname_result
     ;;
   *)
     # Including no sysroot.
@@ -1793,7 +3145,8 @@ func_replace_sysroot ()
 # arg is usually of the form 'gcc ...'
 func_infer_tag ()
 {
-    $opt_debug
+    $debug_cmd
+
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -1812,7 +3165,7 @@ func_infer_tag ()
 	for z in $available_tags; do
 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
@@ -1837,7 +3190,7 @@ func_infer_tag ()
 	# line option must be used.
 	if test -z "$tagname"; then
 	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
+	  func_fatal_error "specify a tag with '--tag'"
 #	else
 #	  func_verbose "using $tagname tagged configuration"
 	fi
@@ -1853,15 +3206,15 @@ func_infer_tag ()
 # but don't create it if we're doing a dry run.
 func_write_libtool_object ()
 {
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
     else
       write_lobj=none
     fi
 
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
     else
       write_oldobj=none
     fi
@@ -1869,7 +3222,7 @@ func_write_libtool_object ()
     $opt_dry_run || {
       cat >${write_libobj}T <<EOF
 # $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -1881,7 +3234,7 @@ pic_object=$write_lobj
 non_pic_object=$write_oldobj
 
 EOF
-      $MV "${write_libobj}T" "${write_libobj}"
+      $MV "${write_libobj}T" "$write_libobj"
     }
 }
 
@@ -1901,8 +3254,9 @@ EOF
 # be empty on error (or when ARG is empty)
 func_convert_core_file_wine_to_w32 ()
 {
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
   if test -n "$1"; then
     # Unfortunately, winepath does not exit with a non-zero error code, so we
     # are forced to check the contents of stdout. On the other hand, if the
@@ -1910,9 +3264,9 @@ func_convert_core_file_wine_to_w32 ()
     # *an error message* to stdout. So we must check for both error code of
     # zero AND non-empty stdout, which explains the odd construction:
     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
+        $SED -e "$sed_naive_backslashify"`
     else
       func_convert_core_file_wine_to_w32_result=
     fi
@@ -1933,18 +3287,19 @@ func_convert_core_file_wine_to_w32 ()
 # are convertible, then the result may be empty.
 func_convert_core_path_wine_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
+  func_convert_core_path_wine_to_w32_result=
   if test -n "$1"; then
     oldIFS=$IFS
     IFS=:
     for func_convert_core_path_wine_to_w32_f in $1; do
       IFS=$oldIFS
       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
         if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
         else
           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
         fi
@@ -1973,7 +3328,8 @@ func_convert_core_path_wine_to_w32 ()
 # environment variable; do not put it in $PATH.
 func_cygpath ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     if test "$?" -ne 0; then
@@ -1982,7 +3338,7 @@ func_cygpath ()
     fi
   else
     func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
   fi
 }
 #end: func_cygpath
@@ -1993,10 +3349,11 @@ func_cygpath ()
 # result in func_convert_core_msys_to_w32_result.
 func_convert_core_msys_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # awkward: cmd appends spaces to result
   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
 }
 #end: func_convert_core_msys_to_w32
 
@@ -2007,13 +3364,14 @@ func_convert_core_msys_to_w32 ()
 # func_to_host_file_result to ARG1).
 func_convert_file_check ()
 {
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
     func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
+    func_error "  '$1'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback:
-    func_to_host_file_result="$1"
+    func_to_host_file_result=$1
   fi
 }
 # end func_convert_file_check
@@ -2025,10 +3383,11 @@ func_convert_file_check ()
 # func_to_host_file_result to a simplistic fallback value (see below).
 func_convert_path_check ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$4" && test -n "$3"; then
     func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
+    func_error "  '$3'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback.  This is a deliberately simplistic "conversion" and
     # should not be "improved".  See libtool.info.
@@ -2037,7 +3396,7 @@ func_convert_path_check ()
       func_to_host_path_result=`echo "$3" |
         $SED -e "$lt_replace_pathsep_chars"`
     else
-      func_to_host_path_result="$3"
+      func_to_host_path_result=$3
     fi
   fi
 }
@@ -2049,13 +3408,14 @@ func_convert_path_check ()
 # and appending REPL if ORIG matches BACKPAT.
 func_convert_path_front_back_pathsep ()
 {
-  $opt_debug
+  $debug_cmd
+
   case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
     ;;
   esac
   case $4 in
-  $2 ) func_to_host_path_result+="$3"
+  $2 ) func_append func_to_host_path_result "$3"
     ;;
   esac
 }
@@ -2065,7 +3425,7 @@ func_convert_path_front_back_pathsep ()
 ##################################################
 # $build to $host FILE NAME CONVERSION FUNCTIONS #
 ##################################################
-# invoked via `$to_host_file_cmd ARG'
+# invoked via '$to_host_file_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # Result will be available in $func_to_host_file_result.
@@ -2076,7 +3436,8 @@ func_convert_path_front_back_pathsep ()
 # in func_to_host_file_result.
 func_to_host_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   $to_host_file_cmd "$1"
 }
 # end func_to_host_file
@@ -2088,7 +3449,8 @@ func_to_host_file ()
 # in (the comma separated) LAZY, no conversion takes place.
 func_to_tool_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   case ,$2, in
     *,"$to_tool_file_cmd",*)
       func_to_tool_file_result=$1
@@ -2106,7 +3468,7 @@ func_to_tool_file ()
 # Copy ARG to func_to_host_file_result.
 func_convert_file_noop ()
 {
-  func_to_host_file_result="$1"
+  func_to_host_file_result=$1
 }
 # end func_convert_file_noop
 
@@ -2117,11 +3479,12 @@ func_convert_file_noop ()
 # func_to_host_file_result.
 func_convert_file_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -2133,8 +3496,9 @@ func_convert_file_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_file_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     # LT_CYGPATH in this case.
@@ -2150,11 +3514,12 @@ func_convert_file_cygwin_to_w32 ()
 # and a working winepath. Returns result in func_to_host_file_result.
 func_convert_file_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -2166,12 +3531,13 @@ func_convert_file_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_file_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
     func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -2184,13 +3550,14 @@ func_convert_file_msys_to_cygwin ()
 # in func_to_host_file_result.
 func_convert_file_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
     func_convert_core_file_wine_to_w32 "$1"
     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -2200,7 +3567,7 @@ func_convert_file_nix_to_cygwin ()
 #############################################
 # $build to $host PATH CONVERSION FUNCTIONS #
 #############################################
-# invoked via `$to_host_path_cmd ARG'
+# invoked via '$to_host_path_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # The result will be available in $func_to_host_path_result.
@@ -2224,10 +3591,11 @@ func_convert_file_nix_to_cygwin ()
 to_host_path_cmd=
 func_init_to_host_path_cmd ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$to_host_path_cmd"; then
     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
   fi
 }
 
@@ -2237,7 +3605,8 @@ func_init_to_host_path_cmd ()
 # in func_to_host_path_result.
 func_to_host_path ()
 {
-  $opt_debug
+  $debug_cmd
+
   func_init_to_host_path_cmd
   $to_host_path_cmd "$1"
 }
@@ -2248,7 +3617,7 @@ func_to_host_path ()
 # Copy ARG to func_to_host_path_result.
 func_convert_path_noop ()
 {
-  func_to_host_path_result="$1"
+  func_to_host_path_result=$1
 }
 # end func_convert_path_noop
 
@@ -2259,8 +3628,9 @@ func_convert_path_noop ()
 # func_to_host_path_result.
 func_convert_path_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from ARG.  MSYS
     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -2268,7 +3638,7 @@ func_convert_path_msys_to_w32 ()
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -2282,8 +3652,9 @@ func_convert_path_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_path_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
@@ -2302,14 +3673,15 @@ func_convert_path_cygwin_to_w32 ()
 # a working winepath.  Returns result in func_to_host_file_result.
 func_convert_path_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -2323,15 +3695,16 @@ func_convert_path_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_path_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -2346,8 +3719,9 @@ func_convert_path_msys_to_cygwin ()
 # func_to_host_file_result.
 func_convert_path_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from
     # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -2356,7 +3730,7 @@ func_convert_path_nix_to_cygwin ()
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -2365,13 +3739,31 @@ func_convert_path_nix_to_cygwin ()
 # end func_convert_path_nix_to_cygwin
 
 
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
-    $opt_debug
+    $debug_cmd
+
     # Get the compilation command and the source file.
     base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
     suppress_opt=yes
     suppress_output=
     arg_mode=normal
@@ -2384,12 +3776,12 @@ func_mode_compile ()
       case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
+	lastarg=$arg
 	arg_mode=normal
 	;;
 
       target )
-	libobj="$arg"
+	libobj=$arg
 	arg_mode=normal
 	continue
 	;;
@@ -2399,18 +3791,18 @@ func_mode_compile ()
 	case $arg in
 	-o)
 	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
+	    func_fatal_error "you cannot specify '-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
 
 	-pie | -fpie | -fPIE)
-          pie_flag+=" $arg"
+          func_append pie_flag " $arg"
 	  continue
 	  ;;
 
 	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  later+=" $arg"
+	  func_append later " $arg"
 	  continue
 	  ;;
 
@@ -2428,17 +3820,17 @@ func_mode_compile ()
 	  func_stripname '-Wc,' '' "$arg"
 	  args=$func_stripname_result
 	  lastarg=
-	  save_ifs="$IFS"; IFS=','
+	  save_ifs=$IFS; IFS=,
 	  for arg in $args; do
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 	    func_append_quoted lastarg "$arg"
 	  done
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
 	  # Add the arguments to base_compile.
-	  base_compile+=" $lastarg"
+	  func_append base_compile " $lastarg"
 	  continue
 	  ;;
 
@@ -2446,8 +3838,8 @@ func_mode_compile ()
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
+	  lastarg=$srcfile
+	  srcfile=$arg
 	  ;;
 	esac  #  case $arg
 	;;
@@ -2462,13 +3854,13 @@ func_mode_compile ()
       func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      func_fatal_error "you must specify a target with \`-o'"
+      func_fatal_error "you must specify a target with '-o'"
       ;;
     *)
       # Get the name of the library object.
       test -z "$libobj" && {
 	func_basename "$srcfile"
-	libobj="$func_basename_result"
+	libobj=$func_basename_result
       }
       ;;
     esac
@@ -2488,7 +3880,7 @@ func_mode_compile ()
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      func_fatal_error "cannot determine name of library object from '$libobj'"
       ;;
     esac
 
@@ -2497,8 +3889,8 @@ func_mode_compile ()
     for arg in $later; do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	continue
 	;;
@@ -2524,17 +3916,17 @@ func_mode_compile ()
     func_quote_for_eval "$libobj"
     test "X$libobj" != "X$func_quote_for_eval_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
 
     test -z "$base_compile" && \
       func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       removelist="$obj $lobj $libobj ${libobj}T"
     else
       removelist="$lobj $libobj ${libobj}T"
@@ -2546,16 +3938,16 @@ func_mode_compile ()
       pic_mode=default
       ;;
     esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
 
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
     else
       output_obj=
       need_locks=no
@@ -2564,12 +3956,12 @@ func_mode_compile ()
 
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
+    if test yes = "$need_locks"; then
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
-    elif test "$need_locks" = warn; then
+    elif test warn = "$need_locks"; then
       if test -f "$lockfile"; then
 	$ECHO "\
 *** ERROR, $lockfile exists and contains:
@@ -2577,7 +3969,7 @@ func_mode_compile ()
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2585,12 +3977,12 @@ compiler."
 	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
-      removelist+=" $output_obj"
+      func_append removelist " $output_obj"
       $ECHO "$srcfile" > "$lockfile"
     fi
 
     $opt_dry_run || $RM $removelist
-    removelist+=" $lockfile"
+    func_append removelist " $lockfile"
     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
 
     func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
@@ -2599,11 +3991,11 @@ compiler."
     qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
-      if test "$pic_mode" != no; then
+      if test no != "$pic_mode"; then
 	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
@@ -2614,13 +4006,13 @@ compiler."
 
       if test -z "$output_obj"; then
 	# Place PIC objects in $objdir
-	command+=" -o $lobj"
+	func_append command " -o $lobj"
       fi
 
       func_show_eval_locale "$command"	\
           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2631,7 +4023,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2647,29 +4039,29 @@ compiler."
       fi
 
       # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
+      if test yes = "$suppress_opt"; then
 	suppress_output=' >/dev/null 2>&1'
       fi
     fi
 
     # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
 	# Don't build PIC code
 	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
-      if test "$compiler_c_o" = yes; then
-	command+=" -o $obj"
+      if test yes = "$compiler_c_o"; then
+	func_append command " -o $obj"
       fi
 
       # Suppress compiler output if we already did a PIC compilation.
-      command+="$suppress_output"
+      func_append command "$suppress_output"
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2680,7 +4072,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2700,7 +4092,7 @@ compiler."
       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
       # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
+      if test no != "$need_locks"; then
 	removelist=$lockfile
         $RM "$lockfile"
       fi
@@ -2710,7 +4102,7 @@ compiler."
 }
 
 $opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
@@ -2730,7 +4122,7 @@ func_mode_help ()
 Remove files from the build directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, object or program, all the files associated
@@ -2749,16 +4141,16 @@ This mode accepts the following additional options:
   -no-suppress      do not suppress compiler output for multiple passes
   -prefer-pic       try to build PIC objects only
   -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
   -Wc,FLAG          pass FLAG directly to the compiler
 
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
 from the given SOURCEFILE.
 
 The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
         ;;
 
       execute)
@@ -2771,7 +4163,7 @@ This mode accepts the following additional options:
 
   -dlopen FILE      add the directory containing FILE to the library path
 
-This mode sets the library path environment variable according to \`-dlopen'
+This mode sets the library path environment variable according to '-dlopen'
 flags.
 
 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2790,7 +4182,7 @@ Complete the installation of libtool libraries.
 Each LIBDIR is a directory that contains libtool libraries.
 
 The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
+the '--dry-run' option if you just want to see what would be executed."
         ;;
 
       install)
@@ -2800,7 +4192,7 @@ the \`--dry-run' option if you just want to see what would be executed."
 Install executables or libraries.
 
 INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
@@ -2826,7 +4218,7 @@ The following components of LINK-COMMAND are treated specially:
   -avoid-version    do not add a version suffix if possible
   -bindir BINDIR    specify path to binaries directory (for systems where
                     libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
@@ -2840,7 +4232,8 @@ The following components of LINK-COMMAND are treated specially:
   -no-install       link a not-installable executable
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -objectlist FILE  use a list of object files found in FILE to specify objects
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
   -precious-files-regex REGEX
                     don't remove output files matching REGEX
   -release RELEASE  specify package release information
@@ -2860,20 +4253,20 @@ The following components of LINK-COMMAND are treated specially:
   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
 
-Every other argument is treated as a filename.  Files ending in \`.la' are
+Every other argument is treated as a filename.  Files ending in '.la' are
 treated as uninstalled libtool libraries, other files are standard or library
 object files.
 
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
 required, except when creating a convenience library.
 
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
 
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
 is created, otherwise an executable program is created."
         ;;
 
@@ -2884,7 +4277,7 @@ is created, otherwise an executable program is created."
 Remove libraries from an installation directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, all the files associated with it are deleted.
@@ -2892,17 +4285,17 @@ Otherwise, only FILE itself is deleted using RM."
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
+        func_fatal_help "invalid operation mode '$opt_mode'"
         ;;
     esac
 
     echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
+    $ECHO "Try '$progname --help' for more information about other modes."
 }
 
 # Now that we've collected a possible --mode arg, show help if necessary
 if $opt_help; then
-  if test "$opt_help" = :; then
+  if test : = "$opt_help"; then
     func_mode_help
   else
     {
@@ -2910,7 +4303,7 @@ if $opt_help; then
       for opt_mode in compile link execute install finish uninstall clean; do
 	func_mode_help
       done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
     {
       func_help noexit
       for opt_mode in compile link execute install finish uninstall clean; do
@@ -2918,7 +4311,7 @@ if $opt_help; then
 	func_mode_help
       done
     } |
-    sed '1d
+    $SED '1d
       /^When reporting/,/^Report/{
 	H
 	d
@@ -2935,16 +4328,17 @@ fi
 # func_mode_execute arg...
 func_mode_execute ()
 {
-    $opt_debug
+    $debug_cmd
+
     # The first argument is the command name.
-    cmd="$nonopt"
+    cmd=$nonopt
     test -z "$cmd" && \
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
     for file in $opt_dlopen; do
       test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
+	|| func_fatal_help "'$file' is not a file"
 
       dir=
       case $file in
@@ -2954,7 +4348,7 @@ func_mode_execute ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
 
 	# Read the libtool library.
 	dlname=
@@ -2965,18 +4359,18 @@ func_mode_execute ()
 	if test -z "$dlname"; then
 	  # Warn if it was a shared library.
 	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	    func_warning "'$file' was not linked with '-export-dynamic'"
 	  continue
 	fi
 
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 
 	if test -f "$dir/$objdir/$dlname"; then
-	  dir+="/$objdir"
+	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
 	  fi
 	fi
 	;;
@@ -2984,18 +4378,18 @@ func_mode_execute ()
       *.lo)
 	# Just add the directory containing the .lo file.
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	;;
 
       *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
 	continue
 	;;
       esac
 
       # Get the absolute pathname.
       absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
+      test -n "$absdir" && dir=$absdir
 
       # Now add the directory to shlibpath_var.
       if eval "test -z \"\$$shlibpath_var\""; then
@@ -3007,7 +4401,7 @@ func_mode_execute ()
 
     # This variable tells wrapper scripts just to set shlibpath_var
     # rather than running their programs.
-    libtool_execute_magic="$magic"
+    libtool_execute_magic=$magic
 
     # Check if any of the arguments is a wrapper script.
     args=
@@ -3020,12 +4414,12 @@ func_mode_execute ()
 	if func_ltwrapper_script_p "$file"; then
 	  func_source "$file"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	elif func_ltwrapper_executable_p "$file"; then
 	  func_ltwrapper_scriptname "$file"
 	  func_source "$func_ltwrapper_scriptname_result"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	fi
 	;;
       esac
@@ -3033,7 +4427,15 @@ func_mode_execute ()
       func_append_quoted args "$file"
     done
 
-    if test "X$opt_dry_run" = Xfalse; then
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
       if test -n "$shlibpath_var"; then
 	# Export the shlibpath_var.
 	eval "export $shlibpath_var"
@@ -3050,25 +4452,18 @@ func_mode_execute ()
       done
 
       # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
+      exec_cmd=\$cmd$args
     fi
 }
 
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
-    $opt_debug
+    $debug_cmd
+
     libs=
     libdirs=
     admincmds=
@@ -3076,17 +4471,17 @@ func_mode_finish ()
     for opt in "$nonopt" ${1+"$@"}
     do
       if test -d "$opt"; then
-	libdirs+=" $opt"
+	func_append libdirs " $opt"
 
       elif test -f "$opt"; then
 	if func_lalib_unsafe_p "$opt"; then
-	  libs+=" $opt"
+	  func_append libs " $opt"
 	else
-	  func_warning "\`$opt' is not a valid libtool archive"
+	  func_warning "'$opt' is not a valid libtool archive"
 	fi
 
       else
-	func_fatal_error "invalid argument \`$opt'"
+	func_fatal_error "invalid argument '$opt'"
       fi
     done
 
@@ -3101,12 +4496,12 @@ func_mode_finish ()
       # Remove sysroot references
       if $opt_dry_run; then
         for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
         done
       else
         tmpdir=`func_mktempdir`
         for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 	    > $tmpdir/tmp-la
 	  mv -f $tmpdir/tmp-la $lib
 	done
@@ -3124,14 +4519,14 @@ func_mode_finish ()
 	if test -n "$finish_eval"; then
 	  # Do the single finish_eval.
 	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || admincmds+="
+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
        $cmds"
 	fi
       done
     fi
 
     # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
+    $opt_quiet && exit $EXIT_SUCCESS
 
     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       echo "----------------------------------------------------------------------"
@@ -3142,27 +4537,27 @@ func_mode_finish ()
       echo
       echo "If you ever happen to want to link against installed libraries"
       echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
       echo "flag during linking and do at least one of the following:"
       if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
 	echo "     during execution"
       fi
       if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
 	echo "     during linking"
       fi
       if test -n "$hardcode_libdir_flag_spec"; then
 	libdir=LIBDIR
 	eval flag=\"$hardcode_libdir_flag_spec\"
 
-	$ECHO "   - use the \`$flag' linker flag"
+	$ECHO "   - use the '$flag' linker flag"
       fi
       if test -n "$admincmds"; then
 	$ECHO "   - have your system administrator run these commands:$admincmds"
       fi
       if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
       fi
       echo
 
@@ -3181,18 +4576,20 @@ func_mode_finish ()
     exit $EXIT_SUCCESS
 }
 
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
 func_mode_install ()
 {
-    $opt_debug
+    $debug_cmd
+
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
        # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -3206,7 +4603,7 @@ func_mode_install ()
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
     func_quote_for_eval "$arg"
-    install_prog+="$func_quote_for_eval_result"
+    func_append install_prog "$func_quote_for_eval_result"
     install_shared_prog=$install_prog
     case " $install_prog " in
       *[\\\ /]cp\ *) install_cp=: ;;
@@ -3219,20 +4616,20 @@ func_mode_install ()
     opts=
     prev=
     install_type=
-    isdir=no
+    isdir=false
     stripme=
     no_mode=:
     for arg
     do
       arg2=
       if test -n "$dest"; then
-	files+=" $dest"
+	func_append files " $dest"
 	dest=$arg
 	continue
       fi
 
       case $arg in
-      -d) isdir=yes ;;
+      -d) isdir=: ;;
       -f)
 	if $install_cp; then :; else
 	  prev=$arg
@@ -3250,7 +4647,7 @@ func_mode_install ()
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
 	    arg2=$install_override_mode
 	    no_mode=false
 	  fi
@@ -3264,23 +4661,23 @@ func_mode_install ()
 
       # Aesthetically quote the argument.
       func_quote_for_eval "$arg"
-      install_prog+=" $func_quote_for_eval_result"
+      func_append install_prog " $func_quote_for_eval_result"
       if test -n "$arg2"; then
 	func_quote_for_eval "$arg2"
       fi
-      install_shared_prog+=" $func_quote_for_eval_result"
+      func_append install_shared_prog " $func_quote_for_eval_result"
     done
 
     test -z "$install_prog" && \
       func_fatal_help "you must specify an install program"
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
+      func_fatal_help "the '$prev' option requires an argument"
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
 	func_quote_for_eval "$install_override_mode"
-	install_shared_prog+=" -m $func_quote_for_eval_result"
+	func_append install_shared_prog " -m $func_quote_for_eval_result"
       fi
     fi
 
@@ -3297,19 +4694,19 @@ func_mode_install ()
     dest=$func_stripname_result
 
     # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
       destname=
     else
       func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
+      destdir=$func_dirname_result
+      destname=$func_basename_result
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files; shift
       test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
+	func_fatal_help "'$dest' is not a directory"
     fi
     case $destdir in
     [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -3318,7 +4715,7 @@ func_mode_install ()
 	case $file in
 	*.lo) ;;
 	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  func_fatal_help "'$destdir' must be an absolute directory name"
 	  ;;
 	esac
       done
@@ -3327,7 +4724,7 @@ func_mode_install ()
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     staticlibs=
     future_libdirs=
@@ -3338,7 +4735,7 @@ func_mode_install ()
       case $file in
       *.$libext)
 	# Do the static libraries later.
-	staticlibs+=" $file"
+	func_append staticlibs " $file"
 	;;
 
       *.la)
@@ -3347,7 +4744,7 @@ func_mode_install ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
+	  || func_fatal_help "'$file' is not a valid libtool archive"
 
 	library_names=
 	old_library=
@@ -3358,19 +4755,19 @@ func_mode_install ()
 	if test "X$destdir" = "X$libdir"; then
 	  case "$current_libdirs " in
 	  *" $libdir "*) ;;
-	  *) current_libdirs+=" $libdir" ;;
+	  *) func_append current_libdirs " $libdir" ;;
 	  esac
 	else
 	  # Note the libdir as a future libdir.
 	  case "$future_libdirs " in
 	  *" $libdir "*) ;;
-	  *) future_libdirs+=" $libdir" ;;
+	  *) func_append future_libdirs " $libdir" ;;
 	  esac
 	fi
 
 	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
-	dir+="$objdir"
+	dir=$func_dirname_result
+	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
 	  # Determine the prefix the user has applied to our future dir.
@@ -3383,7 +4780,7 @@ func_mode_install ()
 	  # are installed into $libdir/../bin (currently, that works fine)
 	  # but it's something to keep an eye on.
 	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
@@ -3392,29 +4789,36 @@ func_mode_install ()
 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
-	  func_warning "relinking \`$file'"
+	  func_warning "relinking '$file'"
 	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
 	fi
 
 	# See the names of the shared library.
 	set dummy $library_names; shift
 	if test -n "$1"; then
-	  realname="$1"
+	  realname=$1
 	  shift
 
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
 
 	  # Install the shared library and build the symlinks.
 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
-	  tstripme="$stripme"
+	  tstripme=$stripme
 	  case $host_os in
 	  cygwin* | mingw* | pw32* | cegcc*)
 	    case $realname in
 	    *.dll.a)
-	      tstripme=""
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  os2*)
+	    case $realname in
+	    *_dll.a)
+	      tstripme=
 	      ;;
 	    esac
 	    ;;
@@ -3425,7 +4829,7 @@ func_mode_install ()
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
 	    # so we also need to try rm && ln -s.
 	    for linkname
@@ -3436,18 +4840,18 @@ func_mode_install ()
 	  fi
 
 	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
+	  lib=$destdir/$realname
 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
 	fi
 
 	# Install the pseudo-library for information purposes.
 	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
+	name=$func_basename_result
+	instname=$dir/${name}i
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs+=" $dir/$old_library"
+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
 	;;
 
       *.lo)
@@ -3455,11 +4859,11 @@ func_mode_install ()
 
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# Deduce the name of the destination old-style object file.
@@ -3469,11 +4873,11 @@ func_mode_install ()
 	  staticdest=$func_lo2o_result
 	  ;;
 	*.$objext)
-	  staticdest="$destfile"
+	  staticdest=$destfile
 	  destfile=
 	  ;;
 	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
 	  ;;
 	esac
 
@@ -3482,7 +4886,7 @@ func_mode_install ()
 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
 
 	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
+	if test yes = "$build_old_libs"; then
 	  # Deduce the name of the old-style object file.
 	  func_lo2o "$file"
 	  staticobj=$func_lo2o_result
@@ -3494,23 +4898,23 @@ func_mode_install ()
       *)
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# If the file is missing, and there is a .exe on the end, strip it
 	# because it is most likely a libtool script we actually want to
 	# install
-	stripped_ext=""
+	stripped_ext=
 	case $file in
 	  *.exe)
 	    if test ! -f "$file"; then
 	      func_stripname '' '.exe' "$file"
 	      file=$func_stripname_result
-	      stripped_ext=".exe"
+	      stripped_ext=.exe
 	    fi
 	    ;;
 	esac
@@ -3538,19 +4942,19 @@ func_mode_install ()
 
 	  # Check the variables that should have been set.
 	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
 
-	  finalize=yes
+	  finalize=:
 	  for lib in $notinst_deplibs; do
 	    # Check to see that each library is installed.
 	    libdir=
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
 	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
 	    fi
 	  done
 
@@ -3558,29 +4962,29 @@ func_mode_install ()
 	  func_source "$wrapper"
 
 	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
+	  if test no = "$fast_install" && test -n "$relink_command"; then
 	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
+	      if $finalize; then
 	        tmpdir=`func_mktempdir`
 		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
 	        # Replace the output file specification.
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
-	        $opt_silent || {
+	        $opt_quiet || {
 	          func_quote_for_expand "$relink_command"
 		  eval "func_echo $func_quote_for_expand_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
+		  func_error "error: relink '$file' with the above command before installing it"
 		  $opt_dry_run || ${RM}r "$tmpdir"
 		  continue
 	        fi
-	        file="$outputname"
+	        file=$outputname
 	      else
-	        func_warning "cannot relink \`$file'"
+	        func_warning "cannot relink '$file'"
 	      fi
 	    }
 	  else
@@ -3617,10 +5021,10 @@ func_mode_install ()
 
     for file in $staticlibs; do
       func_basename "$file"
-      name="$func_basename_result"
+      name=$func_basename_result
 
       # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
+      oldlib=$destdir/$name
       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
       tool_oldlib=$func_to_tool_file_result
 
@@ -3635,18 +5039,18 @@ func_mode_install ()
     done
 
     test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
+      func_warning "remember to run '$progname --finish$future_libdirs'"
 
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -3654,16 +5058,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"}
 # a dlpreopen symbol table.
 func_generate_dlsyms ()
 {
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
     my_dlsyms=
 
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
       if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
+	my_dlsyms=${my_outputname}S.c
       else
 	func_error "not configured to extract global symbols from dlpreopened files"
       fi
@@ -3674,7 +5079,7 @@ func_generate_dlsyms ()
       "") ;;
       *.c)
 	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
+	nlist=$output_objdir/$my_outputname.nm
 
 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
 
@@ -3682,34 +5087,36 @@ func_generate_dlsyms ()
 	func_verbose "creating $output_objdir/$my_dlsyms"
 
 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
 
 #ifdef __cplusplus
 extern \"C\" {
 #endif
 
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
 # define LT_DLSYM_CONST const
 #endif
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* External symbol declarations for the compiler. */\
 "
 
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
 
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
@@ -3717,7 +5124,7 @@ extern \"C\" {
 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
@@ -3737,10 +5144,10 @@ extern \"C\" {
 
 	  # Prepare the list of exported symbols
 	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
+	    export_symbols=$output_objdir/$outputname.exp
 	    $opt_dry_run || {
 	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 	      case $host in
 	      *cygwin* | *mingw* | *cegcc* )
                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3750,7 +5157,7 @@ extern \"C\" {
 	    }
 	  else
 	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
@@ -3764,22 +5171,22 @@ extern \"C\" {
 	fi
 
 	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_verbose "extracting global C symbols from '$dlprefile'"
 	  func_basename "$dlprefile"
-	  name="$func_basename_result"
+	  name=$func_basename_result
           case $host in
 	    *cygwin* | *mingw* | *cegcc* )
 	      # if an import library, we need to obtain dlname
 	      if func_win32_import_lib_p "$dlprefile"; then
 	        func_tr_sh "$dlprefile"
 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
+	        dlprefile_dlbasename=
 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 	          # Use subshell, to avoid clobbering current variable values
 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
+	          if test -n "$dlprefile_dlname"; then
 	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
+	            dlprefile_dlbasename=$func_basename_result
 	          else
 	            # no lafile. user explicitly requested -dlpreopen <import library>.
 	            $sharedlib_from_linklib_cmd "$dlprefile"
@@ -3787,7 +5194,7 @@ extern \"C\" {
 	          fi
 	        fi
 	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
+	          if test -n "$dlprefile_dlbasename"; then
 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 	          else
 	            func_warning "Could not compute DLL name from $name"
@@ -3843,6 +5250,11 @@ extern \"C\" {
 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
 	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
@@ -3851,11 +5263,30 @@ typedef struct {
   void *address;
 } lt_dlsymlist;
 extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
 LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
 
 	  case $need_lib_prefix in
 	  no)
@@ -3897,9 +5328,7 @@ static const void *lt_preloaded_setup() {
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
 	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
 	    ;;
 	  esac
 	  ;;
@@ -3908,7 +5337,7 @@ static const void *lt_preloaded_setup() {
 	for arg in $LTCFLAGS; do
 	  case $arg in
 	  -pie | -fpie | -fPIE) ;;
-	  *) symtab_cflags+=" $arg" ;;
+	  *) func_append symtab_cflags " $arg" ;;
 	  esac
 	done
 
@@ -3916,10 +5345,10 @@ static const void *lt_preloaded_setup() {
 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
 
 	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
 
 	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	symfileobj=$output_objdir/${my_outputname}S.$objext
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
@@ -3937,7 +5366,7 @@ static const void *lt_preloaded_setup() {
 	esac
 	;;
       *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
 	;;
       esac
     else
@@ -3951,6 +5380,32 @@ static const void *lt_preloaded_setup() {
     fi
 }
 
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -3960,8 +5415,9 @@ static const void *lt_preloaded_setup() {
 # Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
-  $opt_debug
-  win32_libid_type="unknown"
+  $debug_cmd
+
+  win32_libid_type=unknown
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
   *ar\ archive\ import\ library*) # definitely import
@@ -3971,16 +5427,29 @@ func_win32_libid ()
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
 	    1,100{
 		/ I /{
-		    s,.*,import,
+		    s|.*|import|
 		    p
 		    q
 		}
 	    }'`
+	;;
+      esac
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -4012,7 +5481,8 @@ func_win32_libid ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib ()
 {
-  $opt_debug
+  $debug_cmd
+
   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 }
 
@@ -4029,7 +5499,8 @@ func_cygming_dll_for_implib ()
 # specified import library.
 func_cygming_dll_for_implib_fallback_core ()
 {
-  $opt_debug
+  $debug_cmd
+
   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     $SED '/^Contents of section '"$match_literal"':/{
@@ -4065,8 +5536,8 @@ func_cygming_dll_for_implib_fallback_core ()
       /./p' |
     # we now have a list, one entry per line, of the stringified
     # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
     # a '.' (that is, objdump's representation of an unprintable
     # character.) This should work for all archives with less than
     # 0x302f exports -- but will fail for DLLs whose name actually
@@ -4077,30 +5548,6 @@ func_cygming_dll_for_implib_fallback_core ()
     $SED -e '/^\./d;/^.\./d;q'
 }
 
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
 # func_cygming_dll_for_implib_fallback ARG
 # Platform-specific function to extract the
 # name of the DLL associated with the specified
@@ -4114,16 +5561,17 @@ func_cygming_ms_implib_p ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib_fallback ()
 {
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
     # binutils import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
+  elif func_cygming_ms_implib_p "$1"; then
     # ms-generated import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
   else
     # unknown
-    sharedlib_from_linklib_result=""
+    sharedlib_from_linklib_result=
   fi
 }
 
@@ -4131,10 +5579,11 @@ func_cygming_dll_for_implib_fallback ()
 # func_extract_an_archive dir oldlib
 func_extract_an_archive ()
 {
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
       lockfile=$f_ex_an_ar_oldlib.lock
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
@@ -4143,7 +5592,7 @@ func_extract_an_archive ()
     fi
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
+    if test yes = "$lock_old_archive_extraction"; then
       $opt_dry_run || rm -f "$lockfile"
     fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -4157,22 +5606,23 @@ func_extract_an_archive ()
 # func_extract_archives gentop oldlib ...
 func_extract_archives ()
 {
-    $opt_debug
-    my_gentop="$1"; shift
+    $debug_cmd
+
+    my_gentop=$1; shift
     my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
 
     for my_xlib in $my_oldlibs; do
       # Extract the objects.
       case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
+      my_xlib=$func_basename_result
       my_xlib_u=$my_xlib
       while :; do
         case " $extracted_archives " in
@@ -4184,7 +5634,7 @@ func_extract_archives ()
 	esac
       done
       extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
 
       func_mkdir_p "$my_xdir"
 
@@ -4197,22 +5647,23 @@ func_extract_archives ()
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
 	  if test -n "$darwin_arches"; then
 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
 	    darwin_arch=
 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
 	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
 	    done # $darwin_arches
             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
@@ -4234,7 +5685,7 @@ func_extract_archives ()
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
-    func_extract_archives_result="$my_oldobjs"
+    func_extract_archives_result=$my_oldobjs
 }
 
 
@@ -4249,7 +5700,7 @@ func_extract_archives ()
 #
 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 # variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
 # the $objdir directory.  This is a cygwin/mingw-specific
 # behavior.
 func_emit_wrapper ()
@@ -4260,7 +5711,7 @@ func_emit_wrapper ()
 #! $SHELL
 
 # $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # The $output program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -4317,9 +5768,9 @@ _LTECHO_EOF'
 
 # Very basic option parsing. These options are (a) specific to
 # the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
 # windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
 # this pattern).
 #
 # There are only two supported options: --lt-debug and
@@ -4352,7 +5803,7 @@ func_parse_lt_options ()
 
   # Print the debug banner immediately:
   if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
   fi
 }
 
@@ -4363,7 +5814,7 @@ func_lt_dump_args ()
   lt_dump_args_N=1;
   for lt_arg
   do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
   done
 }
@@ -4377,7 +5828,7 @@ func_exec_program_core ()
   *-*-mingw | *-*-os2* | *-cegcc*)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -4387,7 +5838,7 @@ func_exec_program_core ()
   *)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4462,13 +5913,13 @@ func_exec_program ()
   test -n \"\$absdir\" && thisdir=\"\$absdir\"
 "
 
-	if test "$fast_install" = yes; then
+	if test yes = "$fast_install"; then
 	  $ECHO "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -4485,7 +5936,7 @@ func_exec_program ()
     if test -n \"\$relink_command\"; then
       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
       else
-	$ECHO \"\$relink_command_output\" >&2
+	\$ECHO \"\$relink_command_output\" >&2
 	$RM \"\$progdir/\$file\"
 	exit 1
       fi
@@ -4520,7 +5971,7 @@ func_exec_program ()
 	fi
 
 	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
     # Add our own library path to $shlibpath_var
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4540,7 +5991,7 @@ func_exec_program ()
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
@@ -4559,7 +6010,7 @@ func_emit_cwrapperexe_src ()
 	cat <<EOF
 
 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
@@ -4594,47 +6045,45 @@ EOF
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
 # define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # define HAVE_SETENV
 # define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
-#if defined(PATH_MAX)
+#if defined PATH_MAX
 # define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -4653,8 +6102,8 @@ int setenv (const char *, const char *, int);
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
 # define HAVE_DOS_BASED_FILE_SYSTEM
 # define FOPEN_WB "wb"
 # ifndef DIR_SEPARATOR_2
@@ -4687,10 +6136,10 @@ int setenv (const char *, const char *, int);
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
 static int lt_debug = 1;
 #else
 static int lt_debug = 0;
@@ -4719,11 +6168,16 @@ void lt_dump_script (FILE *f);
 EOF
 
 	    cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
               func_to_host_path "$temp_rpath"
 	      cat <<EOF
 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
@@ -4747,7 +6201,7 @@ const char * EXE_PATH_VALUE   = "";
 EOF
 	    fi
 
-	    if test "$fast_install" = yes; then
+	    if test yes = "$fast_install"; then
 	      cat <<EOF
 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
 EOF
@@ -4776,12 +6230,12 @@ main (int argc, char *argv[])
   char *actual_cwrapper_name;
   char *target_name;
   char *lt_argv_zero;
-  intptr_t rval = 127;
+  int rval = 127;
 
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
+  newargz = XMALLOC (char *, (size_t) argc + 1);
 
   /* very simple arg parsing; don't want to rely on getopt
    * also, copy all non cwrapper options to newargz, except
@@ -4790,10 +6244,10 @@ main (int argc, char *argv[])
   newargc=0;
   for (i = 1; i < argc; i++)
     {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
+      if (STREQ (argv[i], dumpscript_opt))
 	{
 EOF
-	    case "$host" in
+	    case $host in
 	      *mingw* | *cygwin* )
 		# make stdout use "unix" line endings
 		echo "          setmode(1,_O_BINARY);"
@@ -4804,12 +6258,12 @@ EOF
 	  lt_dump_script (stdout);
 	  return 0;
 	}
-      if (strcmp (argv[i], debug_opt) == 0)
+      if (STREQ (argv[i], debug_opt))
 	{
           lt_debug = 1;
           continue;
 	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+      if (STREQ (argv[i], ltwrapper_option_prefix))
         {
           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
              namespace, but it is not one of the ones we know about and
@@ -4832,7 +6286,7 @@ EOF
 EOF
 	    cat <<EOF
   /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
 EOF
 	    cat <<"EOF"
   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4943,7 +6397,7 @@ EOF
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
   newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
@@ -4988,7 +6442,7 @@ base_name (const char *name)
 {
   const char *base;
 
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   /* Skip over the disk name in MSDOS pathnames. */
   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     name += 2;
@@ -5047,7 +6501,7 @@ find_executable (const char *wrapper)
   const char *p_next;
   /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
-  int tmp_len;
+  size_t tmp_len;
   char *concat_name;
 
   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -5057,7 +6511,7 @@ find_executable (const char *wrapper)
     return NULL;
 
   /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
     {
       concat_name = xstrdup (wrapper);
@@ -5075,7 +6529,7 @@ find_executable (const char *wrapper)
 	    return concat_name;
 	  XFREE (concat_name);
 	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
     }
 #endif
 
@@ -5098,7 +6552,7 @@ find_executable (const char *wrapper)
 	      for (q = p; *q; q++)
 		if (IS_PATH_SEPARATOR (*q))
 		  break;
-	      p_len = q - p;
+	      p_len = (size_t) (q - p);
 	      p_next = (*q == '\0' ? q : q + 1);
 	      if (p_len == 0)
 		{
@@ -5217,7 +6671,7 @@ strendzap (char *str, const char *pat)
   if (patlen <= len)
     {
       str += len - patlen;
-      if (strcmp (str, pat) == 0)
+      if (STREQ (str, pat))
 	*str = '\0';
     }
   return str;
@@ -5282,7 +6736,7 @@ lt_setenv (const char *name, const char *value)
     char *str = xstrdup (value);
     setenv (name, str, 1);
 #else
-    int len = strlen (name) + 1 + strlen (value) + 1;
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
     char *str = XMALLOC (char, len);
     sprintf (str, "%s=%s", name, value);
     if (putenv (str) != EXIT_SUCCESS)
@@ -5299,8 +6753,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
   char *new_value;
   if (orig_value && *orig_value)
     {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
       new_value = XMALLOC (char, add_len + orig_value_len + 1);
       if (to_end)
         {
@@ -5331,10 +6785,10 @@ lt_update_exe_path (const char *name, const char *value)
     {
       char *new_value = lt_extend_str (getenv (name), value, 0);
       /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
         {
-          new_value[len-1] = '\0';
+          new_value[--len] = '\0';
         }
       lt_setenv (name, new_value);
       XFREE (new_value);
@@ -5501,27 +6955,47 @@ EOF
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
 {
-    $opt_debug
+    $debug_cmd
+
     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
     *import*) : ;;
     *) false ;;
     esac
 }
 
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
+      # what system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
+      # to make a dll that has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
@@ -5565,10 +7039,11 @@ func_mode_link ()
     module=no
     no_install=no
     objs=
+    os2dllname=
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
-    preload=no
+    preload=false
     prev=
     prevarg=
     release=
@@ -5580,7 +7055,7 @@ func_mode_link ()
     vinfo=
     vinfo_number=no
     weak_libs=
-    single_module="${wl}-single_module"
+    single_module=$wl-single_module
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -5588,15 +7063,15 @@ func_mode_link ()
     do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	break
 	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
 	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
@@ -5629,38 +7104,38 @@ func_mode_link ()
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
-      arg="$1"
+      arg=$1
       shift
       func_quote_for_eval "$arg"
       qarg=$func_quote_for_eval_unquoted_result
-      libtool_args+=" $func_quote_for_eval_result"
+      func_append libtool_args " $func_quote_for_eval_result"
 
       # If the previous option needs an argument, assign it.
       if test -n "$prev"; then
 	case $prev in
 	output)
-	  compile_command+=" @OUTPUT@"
-	  finalize_command+=" @OUTPUT@"
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
 	  ;;
 	esac
 
 	case $prev in
 	bindir)
-	  bindir="$arg"
+	  bindir=$arg
 	  prev=
 	  continue
 	  ;;
 	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
+	  $preload || {
 	    # Add the symbol object into the linking commands.
-	    compile_command+=" @SYMFILE@"
-	    finalize_command+=" @SYMFILE@"
-	    preload=yes
-	  fi
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=:
+	  }
 	  case $arg in
 	  *.la | *.lo) ;;  # We handle these cases below.
 	  force)
-	    if test "$dlself" = no; then
+	    if test no = "$dlself"; then
 	      dlself=needless
 	      export_dynamic=yes
 	    fi
@@ -5668,9 +7143,9 @@ func_mode_link ()
 	    continue
 	    ;;
 	  self)
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
 	      dlself=yes
 	    else
 	      dlself=needless
@@ -5680,10 +7155,10 @@ func_mode_link ()
 	    continue
 	    ;;
 	  *)
-	    if test "$prev" = dlfiles; then
-	      dlfiles+=" $arg"
+	    if test dlfiles = "$prev"; then
+	      func_append dlfiles " $arg"
 	    else
-	      dlprefiles+=" $arg"
+	      func_append dlprefiles " $arg"
 	    fi
 	    prev=
 	    continue
@@ -5691,14 +7166,14 @@ func_mode_link ()
 	  esac
 	  ;;
 	expsyms)
-	  export_symbols="$arg"
+	  export_symbols=$arg
 	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
+	    || func_fatal_error "symbol file '$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
 	expsyms_regex)
-	  export_symbols_regex="$arg"
+	  export_symbols_regex=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5707,7 +7182,7 @@ func_mode_link ()
 	    *-*-darwin*)
 	      case "$deplibs " in
 		*" $qarg.ltframework "*) ;;
-		*) deplibs+=" $qarg.ltframework" # this is fixed later
+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
 		   ;;
 	      esac
 	      ;;
@@ -5716,7 +7191,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	inst_prefix)
-	  inst_prefix_dir="$arg"
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
 	  prev=
 	  continue
 	  ;;
@@ -5726,7 +7207,7 @@ func_mode_link ()
 	    moreargs=
 	    for fil in `cat "$save_arg"`
 	    do
-#	      moreargs+=" $fil"
+#	      func_append moreargs " $fil"
 	      arg=$fil
 	      # A libtool-controlled object.
 
@@ -5740,22 +7221,22 @@ func_mode_link ()
 
 		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
 		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
+		xdir=$func_dirname_result
 
-		if test "$pic_object" != none; then
+		if test none != "$pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
+		  pic_object=$xdir$pic_object
 
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      dlfiles+=" $pic_object"
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
 		    else
@@ -5765,64 +7246,69 @@ func_mode_link ()
 		  fi
 
 		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
+		  if test dlprefiles = "$prev"; then
 		    # Preload the old-style object.
-		    dlprefiles+=" $pic_object"
+		    func_append dlprefiles " $pic_object"
 		    prev=
 		  fi
 
 		  # A PIC object.
-		  libobjs+=" $pic_object"
-		  arg="$pic_object"
+		  func_append libobjs " $pic_object"
+		  arg=$pic_object
 		fi
 
 		# Non-PIC object.
-		if test "$non_pic_object" != none; then
+		if test none != "$non_pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
+		  non_pic_object=$xdir$non_pic_object
 
 		  # A standard non-PIC object
-		  non_pic_objects+=" $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
 		  fi
 		else
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
-		  non_pic_objects+=" $non_pic_object"
+		  non_pic_object=$pic_object
+		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
 		# Only an error if not doing a dry-run.
 		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
 		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
+		  xdir=$func_dirname_result
 
 		  func_lo2o "$arg"
 		  pic_object=$xdir$objdir/$func_lo2o_result
 		  non_pic_object=$xdir$func_lo2o_result
-		  libobjs+=" $pic_object"
-		  non_pic_objects+=" $non_pic_object"
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
 	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
+		  func_fatal_error "'$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
+	    func_fatal_error "link input file '$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
+	os2dllname)
+	  os2dllname=$arg
+	  prev=
+	  continue
+	  ;;
 	precious_regex)
-	  precious_files_regex="$arg"
+	  precious_files_regex=$arg
 	  prev=
 	  continue
 	  ;;
 	release)
-	  release="-$arg"
+	  release=-$arg
 	  prev=
 	  continue
 	  ;;
@@ -5834,51 +7320,51 @@ func_mode_link ()
 	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
-	  if test "$prev" = rpath; then
+	  if test rpath = "$prev"; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
-	    *) rpath+=" $arg" ;;
+	    *) func_append rpath " $arg" ;;
 	    esac
 	  else
 	    case "$xrpath " in
 	    *" $arg "*) ;;
-	    *) xrpath+=" $arg" ;;
+	    *) func_append xrpath " $arg" ;;
 	    esac
 	  fi
 	  prev=
 	  continue
 	  ;;
 	shrext)
-	  shrext_cmds="$arg"
+	  shrext_cmds=$arg
 	  prev=
 	  continue
 	  ;;
 	weak)
-	  weak_libs+=" $arg"
+	  func_append weak_libs " $arg"
 	  prev=
 	  continue
 	  ;;
 	xcclinker)
-	  linker_flags+=" $qarg"
-	  compiler_flags+=" $qarg"
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $qarg"
 	  prev=
-	  compile_command+=" $qarg"
-	  finalize_command+=" $qarg"
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
 	xcompiler)
-	  compiler_flags+=" $qarg"
+	  func_append compiler_flags " $qarg"
 	  prev=
-	  compile_command+=" $qarg"
-	  finalize_command+=" $qarg"
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
 	xlinker)
-	  linker_flags+=" $qarg"
-	  compiler_flags+=" $wl$qarg"
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $wl$qarg"
 	  prev=
-	  compile_command+=" $wl$qarg"
-	  finalize_command+=" $wl$qarg"
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
 	  continue
 	  ;;
 	*)
@@ -5889,21 +7375,21 @@ func_mode_link ()
 	esac
       fi # test -n "$prev"
 
-      prevarg="$arg"
+      prevarg=$arg
 
       case $arg in
       -all-static)
 	if test -n "$link_static_flag"; then
 	  # See comment for -static flag below, for more details.
-	  compile_command+=" $link_static_flag"
-	  finalize_command+=" $link_static_flag"
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
 	fi
 	continue
 	;;
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -5935,7 +7421,7 @@ func_mode_link ()
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
-	if test "X$arg" = "X-export-symbols"; then
+	if test X-export-symbols = "X$arg"; then
 	  prev=expsyms
 	else
 	  prev=expsyms_regex
@@ -5958,8 +7444,8 @@ func_mode_link ()
       -L[A-Z][A-Z]*:*)
 	case $with_gcc/$host in
 	no/*-*-irix* | /*-*-irix*)
-	  compile_command+=" $arg"
-	  finalize_command+=" $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
 	  ;;
 	esac
 	continue
@@ -5969,9 +7455,9 @@ func_mode_link ()
 	func_stripname "-L" '' "$arg"
 	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
+	    func_fatal_error "require no space between '-L' and '$1'"
 	  else
-	    func_fatal_error "need path for \`-L' option"
+	    func_fatal_error "need path for '-L' option"
 	  fi
 	fi
 	func_resolve_sysroot "$func_stripname_result"
@@ -5982,8 +7468,8 @@ func_mode_link ()
 	*)
 	  absdir=`cd "$dir" && pwd`
 	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
 	  ;;
 	esac
 	case "$deplibs " in
@@ -5993,10 +7479,10 @@ func_mode_link ()
 	*)
 	  # Preserve sysroot, but never include relative directories
 	  case $dir in
-	    [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
-	    *) deplibs+=" -L$dir" ;;
+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+	    *) func_append deplibs " -L$dir" ;;
 	  esac
-	  lib_search_path+=" $dir"
+	  func_append lib_search_path " $dir"
 	  ;;
 	esac
 	case $host in
@@ -6005,12 +7491,12 @@ func_mode_link ()
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
 	  ::) dllsearchpath=$dir;;
-	  *) dllsearchpath+=":$dir";;
+	  *) func_append dllsearchpath ":$dir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
 	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath+=":$testbindir";;
+	  *) func_append dllsearchpath ":$testbindir";;
 	  esac
 	  ;;
 	esac
@@ -6018,7 +7504,7 @@ func_mode_link ()
 	;;
 
       -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
@@ -6026,35 +7512,40 @@ func_mode_link ()
 	    ;;
 	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
-	    deplibs+=" System.ltframework"
+	    func_append deplibs " System.ltframework"
 	    continue
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  esac
-	elif test "X$arg" = "X-lc_r"; then
+	elif test X-lc_r = "X$arg"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
 	 esac
 	fi
-	deplibs+=" $arg"
+	func_append deplibs " $arg"
+	continue
+	;;
+
+      -mllvm)
+	prev=mllvm
 	continue
 	;;
 
@@ -6067,27 +7558,27 @@ func_mode_link ()
       # classes, name mangling, and exception handling.
       # Darwin uses the -arch flag to determine output architecture.
       -model|-arch|-isysroot|--sysroot)
-	compiler_flags+=" $arg"
-	compile_command+=" $arg"
-	finalize_command+=" $arg"
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
 	prev=xcompiler
 	continue
 	;;
 
       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
       |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	compiler_flags+=" $arg"
-	compile_command+=" $arg"
-	finalize_command+=" $arg"
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
 	case "$new_inherited_linker_flags " in
 	    *" $arg "*) ;;
-	    * ) new_inherited_linker_flags+=" $arg" ;;
+	    * ) func_append new_inherited_linker_flags " $arg" ;;
 	esac
 	continue
 	;;
 
       -multi_module)
-	single_module="${wl}-multi_module"
+	single_module=$wl-multi_module
 	continue
 	;;
 
@@ -6101,8 +7592,8 @@ func_mode_link ()
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -6120,6 +7611,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
       -o) prev=output ;;
 
       -precious-files-regex)
@@ -6158,7 +7654,7 @@ func_mode_link ()
 	esac
 	case "$xrpath " in
 	*" $dir "*) ;;
-	*) xrpath+=" $dir" ;;
+	*) func_append xrpath " $dir" ;;
 	esac
 	continue
 	;;
@@ -6207,14 +7703,14 @@ func_mode_link ()
 	func_stripname '-Wc,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
-	  arg+=" $func_quote_for_eval_result"
-	  compiler_flags+=" $func_quote_for_eval_result"
+	  func_append arg " $func_quote_for_eval_result"
+	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -6223,15 +7719,15 @@ func_mode_link ()
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
-	  arg+=" $wl$func_quote_for_eval_result"
-	  compiler_flags+=" $wl$func_quote_for_eval_result"
-	  linker_flags+=" $func_quote_for_eval_result"
+	  func_append arg " $wl$func_quote_for_eval_result"
+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
+	  func_append linker_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -6254,7 +7750,7 @@ func_mode_link ()
       # -msg_* for osf cc
       -msg_*)
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -6266,30 +7762,51 @@ func_mode_link ()
       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
       # -F/path              path to uninstalled frameworks, gcc on darwin
       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # -fstack-protector*   stack protector flags for GCC
       # @file                GCC response files
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -stdlib=*            select c++ std lib with clang
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-        compile_command+=" $arg"
-        finalize_command+=" $arg"
-        compiler_flags+=" $arg"
+	arg=$func_quote_for_eval_result
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        func_append compiler_flags " $arg"
         continue
         ;;
 
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+	  compiler_flags="$compiler_flags $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  case $arg in
+	  -Zlinker | -Zstack)
+	    prev=xcompiler
+	    ;;
+	  esac
+	  continue
+        else
+	  # Otherwise treat like 'Some other compiler flag' below
+	  func_quote_for_eval "$arg"
+	  arg=$func_quote_for_eval_result
+        fi
+	;;
+
       # Some other compiler flag.
       -* | +*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       *.$objext)
 	# A standard object.
-	objs+=" $arg"
+	func_append objs " $arg"
 	;;
 
       *.lo)
@@ -6305,22 +7822,22 @@ func_mode_link ()
 
 	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
 	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
+	  xdir=$func_dirname_result
 
-	  if test "$pic_object" != none; then
+	  test none = "$pic_object" || {
 	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
+	    pic_object=$xdir$pic_object
 
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		dlfiles+=" $pic_object"
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+		func_append dlfiles " $pic_object"
 		prev=
 		continue
 	      else
@@ -6330,55 +7847,55 @@ func_mode_link ()
 	    fi
 
 	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      # Preload the old-style object.
-	      dlprefiles+=" $pic_object"
+	      func_append dlprefiles " $pic_object"
 	      prev=
 	    fi
 
 	    # A PIC object.
-	    libobjs+=" $pic_object"
-	    arg="$pic_object"
-	  fi
+	    func_append libobjs " $pic_object"
+	    arg=$pic_object
+	  }
 
 	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
+	  if test none != "$non_pic_object"; then
 	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
+	    non_pic_object=$xdir$non_pic_object
 
 	    # A standard non-PIC object
-	    non_pic_objects+=" $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
 	    fi
 	  else
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
-	    non_pic_objects+=" $non_pic_object"
+	    non_pic_object=$pic_object
+	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
 	  # Only an error if not doing a dry-run.
 	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
 	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
+	    xdir=$func_dirname_result
 
 	    func_lo2o "$arg"
 	    pic_object=$xdir$objdir/$func_lo2o_result
 	    non_pic_object=$xdir$func_lo2o_result
-	    libobjs+=" $pic_object"
-	    non_pic_objects+=" $non_pic_object"
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
 	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
+	    func_fatal_error "'$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
 
       *.$libext)
 	# An archive.
-	deplibs+=" $arg"
-	old_deplibs+=" $arg"
+	func_append deplibs " $arg"
+	func_append old_deplibs " $arg"
 	continue
 	;;
 
@@ -6386,16 +7903,16 @@ func_mode_link ()
 	# A libtool-controlled library.
 
 	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
+	if test dlfiles = "$prev"; then
 	  # This library was specified with -dlopen.
-	  dlfiles+=" $func_resolve_sysroot_result"
+	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
-	elif test "$prev" = dlprefiles; then
+	elif test dlprefiles = "$prev"; then
 	  # The library was specified with -dlpreopen.
-	  dlprefiles+=" $func_resolve_sysroot_result"
+	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
 	else
-	  deplibs+=" $func_resolve_sysroot_result"
+	  func_append deplibs " $func_resolve_sysroot_result"
 	fi
 	continue
 	;;
@@ -6405,43 +7922,46 @@ func_mode_link ()
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
       esac # arg
 
       # Now actually substitute the argument into the commands.
       if test -n "$arg"; then
-	compile_command+=" $arg"
-	finalize_command+=" $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
       fi
     done # argument parsing loop
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
+      func_fatal_help "the '$prevarg' option requires an argument"
 
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
-      compile_command+=" $arg"
-      finalize_command+=" $arg"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
     fi
 
     oldlibs=
     # calculate the name of the file, without its directory
     func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
     func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
+    output_objdir=$func_dirname_result$objdir
     func_to_tool_file "$output_objdir/"
     tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
@@ -6464,15 +7984,15 @@ func_mode_link ()
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
+      if $opt_preserve_dup_deps; then
 	case "$libs " in
-	*" $deplib "*) specialdeplibs+=" $deplib" ;;
+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
       fi
-      libs+=" $deplib"
+      func_append libs " $deplib"
     done
 
-    if test "$linkmode" = lib; then
+    if test lib = "$linkmode"; then
       libs="$predeps $libs $compiler_lib_search_path $postdeps"
 
       # Compute libraries that are listed more than once in $predeps
@@ -6482,9 +8002,9 @@ func_mode_link ()
       if $opt_duplicate_compiler_generated_deps; then
 	for pre_post_dep in $predeps $postdeps; do
 	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;;
+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
 	  esac
-	  pre_post_deps+=" $pre_post_dep"
+	  func_append pre_post_deps " $pre_post_dep"
 	done
       fi
       pre_post_deps=
@@ -6504,7 +8024,7 @@ func_mode_link ()
 	  case $file in
 	  *.la) ;;
 	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -6512,7 +8032,7 @@ func_mode_link ()
     prog)
 	compile_deplibs=
 	finalize_deplibs=
-	alldeplibs=no
+	alldeplibs=false
 	newdlfiles=
 	newdlprefiles=
 	passes="conv scan dlopen dlpreopen link"
@@ -6524,29 +8044,29 @@ func_mode_link ()
     for pass in $passes; do
       # The preopen pass in lib mode reverses $deplibs; put it back here
       # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
+      if test lib,link = "$linkmode,$pass"; then
 	## FIXME: Find the place where the list is rebuilt in the wrong
 	##        order, and fix it there properly
         tmp_deplibs=
 	for deplib in $deplibs; do
 	  tmp_deplibs="$deplib $tmp_deplibs"
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
       fi
 
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
 	deplibs=
       fi
-      if test "$linkmode" = prog; then
+      if test prog = "$linkmode"; then
 	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
 	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 	esac
       fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+      if test lib,dlpreopen = "$linkmode,$pass"; then
 	# Collect and forward deplibs of preopened libtool libs
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
@@ -6563,46 +8083,46 @@ func_mode_link ()
             deplib_base=$func_basename_result
 	    case " $weak_libs " in
 	    *" $deplib_base "*) ;;
-	    *) deplibs+=" $deplib" ;;
+	    *) func_append deplibs " $deplib" ;;
 	    esac
 	  done
 	done
-	libs="$dlprefiles"
+	libs=$dlprefiles
       fi
-      if test "$pass" = dlopen; then
+      if test dlopen = "$pass"; then
 	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
+	save_deplibs=$deplibs
 	deplibs=
       fi
 
       for deplib in $libs; do
 	lib=
-	found=no
+	found=false
 	case $deplib in
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
-	    compiler_flags+=" $deplib"
-	    if test "$linkmode" = lib ; then
+	    func_append compiler_flags " $deplib"
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags+=" $deplib" ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
 		esac
 	    fi
 	  fi
 	  continue
 	  ;;
 	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
 	    continue
 	  fi
 	  func_stripname '-l' '' "$deplib"
 	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6610,31 +8130,22 @@ func_mode_link ()
 	  for searchdir in $searchdirs; do
 	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
+	      lib=$searchdir/lib$name$search_ext
 	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
+		if test .la = "$search_ext"; then
+		  found=:
 		else
-		  found=no
+		  found=false
 		fi
 		break 2
 	      fi
 	    done
 	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
+	  if $found; then
+	    # deplib is a libtool library
 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
 	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
 		if func_lalib_p "$lib"; then
@@ -6642,19 +8153,19 @@ func_mode_link ()
 		  old_library=
 		  func_source "$lib"
 		  for l in $old_library $library_names; do
-		    ll="$l"
+		    ll=$l
 		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
 		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
+		    ladir=$func_dirname_result
 		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
+		    if test prog,link = "$linkmode,$pass"; then
 		      compile_deplibs="$deplib $compile_deplibs"
 		      finalize_deplibs="$deplib $finalize_deplibs"
 		    else
 		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
 		    fi
 		    continue
 		  fi
@@ -6663,18 +8174,28 @@ func_mode_link ()
 	      *) ;;
 	      esac
 	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
 	  fi
 	  ;; # -l
 	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags+=" $deplib" ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
 		esac
 	    fi
 	  fi
@@ -6684,18 +8205,18 @@ func_mode_link ()
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
+	    test conv = "$pass" && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
-	    newlib_search_path+=" $func_resolve_sysroot_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
-	    if test "$pass" = conv; then
+	    if test conv = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	      continue
 	    fi
-	    if test "$pass" = scan; then
+	    if test scan = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6703,23 +8224,23 @@ func_mode_link ()
 	    fi
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
-	    newlib_search_path+=" $func_resolve_sysroot_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
+	    func_warning "'-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
-	  if test "$pass" = link; then
+	  if test link = "$pass"; then
 	    func_stripname '-R' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    dir=$func_resolve_sysroot_result
 	    # Make sure the xrpath contains only unique directories.
 	    case "$xrpath " in
 	    *" $dir "*) ;;
-	    *) xrpath+=" $dir" ;;
+	    *) func_append xrpath " $dir" ;;
 	    esac
 	  fi
 	  deplibs="$deplib $deplibs"
@@ -6730,7 +8251,7 @@ func_mode_link ()
 	  lib=$func_resolve_sysroot_result
 	  ;;
 	*.$libext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
 	    continue
 	  fi
@@ -6741,21 +8262,26 @@ func_mode_link ()
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=no
+	      valid_a_lib=false
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
+		    valid_a_lib=:
 		  fi
 		;;
 		pass_all)
-		  valid_a_lib=yes
+		  valid_a_lib=:
 		;;
 	      esac
-	      if test "$valid_a_lib" != yes; then
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
 		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
 		echo "*** I have the capability to make that library automatically link in when"
@@ -6763,18 +8289,13 @@ func_mode_link ()
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because the file extensions .$libext of this argument makes me believe"
 		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
 	      fi
 	      ;;
 	    esac
 	    continue
 	    ;;
 	  prog)
-	    if test "$pass" != link; then
+	    if test link != "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6785,38 +8306,36 @@ func_mode_link ()
 	  esac # linkmode
 	  ;; # *.$libext
 	*.lo | *.$objext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
-	      newdlprefiles+=" $deplib"
+	      func_append newdlprefiles " $deplib"
 	      compile_deplibs="$deplib $compile_deplibs"
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    else
-	      newdlfiles+=" $deplib"
+	      func_append newdlfiles " $deplib"
 	    fi
 	  fi
 	  continue
 	  ;;
 	%DEPLIBS%)
-	  alldeplibs=yes
+	  alldeplibs=:
 	  continue
 	  ;;
 	esac # case $deplib
 
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
 
 	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
+	ladir=$func_dirname_result
 
 	dlname=
 	dlopen=
@@ -6841,40 +8360,40 @@ func_mode_link ()
 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
 	    case " $new_inherited_linker_flags " in
 	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
 	    esac
 	  done
 	fi
 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && dlfiles+=" $dlopen"
-	  test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
-	if test "$pass" = conv; then
+	if test conv = "$pass"; then
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
+	      func_fatal_error "cannot find name of link library for '$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
-	    convenience+=" $ladir/$objdir/$old_library"
-	    old_convenience+=" $ladir/$objdir/$old_library"
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
+	    func_append convenience " $ladir/$objdir/$old_library"
+	    func_append old_convenience " $ladir/$objdir/$old_library"
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
 	  fi
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs+=" $deplib" ;;
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
 	    fi
-	    tmp_libs+=" $deplib"
+	    func_append tmp_libs " $deplib"
 	  done
 	  continue
 	fi # $pass = conv
@@ -6883,86 +8402,86 @@ func_mode_link ()
 	# Get the name of the library we link against.
 	linklib=
 	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
 	  linklib=$old_library
 	else
 	  for l in $old_library $library_names; do
-	    linklib="$l"
+	    linklib=$l
 	  done
 	fi
 	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
+	  func_fatal_error "cannot find name of link library for '$lib'"
 	fi
 
 	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
 	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
 	    # bomb out in the load deplibs phase.
-	    dlprefiles+=" $lib $dependency_libs"
+	    func_append dlprefiles " $lib $dependency_libs"
 	  else
-	    newdlfiles+=" $lib"
+	    func_append newdlfiles " $lib"
 	  fi
 	  continue
 	fi # $pass = dlopen
 
 	# We need an absolute path.
 	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "cannot determine absolute directory name of '$ladir'"
 	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
+	    abs_ladir=$ladir
 	  fi
 	  ;;
 	esac
 	func_basename "$lib"
-	laname="$func_basename_result"
+	laname=$func_basename_result
 
 	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
+	if test yes = "$installed"; then
 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
+	    func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
 	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
 	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
+	    dir=$ladir
+	    absdir=$abs_ladir
 	    # Remove this search path later
-	    notinst_path+=" $abs_ladir"
+	    func_append notinst_path " $abs_ladir"
 	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
 	    # Remove this search path later
-	    notinst_path+=" $abs_ladir"
+	    func_append notinst_path " $abs_ladir"
 	  fi
 	fi # $installed = yes
 	func_stripname 'lib' '.la' "$laname"
 	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
 	  fi
-	  case "$host" in
+	  case $host in
 	    # special handling for platforms with PE-DLLs.
 	    *cygwin* | *mingw* | *cegcc* )
 	      # Linker will automatically link against shared library if both
@@ -6976,29 +8495,29 @@ func_mode_link ()
 	      if test -n "$dlname"; then
 	        func_tr_sh "$dir/$linklib"
 	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-	        newdlprefiles+=" $dir/$linklib"
+	        func_append newdlprefiles " $dir/$linklib"
 	      else
-	        newdlprefiles+=" $dir/$old_library"
+	        func_append newdlprefiles " $dir/$old_library"
 	        # Keep a list of preopened convenience libraries to check
 	        # that they are being used correctly in the link pass.
 	        test -z "$libdir" && \
-	          dlpreconveniencelibs+=" $dir/$old_library"
+	          func_append dlpreconveniencelibs " $dir/$old_library"
 	      fi
 	    ;;
 	    * )
 	      # Prefer using a static library (so that no silly _DYNAMIC symbols
 	      # are required to link).
 	      if test -n "$old_library"; then
-	        newdlprefiles+=" $dir/$old_library"
+	        func_append newdlprefiles " $dir/$old_library"
 	        # Keep a list of preopened convenience libraries to check
 	        # that they are being used correctly in the link pass.
 	        test -z "$libdir" && \
-	          dlpreconveniencelibs+=" $dir/$old_library"
+	          func_append dlpreconveniencelibs " $dir/$old_library"
 	      # Otherwise, use the dlname, so that lt_dlopen finds it.
 	      elif test -n "$dlname"; then
-	        newdlprefiles+=" $dir/$dlname"
+	        func_append newdlprefiles " $dir/$dlname"
 	      else
-	        newdlprefiles+=" $dir/$linklib"
+	        func_append newdlprefiles " $dir/$linklib"
 	      fi
 	    ;;
 	  esac
@@ -7006,9 +8525,9 @@ func_mode_link ()
 
 	if test -z "$libdir"; then
 	  # Link the convenience library
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
+	  elif test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$dir/$old_library $compile_deplibs"
 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
@@ -7018,14 +8537,14 @@ func_mode_link ()
 	fi
 
 
-	if test "$linkmode" = prog && test "$pass" != link; then
-	  newlib_search_path+=" $ladir"
+	if test prog = "$linkmode" && test link != "$pass"; then
+	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
 	  fi
 
 	  tmp_libs=
@@ -7033,38 +8552,38 @@ func_mode_link ()
 	    case $deplib in
 	    -L*) func_stripname '-L' '' "$deplib"
 	         func_resolve_sysroot "$func_stripname_result"
-	         newlib_search_path+=" $func_resolve_sysroot_result"
+	         func_append newlib_search_path " $func_resolve_sysroot_result"
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
+	    if $linkalldeplibs; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      # Need to hardcode shared library paths
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs+=" $deplib" ;;
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
 	    fi
-	    tmp_libs+=" $deplib"
+	    func_append tmp_libs " $deplib"
 	  done # for deplib
 	  continue
 	fi # $linkmode = prog...
 
-	if test "$linkmode,$pass" = "prog,link"; then
+	if test prog,link = "$linkmode,$pass"; then
 	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
+	      case $temp_rpath: in
 	      *"$absdir:"*) ;;
-	      *) temp_rpath+="$absdir:" ;;
+	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
 	    fi
 
@@ -7076,7 +8595,7 @@ func_mode_link ()
 	    *)
 	      case "$compile_rpath " in
 	      *" $absdir "*) ;;
-	      *) compile_rpath+=" $absdir" ;;
+	      *) func_append compile_rpath " $absdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -7085,15 +8604,15 @@ func_mode_link ()
 	    *)
 	      case "$finalize_rpath " in
 	      *" $libdir "*) ;;
-	      *) finalize_rpath+=" $libdir" ;;
+	      *) func_append finalize_rpath " $libdir" ;;
 	      esac
 	      ;;
 	    esac
 	  fi # $linkmode,$pass = prog,link...
 
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
 		 test -n "$library_names"; }; }; then
 	    # We only need to search for static libraries
 	    continue
@@ -7102,20 +8621,20 @@ func_mode_link ()
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
+	if test built = "$use_static_libs" && test yes = "$installed"; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
 	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
+	  *cygwin* | *mingw* | *cegcc* | *os2*)
 	      # No point in relinking DLLs because paths are not encoded
-	      notinst_deplibs+=" $lib"
+	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
-	    if test "$installed" = no; then
-	      notinst_deplibs+=" $lib"
+	    if test no = "$installed"; then
+	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
 	    ;;
@@ -7124,24 +8643,24 @@ func_mode_link ()
 
 	  # Warn about portability, can't link against -module's on some
 	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
+	  dlopenmodule=
 	  for dlpremoduletest in $dlprefiles; do
 	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
+	      dlopenmodule=$dlpremoduletest
 	      break
 	    fi
 	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
 	    echo
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
 	    $ECHO "*** $linklib is not portable!"
 	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
 	    # Hardcode the library path.
 	    # Skip directories that are in the system default run-time
 	    # search path.
@@ -7150,7 +8669,7 @@ func_mode_link ()
 	    *)
 	      case "$compile_rpath " in
 	      *" $absdir "*) ;;
-	      *) compile_rpath+=" $absdir" ;;
+	      *) func_append compile_rpath " $absdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -7159,7 +8678,7 @@ func_mode_link ()
 	    *)
 	      case "$finalize_rpath " in
 	      *" $libdir "*) ;;
-	      *) finalize_rpath+=" $libdir" ;;
+	      *) func_append finalize_rpath " $libdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -7169,43 +8688,43 @@ func_mode_link ()
 	    # figure out the soname
 	    set dummy $library_names
 	    shift
-	    realname="$1"
+	    realname=$1
 	    shift
 	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
-	      soname="$dlname"
+	      soname=$dlname
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
+	      *cygwin* | mingw* | *cegcc* | *os2*)
 	        func_arith $current - $age
 		major=$func_arith_result
-		versuffix="-$major"
+		versuffix=-$major
 		;;
 	      esac
 	      eval soname=\"$soname_spec\"
 	    else
-	      soname="$realname"
+	      soname=$realname
 	    fi
 
 	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
+	    soroot=$soname
 	    func_basename "$soroot"
-	    soname="$func_basename_result"
+	    soname=$func_basename_result
 	    func_stripname 'lib' '.dll' "$soname"
 	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_verbose "extracting exported symbol list from '$soname'"
 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
+	      func_verbose "generating import library for '$soname'"
 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
@@ -7213,70 +8732,70 @@ func_mode_link ()
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    lib_linked=yes
 	    case $hardcode_action in
 	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
 		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
+		    *-*-unixware7*) add_dir=-L$dir ;;
 		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
+		    # if the lib is a (non-dlopened) module then we cannot
 		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
+			 $GREP ": [^:]* bundle" >/dev/null; then
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
+			if test -z "$old_library"; then
 			  echo
 			  echo "*** And there doesn't seem to be a static archive available"
 			  echo "*** The link will probably fail, sorry"
 			else
-			  add="$dir/$old_library"
+			  add=$dir/$old_library
 			fi
 		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
+			add=$dir/$old_library
 		      fi
 		    fi
 		esac
-	      elif test "$hardcode_minus_L" = no; then
+	      elif test no = "$hardcode_minus_L"; then
 		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
+		*-*-sunos*) add_shlibpath=$dir ;;
 		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
 		    [\\/]*)
-		      add_dir+=" -L$inst_prefix_dir$libdir"
+		      func_append add_dir " -L$inst_prefix_dir$libdir"
 		      ;;
 		  esac
 		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
@@ -7284,72 +8803,72 @@ func_mode_link ()
 	    *) lib_linked=no ;;
 	    esac
 
-	    if test "$lib_linked" != yes; then
+	    if test yes != "$lib_linked"; then
 	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
 	    if test -n "$add_shlibpath"; then
 	      case :$compile_shlibpath: in
 	      *":$add_shlibpath:"*) ;;
-	      *) compile_shlibpath+="$add_shlibpath:" ;;
+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
-		*) finalize_shlibpath+="$libdir:" ;;
+		*) func_append finalize_shlibpath "$libdir:" ;;
 		esac
 	      fi
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
-	      *) finalize_shlibpath+="$libdir:" ;;
+	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
 	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
 	      else
-		add="$libdir/$linklib"
+		add=$libdir/$linklib
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
+	      add_dir=-L$libdir
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
 		  [\\/]*)
-		    add_dir+=" -L$inst_prefix_dir$libdir"
+		    func_append add_dir " -L$inst_prefix_dir$libdir"
 		    ;;
 		esac
 	      fi
-	      add="-l$name"
+	      add=-l$name
 	    fi
 
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
 	    else
@@ -7357,43 +8876,43 @@ func_mode_link ()
 	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
 	  fi
-	elif test "$linkmode" = prog; then
+	elif test prog = "$linkmode"; then
 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
 	  # is not unsupported.  This is valid on all known static and
 	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
 	    compile_deplibs="$dir/$linklib $compile_deplibs"
 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
 	  else
 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
 	  fi
-	elif test "$build_libtool_libs" = yes; then
+	elif test yes = "$build_libtool_libs"; then
 	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
+	  if test pass_all != "$deplibs_check_method"; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
 	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
 	    echo "*** I have the capability to make that library automatically link in when"
 	    echo "*** you link to this library.  But I can only do this if you have a"
 	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
+	    if test yes = "$module"; then
 	      echo "*** But as you try to build a module library, libtool will still create "
 	      echo "*** a static module, that should work as long as the dlopening application"
 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
 		echo
 		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	      fi
-	      if test "$build_old_libs" = no; then
+	      if test no = "$build_old_libs"; then
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -7406,11 +8925,11 @@ func_mode_link ()
 	  fi
 	fi # link shared/static library?
 
-	if test "$linkmode" = lib; then
+	if test lib = "$linkmode"; then
 	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
@@ -7419,17 +8938,17 @@ func_mode_link ()
 	           temp_xrpath=$func_stripname_result
 		   case " $xrpath " in
 		   *" $temp_xrpath "*) ;;
-		   *) xrpath+=" $temp_xrpath";;
+		   *) func_append xrpath " $temp_xrpath";;
 		   esac;;
-	      *) temp_deplibs+=" $libdir";;
+	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
-	    dependency_libs="$temp_deplibs"
+	    dependency_libs=$temp_deplibs
 	  fi
 
-	  newlib_search_path+=" $absdir"
+	  func_append newlib_search_path " $absdir"
 	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
@@ -7439,21 +8958,21 @@ func_mode_link ()
                    func_resolve_sysroot "$func_stripname_result";;
               *) func_resolve_sysroot "$deplib" ;;
             esac
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $func_resolve_sysroot_result "*)
-                specialdeplibs+=" $func_resolve_sysroot_result" ;;
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
 	      esac
 	    fi
-	    tmp_libs+=" $func_resolve_sysroot_result"
+	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
-	  if test "$link_all_deplibs" != no; then
+	  if test no != "$link_all_deplibs"; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
 	      path=
 	      case $deplib in
-	      -L*) path="$deplib" ;;
+	      -L*) path=$deplib ;;
 	      *.la)
 	        func_resolve_sysroot "$deplib"
 	        deplib=$func_resolve_sysroot_result
@@ -7461,12 +8980,12 @@ func_mode_link ()
 		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
 		  fi
 		  ;;
 		esac
@@ -7474,35 +8993,35 @@ func_mode_link ()
 		case $host in
 		*-*-darwin*)
 		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                       if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
 		      path=
 		    fi
 		  fi
 		  ;;
 		*)
-		  path="-L$absdir/$objdir"
+		  path=-L$absdir/$objdir
 		  ;;
 		esac
 		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
 		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
+		    func_warning "'$deplib' seems to be moved"
 
-		  path="-L$absdir"
+		  path=-L$absdir
 		fi
 		;;
 	      esac
@@ -7514,38 +9033,38 @@ func_mode_link ()
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
 	# Link the dlpreopened libraries before other libraries
 	for deplib in $save_deplibs; do
 	  deplibs="$deplib $deplibs"
 	done
       fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
 	  # Make sure lib_search_path contains only unique directories.
 	  lib_search_path=
 	  for dir in $newlib_search_path; do
 	    case "$lib_search_path " in
 	    *" $dir "*) ;;
-	    *) lib_search_path+=" $dir" ;;
+	    *) func_append lib_search_path " $dir" ;;
 	    esac
 	  done
 	  newlib_search_path=
-	fi
+	}
 
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
+	if test prog,link = "$linkmode,$pass"; then
 	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
 	fi
 	for var in $vars dependency_libs; do
 	  # Add libraries to $var in reverse order
@@ -7594,71 +9113,102 @@ func_mode_link ()
 	    -L*)
 	      case " $tmp_libs " in
 	      *" $deplib "*) ;;
-	      *) tmp_libs+=" $deplib" ;;
+	      *) func_append tmp_libs " $deplib" ;;
 	      esac
 	      ;;
-	    *) tmp_libs+=" $deplib" ;;
+	    *) func_append tmp_libs " $deplib" ;;
 	    esac
 	  done
 	  eval $var=\"$tmp_libs\"
 	done # for var
       fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
-      for i in $dependency_libs ; do
+      for i in $dependency_libs; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
 	*" $i "*)
-	  i=""
+	  i=
 	  ;;
 	esac
-	if test -n "$i" ; then
-	  tmp_libs+=" $i"
+	if test -n "$i"; then
+	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
     done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
     fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
     fi
 
     case $linkmode in
     oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+	func_warning "'-l' and '-L' are ignored for archives" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
+	func_warning "'-rpath' is ignored for archives"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
+	func_warning "'-R' is ignored for archives"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
+	func_warning "'-version-info/-version-number' is ignored for archives"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
+	func_warning "'-release' is ignored for archives"
 
       test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
+	func_warning "'-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
-      oldlibs="$output"
-      objs+="$old_deplibs"
+      oldlibs=$output
+      func_append objs "$old_deplibs"
       ;;
 
     lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
+      # Make sure we only generate libraries of the form 'libNAME.la'.
       case $outputname in
       lib*)
 	func_stripname 'lib' '.la' "$outputname"
@@ -7667,10 +9217,10 @@ func_mode_link ()
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
 
-	if test "$need_lib_prefix" != no; then
+	if test no != "$need_lib_prefix"; then
 	  # Add the "lib" prefix for modules if required
 	  func_stripname '' '.la' "$outputname"
 	  name=$func_stripname_result
@@ -7684,31 +9234,31 @@ func_mode_link ()
       esac
 
       if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
 	else
 	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
 	  $ECHO "*** objects $objs is not portable!"
-	  libobjs+=" $objs"
+	  func_append libobjs " $objs"
 	fi
       fi
 
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
       shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
 
-      install_libdir="$1"
+      install_libdir=$1
 
       oldlibs=
       if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
+	if test yes = "$build_libtool_libs"; then
 	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
+	  # Some compilers have problems with a '.al' extension so
 	  # convenience libraries should have the same extension an
 	  # archive normally would.
 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -7717,20 +9267,20 @@ func_mode_link ()
 	fi
 
 	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
 
 	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
+	  func_warning "'-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
+	save_ifs=$IFS; IFS=:
 	set dummy $vinfo 0 0 0
 	shift
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
+	  func_fatal_help "too many parameters to '-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -7738,42 +9288,42 @@ func_mode_link ()
 
 	case $vinfo_number in
 	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
 	  # and those that subtract age and use age as
 	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
+	  # that has an extra 1 added just for fun
 	  #
 	  case $version_type in
 	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
+	  darwin|freebsd-elf|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
+	    age=$number_minor
+	    revision=$number_revision
 	    ;;
-	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
+	  freebsd-aout|qnx|sunos)
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
 	    ;;
 	  irix|nonstopux)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
+	    age=$number_minor
+	    revision=$number_minor
 	    lt_irix_increment=no
 	    ;;
 	  esac
 	  ;;
 	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
+	  current=$1
+	  revision=$2
+	  age=$3
 	  ;;
 	esac
 
@@ -7781,30 +9331,30 @@ func_mode_link ()
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -7819,26 +9369,36 @@ func_mode_link ()
 	  # verstring for coding it into the library header
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
 	  ;;
 
 	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
+	  if test no = "$lt_irix_increment"; then
 	    func_arith $current - $age
 	  else
 	    func_arith $current - $age + 1
@@ -7849,69 +9409,74 @@ func_mode_link ()
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
 	  esac
-	  verstring="$verstring_prefix$major.$revision"
+	  verstring=$verstring_prefix$major.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $revision - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
+	    verstring=$verstring_prefix$major.$iface:$verstring
 	  done
 
-	  # Before this point, $major must not contain `.'.
+	  # Before this point, $major must not contain '.'.
 	  major=.$major
-	  versuffix="$major.$revision"
+	  versuffix=$major.$revision
 	  ;;
 
 	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	osf)
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $current - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
+	    verstring=$verstring:$iface.0
 	  done
 
 	  # Make executables depend on our current version.
-	  verstring+=":${current}.0"
+	  func_append verstring ":$current.0"
 	  ;;
 
 	qnx)
-	  major=".$current"
-	  versuffix=".$current"
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sco)
+	  major=.$current
+	  versuffix=.$current
 	  ;;
 
 	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	windows)
 	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
+	  # extension on DOS 8.3 file systems.
 	  func_arith $current - $age
 	  major=$func_arith_result
-	  versuffix="-$major"
+	  versuffix=-$major
 	  ;;
 
 	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  func_fatal_configuration "unknown library version type '$version_type'"
 	  ;;
 	esac
 
@@ -7925,42 +9490,45 @@ func_mode_link ()
 	    verstring=
 	    ;;
 	  *)
-	    verstring="0.0"
+	    verstring=0.0
 	    ;;
 	  esac
-	  if test "$need_version" = no; then
+	  if test no = "$need_version"; then
 	    versuffix=
 	  else
-	    versuffix=".0.0"
+	    versuffix=.0.0
 	  fi
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
+	if test yes,no = "$avoid_version,$need_version"; then
 	  major=
 	  versuffix=
-	  verstring=""
+	  verstring=
 	fi
 
 	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
 	  fi
 	else
 	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
+	  allow_undefined_flag=$no_undefined_flag
 	fi
 
       fi
 
-      func_generate_dlsyms "$libname" "$libname" "yes"
-      libobjs+=" $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
+      func_generate_dlsyms "$libname" "$libname" :
+      func_append libobjs " $symfileobj"
+      test " " = "$libobjs" && libobjs=
 
-      if test "$opt_mode" != relink; then
+      if test relink != "$opt_mode"; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -7969,14 +9537,14 @@ func_mode_link ()
 	  case $p in
 	    *.$objext | *.gcno)
 	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 		 then
 		   continue
 		 fi
 	       fi
-	       removelist+=" $p"
+	       func_append removelist " $p"
 	       ;;
 	    *) ;;
 	  esac
@@ -7986,11 +9554,11 @@ func_mode_link ()
       fi
 
       # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	oldlibs+=" $output_objdir/$libname.$libext"
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
+	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
@@ -8005,38 +9573,38 @@ func_mode_link ()
 	temp_xrpath=
 	for libdir in $xrpath; do
 	  func_replace_sysroot "$libdir"
-	  temp_xrpath+=" -R$func_replace_sysroot_result"
+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
 	  case "$finalize_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_rpath+=" $libdir" ;;
+	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
 	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
       fi
 
       # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
+      old_dlfiles=$dlfiles
       dlfiles=
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
 	*" $lib "*) ;;
-	*) dlfiles+=" $lib" ;;
+	*) func_append dlfiles " $lib" ;;
 	esac
       done
 
       # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
+      old_dlprefiles=$dlprefiles
       dlprefiles=
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
 	*" $lib "*) ;;
-	*) dlprefiles+=" $lib" ;;
+	*) func_append dlprefiles " $lib" ;;
 	esac
       done
 
-      if test "$build_libtool_libs" = yes; then
+      if test yes = "$build_libtool_libs"; then
 	if test -n "$rpath"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -8044,7 +9612,7 @@ func_mode_link ()
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C library is in the System framework
-	    deplibs+=" System.ltframework"
+	    func_append deplibs " System.ltframework"
 	    ;;
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
@@ -8060,8 +9628,8 @@ func_mode_link ()
 	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
-	      deplibs+=" -lc"
+	    if test yes = "$build_libtool_need_lc"; then
+	      func_append deplibs " -lc"
 	    fi
 	    ;;
 	  esac
@@ -8076,9 +9644,9 @@ func_mode_link ()
 	# I'm not sure if I'm treating the release correctly.  I think
 	# release should show up in the -l (ie -lgmp5) so we don't want to
 	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
+	release=
+	versuffix=
+	major=
 	newdeplibs=
 	droppeddeps=no
 	case $deplibs_check_method in
@@ -8107,21 +9675,21 @@ EOF
 	      -l*)
 		func_stripname -l '' "$i"
 		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
-		    newdeplibs+=" $i"
-		    i=""
+		    func_append newdeplibs " $i"
+		    i=
 		    ;;
 		  esac
 		fi
-		if test -n "$i" ; then
+		if test -n "$i"; then
 		  libname=`eval "\\$ECHO \"$libname_spec\""`
 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    newdeplibs+=" $i"
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
 		    echo
@@ -8135,7 +9703,7 @@ EOF
 		fi
 		;;
 	      *)
-		newdeplibs+=" $i"
+		func_append newdeplibs " $i"
 		;;
 	      esac
 	    done
@@ -8150,21 +9718,21 @@ EOF
 		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
-		      newdeplibs+=" $i"
-		      i=""
+		      func_append newdeplibs " $i"
+		      i=
 		      ;;
 		    esac
 		  fi
-		  if test -n "$i" ; then
+		  if test -n "$i"; then
 		    libname=`eval "\\$ECHO \"$libname_spec\""`
 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      newdeplibs+=" $i"
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
 		      echo
@@ -8186,7 +9754,7 @@ EOF
 		fi
 		;;
 	      *)
-		newdeplibs+=" $i"
+		func_append newdeplibs " $i"
 		;;
 	      esac
 	    done
@@ -8200,24 +9768,24 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
-		  newdeplibs+=" $a_deplib"
-		  a_deplib=""
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		if test -n "$file_magic_glob"; then
 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 		else
 		  libnameglob=$libname
 		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
+		  if test yes = "$want_nocaseglob"; then
 		    shopt -s nocaseglob
 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 		    $nocaseglob
@@ -8235,25 +9803,25 @@ EOF
 		      # We might still enter an endless loop, since a link
 		      # loop can be closed while we follow links,
 		      # but so what?
-		      potlib="$potent_lib"
+		      potlib=$potent_lib
 		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
 			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
-			newdeplibs+=" $a_deplib"
-			a_deplib=""
+			func_append newdeplibs " $a_deplib"
+			a_deplib=
 			break 2
 		      fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -8261,7 +9829,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -8271,7 +9839,7 @@ EOF
 	      ;;
 	    *)
 	      # Add a -L argument.
-	      newdeplibs+=" $a_deplib"
+	      func_append newdeplibs " $a_deplib"
 	      ;;
 	    esac
 	  done # Gone through all deplibs.
@@ -8284,30 +9852,30 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
-		  newdeplibs+=" $a_deplib"
-		  a_deplib=""
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    potlib=$potent_lib # see symlink-check above in file_magic test
 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      newdeplibs+=" $a_deplib"
-		      a_deplib=""
+		      func_append newdeplibs " $a_deplib"
+		      a_deplib=
 		      break 2
 		    fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -8315,7 +9883,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -8325,24 +9893,24 @@ EOF
 	      ;;
 	    *)
 	      # Add a -L argument.
-	      newdeplibs+=" $a_deplib"
+	      func_append newdeplibs " $a_deplib"
 	      ;;
 	    esac
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
-	  newdeplibs=""
+	  newdeplibs=
 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
 	    done
 	  fi
 	  case $tmp_deplibs in
 	  *[!\	\ ]*)
 	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
+	    if test none = "$deplibs_check_method"; then
 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
 	      echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -8366,8 +9934,8 @@ EOF
 	  ;;
 	esac
 
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
 	    echo
 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
@@ -8376,12 +9944,12 @@ EOF
 	    if test -z "$global_symbol_pipe"; then
 	      echo
 	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
 	      build_libtool_libs=module
 	      build_old_libs=yes
 	    else
@@ -8392,14 +9960,14 @@ EOF
 	    echo "*** automatically added whenever a program is linked with this library"
 	    echo "*** or is declared to -dlopen it."
 
-	    if test "$allow_undefined" = no; then
+	    if test no = "$allow_undefined"; then
 	      echo
 	      echo "*** Since this library must not contain undefined symbols,"
 	      echo "*** because either the platform does not support them or"
 	      echo "*** it was explicitly requested with -no-undefined,"
 	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -8429,7 +9997,7 @@ EOF
 	*)
 	  case " $deplibs " in
 	  *" -L$path/$objdir "*)
-	    new_libs+=" -L$path/$objdir" ;;
+	    func_append new_libs " -L$path/$objdir" ;;
 	  esac
 	  ;;
 	esac
@@ -8439,13 +10007,13 @@ EOF
 	-L*)
 	  case " $new_libs " in
 	  *" $deplib "*) ;;
-	  *) new_libs+=" $deplib" ;;
+	  *) func_append new_libs " $deplib" ;;
 	  esac
 	  ;;
-	*) new_libs+=" $deplib" ;;
+	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      deplibs="$new_libs"
+      deplibs=$new_libs
 
       # All the library-specific variables (install_libdir is set above).
       library_names=
@@ -8453,65 +10021,65 @@ EOF
       dlname=
 
       # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
 	# FIXME: should test the right _cmds variable.
 	case $archive_cmds in
 	  *\$LD\ *) wl= ;;
         esac
-	if test "$hardcode_into_libs" = yes; then
+	if test yes = "$hardcode_into_libs"; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
 		func_replace_sysroot "$libdir"
 		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
+		  hardcode_libdirs=$libdir
 		else
 		  # Just accumulate the unique libdirs.
 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		    ;;
 		  *)
-		    hardcode_libdirs+="$hardcode_libdir_separator$libdir"
+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		    ;;
 		  esac
 		fi
 	      else
 		eval flag=\"$hardcode_libdir_flag_spec\"
-		dep_rpath+=" $flag"
+		func_append dep_rpath " $flag"
 	      fi
 	    elif test -n "$runpath_var"; then
 	      case "$perm_rpath " in
 	      *" $libdir "*) ;;
-	      *) perm_rpath+=" $libdir" ;;
+	      *) func_append perm_rpath " $libdir" ;;
 	      esac
 	    fi
 	  done
 	  # Substitute the hardcoded libdirs into the rpath.
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
+	    libdir=$hardcode_libdirs
 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 	    # We should set the runpath_var.
 	    rpath=
 	    for dir in $perm_rpath; do
-	      rpath+="$dir:"
+	      func_append rpath "$dir:"
 	    done
 	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
 	  fi
 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -8521,23 +10089,23 @@ EOF
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	shift
-	realname="$1"
+	realname=$1
 	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
 	else
-	  soname="$realname"
+	  soname=$realname
 	fi
 	if test -z "$dlname"; then
 	  dlname=$soname
 	fi
 
-	lib="$output_objdir/$realname"
+	lib=$output_objdir/$realname
 	linknames=
 	for link
 	do
-	  linknames+=" $link"
+	  func_append linknames " $link"
 	done
 
 	# Use standard objects if they are pic
@@ -8547,8 +10115,8 @@ EOF
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
-	  delfiles+=" $export_symbols"
+	  export_symbols=$output_objdir/$libname.uexp
+	  func_append delfiles " $export_symbols"
 	fi
 
 	orig_export_symbols=
@@ -8556,31 +10124,31 @@ EOF
 	cygwin* | mingw* | cegcc*)
 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	    func_dll_def_p "$export_symbols" || {
 	      # and it's NOT already a .def file. Must figure out
 	      # which of the given symbols are data symbols and tag
 	      # them as such. So, trigger use of export_symbols_cmds.
 	      # export_symbols gets reassigned inside the "prepare
 	      # the list of exported symbols" if statement, so the
 	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
+	      orig_export_symbols=$export_symbols
 	      export_symbols=
 	      always_export_symbols=yes
-	    fi
+	    }
 	  fi
 	  ;;
 	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
+	      IFS=$save_ifs
 	      # Take the normal branch if the nm_file_list_spec branch
 	      # doesn't work or if tool conversion is not needed.
 	      case $nm_file_list_spec~$to_tool_file_cmd in
@@ -8594,7 +10162,7 @@ EOF
 		  try_normal_branch=no
 		  ;;
 	      esac
-	      if test "$try_normal_branch" = yes \
+	      if test yes = "$try_normal_branch" \
 		 && { test "$len" -lt "$max_cmd_len" \
 		      || test "$max_cmd_len" -le -1; }
 	      then
@@ -8605,10 +10173,10 @@ EOF
 		output_la=$func_basename_result
 		save_libobjs=$libobjs
 		save_output=$output
-		output=${output_objdir}/${output_la}.nm
+		output=$output_objdir/$output_la.nm
 		func_to_tool_file "$output"
 		libobjs=$nm_file_list_spec$func_to_tool_file_result
-		delfiles+=" $output"
+		func_append delfiles " $output"
 		func_verbose "creating $NM input file list: $output"
 		for obj in $save_libobjs; do
 		  func_to_tool_file "$obj"
@@ -8628,8 +10196,8 @@ EOF
 		break
 	      fi
 	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
@@ -8637,21 +10205,21 @@ EOF
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
 	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
 	  # though. Also, the filter scales superlinearly with the number of
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  delfiles+=" $export_symbols $output_objdir/$libname.filter"
+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 	  export_symbols=$output_objdir/$libname.def
 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	fi
@@ -8661,15 +10229,15 @@ EOF
 	  case " $convenience " in
 	  *" $test_deplib "*) ;;
 	  *)
-	    tmp_deplibs+=" $test_deplib"
+	    func_append tmp_deplibs " $test_deplib"
 	    ;;
 	  esac
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
+	    test yes = "$compiler_needs_object" &&
 	    test -z "$libobjs"; then
 	    # extract the archives, so we have objects to list.
 	    # TODO: could optimize this to just extract one archive.
@@ -8680,27 +10248,27 @@ EOF
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    gentop="$output_objdir/${outputname}x"
-	    generated+=" $gentop"
+	    gentop=$output_objdir/${outputname}x
+	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
-	    libobjs+=" $func_extract_archives_result"
+	    func_append libobjs " $func_extract_archives_result"
 	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	fi
 
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
-	  linker_flags+=" $flag"
+	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
+	if test yes = "$module" && test -n "$module_cmds"; then
 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	    eval test_cmds=\"$module_expsym_cmds\"
 	    cmds=$module_expsym_cmds
@@ -8718,7 +10286,7 @@ EOF
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" &&
+	if test : != "$skipped_export" &&
 	   func_len " $test_cmds" &&
 	   len=$func_len_result &&
 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -8751,8 +10319,8 @@ EOF
 	  last_robj=
 	  k=1
 
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
 	    func_verbose "creating GNU ld script: $output"
 	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
@@ -8761,17 +10329,17 @@ EOF
 	      $ECHO "$func_to_tool_file_result" >> $output
 	    done
 	    echo ')' >> $output
-	    delfiles+=" $output"
+	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
 	    func_verbose "creating linker input file list: $output"
 	    : > $output
 	    set x $save_libobjs
 	    shift
 	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
+	    if test yes = "$compiler_needs_object"; then
 	      firstobj="$1 "
 	      shift
 	    fi
@@ -8780,13 +10348,13 @@ EOF
 	      func_to_tool_file "$obj"
 	      $ECHO "$func_to_tool_file_result" >> $output
 	    done
-	    delfiles+=" $output"
+	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
+	      output=$output_objdir/$output_la-$k.$objext
 	      eval test_cmds=\"$reload_cmds\"
 	      func_len " $test_cmds"
 	      len0=$func_len_result
@@ -8798,13 +10366,13 @@ EOF
 		func_len " $obj"
 		func_arith $len + $func_len_result
 		len=$func_arith_result
-		if test "X$objlist" = X ||
+		if test -z "$objlist" ||
 		   test "$len" -lt "$max_cmd_len"; then
-		  objlist+=" $obj"
+		  func_append objlist " $obj"
 		else
 		  # The command $test_cmds is almost too long, add a
 		  # command to the queue.
-		  if test "$k" -eq 1 ; then
+		  if test 1 -eq "$k"; then
 		    # The first file doesn't have a previous command to add.
 		    reload_objs=$objlist
 		    eval concat_cmds=\"$reload_cmds\"
@@ -8814,10 +10382,10 @@ EOF
 		    reload_objs="$objlist $last_robj"
 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  last_robj=$output_objdir/$output_la-$k.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
+		  output=$output_objdir/$output_la-$k.$objext
 		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
@@ -8829,19 +10397,19 @@ EOF
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
 	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	      delfiles+=" $output"
+	      func_append delfiles " $output"
 
 	    else
 	      output=
 	    fi
 
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
 	      $opt_dry_run || $RM $export_symbols
 	      libobjs=$output
 	      # Append the command to create the export file.
@@ -8850,16 +10418,16 @@ EOF
 	      if test -n "$last_robj"; then
 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	    fi
+	    }
 
 	    test -n "$save_libobjs" &&
 	      func_verbose "creating a temporary reloadable object file: $output"
 
 	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
+	      IFS=$save_ifs
+	      $opt_quiet || {
 		  func_quote_for_expand "$cmd"
 		  eval "func_echo $func_quote_for_expand_result"
 	      }
@@ -8867,7 +10435,7 @@ EOF
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
+		if test relink = "$opt_mode"; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -8876,7 +10444,7 @@ EOF
 		exit $lt_exit
 	      }
 	    done
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 
 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -8884,27 +10452,27 @@ EOF
 	    fi
 	  fi
 
-          if ${skipped_export-false}; then
+          ${skipped_export-false} && {
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
 	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
 	      # though. Also, the filter scales superlinearly with the number of
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      delfiles+=" $export_symbols $output_objdir/$libname.filter"
+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
-	  fi
+	  }
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -8918,7 +10486,7 @@ EOF
 	  # value of $libobjs for piecewise linking.
 
 	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test yes = "$module" && test -n "$module_cmds"; then
 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	      cmds=$module_expsym_cmds
 	    else
@@ -8940,19 +10508,20 @@ EOF
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  generated+=" $gentop"
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
-	  libobjs+=" $func_extract_archives_result"
+	  func_append libobjs " $func_extract_archives_result"
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
-	save_ifs="$IFS"; IFS='~'
+	save_ifs=$IFS; IFS='~'
 	for cmd in $cmds; do
-	  IFS="$save_ifs"
+	  IFS=$sp$nl
 	  eval cmd=\"$cmd\"
-	  $opt_silent || {
+	  IFS=$save_ifs
+	  $opt_quiet || {
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
@@ -8960,7 +10529,7 @@ EOF
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
+	    if test relink = "$opt_mode"; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -8969,10 +10538,10 @@ EOF
 	    exit $lt_exit
 	  }
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -8992,39 +10561,39 @@ EOF
 	done
 
 	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
+	if test yes = "$module" || test yes = "$export_dynamic"; then
 	  # On all known operating systems, these are identical.
-	  dlname="$soname"
+	  dlname=$soname
 	fi
       fi
       ;;
 
     obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+	func_warning "'-l' and '-L' are ignored for objects" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
+	func_warning "'-rpath' is ignored for objects"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
+	func_warning "'-R' is ignored for objects"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
+	func_warning "'-version-info' is ignored for objects"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
+	func_warning "'-release' is ignored for objects"
 
       case $output in
       *.lo)
 	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
 
 	libobj=$output
 	func_lo2o "$libobj"
@@ -9032,7 +10601,7 @@ EOF
 	;;
       *)
 	libobj=
-	obj="$output"
+	obj=$output
 	;;
       esac
 
@@ -9045,18 +10614,20 @@ EOF
       # the extraction.
       reload_conv_objs=
       gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
 	else
-	  gentop="$output_objdir/${obj}x"
-	  generated+=" $gentop"
+	  gentop=$output_objdir/${obj}x
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
@@ -9064,12 +10635,12 @@ EOF
       fi
 
       # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
 
-      output="$obj"
+      output=$obj
       func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
@@ -9081,7 +10652,7 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$build_libtool_libs" != yes; then
+      test yes = "$build_libtool_libs" || {
 	if test -n "$gentop"; then
 	  func_show_eval '${RM}r "$gentop"'
 	fi
@@ -9091,12 +10662,12 @@ EOF
 	# $show "echo timestamp > $libobj"
 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
-      fi
+      }
 
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
+	output=$libobj
 	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
@@ -9113,16 +10684,14 @@ EOF
 	          output=$func_stripname_result.exe;;
       esac
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
+	func_warning "'-version-info' is ignored for programs"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
+	func_warning "'-release' is ignored for programs"
 
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
@@ -9136,11 +10705,11 @@ EOF
       *-*-darwin*)
 	# Don't allow lazy linking, it breaks C++ global constructors
 	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
+	if test CXX = "$tagname"; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      compile_command+=" ${wl}-bind_at_load"
-	      finalize_command+=" ${wl}-bind_at_load"
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
 	    ;;
 	  esac
 	fi
@@ -9160,7 +10729,7 @@ EOF
 	*)
 	  case " $compile_deplibs " in
 	  *" -L$path/$objdir "*)
-	    new_libs+=" -L$path/$objdir" ;;
+	    func_append new_libs " -L$path/$objdir" ;;
 	  esac
 	  ;;
 	esac
@@ -9170,17 +10739,17 @@ EOF
 	-L*)
 	  case " $new_libs " in
 	  *" $deplib "*) ;;
-	  *) new_libs+=" $deplib" ;;
+	  *) func_append new_libs " $deplib" ;;
 	  esac
 	  ;;
-	*) new_libs+=" $deplib" ;;
+	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      compile_deplibs="$new_libs"
+      compile_deplibs=$new_libs
 
 
-      compile_command+=" $compile_deplibs"
-      finalize_command+=" $finalize_deplibs"
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
 
       if test -n "$rpath$xrpath"; then
 	# If the user specified any rpath flags, then add them.
@@ -9188,7 +10757,7 @@ EOF
 	  # This is the magic to use -rpath.
 	  case "$finalize_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_rpath+=" $libdir" ;;
+	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
       fi
@@ -9200,39 +10769,39 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		;;
 	      *)
-		hardcode_libdirs+="$hardcode_libdir_separator$libdir"
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		;;
 	      esac
 	    fi
 	  else
 	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath+=" $flag"
+	    func_append rpath " $flag"
 	  fi
 	elif test -n "$runpath_var"; then
 	  case "$perm_rpath " in
 	  *" $libdir "*) ;;
-	  *) perm_rpath+=" $libdir" ;;
+	  *) func_append perm_rpath " $libdir" ;;
 	  esac
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
-	  *) dllsearchpath+=":$libdir";;
+	  *) func_append dllsearchpath ":$libdir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
 	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath+=":$testbindir";;
+	  *) func_append dllsearchpath ":$testbindir";;
 	  esac
 	  ;;
 	esac
@@ -9240,10 +10809,10 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      compile_rpath="$rpath"
+      compile_rpath=$rpath
 
       rpath=
       hardcode_libdirs=
@@ -9251,70 +10820,68 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		;;
 	      *)
-		hardcode_libdirs+="$hardcode_libdir_separator$libdir"
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		;;
 	      esac
 	    fi
 	  else
 	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath+=" $flag"
+	    func_append rpath " $flag"
 	  fi
 	elif test -n "$runpath_var"; then
 	  case "$finalize_perm_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_perm_rpath+=" $libdir" ;;
+	  *) func_append finalize_perm_rpath " $libdir" ;;
 	  esac
 	fi
       done
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      finalize_rpath="$rpath"
+      finalize_rpath=$rpath
 
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
 	# Transform all the library objects into standard objects.
 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
 
       # template prelinking step
       if test -n "$prelink_cmds"; then
 	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      wrappers_required=yes
+      wrappers_required=:
       case $host in
       *cegcc* | *mingw32ce*)
         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
+        wrappers_required=false
         ;;
       *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
+        test yes = "$build_libtool_libs" || wrappers_required=false
         ;;
       *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
         fi
         ;;
       esac
-      if test "$wrappers_required" = no; then
+      $wrappers_required || {
 	# Replace the output file specification.
 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
+	link_command=$compile_command$compile_rpath
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
@@ -9327,12 +10894,12 @@ EOF
 	fi
 
 	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
 	fi
 
 	exit $exit_status
-      fi
+      }
 
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -9348,7 +10915,7 @@ EOF
 	  # We should set the runpath_var.
 	  rpath=
 	  for dir in $perm_rpath; do
-	    rpath+="$dir:"
+	    func_append rpath "$dir:"
 	  done
 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
@@ -9356,15 +10923,15 @@ EOF
 	  # We should set the runpath_var.
 	  rpath=
 	  for dir in $finalize_perm_rpath; do
-	    rpath+="$dir:"
+	    func_append rpath "$dir:"
 	  done
 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
       fi
 
-      if test "$no_install" = yes; then
+      if test yes = "$no_install"; then
 	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
+	link_command=$compile_var$compile_command$compile_rpath
 	# Replace the output file specification.
 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
@@ -9381,27 +10948,28 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
 
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
 
       # Replace the output file specification.
       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -9458,8 +11026,8 @@ EOF
 	    func_dirname_and_basename "$output" "" "."
 	    output_name=$func_basename_result
 	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
 	    $RM $cwrappersource $cwrapper
 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
@@ -9480,7 +11048,7 @@ EOF
 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
+	      if test "x$build" = "x$host"; then
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9503,43 +11071,45 @@ EOF
     # See if we need to build an old-fashioned archive.
     for oldlib in $oldlibs; do
 
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
 	  build_libtool_libs=no
-	else
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
 	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    oldobjs+=" $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
 
       if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
-	generated+=" $gentop"
+	gentop=$output_objdir/${outputname}x
+	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
-	oldobjs+=" $func_extract_archives_result"
+	func_append oldobjs " $func_extract_archives_result"
       fi
 
       # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
 	cmds=$old_archive_from_new_cmds
       else
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  generated+=" $gentop"
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
-	  oldobjs+=" $func_extract_archives_result"
+	  func_append oldobjs " $func_extract_archives_result"
 	fi
 
 	# POSIX demands no paths to be encoded in archives.  We have
@@ -9556,8 +11126,8 @@ EOF
 	  :
 	else
 	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
-	  generated+=" $gentop"
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
 	  oldobjs=
@@ -9565,7 +11135,7 @@ EOF
 	  for obj in $save_oldobjs
 	  do
 	    func_basename "$obj"
-	    objbase="$func_basename_result"
+	    objbase=$func_basename_result
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -9581,9 +11151,9 @@ EOF
 		esac
 	      done
 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      oldobjs+=" $gentop/$newobj"
+	      func_append oldobjs " $gentop/$newobj"
 	      ;;
-	    *) oldobjs+=" $obj" ;;
+	    *) func_append oldobjs " $obj" ;;
 	    esac
 	  done
 	fi
@@ -9628,24 +11198,24 @@ EOF
 	    func_len " $obj"
 	    func_arith $len + $func_len_result
 	    len=$func_arith_result
-	    objlist+=" $obj"
+	    func_append objlist " $obj"
 	    if test "$len" -lt "$max_cmd_len"; then
 	      :
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
+	      if test "$obj" = "$last_oldobj"; then
 		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
 	      objlist=
 	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
 	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
+	  if test -z "$oldobjs"; then
 	    eval cmds=\"\$concat_cmds\"
 	  else
 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -9662,7 +11232,7 @@ EOF
     case $output in
     *.la)
       old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      test yes = "$build_old_libs" && old_library=$libname.$libext
       func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
@@ -9677,63 +11247,63 @@ EOF
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
+      if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
 
       # Only create the output if not a dry run.
       $opt_dry_run || {
 	for installed in no yes; do
-	  if test "$installed" = yes; then
+	  if test yes = "$installed"; then
 	    if test -z "$install_libdir"; then
 	      break
 	    fi
-	    output="$output_objdir/$outputname"i
+	    output=$output_objdir/${outputname}i
 	    # Replace all uninstalled libtool libraries with the installed ones
 	    newdependency_libs=
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
 		func_basename "$deplib"
-		name="$func_basename_result"
+		name=$func_basename_result
 		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
-		newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      -L*)
 		func_stripname -L '' "$deplib"
 		func_replace_sysroot "$func_stripname_result"
-		newdependency_libs+=" -L$func_replace_sysroot_result"
+		func_append newdependency_libs " -L$func_replace_sysroot_result"
 		;;
 	      -R*)
 		func_stripname -R '' "$deplib"
 		func_replace_sysroot "$func_stripname_result"
-		newdependency_libs+=" -R$func_replace_sysroot_result"
+		func_append newdependency_libs " -R$func_replace_sysroot_result"
 		;;
-	      *) newdependency_libs+=" $deplib" ;;
+	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
-	    dependency_libs="$newdependency_libs"
+	    dependency_libs=$newdependency_libs
 	    newdlfiles=
 
 	    for lib in $dlfiles; do
 	      case $lib in
 	      *.la)
 	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
-	      *) newdlfiles+=" $lib" ;;
+	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
@@ -9743,34 +11313,34 @@ EOF
 		# didn't already link the preopened objects directly into
 		# the library:
 		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
-	      newdlfiles+=" $abs"
+	      func_append newdlfiles " $abs"
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
-	      newdlprefiles+=" $abs"
+	      func_append newdlprefiles " $abs"
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
@@ -9786,10 +11356,9 @@ EOF
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
+	      if test -n "$bindir"; then
 		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
+		tdlname=$func_relative_path_result/$dlname
 	      else
 		# Otherwise fall back on heuristic.
 		tdlname=../bin/$dlname
@@ -9798,7 +11367,7 @@ EOF
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -9812,7 +11381,7 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
@@ -9838,7 +11407,7 @@ dlpreopen='$dlprefiles'
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
+	  if test no,yes = "$installed,$need_relink"; then
 	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
@@ -9853,29 +11422,31 @@ relink_command=\"$relink_command\""
     exit $EXIT_SUCCESS
 }
 
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
 
 
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
-    $opt_debug
-    RM="$nonopt"
+    $debug_cmd
+
+    RM=$nonopt
     files=
-    rmforce=
+    rmforce=false
     exit_status=0
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     for arg
     do
       case $arg in
-      -f) RM+=" $arg"; rmforce=yes ;;
-      -*) RM+=" $arg" ;;
-      *) files+=" $arg" ;;
+      -f) func_append RM " $arg"; rmforce=: ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
       esac
     done
 
@@ -9886,21 +11457,21 @@ func_mode_uninstall ()
 
     for file in $files; do
       func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
       else
-	odir="$dir/$objdir"
+	odir=$dir/$objdir
       fi
       func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
 
       # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
+      if test clean = "$opt_mode"; then
 	case " $rmdirs " in
 	  *" $odir "*) ;;
-	  *) rmdirs+=" $odir" ;;
+	  *) func_append rmdirs " $odir" ;;
 	esac
       fi
 
@@ -9912,11 +11483,11 @@ func_mode_uninstall ()
       elif test -d "$file"; then
 	exit_status=1
 	continue
-      elif test "$rmforce" = yes; then
+      elif $rmforce; then
 	continue
       fi
 
-      rmfiles="$file"
+      rmfiles=$file
 
       case $name in
       *.la)
@@ -9926,27 +11497,27 @@ func_mode_uninstall ()
 
 	  # Delete the libtool libraries and symlinks.
 	  for n in $library_names; do
-	    rmfiles+=" $odir/$n"
+	    func_append rmfiles " $odir/$n"
 	  done
-	  test -n "$old_library" && rmfiles+=" $odir/$old_library"
+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$opt_mode" in
+	  case $opt_mode in
 	  clean)
 	    case " $library_names " in
 	    *" $dlname "*) ;;
-	    *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
 	    esac
-	    test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
 	    ;;
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -9962,21 +11533,19 @@ func_mode_uninstall ()
 	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
-	    rmfiles+=" $dir/$pic_object"
+	  if test -n "$pic_object" && test none != "$pic_object"; then
+	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
-	    rmfiles+=" $dir/$non_pic_object"
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
+	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$opt_mode" = clean ; then
+	if test clean = "$opt_mode"; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -9986,7 +11555,7 @@ func_mode_uninstall ()
 	    noexename=$func_stripname_result
 	    # $file with .exe has already been added to rmfiles,
 	    # add $file without .exe
-	    rmfiles+=" $file"
+	    func_append rmfiles " $file"
 	    ;;
 	  esac
 	  # Do a test to see if this is a libtool program.
@@ -9995,7 +11564,7 @@ func_mode_uninstall ()
 	      func_ltwrapper_scriptname "$file"
 	      relink_command=
 	      func_source $func_ltwrapper_scriptname_result
-	      rmfiles+=" $func_ltwrapper_scriptname_result"
+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
 	    else
 	      relink_command=
 	      func_source $dir/$noexename
@@ -10003,12 +11572,12 @@ func_mode_uninstall ()
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    rmfiles+=" $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      rmfiles+=" $odir/lt-$name"
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
+	      func_append rmfiles " $odir/lt-$name"
 	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      rmfiles+=" $odir/lt-${noexename}.c"
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
 	    fi
 	  fi
 	fi
@@ -10017,7 +11586,7 @@ func_mode_uninstall ()
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
 
-    # Try to remove the ${objdir}s in the directories where we deleted files
+    # Try to remove the $objdir's in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
 	func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -10027,16 +11596,17 @@ func_mode_uninstall ()
     exit $exit_status
 }
 
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
 
 test -z "$opt_mode" && {
-  help="$generic_help"
+  help=$generic_help
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
+  func_fatal_help "invalid operation mode '$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
@@ -10047,7 +11617,7 @@ exit $exit_status
 
 
 # The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
+# where we disable both kinds of libraries.  Given conflicting
 # choices, we go for a static library, that is the most portable,
 # since we can't tell whether shared libraries were disabled because
 # the user asked for that or because the platform doesn't support
@@ -10070,5 +11640,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # mode:shell-script
 # sh-indentation:2
 # End:
-# vi:sw=2
-
diff --git a/ltmain.sh b/ltmain.sh
index 63ae69d..0f0a2da 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,9 +1,12 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
 
-# libtool (GNU libtool) 2.4.2
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -23,881 +26,2112 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.2
-TIMESTAMP=""
-package_revision=1.3337
+VERSION=2.4.6
+package_revision=2.4.6
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
 
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
 	fi"
 done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
 
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
 
 
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+		   func_path_progs_result=$func_check_prog_result
+		   ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
+
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
 
 : ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
 
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
 
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-} # func_dirname may be replaced by extended shell implementation
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
 
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
 
-# func_basename file
-func_basename ()
-{
-    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
 
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-    # Extract subdirectory from the argument.
-    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
 
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-    case ${2} in
-      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-    esac
-} # func_stripname may be replaced by extended shell implementation
 
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
 
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
 
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-#             value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
-      fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
-      "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
-        ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
-        ;;
-      *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
-        ;;
-    esac
-  done
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
 
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
 
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
-}
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
 
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
 
-# Make sure we have an absolute path for reexecution:
+# Make sure we have an absolute progpath for reexecution:
 case $progpath in
   [\\/]*|[A-Za-z]:\\*) ;;
   *[\\/]*)
-     progdir=$func_dirname_result
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
      progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
   *)
-     save_IFS="$IFS"
+     _G_IFS=$IFS
      IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
-       IFS="$save_IFS"
+       IFS=$_G_IFS
        test -x "$progdir/$progname" && break
      done
-     IFS="$save_IFS"
+     IFS=$_G_IFS
      test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
 esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
 
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
 
-# Standard options:
 opt_dry_run=false
-opt_help=false
 opt_quiet=false
 opt_verbose=false
-opt_warning=:
 
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
 
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
 
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
 
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
 
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
 
-    # bash bug again:
-    :
-}
 
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
 {
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
 
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
+    require_term_colors=:
 }
-help="Try \`$progname --help' for more information."  ## default
 
 
-# func_grep expression filename
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
 # Check whether EXPRESSION matches any line of FILENAME, without output.
 func_grep ()
 {
+    $debug_cmd
+
     $GREP "$1" "$2" >/dev/null 2>&1
 }
 
 
-# func_mkdir_p directory-path
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
 # Make sure the entire path to DIRECTORY-PATH is available.
 func_mkdir_p ()
 {
-    my_directory_path="$1"
-    my_dir_list=
+    $debug_cmd
 
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+    _G_directory_path=$1
+    _G_dir_list=
 
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
       esac
 
       # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
+      while test ! -d "$_G_directory_path"; do
         # ...make a list in topmost first order.  Use a colon delimited
 	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
+        _G_dir_list=$_G_directory_path:$_G_dir_list
 
         # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
+        case $_G_directory_path in */*) ;; *) break ;; esac
 
         # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
       done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
 
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
         # try to create one of the directories concurrently.  Don't
         # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
+        $MKDIR "$_G_dir" 2>/dev/null || :
       done
-      IFS="$save_mkdir_p_IFS"
+      IFS=$func_mkdir_p_IFS
 
       # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
     fi
 }
 
 
-# func_mktempdir [string]
+# func_mktempdir [BASENAME]
+# -------------------------
 # Make a temporary directory that won't clash with other running
 # libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
+# given, BASENAME is the basename for that directory.
 func_mktempdir ()
 {
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
 
-    if test "$opt_dry_run" = ":"; then
+    if test : = "$opt_dry_run"; then
       # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
+      _G_tmpdir=$_G_template-$$
     else
 
       # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
 
-      if test ! -d "$my_tmpdir"; then
+      if test ! -d "$_G_tmpdir"; then
         # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
 
-        save_mktempdir_umask=`umask`
+        func_mktempdir_umask=`umask`
         umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
+      "")
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
+        ;;
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
+        ;;
+      *)
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+        ;;
+    esac
+
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
+
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
     fi
 
-    $ECHO "$my_tmpdir"
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    $debug_cmd
+
+    case $1 in
+      *[\\\`\"]*)
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        _G_arg=$1 ;;
+    esac
+
+    case $_G_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        _G_arg=\"$_G_arg\"
+        ;;
+    esac
+
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
 }
 
 
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
 {
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
+    $debug_cmd
 
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
-        ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
-    esac
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
+
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
 }
 
 
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
 {
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
+    $debug_cmd
 
-    case $my_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
-        ;;
-    esac
+    func_parse_options_result=
 
-    func_quote_for_expand_result="$my_arg"
-}
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
 
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
 
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
 }
 
 
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
+    func_run_hooks func_validate_options ${1+"$@"}
 
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
 }
 
 
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $opt_debug
 
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
-}
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
 
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
 }
 
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
 func_help ()
 {
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
 }
 
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
 # Echo program name prefixed message to standard error and set global
 # exit_cmd.
 func_missing_arg ()
 {
-    $opt_debug
+    $debug_cmd
 
-    func_error "missing argument for $1."
+    func_error "Missing argument for '$1'."
     exit_cmd=exit
 }
 
 
-# func_split_short_opt shortopt
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
 # Set func_split_short_opt_name and func_split_short_opt_arg shell
 # variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
 {
-    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+    $debug_cmd
 
-    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
-    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
 
 
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
 {
-    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-    my_sed_long_arg='1s/^--[^=]*=//'
+    $debug_cmd
 
-    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
-    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
 
-exit_cmd=:
 
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
 
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
 
+    exit $?
+}
 
 
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
 
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
 
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
 
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
 {
-    eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
+    $debug_cmd
 
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
-    func_quote_for_eval "${2}"
-    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
+    _G_message=$*
 
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
 
-# func_arith arithmetic-term...
-func_arith ()
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
 {
-    func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
+    $debug_cmd
 
+    $warning_func ${1+"$@"}
+}
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
 
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
 
-# func_lo2o object
-func_lo2o ()
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
 {
-    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname (GNU libtool) 2.4.6
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool at gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
 
 
-# func_xform libobj-or-source
-func_xform ()
-{
-    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
 
 
-# func_fatal_configuration arg...
+# func_fatal_configuration ARG...
+# -------------------------------
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
 func_fatal_configuration ()
 {
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
 }
 
 
 # func_config
+# -----------
 # Display the configuration for all the tags in this script.
 func_config ()
 {
@@ -915,17 +2149,19 @@ func_config ()
     exit $?
 }
 
+
 # func_features
+# -------------
 # Display the features supported by this script.
 func_features ()
 {
     echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       echo "enable shared libraries"
     else
       echo "disable shared libraries"
     fi
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       echo "enable static libraries"
     else
       echo "disable static libraries"
@@ -934,314 +2170,350 @@ func_features ()
     exit $?
 }
 
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
 # Verify that TAGNAME is valid, and either flag an error and exit, or
 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
 # variable here.
 func_enable_tag ()
 {
-  # Global variable:
-  tagname="$1"
+    # Global variable:
+    tagname=$1
 
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
 
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
 
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
     *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
+
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
 }
 
+
 # func_check_version_match
+# ------------------------
 # Ensure that we are using m4 macros, and libtool script from the same
 # release of libtool.
 func_check_version_match ()
 {
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from an older release.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      else
-        cat >&2 <<_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
 $progname: of $PACKAGE $VERSION and run autoconf again.
 _LT_EOF
-    fi
+      fi
 
-    exit $EXIT_MISMATCH
-  fi
+      exit $EXIT_MISMATCH
+    fi
 }
 
 
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
 
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
 
+    nonopt=
+    preserve_args=
 
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
+    esac
+
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
 
 
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
 {
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-func_append preserve_args " $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-func_append preserve_args " $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-func_append preserve_args " $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-func_append preserve_args " $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
-
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
-
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-    esac
-  done
+    $debug_cmd
 
-  # Validate options:
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+	# An option not handled by this hook function:
+        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+      esac
+    done
 
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
 
-  # preserve --debug
-  test "$opt_debug" = : || func_append preserve_args " --debug"
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
 
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
 
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
 
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
     fi
 
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
 
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
 
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
+
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
 
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
 
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
 }
+func_add_hook func_validate_options libtool_validate_options
 
 
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
 
 
 ## ----------- ##
 ##    Main.    ##
 ## ----------- ##
 
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
 # func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function is only a basic sanity check; it will hardly flush out
 # determined imposters.
 func_lalib_p ()
 {
     test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function implements the same check as func_lalib_p without
 # resorting to external programs.  To this end, it redirects stdin and
 # closes it afterwards, without saving the original file descriptor.
 # As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
+# fatal anyway.  Works if 'file' does not exist.
 func_lalib_unsafe_p ()
 {
     lalib_p=no
@@ -1249,13 +2521,13 @@ func_lalib_unsafe_p ()
 	for lalib_p_l in 1 2 3 4
 	do
 	    read lalib_p_line
-	    case "$lalib_p_line" in
+	    case $lalib_p_line in
 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
 	    esac
 	done
 	exec 0<&5 5<&-
     fi
-    test "$lalib_p" = yes
+    test yes = "$lalib_p"
 }
 
 # func_ltwrapper_script_p file
@@ -1264,7 +2536,8 @@ func_lalib_unsafe_p ()
 # determined imposters.
 func_ltwrapper_script_p ()
 {
-    func_lalib_p "$1"
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_ltwrapper_executable_p file
@@ -1289,7 +2562,7 @@ func_ltwrapper_scriptname ()
 {
     func_dirname_and_basename "$1" "" "."
     func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
 }
 
 # func_ltwrapper_p file
@@ -1308,11 +2581,13 @@ func_ltwrapper_p ()
 # FAIL_CMD may read-access the current command in variable CMD!
 func_execute_cmds ()
 {
-    $opt_debug
+    $debug_cmd
+
     save_ifs=$IFS; IFS='~'
     for cmd in $1; do
-      IFS=$save_ifs
+      IFS=$sp$nl
       eval cmd=\"$cmd\"
+      IFS=$save_ifs
       func_show_eval "$cmd" "${2-:}"
     done
     IFS=$save_ifs
@@ -1324,10 +2599,11 @@ func_execute_cmds ()
 # Note that it is not necessary on cygwin/mingw to append a dot to
 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
 func_source ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $1 in
     */* | *\\*)	. "$1" ;;
     *)		. "./$1" ;;
@@ -1354,10 +2630,10 @@ func_resolve_sysroot ()
 # store the result into func_replace_sysroot_result.
 func_replace_sysroot ()
 {
-  case "$lt_sysroot:$1" in
+  case $lt_sysroot:$1 in
   ?*:"$lt_sysroot"*)
     func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
+    func_replace_sysroot_result='='$func_stripname_result
     ;;
   *)
     # Including no sysroot.
@@ -1374,7 +2650,8 @@ func_replace_sysroot ()
 # arg is usually of the form 'gcc ...'
 func_infer_tag ()
 {
-    $opt_debug
+    $debug_cmd
+
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -1393,7 +2670,7 @@ func_infer_tag ()
 	for z in $available_tags; do
 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
@@ -1418,7 +2695,7 @@ func_infer_tag ()
 	# line option must be used.
 	if test -z "$tagname"; then
 	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
+	  func_fatal_error "specify a tag with '--tag'"
 #	else
 #	  func_verbose "using $tagname tagged configuration"
 	fi
@@ -1434,15 +2711,15 @@ func_infer_tag ()
 # but don't create it if we're doing a dry run.
 func_write_libtool_object ()
 {
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
     else
       write_lobj=none
     fi
 
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
     else
       write_oldobj=none
     fi
@@ -1450,7 +2727,7 @@ func_write_libtool_object ()
     $opt_dry_run || {
       cat >${write_libobj}T <<EOF
 # $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -1462,7 +2739,7 @@ pic_object=$write_lobj
 non_pic_object=$write_oldobj
 
 EOF
-      $MV "${write_libobj}T" "${write_libobj}"
+      $MV "${write_libobj}T" "$write_libobj"
     }
 }
 
@@ -1482,8 +2759,9 @@ EOF
 # be empty on error (or when ARG is empty)
 func_convert_core_file_wine_to_w32 ()
 {
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
   if test -n "$1"; then
     # Unfortunately, winepath does not exit with a non-zero error code, so we
     # are forced to check the contents of stdout. On the other hand, if the
@@ -1491,9 +2769,9 @@ func_convert_core_file_wine_to_w32 ()
     # *an error message* to stdout. So we must check for both error code of
     # zero AND non-empty stdout, which explains the odd construction:
     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
+        $SED -e "$sed_naive_backslashify"`
     else
       func_convert_core_file_wine_to_w32_result=
     fi
@@ -1514,18 +2792,19 @@ func_convert_core_file_wine_to_w32 ()
 # are convertible, then the result may be empty.
 func_convert_core_path_wine_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
+  func_convert_core_path_wine_to_w32_result=
   if test -n "$1"; then
     oldIFS=$IFS
     IFS=:
     for func_convert_core_path_wine_to_w32_f in $1; do
       IFS=$oldIFS
       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
         if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
         else
           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
         fi
@@ -1554,7 +2833,8 @@ func_convert_core_path_wine_to_w32 ()
 # environment variable; do not put it in $PATH.
 func_cygpath ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     if test "$?" -ne 0; then
@@ -1563,7 +2843,7 @@ func_cygpath ()
     fi
   else
     func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
   fi
 }
 #end: func_cygpath
@@ -1574,10 +2854,11 @@ func_cygpath ()
 # result in func_convert_core_msys_to_w32_result.
 func_convert_core_msys_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # awkward: cmd appends spaces to result
   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
 }
 #end: func_convert_core_msys_to_w32
 
@@ -1588,13 +2869,14 @@ func_convert_core_msys_to_w32 ()
 # func_to_host_file_result to ARG1).
 func_convert_file_check ()
 {
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
     func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
+    func_error "  '$1'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback:
-    func_to_host_file_result="$1"
+    func_to_host_file_result=$1
   fi
 }
 # end func_convert_file_check
@@ -1606,10 +2888,11 @@ func_convert_file_check ()
 # func_to_host_file_result to a simplistic fallback value (see below).
 func_convert_path_check ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$4" && test -n "$3"; then
     func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
+    func_error "  '$3'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback.  This is a deliberately simplistic "conversion" and
     # should not be "improved".  See libtool.info.
@@ -1618,7 +2901,7 @@ func_convert_path_check ()
       func_to_host_path_result=`echo "$3" |
         $SED -e "$lt_replace_pathsep_chars"`
     else
-      func_to_host_path_result="$3"
+      func_to_host_path_result=$3
     fi
   fi
 }
@@ -1630,9 +2913,10 @@ func_convert_path_check ()
 # and appending REPL if ORIG matches BACKPAT.
 func_convert_path_front_back_pathsep ()
 {
-  $opt_debug
+  $debug_cmd
+
   case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
     ;;
   esac
   case $4 in
@@ -1646,7 +2930,7 @@ func_convert_path_front_back_pathsep ()
 ##################################################
 # $build to $host FILE NAME CONVERSION FUNCTIONS #
 ##################################################
-# invoked via `$to_host_file_cmd ARG'
+# invoked via '$to_host_file_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # Result will be available in $func_to_host_file_result.
@@ -1657,7 +2941,8 @@ func_convert_path_front_back_pathsep ()
 # in func_to_host_file_result.
 func_to_host_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   $to_host_file_cmd "$1"
 }
 # end func_to_host_file
@@ -1669,7 +2954,8 @@ func_to_host_file ()
 # in (the comma separated) LAZY, no conversion takes place.
 func_to_tool_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   case ,$2, in
     *,"$to_tool_file_cmd",*)
       func_to_tool_file_result=$1
@@ -1687,7 +2973,7 @@ func_to_tool_file ()
 # Copy ARG to func_to_host_file_result.
 func_convert_file_noop ()
 {
-  func_to_host_file_result="$1"
+  func_to_host_file_result=$1
 }
 # end func_convert_file_noop
 
@@ -1698,11 +2984,12 @@ func_convert_file_noop ()
 # func_to_host_file_result.
 func_convert_file_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1714,8 +3001,9 @@ func_convert_file_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_file_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     # LT_CYGPATH in this case.
@@ -1731,11 +3019,12 @@ func_convert_file_cygwin_to_w32 ()
 # and a working winepath. Returns result in func_to_host_file_result.
 func_convert_file_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1747,12 +3036,13 @@ func_convert_file_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_file_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
     func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1765,13 +3055,14 @@ func_convert_file_msys_to_cygwin ()
 # in func_to_host_file_result.
 func_convert_file_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
     func_convert_core_file_wine_to_w32 "$1"
     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1781,7 +3072,7 @@ func_convert_file_nix_to_cygwin ()
 #############################################
 # $build to $host PATH CONVERSION FUNCTIONS #
 #############################################
-# invoked via `$to_host_path_cmd ARG'
+# invoked via '$to_host_path_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # The result will be available in $func_to_host_path_result.
@@ -1805,10 +3096,11 @@ func_convert_file_nix_to_cygwin ()
 to_host_path_cmd=
 func_init_to_host_path_cmd ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$to_host_path_cmd"; then
     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
   fi
 }
 
@@ -1818,7 +3110,8 @@ func_init_to_host_path_cmd ()
 # in func_to_host_path_result.
 func_to_host_path ()
 {
-  $opt_debug
+  $debug_cmd
+
   func_init_to_host_path_cmd
   $to_host_path_cmd "$1"
 }
@@ -1829,7 +3122,7 @@ func_to_host_path ()
 # Copy ARG to func_to_host_path_result.
 func_convert_path_noop ()
 {
-  func_to_host_path_result="$1"
+  func_to_host_path_result=$1
 }
 # end func_convert_path_noop
 
@@ -1840,8 +3133,9 @@ func_convert_path_noop ()
 # func_to_host_path_result.
 func_convert_path_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from ARG.  MSYS
     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -1849,7 +3143,7 @@ func_convert_path_msys_to_w32 ()
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1863,8 +3157,9 @@ func_convert_path_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_path_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
@@ -1883,14 +3178,15 @@ func_convert_path_cygwin_to_w32 ()
 # a working winepath.  Returns result in func_to_host_file_result.
 func_convert_path_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1904,15 +3200,16 @@ func_convert_path_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_path_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1927,8 +3224,9 @@ func_convert_path_msys_to_cygwin ()
 # func_to_host_file_result.
 func_convert_path_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from
     # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -1937,7 +3235,7 @@ func_convert_path_nix_to_cygwin ()
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1946,13 +3244,31 @@ func_convert_path_nix_to_cygwin ()
 # end func_convert_path_nix_to_cygwin
 
 
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
-    $opt_debug
+    $debug_cmd
+
     # Get the compilation command and the source file.
     base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
     suppress_opt=yes
     suppress_output=
     arg_mode=normal
@@ -1965,12 +3281,12 @@ func_mode_compile ()
       case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
+	lastarg=$arg
 	arg_mode=normal
 	;;
 
       target )
-	libobj="$arg"
+	libobj=$arg
 	arg_mode=normal
 	continue
 	;;
@@ -1980,7 +3296,7 @@ func_mode_compile ()
 	case $arg in
 	-o)
 	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
+	    func_fatal_error "you cannot specify '-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
@@ -2009,12 +3325,12 @@ func_mode_compile ()
 	  func_stripname '-Wc,' '' "$arg"
 	  args=$func_stripname_result
 	  lastarg=
-	  save_ifs="$IFS"; IFS=','
+	  save_ifs=$IFS; IFS=,
 	  for arg in $args; do
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 	    func_append_quoted lastarg "$arg"
 	  done
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
@@ -2027,8 +3343,8 @@ func_mode_compile ()
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
+	  lastarg=$srcfile
+	  srcfile=$arg
 	  ;;
 	esac  #  case $arg
 	;;
@@ -2043,13 +3359,13 @@ func_mode_compile ()
       func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      func_fatal_error "you must specify a target with \`-o'"
+      func_fatal_error "you must specify a target with '-o'"
       ;;
     *)
       # Get the name of the library object.
       test -z "$libobj" && {
 	func_basename "$srcfile"
-	libobj="$func_basename_result"
+	libobj=$func_basename_result
       }
       ;;
     esac
@@ -2069,7 +3385,7 @@ func_mode_compile ()
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      func_fatal_error "cannot determine name of library object from '$libobj'"
       ;;
     esac
 
@@ -2078,8 +3394,8 @@ func_mode_compile ()
     for arg in $later; do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	continue
 	;;
@@ -2105,17 +3421,17 @@ func_mode_compile ()
     func_quote_for_eval "$libobj"
     test "X$libobj" != "X$func_quote_for_eval_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
 
     test -z "$base_compile" && \
       func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       removelist="$obj $lobj $libobj ${libobj}T"
     else
       removelist="$lobj $libobj ${libobj}T"
@@ -2127,16 +3443,16 @@ func_mode_compile ()
       pic_mode=default
       ;;
     esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
 
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
     else
       output_obj=
       need_locks=no
@@ -2145,12 +3461,12 @@ func_mode_compile ()
 
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
+    if test yes = "$need_locks"; then
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
-    elif test "$need_locks" = warn; then
+    elif test warn = "$need_locks"; then
       if test -f "$lockfile"; then
 	$ECHO "\
 *** ERROR, $lockfile exists and contains:
@@ -2158,7 +3474,7 @@ func_mode_compile ()
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2180,11 +3496,11 @@ compiler."
     qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
-      if test "$pic_mode" != no; then
+      if test no != "$pic_mode"; then
 	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
@@ -2201,7 +3517,7 @@ compiler."
       func_show_eval_locale "$command"	\
           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2212,7 +3528,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2228,20 +3544,20 @@ compiler."
       fi
 
       # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
+      if test yes = "$suppress_opt"; then
 	suppress_output=' >/dev/null 2>&1'
       fi
     fi
 
     # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
 	# Don't build PIC code
 	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
-      if test "$compiler_c_o" = yes; then
+      if test yes = "$compiler_c_o"; then
 	func_append command " -o $obj"
       fi
 
@@ -2250,7 +3566,7 @@ compiler."
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2261,7 +3577,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2281,7 +3597,7 @@ compiler."
       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
       # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
+      if test no != "$need_locks"; then
 	removelist=$lockfile
         $RM "$lockfile"
       fi
@@ -2291,7 +3607,7 @@ compiler."
 }
 
 $opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
@@ -2311,7 +3627,7 @@ func_mode_help ()
 Remove files from the build directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, object or program, all the files associated
@@ -2330,16 +3646,16 @@ This mode accepts the following additional options:
   -no-suppress      do not suppress compiler output for multiple passes
   -prefer-pic       try to build PIC objects only
   -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
   -Wc,FLAG          pass FLAG directly to the compiler
 
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
 from the given SOURCEFILE.
 
 The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
         ;;
 
       execute)
@@ -2352,7 +3668,7 @@ This mode accepts the following additional options:
 
   -dlopen FILE      add the directory containing FILE to the library path
 
-This mode sets the library path environment variable according to \`-dlopen'
+This mode sets the library path environment variable according to '-dlopen'
 flags.
 
 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2371,7 +3687,7 @@ Complete the installation of libtool libraries.
 Each LIBDIR is a directory that contains libtool libraries.
 
 The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
+the '--dry-run' option if you just want to see what would be executed."
         ;;
 
       install)
@@ -2381,7 +3697,7 @@ the \`--dry-run' option if you just want to see what would be executed."
 Install executables or libraries.
 
 INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
@@ -2407,7 +3723,7 @@ The following components of LINK-COMMAND are treated specially:
   -avoid-version    do not add a version suffix if possible
   -bindir BINDIR    specify path to binaries directory (for systems where
                     libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
@@ -2421,7 +3737,8 @@ The following components of LINK-COMMAND are treated specially:
   -no-install       link a not-installable executable
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -objectlist FILE  use a list of object files found in FILE to specify objects
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
   -precious-files-regex REGEX
                     don't remove output files matching REGEX
   -release RELEASE  specify package release information
@@ -2441,20 +3758,20 @@ The following components of LINK-COMMAND are treated specially:
   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
 
-Every other argument is treated as a filename.  Files ending in \`.la' are
+Every other argument is treated as a filename.  Files ending in '.la' are
 treated as uninstalled libtool libraries, other files are standard or library
 object files.
 
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
 required, except when creating a convenience library.
 
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
 
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
 is created, otherwise an executable program is created."
         ;;
 
@@ -2465,7 +3782,7 @@ is created, otherwise an executable program is created."
 Remove libraries from an installation directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, all the files associated with it are deleted.
@@ -2473,17 +3790,17 @@ Otherwise, only FILE itself is deleted using RM."
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
+        func_fatal_help "invalid operation mode '$opt_mode'"
         ;;
     esac
 
     echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
+    $ECHO "Try '$progname --help' for more information about other modes."
 }
 
 # Now that we've collected a possible --mode arg, show help if necessary
 if $opt_help; then
-  if test "$opt_help" = :; then
+  if test : = "$opt_help"; then
     func_mode_help
   else
     {
@@ -2491,7 +3808,7 @@ if $opt_help; then
       for opt_mode in compile link execute install finish uninstall clean; do
 	func_mode_help
       done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
     {
       func_help noexit
       for opt_mode in compile link execute install finish uninstall clean; do
@@ -2499,7 +3816,7 @@ if $opt_help; then
 	func_mode_help
       done
     } |
-    sed '1d
+    $SED '1d
       /^When reporting/,/^Report/{
 	H
 	d
@@ -2516,16 +3833,17 @@ fi
 # func_mode_execute arg...
 func_mode_execute ()
 {
-    $opt_debug
+    $debug_cmd
+
     # The first argument is the command name.
-    cmd="$nonopt"
+    cmd=$nonopt
     test -z "$cmd" && \
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
     for file in $opt_dlopen; do
       test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
+	|| func_fatal_help "'$file' is not a file"
 
       dir=
       case $file in
@@ -2535,7 +3853,7 @@ func_mode_execute ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
 
 	# Read the libtool library.
 	dlname=
@@ -2546,18 +3864,18 @@ func_mode_execute ()
 	if test -z "$dlname"; then
 	  # Warn if it was a shared library.
 	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	    func_warning "'$file' was not linked with '-export-dynamic'"
 	  continue
 	fi
 
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 
 	if test -f "$dir/$objdir/$dlname"; then
 	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
 	  fi
 	fi
 	;;
@@ -2565,18 +3883,18 @@ func_mode_execute ()
       *.lo)
 	# Just add the directory containing the .lo file.
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	;;
 
       *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
 	continue
 	;;
       esac
 
       # Get the absolute pathname.
       absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
+      test -n "$absdir" && dir=$absdir
 
       # Now add the directory to shlibpath_var.
       if eval "test -z \"\$$shlibpath_var\""; then
@@ -2588,7 +3906,7 @@ func_mode_execute ()
 
     # This variable tells wrapper scripts just to set shlibpath_var
     # rather than running their programs.
-    libtool_execute_magic="$magic"
+    libtool_execute_magic=$magic
 
     # Check if any of the arguments is a wrapper script.
     args=
@@ -2601,12 +3919,12 @@ func_mode_execute ()
 	if func_ltwrapper_script_p "$file"; then
 	  func_source "$file"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	elif func_ltwrapper_executable_p "$file"; then
 	  func_ltwrapper_scriptname "$file"
 	  func_source "$func_ltwrapper_scriptname_result"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	fi
 	;;
       esac
@@ -2614,7 +3932,15 @@ func_mode_execute ()
       func_append_quoted args "$file"
     done
 
-    if test "X$opt_dry_run" = Xfalse; then
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
       if test -n "$shlibpath_var"; then
 	# Export the shlibpath_var.
 	eval "export $shlibpath_var"
@@ -2631,25 +3957,18 @@ func_mode_execute ()
       done
 
       # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
+      exec_cmd=\$cmd$args
     fi
 }
 
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
-    $opt_debug
+    $debug_cmd
+
     libs=
     libdirs=
     admincmds=
@@ -2663,11 +3982,11 @@ func_mode_finish ()
 	if func_lalib_unsafe_p "$opt"; then
 	  func_append libs " $opt"
 	else
-	  func_warning "\`$opt' is not a valid libtool archive"
+	  func_warning "'$opt' is not a valid libtool archive"
 	fi
 
       else
-	func_fatal_error "invalid argument \`$opt'"
+	func_fatal_error "invalid argument '$opt'"
       fi
     done
 
@@ -2682,12 +4001,12 @@ func_mode_finish ()
       # Remove sysroot references
       if $opt_dry_run; then
         for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
         done
       else
         tmpdir=`func_mktempdir`
         for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 	    > $tmpdir/tmp-la
 	  mv -f $tmpdir/tmp-la $lib
 	done
@@ -2712,7 +4031,7 @@ func_mode_finish ()
     fi
 
     # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
+    $opt_quiet && exit $EXIT_SUCCESS
 
     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       echo "----------------------------------------------------------------------"
@@ -2723,27 +4042,27 @@ func_mode_finish ()
       echo
       echo "If you ever happen to want to link against installed libraries"
       echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
       echo "flag during linking and do at least one of the following:"
       if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
 	echo "     during execution"
       fi
       if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
 	echo "     during linking"
       fi
       if test -n "$hardcode_libdir_flag_spec"; then
 	libdir=LIBDIR
 	eval flag=\"$hardcode_libdir_flag_spec\"
 
-	$ECHO "   - use the \`$flag' linker flag"
+	$ECHO "   - use the '$flag' linker flag"
       fi
       if test -n "$admincmds"; then
 	$ECHO "   - have your system administrator run these commands:$admincmds"
       fi
       if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
       fi
       echo
 
@@ -2762,18 +4081,20 @@ func_mode_finish ()
     exit $EXIT_SUCCESS
 }
 
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
 func_mode_install ()
 {
-    $opt_debug
+    $debug_cmd
+
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
        # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -2800,7 +4121,7 @@ func_mode_install ()
     opts=
     prev=
     install_type=
-    isdir=no
+    isdir=false
     stripme=
     no_mode=:
     for arg
@@ -2813,7 +4134,7 @@ func_mode_install ()
       fi
 
       case $arg in
-      -d) isdir=yes ;;
+      -d) isdir=: ;;
       -f)
 	if $install_cp; then :; else
 	  prev=$arg
@@ -2831,7 +4152,7 @@ func_mode_install ()
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
 	    arg2=$install_override_mode
 	    no_mode=false
 	  fi
@@ -2856,7 +4177,7 @@ func_mode_install ()
       func_fatal_help "you must specify an install program"
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
+      func_fatal_help "the '$prev' option requires an argument"
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
@@ -2878,19 +4199,19 @@ func_mode_install ()
     dest=$func_stripname_result
 
     # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
       destname=
     else
       func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
+      destdir=$func_dirname_result
+      destname=$func_basename_result
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files; shift
       test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
+	func_fatal_help "'$dest' is not a directory"
     fi
     case $destdir in
     [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2899,7 +4220,7 @@ func_mode_install ()
 	case $file in
 	*.lo) ;;
 	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  func_fatal_help "'$destdir' must be an absolute directory name"
 	  ;;
 	esac
       done
@@ -2908,7 +4229,7 @@ func_mode_install ()
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     staticlibs=
     future_libdirs=
@@ -2928,7 +4249,7 @@ func_mode_install ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
+	  || func_fatal_help "'$file' is not a valid libtool archive"
 
 	library_names=
 	old_library=
@@ -2950,7 +4271,7 @@ func_mode_install ()
 	fi
 
 	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
@@ -2964,7 +4285,7 @@ func_mode_install ()
 	  # are installed into $libdir/../bin (currently, that works fine)
 	  # but it's something to keep an eye on.
 	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
@@ -2973,29 +4294,36 @@ func_mode_install ()
 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
-	  func_warning "relinking \`$file'"
+	  func_warning "relinking '$file'"
 	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
 	fi
 
 	# See the names of the shared library.
 	set dummy $library_names; shift
 	if test -n "$1"; then
-	  realname="$1"
+	  realname=$1
 	  shift
 
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
 
 	  # Install the shared library and build the symlinks.
 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
-	  tstripme="$stripme"
+	  tstripme=$stripme
 	  case $host_os in
 	  cygwin* | mingw* | pw32* | cegcc*)
 	    case $realname in
 	    *.dll.a)
-	      tstripme=""
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  os2*)
+	    case $realname in
+	    *_dll.a)
+	      tstripme=
 	      ;;
 	    esac
 	    ;;
@@ -3006,7 +4334,7 @@ func_mode_install ()
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
 	    # so we also need to try rm && ln -s.
 	    for linkname
@@ -3017,14 +4345,14 @@ func_mode_install ()
 	  fi
 
 	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
+	  lib=$destdir/$realname
 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
 	fi
 
 	# Install the pseudo-library for information purposes.
 	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
+	name=$func_basename_result
+	instname=$dir/${name}i
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
@@ -3036,11 +4364,11 @@ func_mode_install ()
 
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# Deduce the name of the destination old-style object file.
@@ -3050,11 +4378,11 @@ func_mode_install ()
 	  staticdest=$func_lo2o_result
 	  ;;
 	*.$objext)
-	  staticdest="$destfile"
+	  staticdest=$destfile
 	  destfile=
 	  ;;
 	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
 	  ;;
 	esac
 
@@ -3063,7 +4391,7 @@ func_mode_install ()
 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
 
 	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
+	if test yes = "$build_old_libs"; then
 	  # Deduce the name of the old-style object file.
 	  func_lo2o "$file"
 	  staticobj=$func_lo2o_result
@@ -3075,23 +4403,23 @@ func_mode_install ()
       *)
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# If the file is missing, and there is a .exe on the end, strip it
 	# because it is most likely a libtool script we actually want to
 	# install
-	stripped_ext=""
+	stripped_ext=
 	case $file in
 	  *.exe)
 	    if test ! -f "$file"; then
 	      func_stripname '' '.exe' "$file"
 	      file=$func_stripname_result
-	      stripped_ext=".exe"
+	      stripped_ext=.exe
 	    fi
 	    ;;
 	esac
@@ -3119,19 +4447,19 @@ func_mode_install ()
 
 	  # Check the variables that should have been set.
 	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
 
-	  finalize=yes
+	  finalize=:
 	  for lib in $notinst_deplibs; do
 	    # Check to see that each library is installed.
 	    libdir=
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
 	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
 	    fi
 	  done
 
@@ -3139,29 +4467,29 @@ func_mode_install ()
 	  func_source "$wrapper"
 
 	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
+	  if test no = "$fast_install" && test -n "$relink_command"; then
 	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
+	      if $finalize; then
 	        tmpdir=`func_mktempdir`
 		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
 	        # Replace the output file specification.
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
-	        $opt_silent || {
+	        $opt_quiet || {
 	          func_quote_for_expand "$relink_command"
 		  eval "func_echo $func_quote_for_expand_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
+		  func_error "error: relink '$file' with the above command before installing it"
 		  $opt_dry_run || ${RM}r "$tmpdir"
 		  continue
 	        fi
-	        file="$outputname"
+	        file=$outputname
 	      else
-	        func_warning "cannot relink \`$file'"
+	        func_warning "cannot relink '$file'"
 	      fi
 	    }
 	  else
@@ -3198,10 +4526,10 @@ func_mode_install ()
 
     for file in $staticlibs; do
       func_basename "$file"
-      name="$func_basename_result"
+      name=$func_basename_result
 
       # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
+      oldlib=$destdir/$name
       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
       tool_oldlib=$func_to_tool_file_result
 
@@ -3216,18 +4544,18 @@ func_mode_install ()
     done
 
     test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
+      func_warning "remember to run '$progname --finish$future_libdirs'"
 
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -3235,16 +4563,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"}
 # a dlpreopen symbol table.
 func_generate_dlsyms ()
 {
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
     my_dlsyms=
 
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
       if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
+	my_dlsyms=${my_outputname}S.c
       else
 	func_error "not configured to extract global symbols from dlpreopened files"
       fi
@@ -3255,7 +4584,7 @@ func_generate_dlsyms ()
       "") ;;
       *.c)
 	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
+	nlist=$output_objdir/$my_outputname.nm
 
 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
 
@@ -3263,34 +4592,36 @@ func_generate_dlsyms ()
 	func_verbose "creating $output_objdir/$my_dlsyms"
 
 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
 
 #ifdef __cplusplus
 extern \"C\" {
 #endif
 
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
 # define LT_DLSYM_CONST const
 #endif
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* External symbol declarations for the compiler. */\
 "
 
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
 
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
@@ -3298,7 +4629,7 @@ extern \"C\" {
 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
@@ -3318,10 +4649,10 @@ extern \"C\" {
 
 	  # Prepare the list of exported symbols
 	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
+	    export_symbols=$output_objdir/$outputname.exp
 	    $opt_dry_run || {
 	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 	      case $host in
 	      *cygwin* | *mingw* | *cegcc* )
                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3331,7 +4662,7 @@ extern \"C\" {
 	    }
 	  else
 	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
@@ -3345,22 +4676,22 @@ extern \"C\" {
 	fi
 
 	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_verbose "extracting global C symbols from '$dlprefile'"
 	  func_basename "$dlprefile"
-	  name="$func_basename_result"
+	  name=$func_basename_result
           case $host in
 	    *cygwin* | *mingw* | *cegcc* )
 	      # if an import library, we need to obtain dlname
 	      if func_win32_import_lib_p "$dlprefile"; then
 	        func_tr_sh "$dlprefile"
 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
+	        dlprefile_dlbasename=
 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 	          # Use subshell, to avoid clobbering current variable values
 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
+	          if test -n "$dlprefile_dlname"; then
 	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
+	            dlprefile_dlbasename=$func_basename_result
 	          else
 	            # no lafile. user explicitly requested -dlpreopen <import library>.
 	            $sharedlib_from_linklib_cmd "$dlprefile"
@@ -3368,7 +4699,7 @@ extern \"C\" {
 	          fi
 	        fi
 	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
+	          if test -n "$dlprefile_dlbasename"; then
 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 	          else
 	            func_warning "Could not compute DLL name from $name"
@@ -3424,6 +4755,11 @@ extern \"C\" {
 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
 	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
@@ -3432,11 +4768,30 @@ typedef struct {
   void *address;
 } lt_dlsymlist;
 extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
 LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
 
 	  case $need_lib_prefix in
 	  no)
@@ -3478,9 +4833,7 @@ static const void *lt_preloaded_setup() {
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
 	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
 	    ;;
 	  esac
 	  ;;
@@ -3497,10 +4850,10 @@ static const void *lt_preloaded_setup() {
 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
 
 	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
 
 	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	symfileobj=$output_objdir/${my_outputname}S.$objext
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
@@ -3518,7 +4871,7 @@ static const void *lt_preloaded_setup() {
 	esac
 	;;
       *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
 	;;
       esac
     else
@@ -3532,6 +4885,32 @@ static const void *lt_preloaded_setup() {
     fi
 }
 
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -3541,8 +4920,9 @@ static const void *lt_preloaded_setup() {
 # Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
-  $opt_debug
-  win32_libid_type="unknown"
+  $debug_cmd
+
+  win32_libid_type=unknown
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
   *ar\ archive\ import\ library*) # definitely import
@@ -3552,16 +4932,29 @@ func_win32_libid ()
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
 	    1,100{
 		/ I /{
-		    s,.*,import,
+		    s|.*|import|
 		    p
 		    q
 		}
 	    }'`
+	;;
+      esac
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -3593,7 +4986,8 @@ func_win32_libid ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib ()
 {
-  $opt_debug
+  $debug_cmd
+
   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 }
 
@@ -3610,7 +5004,8 @@ func_cygming_dll_for_implib ()
 # specified import library.
 func_cygming_dll_for_implib_fallback_core ()
 {
-  $opt_debug
+  $debug_cmd
+
   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     $SED '/^Contents of section '"$match_literal"':/{
@@ -3646,8 +5041,8 @@ func_cygming_dll_for_implib_fallback_core ()
       /./p' |
     # we now have a list, one entry per line, of the stringified
     # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
     # a '.' (that is, objdump's representation of an unprintable
     # character.) This should work for all archives with less than
     # 0x302f exports -- but will fail for DLLs whose name actually
@@ -3658,30 +5053,6 @@ func_cygming_dll_for_implib_fallback_core ()
     $SED -e '/^\./d;/^.\./d;q'
 }
 
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
 # func_cygming_dll_for_implib_fallback ARG
 # Platform-specific function to extract the
 # name of the DLL associated with the specified
@@ -3695,16 +5066,17 @@ func_cygming_ms_implib_p ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib_fallback ()
 {
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
     # binutils import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
+  elif func_cygming_ms_implib_p "$1"; then
     # ms-generated import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
   else
     # unknown
-    sharedlib_from_linklib_result=""
+    sharedlib_from_linklib_result=
   fi
 }
 
@@ -3712,10 +5084,11 @@ func_cygming_dll_for_implib_fallback ()
 # func_extract_an_archive dir oldlib
 func_extract_an_archive ()
 {
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
       lockfile=$f_ex_an_ar_oldlib.lock
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
@@ -3724,7 +5097,7 @@ func_extract_an_archive ()
     fi
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
+    if test yes = "$lock_old_archive_extraction"; then
       $opt_dry_run || rm -f "$lockfile"
     fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -3738,22 +5111,23 @@ func_extract_an_archive ()
 # func_extract_archives gentop oldlib ...
 func_extract_archives ()
 {
-    $opt_debug
-    my_gentop="$1"; shift
+    $debug_cmd
+
+    my_gentop=$1; shift
     my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
 
     for my_xlib in $my_oldlibs; do
       # Extract the objects.
       case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
+      my_xlib=$func_basename_result
       my_xlib_u=$my_xlib
       while :; do
         case " $extracted_archives " in
@@ -3765,7 +5139,7 @@ func_extract_archives ()
 	esac
       done
       extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
 
       func_mkdir_p "$my_xdir"
 
@@ -3778,22 +5152,23 @@ func_extract_archives ()
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
 	  if test -n "$darwin_arches"; then
 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
 	    darwin_arch=
 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
 	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
 	    done # $darwin_arches
             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
@@ -3815,7 +5190,7 @@ func_extract_archives ()
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
-    func_extract_archives_result="$my_oldobjs"
+    func_extract_archives_result=$my_oldobjs
 }
 
 
@@ -3830,7 +5205,7 @@ func_extract_archives ()
 #
 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 # variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
 # the $objdir directory.  This is a cygwin/mingw-specific
 # behavior.
 func_emit_wrapper ()
@@ -3841,7 +5216,7 @@ func_emit_wrapper ()
 #! $SHELL
 
 # $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # The $output program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -3898,9 +5273,9 @@ _LTECHO_EOF'
 
 # Very basic option parsing. These options are (a) specific to
 # the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
 # windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
 # this pattern).
 #
 # There are only two supported options: --lt-debug and
@@ -3933,7 +5308,7 @@ func_parse_lt_options ()
 
   # Print the debug banner immediately:
   if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
   fi
 }
 
@@ -3944,7 +5319,7 @@ func_lt_dump_args ()
   lt_dump_args_N=1;
   for lt_arg
   do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
   done
 }
@@ -3958,7 +5333,7 @@ func_exec_program_core ()
   *-*-mingw | *-*-os2* | *-cegcc*)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3968,7 +5343,7 @@ func_exec_program_core ()
   *)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4043,13 +5418,13 @@ func_exec_program ()
   test -n \"\$absdir\" && thisdir=\"\$absdir\"
 "
 
-	if test "$fast_install" = yes; then
+	if test yes = "$fast_install"; then
 	  $ECHO "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -4066,7 +5441,7 @@ func_exec_program ()
     if test -n \"\$relink_command\"; then
       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
       else
-	$ECHO \"\$relink_command_output\" >&2
+	\$ECHO \"\$relink_command_output\" >&2
 	$RM \"\$progdir/\$file\"
 	exit 1
       fi
@@ -4101,7 +5476,7 @@ func_exec_program ()
 	fi
 
 	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
     # Add our own library path to $shlibpath_var
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4121,7 +5496,7 @@ func_exec_program ()
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
@@ -4140,7 +5515,7 @@ func_emit_cwrapperexe_src ()
 	cat <<EOF
 
 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
@@ -4175,47 +5550,45 @@ EOF
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
 # define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # define HAVE_SETENV
 # define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
-#if defined(PATH_MAX)
+#if defined PATH_MAX
 # define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -4234,8 +5607,8 @@ int setenv (const char *, const char *, int);
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
 # define HAVE_DOS_BASED_FILE_SYSTEM
 # define FOPEN_WB "wb"
 # ifndef DIR_SEPARATOR_2
@@ -4268,10 +5641,10 @@ int setenv (const char *, const char *, int);
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
 static int lt_debug = 1;
 #else
 static int lt_debug = 0;
@@ -4300,11 +5673,16 @@ void lt_dump_script (FILE *f);
 EOF
 
 	    cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
               func_to_host_path "$temp_rpath"
 	      cat <<EOF
 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
@@ -4328,7 +5706,7 @@ const char * EXE_PATH_VALUE   = "";
 EOF
 	    fi
 
-	    if test "$fast_install" = yes; then
+	    if test yes = "$fast_install"; then
 	      cat <<EOF
 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
 EOF
@@ -4357,12 +5735,12 @@ main (int argc, char *argv[])
   char *actual_cwrapper_name;
   char *target_name;
   char *lt_argv_zero;
-  intptr_t rval = 127;
+  int rval = 127;
 
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
+  newargz = XMALLOC (char *, (size_t) argc + 1);
 
   /* very simple arg parsing; don't want to rely on getopt
    * also, copy all non cwrapper options to newargz, except
@@ -4371,10 +5749,10 @@ main (int argc, char *argv[])
   newargc=0;
   for (i = 1; i < argc; i++)
     {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
+      if (STREQ (argv[i], dumpscript_opt))
 	{
 EOF
-	    case "$host" in
+	    case $host in
 	      *mingw* | *cygwin* )
 		# make stdout use "unix" line endings
 		echo "          setmode(1,_O_BINARY);"
@@ -4385,12 +5763,12 @@ EOF
 	  lt_dump_script (stdout);
 	  return 0;
 	}
-      if (strcmp (argv[i], debug_opt) == 0)
+      if (STREQ (argv[i], debug_opt))
 	{
           lt_debug = 1;
           continue;
 	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+      if (STREQ (argv[i], ltwrapper_option_prefix))
         {
           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
              namespace, but it is not one of the ones we know about and
@@ -4413,7 +5791,7 @@ EOF
 EOF
 	    cat <<EOF
   /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
 EOF
 	    cat <<"EOF"
   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4524,7 +5902,7 @@ EOF
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
   newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
@@ -4569,7 +5947,7 @@ base_name (const char *name)
 {
   const char *base;
 
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   /* Skip over the disk name in MSDOS pathnames. */
   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     name += 2;
@@ -4628,7 +6006,7 @@ find_executable (const char *wrapper)
   const char *p_next;
   /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
-  int tmp_len;
+  size_t tmp_len;
   char *concat_name;
 
   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -4638,7 +6016,7 @@ find_executable (const char *wrapper)
     return NULL;
 
   /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
     {
       concat_name = xstrdup (wrapper);
@@ -4656,7 +6034,7 @@ find_executable (const char *wrapper)
 	    return concat_name;
 	  XFREE (concat_name);
 	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
     }
 #endif
 
@@ -4679,7 +6057,7 @@ find_executable (const char *wrapper)
 	      for (q = p; *q; q++)
 		if (IS_PATH_SEPARATOR (*q))
 		  break;
-	      p_len = q - p;
+	      p_len = (size_t) (q - p);
 	      p_next = (*q == '\0' ? q : q + 1);
 	      if (p_len == 0)
 		{
@@ -4798,7 +6176,7 @@ strendzap (char *str, const char *pat)
   if (patlen <= len)
     {
       str += len - patlen;
-      if (strcmp (str, pat) == 0)
+      if (STREQ (str, pat))
 	*str = '\0';
     }
   return str;
@@ -4863,7 +6241,7 @@ lt_setenv (const char *name, const char *value)
     char *str = xstrdup (value);
     setenv (name, str, 1);
 #else
-    int len = strlen (name) + 1 + strlen (value) + 1;
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
     char *str = XMALLOC (char, len);
     sprintf (str, "%s=%s", name, value);
     if (putenv (str) != EXIT_SUCCESS)
@@ -4880,8 +6258,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
   char *new_value;
   if (orig_value && *orig_value)
     {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
       new_value = XMALLOC (char, add_len + orig_value_len + 1);
       if (to_end)
         {
@@ -4912,10 +6290,10 @@ lt_update_exe_path (const char *name, const char *value)
     {
       char *new_value = lt_extend_str (getenv (name), value, 0);
       /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
         {
-          new_value[len-1] = '\0';
+          new_value[--len] = '\0';
         }
       lt_setenv (name, new_value);
       XFREE (new_value);
@@ -5082,27 +6460,47 @@ EOF
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
 {
-    $opt_debug
+    $debug_cmd
+
     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
     *import*) : ;;
     *) false ;;
     esac
 }
 
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
+      # what system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
+      # to make a dll that has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
@@ -5146,10 +6544,11 @@ func_mode_link ()
     module=no
     no_install=no
     objs=
+    os2dllname=
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
-    preload=no
+    preload=false
     prev=
     prevarg=
     release=
@@ -5161,7 +6560,7 @@ func_mode_link ()
     vinfo=
     vinfo_number=no
     weak_libs=
-    single_module="${wl}-single_module"
+    single_module=$wl-single_module
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -5169,15 +6568,15 @@ func_mode_link ()
     do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	break
 	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
 	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
@@ -5210,7 +6609,7 @@ func_mode_link ()
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
-      arg="$1"
+      arg=$1
       shift
       func_quote_for_eval "$arg"
       qarg=$func_quote_for_eval_unquoted_result
@@ -5227,21 +6626,21 @@ func_mode_link ()
 
 	case $prev in
 	bindir)
-	  bindir="$arg"
+	  bindir=$arg
 	  prev=
 	  continue
 	  ;;
 	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
+	  $preload || {
 	    # Add the symbol object into the linking commands.
 	    func_append compile_command " @SYMFILE@"
 	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
+	    preload=:
+	  }
 	  case $arg in
 	  *.la | *.lo) ;;  # We handle these cases below.
 	  force)
-	    if test "$dlself" = no; then
+	    if test no = "$dlself"; then
 	      dlself=needless
 	      export_dynamic=yes
 	    fi
@@ -5249,9 +6648,9 @@ func_mode_link ()
 	    continue
 	    ;;
 	  self)
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
 	      dlself=yes
 	    else
 	      dlself=needless
@@ -5261,7 +6660,7 @@ func_mode_link ()
 	    continue
 	    ;;
 	  *)
-	    if test "$prev" = dlfiles; then
+	    if test dlfiles = "$prev"; then
 	      func_append dlfiles " $arg"
 	    else
 	      func_append dlprefiles " $arg"
@@ -5272,14 +6671,14 @@ func_mode_link ()
 	  esac
 	  ;;
 	expsyms)
-	  export_symbols="$arg"
+	  export_symbols=$arg
 	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
+	    || func_fatal_error "symbol file '$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
 	expsyms_regex)
-	  export_symbols_regex="$arg"
+	  export_symbols_regex=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5297,7 +6696,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	inst_prefix)
-	  inst_prefix_dir="$arg"
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
 	  prev=
 	  continue
 	  ;;
@@ -5321,21 +6726,21 @@ func_mode_link ()
 
 		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
 		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
+		xdir=$func_dirname_result
 
-		if test "$pic_object" != none; then
+		if test none != "$pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
+		  pic_object=$xdir$pic_object
 
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
@@ -5346,7 +6751,7 @@ func_mode_link ()
 		  fi
 
 		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
+		  if test dlprefiles = "$prev"; then
 		    # Preload the old-style object.
 		    func_append dlprefiles " $pic_object"
 		    prev=
@@ -5354,23 +6759,23 @@ func_mode_link ()
 
 		  # A PIC object.
 		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
+		  arg=$pic_object
 		fi
 
 		# Non-PIC object.
-		if test "$non_pic_object" != none; then
+		if test none != "$non_pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
+		  non_pic_object=$xdir$non_pic_object
 
 		  # A standard non-PIC object
 		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
 		  fi
 		else
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
+		  non_pic_object=$pic_object
 		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
@@ -5378,7 +6783,7 @@ func_mode_link ()
 		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
 		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
+		  xdir=$func_dirname_result
 
 		  func_lo2o "$arg"
 		  pic_object=$xdir$objdir/$func_lo2o_result
@@ -5386,24 +6791,29 @@ func_mode_link ()
 		  func_append libobjs " $pic_object"
 		  func_append non_pic_objects " $non_pic_object"
 	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
+		  func_fatal_error "'$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
+	    func_fatal_error "link input file '$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
+	os2dllname)
+	  os2dllname=$arg
+	  prev=
+	  continue
+	  ;;
 	precious_regex)
-	  precious_files_regex="$arg"
+	  precious_files_regex=$arg
 	  prev=
 	  continue
 	  ;;
 	release)
-	  release="-$arg"
+	  release=-$arg
 	  prev=
 	  continue
 	  ;;
@@ -5415,7 +6825,7 @@ func_mode_link ()
 	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
-	  if test "$prev" = rpath; then
+	  if test rpath = "$prev"; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
 	    *) func_append rpath " $arg" ;;
@@ -5430,7 +6840,7 @@ func_mode_link ()
 	  continue
 	  ;;
 	shrext)
-	  shrext_cmds="$arg"
+	  shrext_cmds=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5470,7 +6880,7 @@ func_mode_link ()
 	esac
       fi # test -n "$prev"
 
-      prevarg="$arg"
+      prevarg=$arg
 
       case $arg in
       -all-static)
@@ -5484,7 +6894,7 @@ func_mode_link ()
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -5516,7 +6926,7 @@ func_mode_link ()
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
-	if test "X$arg" = "X-export-symbols"; then
+	if test X-export-symbols = "X$arg"; then
 	  prev=expsyms
 	else
 	  prev=expsyms_regex
@@ -5550,9 +6960,9 @@ func_mode_link ()
 	func_stripname "-L" '' "$arg"
 	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
+	    func_fatal_error "require no space between '-L' and '$1'"
 	  else
-	    func_fatal_error "need path for \`-L' option"
+	    func_fatal_error "need path for '-L' option"
 	  fi
 	fi
 	func_resolve_sysroot "$func_stripname_result"
@@ -5563,8 +6973,8 @@ func_mode_link ()
 	*)
 	  absdir=`cd "$dir" && pwd`
 	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
 	  ;;
 	esac
 	case "$deplibs " in
@@ -5599,7 +7009,7 @@ func_mode_link ()
 	;;
 
       -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
@@ -5607,11 +7017,11 @@ func_mode_link ()
 	    ;;
 	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
@@ -5620,16 +7030,16 @@ func_mode_link ()
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  esac
-	elif test "X$arg" = "X-lc_r"; then
+	elif test X-lc_r = "X$arg"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -5639,6 +7049,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -mllvm)
+	prev=mllvm
+	continue
+	;;
+
       -module)
 	module=yes
 	continue
@@ -5668,7 +7083,7 @@ func_mode_link ()
 	;;
 
       -multi_module)
-	single_module="${wl}-multi_module"
+	single_module=$wl-multi_module
 	continue
 	;;
 
@@ -5682,8 +7097,8 @@ func_mode_link ()
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -5701,6 +7116,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
       -o) prev=output ;;
 
       -precious-files-regex)
@@ -5788,14 +7208,14 @@ func_mode_link ()
 	func_stripname '-Wc,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $func_quote_for_eval_result"
 	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5804,15 +7224,15 @@ func_mode_link ()
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $wl$func_quote_for_eval_result"
 	  func_append compiler_flags " $wl$func_quote_for_eval_result"
 	  func_append linker_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5835,7 +7255,7 @@ func_mode_link ()
       # -msg_* for osf cc
       -msg_*)
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -5847,25 +7267,46 @@ func_mode_link ()
       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
       # -F/path              path to uninstalled frameworks, gcc on darwin
       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # -fstack-protector*   stack protector flags for GCC
       # @file                GCC response files
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -stdlib=*            select c++ std lib with clang
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
         continue
         ;;
 
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+	  compiler_flags="$compiler_flags $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  case $arg in
+	  -Zlinker | -Zstack)
+	    prev=xcompiler
+	    ;;
+	  esac
+	  continue
+        else
+	  # Otherwise treat like 'Some other compiler flag' below
+	  func_quote_for_eval "$arg"
+	  arg=$func_quote_for_eval_result
+        fi
+	;;
+
       # Some other compiler flag.
       -* | +*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       *.$objext)
@@ -5886,21 +7327,21 @@ func_mode_link ()
 
 	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
 	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
+	  xdir=$func_dirname_result
 
-	  if test "$pic_object" != none; then
+	  test none = "$pic_object" || {
 	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
+	    pic_object=$xdir$pic_object
 
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		func_append dlfiles " $pic_object"
 		prev=
 		continue
@@ -5911,7 +7352,7 @@ func_mode_link ()
 	    fi
 
 	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      # Preload the old-style object.
 	      func_append dlprefiles " $pic_object"
 	      prev=
@@ -5919,23 +7360,23 @@ func_mode_link ()
 
 	    # A PIC object.
 	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
+	    arg=$pic_object
+	  }
 
 	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
+	  if test none != "$non_pic_object"; then
 	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
+	    non_pic_object=$xdir$non_pic_object
 
 	    # A standard non-PIC object
 	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
 	    fi
 	  else
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
+	    non_pic_object=$pic_object
 	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
@@ -5943,7 +7384,7 @@ func_mode_link ()
 	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
 	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
+	    xdir=$func_dirname_result
 
 	    func_lo2o "$arg"
 	    pic_object=$xdir$objdir/$func_lo2o_result
@@ -5951,7 +7392,7 @@ func_mode_link ()
 	    func_append libobjs " $pic_object"
 	    func_append non_pic_objects " $non_pic_object"
 	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
+	    func_fatal_error "'$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -5967,11 +7408,11 @@ func_mode_link ()
 	# A libtool-controlled library.
 
 	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
+	if test dlfiles = "$prev"; then
 	  # This library was specified with -dlopen.
 	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
-	elif test "$prev" = dlprefiles; then
+	elif test dlprefiles = "$prev"; then
 	  # The library was specified with -dlpreopen.
 	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
@@ -5986,7 +7427,7 @@ func_mode_link ()
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
       esac # arg
 
@@ -5998,9 +7439,9 @@ func_mode_link ()
     done # argument parsing loop
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
+      func_fatal_help "the '$prevarg' option requires an argument"
 
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       func_append compile_command " $arg"
       func_append finalize_command " $arg"
@@ -6009,20 +7450,23 @@ func_mode_link ()
     oldlibs=
     # calculate the name of the file, without its directory
     func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
     func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
+    output_objdir=$func_dirname_result$objdir
     func_to_tool_file "$output_objdir/"
     tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
@@ -6045,7 +7489,7 @@ func_mode_link ()
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
+      if $opt_preserve_dup_deps; then
 	case "$libs " in
 	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
@@ -6053,7 +7497,7 @@ func_mode_link ()
       func_append libs " $deplib"
     done
 
-    if test "$linkmode" = lib; then
+    if test lib = "$linkmode"; then
       libs="$predeps $libs $compiler_lib_search_path $postdeps"
 
       # Compute libraries that are listed more than once in $predeps
@@ -6085,7 +7529,7 @@ func_mode_link ()
 	  case $file in
 	  *.la) ;;
 	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -6093,7 +7537,7 @@ func_mode_link ()
     prog)
 	compile_deplibs=
 	finalize_deplibs=
-	alldeplibs=no
+	alldeplibs=false
 	newdlfiles=
 	newdlprefiles=
 	passes="conv scan dlopen dlpreopen link"
@@ -6105,29 +7549,29 @@ func_mode_link ()
     for pass in $passes; do
       # The preopen pass in lib mode reverses $deplibs; put it back here
       # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
+      if test lib,link = "$linkmode,$pass"; then
 	## FIXME: Find the place where the list is rebuilt in the wrong
 	##        order, and fix it there properly
         tmp_deplibs=
 	for deplib in $deplibs; do
 	  tmp_deplibs="$deplib $tmp_deplibs"
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
       fi
 
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
 	deplibs=
       fi
-      if test "$linkmode" = prog; then
+      if test prog = "$linkmode"; then
 	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
 	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 	esac
       fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+      if test lib,dlpreopen = "$linkmode,$pass"; then
 	# Collect and forward deplibs of preopened libtool libs
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
@@ -6148,26 +7592,26 @@ func_mode_link ()
 	    esac
 	  done
 	done
-	libs="$dlprefiles"
+	libs=$dlprefiles
       fi
-      if test "$pass" = dlopen; then
+      if test dlopen = "$pass"; then
 	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
+	save_deplibs=$deplibs
 	deplibs=
       fi
 
       for deplib in $libs; do
 	lib=
-	found=no
+	found=false
 	case $deplib in
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    func_append compiler_flags " $deplib"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6177,13 +7621,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
 	    continue
 	  fi
 	  func_stripname '-l' '' "$deplib"
 	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6191,31 +7635,22 @@ func_mode_link ()
 	  for searchdir in $searchdirs; do
 	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
+	      lib=$searchdir/lib$name$search_ext
 	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
+		if test .la = "$search_ext"; then
+		  found=:
 		else
-		  found=no
+		  found=false
 		fi
 		break 2
 	      fi
 	    done
 	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
+	  if $found; then
+	    # deplib is a libtool library
 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
 	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
 		if func_lalib_p "$lib"; then
@@ -6223,19 +7658,19 @@ func_mode_link ()
 		  old_library=
 		  func_source "$lib"
 		  for l in $old_library $library_names; do
-		    ll="$l"
+		    ll=$l
 		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
 		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
+		    ladir=$func_dirname_result
 		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
+		    if test prog,link = "$linkmode,$pass"; then
 		      compile_deplibs="$deplib $compile_deplibs"
 		      finalize_deplibs="$deplib $finalize_deplibs"
 		    else
 		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
 		    fi
 		    continue
 		  fi
@@ -6244,15 +7679,25 @@ func_mode_link ()
 	      *) ;;
 	      esac
 	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
 	  fi
 	  ;; # -l
 	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6265,18 +7710,18 @@ func_mode_link ()
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
+	    test conv = "$pass" && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
-	    if test "$pass" = conv; then
+	    if test conv = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	      continue
 	    fi
-	    if test "$pass" = scan; then
+	    if test scan = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6287,13 +7732,13 @@ func_mode_link ()
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
+	    func_warning "'-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
-	  if test "$pass" = link; then
+	  if test link = "$pass"; then
 	    func_stripname '-R' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    dir=$func_resolve_sysroot_result
@@ -6311,7 +7756,7 @@ func_mode_link ()
 	  lib=$func_resolve_sysroot_result
 	  ;;
 	*.$libext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
 	    continue
 	  fi
@@ -6322,21 +7767,26 @@ func_mode_link ()
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=no
+	      valid_a_lib=false
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
+		    valid_a_lib=:
 		  fi
 		;;
 		pass_all)
-		  valid_a_lib=yes
+		  valid_a_lib=:
 		;;
 	      esac
-	      if test "$valid_a_lib" != yes; then
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
 		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
 		echo "*** I have the capability to make that library automatically link in when"
@@ -6344,18 +7794,13 @@ func_mode_link ()
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because the file extensions .$libext of this argument makes me believe"
 		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
 	      fi
 	      ;;
 	    esac
 	    continue
 	    ;;
 	  prog)
-	    if test "$pass" != link; then
+	    if test link != "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6366,10 +7811,10 @@ func_mode_link ()
 	  esac # linkmode
 	  ;; # *.$libext
 	*.lo | *.$objext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
 	      func_append newdlprefiles " $deplib"
@@ -6382,22 +7827,20 @@ func_mode_link ()
 	  continue
 	  ;;
 	%DEPLIBS%)
-	  alldeplibs=yes
+	  alldeplibs=:
 	  continue
 	  ;;
 	esac # case $deplib
 
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
 
 	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
+	ladir=$func_dirname_result
 
 	dlname=
 	dlopen=
@@ -6427,30 +7870,30 @@ func_mode_link ()
 	  done
 	fi
 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
 	  test -n "$dlopen" && func_append dlfiles " $dlopen"
 	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
-	if test "$pass" = conv; then
+	if test conv = "$pass"; then
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
+	      func_fatal_error "cannot find name of link library for '$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
 	    func_append old_convenience " $ladir/$objdir/$old_library"
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
 	  fi
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -6464,26 +7907,26 @@ func_mode_link ()
 	# Get the name of the library we link against.
 	linklib=
 	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
 	  linklib=$old_library
 	else
 	  for l in $old_library $library_names; do
-	    linklib="$l"
+	    linklib=$l
 	  done
 	fi
 	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
+	  func_fatal_error "cannot find name of link library for '$lib'"
 	fi
 
 	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
 	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
@@ -6497,40 +7940,40 @@ func_mode_link ()
 
 	# We need an absolute path.
 	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "cannot determine absolute directory name of '$ladir'"
 	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
+	    abs_ladir=$ladir
 	  fi
 	  ;;
 	esac
 	func_basename "$lib"
-	laname="$func_basename_result"
+	laname=$func_basename_result
 
 	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
+	if test yes = "$installed"; then
 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
+	    func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
 	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
 	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
+	    dir=$ladir
+	    absdir=$abs_ladir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  fi
@@ -6539,11 +7982,11 @@ func_mode_link ()
 	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
 	  fi
-	  case "$host" in
+	  case $host in
 	    # special handling for platforms with PE-DLLs.
 	    *cygwin* | *mingw* | *cegcc* )
 	      # Linker will automatically link against shared library if both
@@ -6587,9 +8030,9 @@ func_mode_link ()
 
 	if test -z "$libdir"; then
 	  # Link the convenience library
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
+	  elif test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$dir/$old_library $compile_deplibs"
 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
@@ -6599,14 +8042,14 @@ func_mode_link ()
 	fi
 
 
-	if test "$linkmode" = prog && test "$pass" != link; then
+	if test prog = "$linkmode" && test link != "$pass"; then
 	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
 	  fi
 
 	  tmp_libs=
@@ -6618,14 +8061,14 @@ func_mode_link ()
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
+	    if $linkalldeplibs; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      # Need to hardcode shared library paths
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -6635,15 +8078,15 @@ func_mode_link ()
 	  continue
 	fi # $linkmode = prog...
 
-	if test "$linkmode,$pass" = "prog,link"; then
+	if test prog,link = "$linkmode,$pass"; then
 	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
+	      case $temp_rpath: in
 	      *"$absdir:"*) ;;
 	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
@@ -6672,9 +8115,9 @@ func_mode_link ()
 	    esac
 	  fi # $linkmode,$pass = prog,link...
 
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
 		 test -n "$library_names"; }; }; then
 	    # We only need to search for static libraries
 	    continue
@@ -6683,19 +8126,19 @@ func_mode_link ()
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
+	if test built = "$use_static_libs" && test yes = "$installed"; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
 	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
+	  *cygwin* | *mingw* | *cegcc* | *os2*)
 	      # No point in relinking DLLs because paths are not encoded
 	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
-	    if test "$installed" = no; then
+	    if test no = "$installed"; then
 	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
@@ -6705,24 +8148,24 @@ func_mode_link ()
 
 	  # Warn about portability, can't link against -module's on some
 	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
+	  dlopenmodule=
 	  for dlpremoduletest in $dlprefiles; do
 	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
+	      dlopenmodule=$dlpremoduletest
 	      break
 	    fi
 	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
 	    echo
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
 	    $ECHO "*** $linklib is not portable!"
 	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
 	    # Hardcode the library path.
 	    # Skip directories that are in the system default run-time
 	    # search path.
@@ -6750,43 +8193,43 @@ func_mode_link ()
 	    # figure out the soname
 	    set dummy $library_names
 	    shift
-	    realname="$1"
+	    realname=$1
 	    shift
 	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
-	      soname="$dlname"
+	      soname=$dlname
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
+	      *cygwin* | mingw* | *cegcc* | *os2*)
 	        func_arith $current - $age
 		major=$func_arith_result
-		versuffix="-$major"
+		versuffix=-$major
 		;;
 	      esac
 	      eval soname=\"$soname_spec\"
 	    else
-	      soname="$realname"
+	      soname=$realname
 	    fi
 
 	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
+	    soroot=$soname
 	    func_basename "$soroot"
-	    soname="$func_basename_result"
+	    soname=$func_basename_result
 	    func_stripname 'lib' '.dll' "$soname"
 	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_verbose "extracting exported symbol list from '$soname'"
 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
+	      func_verbose "generating import library for '$soname'"
 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
@@ -6794,58 +8237,58 @@ func_mode_link ()
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    lib_linked=yes
 	    case $hardcode_action in
 	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
 		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
+		    *-*-unixware7*) add_dir=-L$dir ;;
 		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
+		    # if the lib is a (non-dlopened) module then we cannot
 		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
+			 $GREP ": [^:]* bundle" >/dev/null; then
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
+			if test -z "$old_library"; then
 			  echo
 			  echo "*** And there doesn't seem to be a static archive available"
 			  echo "*** The link will probably fail, sorry"
 			else
-			  add="$dir/$old_library"
+			  add=$dir/$old_library
 			fi
 		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
+			add=$dir/$old_library
 		      fi
 		    fi
 		esac
-	      elif test "$hardcode_minus_L" = no; then
+	      elif test no = "$hardcode_minus_L"; then
 		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
+		*-*-sunos*) add_shlibpath=$dir ;;
 		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
@@ -6854,10 +8297,10 @@ func_mode_link ()
 		      ;;
 		  esac
 		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
@@ -6865,7 +8308,7 @@ func_mode_link ()
 	    *) lib_linked=no ;;
 	    esac
 
-	    if test "$lib_linked" != yes; then
+	    if test yes != "$lib_linked"; then
 	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
@@ -6875,15 +8318,15 @@ func_mode_link ()
 	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
 		*) func_append finalize_shlibpath "$libdir:" ;;
@@ -6892,33 +8335,33 @@ func_mode_link ()
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
 	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
 	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
 	      else
-		add="$libdir/$linklib"
+		add=$libdir/$linklib
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
+	      add_dir=-L$libdir
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
@@ -6927,10 +8370,10 @@ func_mode_link ()
 		    ;;
 		esac
 	      fi
-	      add="-l$name"
+	      add=-l$name
 	    fi
 
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
 	    else
@@ -6938,43 +8381,43 @@ func_mode_link ()
 	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
 	  fi
-	elif test "$linkmode" = prog; then
+	elif test prog = "$linkmode"; then
 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
 	  # is not unsupported.  This is valid on all known static and
 	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
 	    compile_deplibs="$dir/$linklib $compile_deplibs"
 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
 	  else
 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
 	  fi
-	elif test "$build_libtool_libs" = yes; then
+	elif test yes = "$build_libtool_libs"; then
 	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
+	  if test pass_all != "$deplibs_check_method"; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
 	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
 	    echo "*** I have the capability to make that library automatically link in when"
 	    echo "*** you link to this library.  But I can only do this if you have a"
 	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
+	    if test yes = "$module"; then
 	      echo "*** But as you try to build a module library, libtool will still create "
 	      echo "*** a static module, that should work as long as the dlopening application"
 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
 		echo
 		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	      fi
-	      if test "$build_old_libs" = no; then
+	      if test no = "$build_old_libs"; then
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -6987,11 +8430,11 @@ func_mode_link ()
 	  fi
 	fi # link shared/static library?
 
-	if test "$linkmode" = lib; then
+	if test lib = "$linkmode"; then
 	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
@@ -7005,12 +8448,12 @@ func_mode_link ()
 	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
-	    dependency_libs="$temp_deplibs"
+	    dependency_libs=$temp_deplibs
 	  fi
 
 	  func_append newlib_search_path " $absdir"
 	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
@@ -7020,7 +8463,7 @@ func_mode_link ()
                    func_resolve_sysroot "$func_stripname_result";;
               *) func_resolve_sysroot "$deplib" ;;
             esac
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $func_resolve_sysroot_result "*)
                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -7029,12 +8472,12 @@ func_mode_link ()
 	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
-	  if test "$link_all_deplibs" != no; then
+	  if test no != "$link_all_deplibs"; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
 	      path=
 	      case $deplib in
-	      -L*) path="$deplib" ;;
+	      -L*) path=$deplib ;;
 	      *.la)
 	        func_resolve_sysroot "$deplib"
 	        deplib=$func_resolve_sysroot_result
@@ -7042,12 +8485,12 @@ func_mode_link ()
 		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
 		  fi
 		  ;;
 		esac
@@ -7055,35 +8498,35 @@ func_mode_link ()
 		case $host in
 		*-*-darwin*)
 		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                       if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
 		      path=
 		    fi
 		  fi
 		  ;;
 		*)
-		  path="-L$absdir/$objdir"
+		  path=-L$absdir/$objdir
 		  ;;
 		esac
 		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
 		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
+		    func_warning "'$deplib' seems to be moved"
 
-		  path="-L$absdir"
+		  path=-L$absdir
 		fi
 		;;
 	      esac
@@ -7095,23 +8538,23 @@ func_mode_link ()
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
 	# Link the dlpreopened libraries before other libraries
 	for deplib in $save_deplibs; do
 	  deplibs="$deplib $deplibs"
 	done
       fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
 	  # Make sure lib_search_path contains only unique directories.
 	  lib_search_path=
 	  for dir in $newlib_search_path; do
@@ -7121,12 +8564,12 @@ func_mode_link ()
 	    esac
 	  done
 	  newlib_search_path=
-	fi
+	}
 
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
+	if test prog,link = "$linkmode,$pass"; then
 	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
 	fi
 	for var in $vars dependency_libs; do
 	  # Add libraries to $var in reverse order
@@ -7184,62 +8627,93 @@ func_mode_link ()
 	  eval $var=\"$tmp_libs\"
 	done # for var
       fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
-      for i in $dependency_libs ; do
+      for i in $dependency_libs; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
 	*" $i "*)
-	  i=""
+	  i=
 	  ;;
 	esac
-	if test -n "$i" ; then
+	if test -n "$i"; then
 	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
     done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
     fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
     fi
 
     case $linkmode in
     oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+	func_warning "'-l' and '-L' are ignored for archives" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
+	func_warning "'-rpath' is ignored for archives"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
+	func_warning "'-R' is ignored for archives"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
+	func_warning "'-version-info/-version-number' is ignored for archives"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
+	func_warning "'-release' is ignored for archives"
 
       test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
+	func_warning "'-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
-      oldlibs="$output"
+      oldlibs=$output
       func_append objs "$old_deplibs"
       ;;
 
     lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
+      # Make sure we only generate libraries of the form 'libNAME.la'.
       case $outputname in
       lib*)
 	func_stripname 'lib' '.la' "$outputname"
@@ -7248,10 +8722,10 @@ func_mode_link ()
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
 
-	if test "$need_lib_prefix" != no; then
+	if test no != "$need_lib_prefix"; then
 	  # Add the "lib" prefix for modules if required
 	  func_stripname '' '.la' "$outputname"
 	  name=$func_stripname_result
@@ -7265,8 +8739,8 @@ func_mode_link ()
       esac
 
       if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
 	else
 	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
@@ -7275,21 +8749,21 @@ func_mode_link ()
 	fi
       fi
 
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
       shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
 
-      install_libdir="$1"
+      install_libdir=$1
 
       oldlibs=
       if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
+	if test yes = "$build_libtool_libs"; then
 	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
+	  # Some compilers have problems with a '.al' extension so
 	  # convenience libraries should have the same extension an
 	  # archive normally would.
 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -7298,20 +8772,20 @@ func_mode_link ()
 	fi
 
 	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
 
 	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
+	  func_warning "'-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
+	save_ifs=$IFS; IFS=:
 	set dummy $vinfo 0 0 0
 	shift
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
+	  func_fatal_help "too many parameters to '-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -7319,42 +8793,42 @@ func_mode_link ()
 
 	case $vinfo_number in
 	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
 	  # and those that subtract age and use age as
 	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
+	  # that has an extra 1 added just for fun
 	  #
 	  case $version_type in
 	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
+	  darwin|freebsd-elf|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
+	    age=$number_minor
+	    revision=$number_revision
 	    ;;
-	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
+	  freebsd-aout|qnx|sunos)
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
 	    ;;
 	  irix|nonstopux)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
+	    age=$number_minor
+	    revision=$number_minor
 	    lt_irix_increment=no
 	    ;;
 	  esac
 	  ;;
 	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
+	  current=$1
+	  revision=$2
+	  age=$3
 	  ;;
 	esac
 
@@ -7362,30 +8836,30 @@ func_mode_link ()
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -7400,26 +8874,36 @@ func_mode_link ()
 	  # verstring for coding it into the library header
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
 	  ;;
 
 	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
+	  if test no = "$lt_irix_increment"; then
 	    func_arith $current - $age
 	  else
 	    func_arith $current - $age + 1
@@ -7430,69 +8914,74 @@ func_mode_link ()
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
 	  esac
-	  verstring="$verstring_prefix$major.$revision"
+	  verstring=$verstring_prefix$major.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $revision - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
+	    verstring=$verstring_prefix$major.$iface:$verstring
 	  done
 
-	  # Before this point, $major must not contain `.'.
+	  # Before this point, $major must not contain '.'.
 	  major=.$major
-	  versuffix="$major.$revision"
+	  versuffix=$major.$revision
 	  ;;
 
 	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	osf)
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $current - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
+	    verstring=$verstring:$iface.0
 	  done
 
 	  # Make executables depend on our current version.
-	  func_append verstring ":${current}.0"
+	  func_append verstring ":$current.0"
 	  ;;
 
 	qnx)
-	  major=".$current"
-	  versuffix=".$current"
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sco)
+	  major=.$current
+	  versuffix=.$current
 	  ;;
 
 	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	windows)
 	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
+	  # extension on DOS 8.3 file systems.
 	  func_arith $current - $age
 	  major=$func_arith_result
-	  versuffix="-$major"
+	  versuffix=-$major
 	  ;;
 
 	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  func_fatal_configuration "unknown library version type '$version_type'"
 	  ;;
 	esac
 
@@ -7506,42 +8995,45 @@ func_mode_link ()
 	    verstring=
 	    ;;
 	  *)
-	    verstring="0.0"
+	    verstring=0.0
 	    ;;
 	  esac
-	  if test "$need_version" = no; then
+	  if test no = "$need_version"; then
 	    versuffix=
 	  else
-	    versuffix=".0.0"
+	    versuffix=.0.0
 	  fi
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
+	if test yes,no = "$avoid_version,$need_version"; then
 	  major=
 	  versuffix=
-	  verstring=""
+	  verstring=
 	fi
 
 	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
 	  fi
 	else
 	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
+	  allow_undefined_flag=$no_undefined_flag
 	fi
 
       fi
 
-      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_generate_dlsyms "$libname" "$libname" :
       func_append libobjs " $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
+      test " " = "$libobjs" && libobjs=
 
-      if test "$opt_mode" != relink; then
+      if test relink != "$opt_mode"; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -7550,8 +9042,8 @@ func_mode_link ()
 	  case $p in
 	    *.$objext | *.gcno)
 	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 		 then
 		   continue
@@ -7567,11 +9059,11 @@ func_mode_link ()
       fi
 
       # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
 	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
@@ -7592,13 +9084,13 @@ func_mode_link ()
 	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
 	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
       fi
 
       # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
+      old_dlfiles=$dlfiles
       dlfiles=
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
@@ -7608,7 +9100,7 @@ func_mode_link ()
       done
 
       # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
+      old_dlprefiles=$dlprefiles
       dlprefiles=
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
@@ -7617,7 +9109,7 @@ func_mode_link ()
 	esac
       done
 
-      if test "$build_libtool_libs" = yes; then
+      if test yes = "$build_libtool_libs"; then
 	if test -n "$rpath"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -7641,7 +9133,7 @@ func_mode_link ()
 	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
+	    if test yes = "$build_libtool_need_lc"; then
 	      func_append deplibs " -lc"
 	    fi
 	    ;;
@@ -7657,9 +9149,9 @@ func_mode_link ()
 	# I'm not sure if I'm treating the release correctly.  I think
 	# release should show up in the -l (ie -lgmp5) so we don't want to
 	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
+	release=
+	versuffix=
+	major=
 	newdeplibs=
 	droppeddeps=no
 	case $deplibs_check_method in
@@ -7688,20 +9180,20 @@ EOF
 	      -l*)
 		func_stripname -l '' "$i"
 		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
 		    func_append newdeplibs " $i"
-		    i=""
+		    i=
 		    ;;
 		  esac
 		fi
-		if test -n "$i" ; then
+		if test -n "$i"; then
 		  libname=`eval "\\$ECHO \"$libname_spec\""`
 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
@@ -7731,20 +9223,20 @@ EOF
 		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
 		      func_append newdeplibs " $i"
-		      i=""
+		      i=
 		      ;;
 		    esac
 		  fi
-		  if test -n "$i" ; then
+		  if test -n "$i"; then
 		    libname=`eval "\\$ECHO \"$libname_spec\""`
 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
@@ -7781,24 +9273,24 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		if test -n "$file_magic_glob"; then
 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 		else
 		  libnameglob=$libname
 		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
+		  if test yes = "$want_nocaseglob"; then
 		    shopt -s nocaseglob
 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 		    $nocaseglob
@@ -7816,25 +9308,25 @@ EOF
 		      # We might still enter an endless loop, since a link
 		      # loop can be closed while we follow links,
 		      # but so what?
-		      potlib="$potent_lib"
+		      potlib=$potent_lib
 		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
 			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
 			func_append newdeplibs " $a_deplib"
-			a_deplib=""
+			a_deplib=
 			break 2
 		      fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7842,7 +9334,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7865,30 +9357,30 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    potlib=$potent_lib # see symlink-check above in file_magic test
 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      func_append newdeplibs " $a_deplib"
-		      a_deplib=""
+		      a_deplib=
 		      break 2
 		    fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7896,7 +9388,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7912,18 +9404,18 @@ EOF
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
-	  newdeplibs=""
+	  newdeplibs=
 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
 	    done
 	  fi
 	  case $tmp_deplibs in
 	  *[!\	\ ]*)
 	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
+	    if test none = "$deplibs_check_method"; then
 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
 	      echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -7947,8 +9439,8 @@ EOF
 	  ;;
 	esac
 
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
 	    echo
 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
@@ -7957,12 +9449,12 @@ EOF
 	    if test -z "$global_symbol_pipe"; then
 	      echo
 	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
 	      build_libtool_libs=module
 	      build_old_libs=yes
 	    else
@@ -7973,14 +9465,14 @@ EOF
 	    echo "*** automatically added whenever a program is linked with this library"
 	    echo "*** or is declared to -dlopen it."
 
-	    if test "$allow_undefined" = no; then
+	    if test no = "$allow_undefined"; then
 	      echo
 	      echo "*** Since this library must not contain undefined symbols,"
 	      echo "*** because either the platform does not support them or"
 	      echo "*** it was explicitly requested with -no-undefined,"
 	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -8026,7 +9518,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      deplibs="$new_libs"
+      deplibs=$new_libs
 
       # All the library-specific variables (install_libdir is set above).
       library_names=
@@ -8034,25 +9526,25 @@ EOF
       dlname=
 
       # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
 	# FIXME: should test the right _cmds variable.
 	case $archive_cmds in
 	  *\$LD\ *) wl= ;;
         esac
-	if test "$hardcode_into_libs" = yes; then
+	if test yes = "$hardcode_into_libs"; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
 		func_replace_sysroot "$libdir"
 		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
+		  hardcode_libdirs=$libdir
 		else
 		  # Just accumulate the unique libdirs.
 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8077,7 +9569,7 @@ EOF
 	  # Substitute the hardcoded libdirs into the rpath.
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
+	    libdir=$hardcode_libdirs
 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
@@ -8091,8 +9583,8 @@ EOF
 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -8102,19 +9594,19 @@ EOF
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	shift
-	realname="$1"
+	realname=$1
 	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
 	else
-	  soname="$realname"
+	  soname=$realname
 	fi
 	if test -z "$dlname"; then
 	  dlname=$soname
 	fi
 
-	lib="$output_objdir/$realname"
+	lib=$output_objdir/$realname
 	linknames=
 	for link
 	do
@@ -8128,7 +9620,7 @@ EOF
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
+	  export_symbols=$output_objdir/$libname.uexp
 	  func_append delfiles " $export_symbols"
 	fi
 
@@ -8137,31 +9629,31 @@ EOF
 	cygwin* | mingw* | cegcc*)
 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	    func_dll_def_p "$export_symbols" || {
 	      # and it's NOT already a .def file. Must figure out
 	      # which of the given symbols are data symbols and tag
 	      # them as such. So, trigger use of export_symbols_cmds.
 	      # export_symbols gets reassigned inside the "prepare
 	      # the list of exported symbols" if statement, so the
 	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
+	      orig_export_symbols=$export_symbols
 	      export_symbols=
 	      always_export_symbols=yes
-	    fi
+	    }
 	  fi
 	  ;;
 	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
+	      IFS=$save_ifs
 	      # Take the normal branch if the nm_file_list_spec branch
 	      # doesn't work or if tool conversion is not needed.
 	      case $nm_file_list_spec~$to_tool_file_cmd in
@@ -8175,7 +9667,7 @@ EOF
 		  try_normal_branch=no
 		  ;;
 	      esac
-	      if test "$try_normal_branch" = yes \
+	      if test yes = "$try_normal_branch" \
 		 && { test "$len" -lt "$max_cmd_len" \
 		      || test "$max_cmd_len" -le -1; }
 	      then
@@ -8186,7 +9678,7 @@ EOF
 		output_la=$func_basename_result
 		save_libobjs=$libobjs
 		save_output=$output
-		output=${output_objdir}/${output_la}.nm
+		output=$output_objdir/$output_la.nm
 		func_to_tool_file "$output"
 		libobjs=$nm_file_list_spec$func_to_tool_file_result
 		func_append delfiles " $output"
@@ -8209,8 +9701,8 @@ EOF
 		break
 	      fi
 	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
@@ -8218,16 +9710,16 @@ EOF
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
 	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
 	  # though. Also, the filter scales superlinearly with the number of
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
@@ -8246,11 +9738,11 @@ EOF
 	    ;;
 	  esac
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
+	    test yes = "$compiler_needs_object" &&
 	    test -z "$libobjs"; then
 	    # extract the archives, so we have objects to list.
 	    # TODO: could optimize this to just extract one archive.
@@ -8261,7 +9753,7 @@ EOF
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    gentop="$output_objdir/${outputname}x"
+	    gentop=$output_objdir/${outputname}x
 	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
@@ -8270,18 +9762,18 @@ EOF
 	  fi
 	fi
 
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
+	if test yes = "$module" && test -n "$module_cmds"; then
 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	    eval test_cmds=\"$module_expsym_cmds\"
 	    cmds=$module_expsym_cmds
@@ -8299,7 +9791,7 @@ EOF
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" &&
+	if test : != "$skipped_export" &&
 	   func_len " $test_cmds" &&
 	   len=$func_len_result &&
 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -8332,8 +9824,8 @@ EOF
 	  last_robj=
 	  k=1
 
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
 	    func_verbose "creating GNU ld script: $output"
 	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
@@ -8345,14 +9837,14 @@ EOF
 	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
 	    func_verbose "creating linker input file list: $output"
 	    : > $output
 	    set x $save_libobjs
 	    shift
 	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
+	    if test yes = "$compiler_needs_object"; then
 	      firstobj="$1 "
 	      shift
 	    fi
@@ -8367,7 +9859,7 @@ EOF
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
+	      output=$output_objdir/$output_la-$k.$objext
 	      eval test_cmds=\"$reload_cmds\"
 	      func_len " $test_cmds"
 	      len0=$func_len_result
@@ -8379,13 +9871,13 @@ EOF
 		func_len " $obj"
 		func_arith $len + $func_len_result
 		len=$func_arith_result
-		if test "X$objlist" = X ||
+		if test -z "$objlist" ||
 		   test "$len" -lt "$max_cmd_len"; then
 		  func_append objlist " $obj"
 		else
 		  # The command $test_cmds is almost too long, add a
 		  # command to the queue.
-		  if test "$k" -eq 1 ; then
+		  if test 1 -eq "$k"; then
 		    # The first file doesn't have a previous command to add.
 		    reload_objs=$objlist
 		    eval concat_cmds=\"$reload_cmds\"
@@ -8395,10 +9887,10 @@ EOF
 		    reload_objs="$objlist $last_robj"
 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  last_robj=$output_objdir/$output_la-$k.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
+		  output=$output_objdir/$output_la-$k.$objext
 		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
@@ -8410,9 +9902,9 @@ EOF
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
 	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
 	      func_append delfiles " $output"
 
@@ -8420,9 +9912,9 @@ EOF
 	      output=
 	    fi
 
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
 	      $opt_dry_run || $RM $export_symbols
 	      libobjs=$output
 	      # Append the command to create the export file.
@@ -8431,16 +9923,16 @@ EOF
 	      if test -n "$last_robj"; then
 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	    fi
+	    }
 
 	    test -n "$save_libobjs" &&
 	      func_verbose "creating a temporary reloadable object file: $output"
 
 	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
+	      IFS=$save_ifs
+	      $opt_quiet || {
 		  func_quote_for_expand "$cmd"
 		  eval "func_echo $func_quote_for_expand_result"
 	      }
@@ -8448,7 +9940,7 @@ EOF
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
+		if test relink = "$opt_mode"; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -8457,7 +9949,7 @@ EOF
 		exit $lt_exit
 	      }
 	    done
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 
 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -8465,18 +9957,18 @@ EOF
 	    fi
 	  fi
 
-          if ${skipped_export-false}; then
+          ${skipped_export-false} && {
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
 	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
 	      # though. Also, the filter scales superlinearly with the number of
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
@@ -8485,7 +9977,7 @@ EOF
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
-	  fi
+	  }
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -8499,7 +9991,7 @@ EOF
 	  # value of $libobjs for piecewise linking.
 
 	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test yes = "$module" && test -n "$module_cmds"; then
 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	      cmds=$module_expsym_cmds
 	    else
@@ -8521,7 +10013,7 @@ EOF
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -8529,11 +10021,12 @@ EOF
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
-	save_ifs="$IFS"; IFS='~'
+	save_ifs=$IFS; IFS='~'
 	for cmd in $cmds; do
-	  IFS="$save_ifs"
+	  IFS=$sp$nl
 	  eval cmd=\"$cmd\"
-	  $opt_silent || {
+	  IFS=$save_ifs
+	  $opt_quiet || {
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
@@ -8541,7 +10034,7 @@ EOF
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
+	    if test relink = "$opt_mode"; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -8550,10 +10043,10 @@ EOF
 	    exit $lt_exit
 	  }
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -8573,39 +10066,39 @@ EOF
 	done
 
 	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
+	if test yes = "$module" || test yes = "$export_dynamic"; then
 	  # On all known operating systems, these are identical.
-	  dlname="$soname"
+	  dlname=$soname
 	fi
       fi
       ;;
 
     obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+	func_warning "'-l' and '-L' are ignored for objects" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
+	func_warning "'-rpath' is ignored for objects"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
+	func_warning "'-R' is ignored for objects"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
+	func_warning "'-version-info' is ignored for objects"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
+	func_warning "'-release' is ignored for objects"
 
       case $output in
       *.lo)
 	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
 
 	libobj=$output
 	func_lo2o "$libobj"
@@ -8613,7 +10106,7 @@ EOF
 	;;
       *)
 	libobj=
-	obj="$output"
+	obj=$output
 	;;
       esac
 
@@ -8626,17 +10119,19 @@ EOF
       # the extraction.
       reload_conv_objs=
       gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
 	else
-	  gentop="$output_objdir/${obj}x"
+	  gentop=$output_objdir/${obj}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
@@ -8645,12 +10140,12 @@ EOF
       fi
 
       # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
 
-      output="$obj"
+      output=$obj
       func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
@@ -8662,7 +10157,7 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$build_libtool_libs" != yes; then
+      test yes = "$build_libtool_libs" || {
 	if test -n "$gentop"; then
 	  func_show_eval '${RM}r "$gentop"'
 	fi
@@ -8672,12 +10167,12 @@ EOF
 	# $show "echo timestamp > $libobj"
 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
-      fi
+      }
 
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
+	output=$libobj
 	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
@@ -8694,16 +10189,14 @@ EOF
 	          output=$func_stripname_result.exe;;
       esac
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
+	func_warning "'-version-info' is ignored for programs"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
+	func_warning "'-release' is ignored for programs"
 
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
@@ -8717,11 +10210,11 @@ EOF
       *-*-darwin*)
 	# Don't allow lazy linking, it breaks C++ global constructors
 	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
+	if test CXX = "$tagname"; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      func_append compile_command " ${wl}-bind_at_load"
-	      func_append finalize_command " ${wl}-bind_at_load"
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
 	    ;;
 	  esac
 	fi
@@ -8757,7 +10250,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      compile_deplibs="$new_libs"
+      compile_deplibs=$new_libs
 
 
       func_append compile_command " $compile_deplibs"
@@ -8781,7 +10274,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8804,7 +10297,7 @@ EOF
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
@@ -8821,10 +10314,10 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      compile_rpath="$rpath"
+      compile_rpath=$rpath
 
       rpath=
       hardcode_libdirs=
@@ -8832,7 +10325,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8857,45 +10350,43 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      finalize_rpath="$rpath"
+      finalize_rpath=$rpath
 
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
 	# Transform all the library objects into standard objects.
 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
 
       # template prelinking step
       if test -n "$prelink_cmds"; then
 	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      wrappers_required=yes
+      wrappers_required=:
       case $host in
       *cegcc* | *mingw32ce*)
         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
+        wrappers_required=false
         ;;
       *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
+        test yes = "$build_libtool_libs" || wrappers_required=false
         ;;
       *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
         fi
         ;;
       esac
-      if test "$wrappers_required" = no; then
+      $wrappers_required || {
 	# Replace the output file specification.
 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
+	link_command=$compile_command$compile_rpath
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
@@ -8908,12 +10399,12 @@ EOF
 	fi
 
 	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
 	fi
 
 	exit $exit_status
-      fi
+      }
 
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -8943,9 +10434,9 @@ EOF
 	fi
       fi
 
-      if test "$no_install" = yes; then
+      if test yes = "$no_install"; then
 	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
+	link_command=$compile_var$compile_command$compile_rpath
 	# Replace the output file specification.
 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
@@ -8962,27 +10453,28 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
 
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
 
       # Replace the output file specification.
       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -9039,8 +10531,8 @@ EOF
 	    func_dirname_and_basename "$output" "" "."
 	    output_name=$func_basename_result
 	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
 	    $RM $cwrappersource $cwrapper
 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
@@ -9061,7 +10553,7 @@ EOF
 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
+	      if test "x$build" = "x$host"; then
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9084,25 +10576,27 @@ EOF
     # See if we need to build an old-fashioned archive.
     for oldlib in $oldlibs; do
 
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
 	  build_libtool_libs=no
-	else
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
 	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    func_append oldobjs " $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
 
       if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
+	gentop=$output_objdir/${outputname}x
 	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
@@ -9110,13 +10604,13 @@ EOF
       fi
 
       # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
 	cmds=$old_archive_from_new_cmds
       else
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -9137,7 +10631,7 @@ EOF
 	  :
 	else
 	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
@@ -9146,7 +10640,7 @@ EOF
 	  for obj in $save_oldobjs
 	  do
 	    func_basename "$obj"
-	    objbase="$func_basename_result"
+	    objbase=$func_basename_result
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -9215,18 +10709,18 @@ EOF
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
+	      if test "$obj" = "$last_oldobj"; then
 		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
 	      objlist=
 	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
 	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
+	  if test -z "$oldobjs"; then
 	    eval cmds=\"\$concat_cmds\"
 	  else
 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -9243,7 +10737,7 @@ EOF
     case $output in
     *.la)
       old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      test yes = "$build_old_libs" && old_library=$libname.$libext
       func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
@@ -9258,31 +10752,31 @@ EOF
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
+      if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
 
       # Only create the output if not a dry run.
       $opt_dry_run || {
 	for installed in no yes; do
-	  if test "$installed" = yes; then
+	  if test yes = "$installed"; then
 	    if test -z "$install_libdir"; then
 	      break
 	    fi
-	    output="$output_objdir/$outputname"i
+	    output=$output_objdir/${outputname}i
 	    # Replace all uninstalled libtool libraries with the installed ones
 	    newdependency_libs=
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
 		func_basename "$deplib"
-		name="$func_basename_result"
+		name=$func_basename_result
 		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      -L*)
@@ -9298,23 +10792,23 @@ EOF
 	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
-	    dependency_libs="$newdependency_libs"
+	    dependency_libs=$newdependency_libs
 	    newdlfiles=
 
 	    for lib in $dlfiles; do
 	      case $lib in
 	      *.la)
 	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
@@ -9324,34 +10818,34 @@ EOF
 		# didn't already link the preopened objects directly into
 		# the library:
 		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlfiles " $abs"
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlprefiles " $abs"
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
@@ -9367,10 +10861,9 @@ EOF
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
+	      if test -n "$bindir"; then
 		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
+		tdlname=$func_relative_path_result/$dlname
 	      else
 		# Otherwise fall back on heuristic.
 		tdlname=../bin/$dlname
@@ -9379,7 +10872,7 @@ EOF
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -9393,7 +10886,7 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
@@ -9419,7 +10912,7 @@ dlpreopen='$dlprefiles'
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
+	  if test no,yes = "$installed,$need_relink"; then
 	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
@@ -9434,27 +10927,29 @@ relink_command=\"$relink_command\""
     exit $EXIT_SUCCESS
 }
 
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
 
 
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
-    $opt_debug
-    RM="$nonopt"
+    $debug_cmd
+
+    RM=$nonopt
     files=
-    rmforce=
+    rmforce=false
     exit_status=0
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     for arg
     do
       case $arg in
-      -f) func_append RM " $arg"; rmforce=yes ;;
+      -f) func_append RM " $arg"; rmforce=: ;;
       -*) func_append RM " $arg" ;;
       *) func_append files " $arg" ;;
       esac
@@ -9467,18 +10962,18 @@ func_mode_uninstall ()
 
     for file in $files; do
       func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
       else
-	odir="$dir/$objdir"
+	odir=$dir/$objdir
       fi
       func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
 
       # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
+      if test clean = "$opt_mode"; then
 	case " $rmdirs " in
 	  *" $odir "*) ;;
 	  *) func_append rmdirs " $odir" ;;
@@ -9493,11 +10988,11 @@ func_mode_uninstall ()
       elif test -d "$file"; then
 	exit_status=1
 	continue
-      elif test "$rmforce" = yes; then
+      elif $rmforce; then
 	continue
       fi
 
-      rmfiles="$file"
+      rmfiles=$file
 
       case $name in
       *.la)
@@ -9511,7 +11006,7 @@ func_mode_uninstall ()
 	  done
 	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$opt_mode" in
+	  case $opt_mode in
 	  clean)
 	    case " $library_names " in
 	    *" $dlname "*) ;;
@@ -9522,12 +11017,12 @@ func_mode_uninstall ()
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -9543,21 +11038,19 @@ func_mode_uninstall ()
 	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
+	  if test -n "$pic_object" && test none != "$pic_object"; then
 	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
 	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$opt_mode" = clean ; then
+	if test clean = "$opt_mode"; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -9584,12 +11077,12 @@ func_mode_uninstall ()
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
 	      func_append rmfiles " $odir/lt-$name"
 	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      func_append rmfiles " $odir/lt-${noexename}.c"
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
 	    fi
 	  fi
 	fi
@@ -9598,7 +11091,7 @@ func_mode_uninstall ()
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
 
-    # Try to remove the ${objdir}s in the directories where we deleted files
+    # Try to remove the $objdir's in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
 	func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -9608,16 +11101,17 @@ func_mode_uninstall ()
     exit $exit_status
 }
 
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
 
 test -z "$opt_mode" && {
-  help="$generic_help"
+  help=$generic_help
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
+  func_fatal_help "invalid operation mode '$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
@@ -9628,7 +11122,7 @@ exit $exit_status
 
 
 # The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
+# where we disable both kinds of libraries.  Given conflicting
 # choices, we go for a static library, that is the most portable,
 # since we can't tell whether shared libraries were disabled because
 # the user asked for that or because the platform doesn't support
@@ -9651,5 +11145,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # mode:shell-script
 # sh-indentation:2
 # End:
-# vi:sw=2
-
diff --git a/src/Makefile.am b/src/Makefile.am
index bab3590..a9b10e6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,14 +4,11 @@ endif
 if BUILD_GL
   XBUILD_SUB_GL = mbview mbgrdviz mbeditviz
 endif
-if BUILD_GSF
-  XBUILD_SUB_GSF = gsf
-endif
 if BUILD_PROJ
   XBUILD_SUB_PROJ = proj
 endif
 
-SUBDIRS = $(XBUILD_SUB_GSF) $(XBUILD_SUB_PROJ) surf bsio mbio mbaux \
+SUBDIRS = $(XBUILD_SUB_PROJ) gsf surf bsio mbio mbaux \
 	utilities gmt otps macros \
 	$(XBUILD_SUB_MOTIF) $(XBUILD_SUB_GL) \
 	man html ps share
diff --git a/src/Makefile.in b/src/Makefile.in
index d2e3a37..574555e 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -144,7 +144,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = gsf proj surf bsio mbio mbaux utilities gmt otps macros \
+DIST_SUBDIRS = proj gsf surf bsio mbio mbaux utilities gmt otps macros \
 	mbedit mbnavedit mbvelocitytool mbnavadjust mbview mbgrdviz \
 	mbeditviz man html ps share
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -201,8 +201,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -219,6 +217,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -282,19 +281,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -307,8 +313,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -324,9 +328,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @BUILD_MOTIF_TRUE at XBUILD_SUB_MOTIF = mbedit mbnavedit mbvelocitytool mbnavadjust
 @BUILD_GL_TRUE at XBUILD_SUB_GL = mbview mbgrdviz mbeditviz
- at BUILD_GSF_TRUE@XBUILD_SUB_GSF = gsf
 @BUILD_PROJ_TRUE at XBUILD_SUB_PROJ = proj
-SUBDIRS = $(XBUILD_SUB_GSF) $(XBUILD_SUB_PROJ) surf bsio mbio mbaux \
+SUBDIRS = $(XBUILD_SUB_PROJ) gsf surf bsio mbio mbaux \
 	utilities gmt otps macros \
 	$(XBUILD_SUB_MOTIF) $(XBUILD_SUB_GL) \
 	man html ps share
diff --git a/src/Makefile.template b/src/Makefile.template
deleted file mode 100644
index db28503..0000000
--- a/src/Makefile.template
+++ /dev/null
@@ -1,65 +0,0 @@
-#     The MB-system:	Makefile.template	5/24/94
-#	$Id: Makefile.template 2180 2014-04-02 20:58:34Z caress $
-#
-#     Copyright (c) 1993-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system in the src directory
-# Author:	D. W. Caress
-# Date:		January 21, 1993
-#
-# $Log: Makefile.template,v $
-#
-
-all:
-	cd gsf; make all
-	cd surf; make all
-	cd bsio; make all
-	cd proj; make all
-	cd mbio; make all
-	cd mbaux; make all
-	cd mbview; make all
-	cd utilities; make all
-	cd gmt; make all
-	cd macros; make all
-	cd mbedit; make all
-	cd mbnavedit; make all
-	cd mbnavadjust; make all
-	cd mbvelocitytool; make all
-	cd mbgrdviz; make all
-	cd mbeditviz; make all
-	cd otps; make all
-	cd man; make all
-	cd html; make all
-	cd ps; make all
-	cd share; make all
-
-clean:
-	- cd gsf; make clean
-	- cd surf; make clean
-	- cd bsio; make clean
-	- cd proj; make clean
-	- cd mbio; make clean
-	- cd mbaux; make clean
-	- cd mbview; make clean
-	- cd utilities; make clean
-	- cd gmt; make clean
-	- cd macros; make clean
-	- cd mbedit; make clean
-	- cd mbnavedit; make clean
-	- cd mbnavadjust; make clean
-	- cd mbvelocitytool; make clean
-	- cd mbgrdviz; make clean
-	- cd mbeditviz; make clean
-	- cd otps; make clean
-	- cd man; make clean
-	- cd html; make clean
-	- cd ps; make clean
-	- cd share; make clean
diff --git a/src/bsio/Makefile.in b/src/bsio/Makefile.in
index 615e660..8f791fd 100644
--- a/src/bsio/Makefile.in
+++ b/src/bsio/Makefile.in
@@ -225,8 +225,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -243,6 +241,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -306,19 +305,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -331,8 +337,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/bsio/Makefile.template b/src/bsio/Makefile.template
deleted file mode 100644
index b600cca..0000000
--- a/src/bsio/Makefile.template
+++ /dev/null
@@ -1,109 +0,0 @@
-#     The MB-system:	Makefile.template  3/3/2014
-#	$Id: Makefile.template 2172 2014-03-14 07:28:54Z caress $
-#
-#     Copyright (c) 2014-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbbsio directory level
-# The source code in src/mbbsio derives from and is copyright by
-# the University of Hawaii.
-#
-# Author:	Roger Davis, University of Hawaii (MBBSIO library)
-# Author:	D. W. Caress (MB-System implementation)
-# Date:		March 3, 2014
-#
-# $Log: Makefile.template,v $
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -O2
-ARCHIVE = ar rcv
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the mbaux library and associated include files
-all:	$(INCDIR)/mbbs.h \
-	$(INCDIR)/mbbs_defines.h \
-	$(INCDIR)/mbbs_mem.h \
-	$(LIBDIR)/libmbbsio.a
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### link the executables
-
-### put together the libraries
-$(LIBDIR)/libmbbsio.a:	\
-		mbbs_io.o \
-		mbbs_iomrv1.o \
-		mbbs_iomrv2.o \
-		mbbs_memalloc.o \
-		mbbs_misc.o \
-		mbbs_swapbytes.o \
-		mbbs_tm.o \
-		mbbs_utils.o \
-		mbbs_wrhdrfields.o \
-		mbbs_wrsampflags.o
-	$(ARCHIVE) $(LIBDIR)/libmbbsio.a \
-		mbbs_io.o \
-		mbbs_iomrv1.o \
-		mbbs_iomrv2.o \
-		mbbs_memalloc.o \
-		mbbs_misc.o \
-		mbbs_swapbytes.o \
-		mbbs_tm.o \
-		mbbs_utils.o \
-		mbbs_wrhdrfields.o \
-		mbbs_wrsampflags.o
-	ranlib $(LIBDIR)/libmbbsio.a
-
-### compile the source files
-mbbs_io.o:	mbbs_io.c $(INCDIR)/mbbs_defines.h $(INCDIR)/mbbs_mem.h
-	$(CC) -c $(CFLAGS) mbbs_io.c
-mbbs_iomrv1.o:	mbbs_iomrv1.c $(INCDIR)/mbbs_defines.h
-	$(CC) -c $(CFLAGS) mbbs_iomrv1.c
-mbbs_iomrv2.o:	mbbs_iomrv2.c $(INCDIR)/mbbs_defines.h
-	$(CC) -c $(CFLAGS) mbbs_iomrv2.c
-mbbs_memalloc.o:	mbbs_memalloc.c $(INCDIR)/mbbs_mem.h
-	$(CC) -c $(CFLAGS) mbbs_memalloc.c
-mbbs_misc.o:	mbbs_misc.c $(INCDIR)/mbbs_defines.h $(INCDIR)/mbbs_mem.h
-	$(CC) -c $(CFLAGS) mbbs_misc.c
-mbbs_swapbytes.o:	mbbs_swapbytes.c $(INCDIR)/mbbs_mem.h
-	$(CC) -c $(CFLAGS) mbbs_swapbytes.c
-mbbs_tm.o:	mbbs_tm.c $(INCDIR)/mbbs_defines.h
-	$(CC) -c $(CFLAGS) mbbs_tm.c
-mbbs_utils.o:	mbbs_utils.c $(INCDIR)/mbbs_defines.h
-	$(CC) -c $(CFLAGS) mbbs_utils.c
-mbbs_wrhdrfields.o:	mbbs_wrhdrfields.c $(INCDIR)/mbbs_defines.h
-	$(CC) -c $(CFLAGS) mbbs_wrhdrfields.c
-mbbs_wrsampflags.o:	mbbs_wrsampflags.c $(INCDIR)/mbbs_defines.h
-	$(CC) -c $(CFLAGS) mbbs_wrsampflags.c
-
-### copy the include files to the include file directory
-$(INCDIR)/mbbs.h:	mbbs.h
-	cp mbbs.h $(INCDIR)/mbbs.h
-	chmod 664 $(INCDIR)/mbbs.h
-$(INCDIR)/mbbs_defines.h:	mbbs_defines.h
-	cp mbbs_defines.h $(INCDIR)/mbbs_defines.h
-	chmod 664 $(INCDIR)/mbbs_defines.h
-$(INCDIR)/mbbs_mem.h:	mbbs_mem.h
-	cp mbbs_mem.h $(INCDIR)/mbbs_mem.h
-	chmod 664 $(INCDIR)/mbbs_mem.h
diff --git a/src/bsio/bs2asc.c b/src/bsio/bs2asc.c
index 6dc6de2..4bf5155 100644
--- a/src/bsio/bs2asc.c
+++ b/src/bsio/bs2asc.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs2asc.c	3/3/2014
- *	$Id: bs2asc.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: bs2asc.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/bsio/mbbs.h b/src/bsio/mbbs.h
index 06911f5..e6ea6bb 100644
--- a/src/bsio/mbbs.h
+++ b/src/bsio/mbbs.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs.h	3/3/2014
- *	$Id: mbbs.h 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/bsio/mbbs_defines.h b/src/bsio/mbbs_defines.h
index cce19f4..fe26236 100644
--- a/src/bsio/mbbs_defines.h
+++ b/src/bsio/mbbs_defines.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_defines.h	3/3/2014
- *	$Id: mbbs_defines.h 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_defines.h 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -38,6 +38,9 @@
 #define __MBBS_DEFINES__
 
 #include <time.h>
+#ifndef WIN32
+#include <sys/time.h>
+#endif
 
 /* The preprocessor code inserted here to insure access to
  * XDR definitions is changed from the HMRG codebase */
@@ -86,11 +89,19 @@
 #include <rpc/types.h>
 #include <rpc/xdr.h>
 #endif
+#ifdef WIN32
+#include <rpc/rpc.h>
+#endif
 #ifdef OTHER
 #include <rpc/types.h>
 #include <rpc/xdr.h>
 #endif
 
+#ifdef WIN32
+#include <float.h>
+#define isnan _isnan
+#endif
+
 #endif /* HAVE_CONFIG_H */
 
 /* Some type definitions given here are in a separate
diff --git a/src/bsio/mbbs_io.c b/src/bsio/mbbs_io.c
index 43ce476..749f8ea 100644
--- a/src/bsio/mbbs_io.c
+++ b/src/bsio/mbbs_io.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_io.c	3/3/2014
- *	$Id: mbbs_io.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_io.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -37,6 +37,9 @@
 #include <string.h>
 #include <math.h>
 #include <stdlib.h>
+#ifdef WIN32
+#include <stdint.h>		/* To get INT32_MIN, INT32_MAX, etc ... */
+#endif
 
 #include "mbbs_defines.h"
 #include "mbbs_mem.h"
diff --git a/src/bsio/mbbs_iomrv1.c b/src/bsio/mbbs_iomrv1.c
index ded6b29..ca57bd9 100644
--- a/src/bsio/mbbs_iomrv1.c
+++ b/src/bsio/mbbs_iomrv1.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_iomrv1.c	3/3/2014
- *	$Id: mbbs_iomrv1.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_iomrv1.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/bsio/mbbs_iomrv2.c b/src/bsio/mbbs_iomrv2.c
index f7bab21..ed13eef 100644
--- a/src/bsio/mbbs_iomrv2.c
+++ b/src/bsio/mbbs_iomrv2.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_iomrv2.c	3/3/2014
- *	$Id: mbbs_iomrv2.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_iomrv2.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/bsio/mbbs_mem.h b/src/bsio/mbbs_mem.h
index 0e0cc38..aafdd37 100644
--- a/src/bsio/mbbs_mem.h
+++ b/src/bsio/mbbs_mem.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_mem.h	3/3/2014
- *	$Id: mbbs_mem.h 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_mem.h 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -32,7 +32,9 @@
 #define __MBBS_MEM__
 
 #include <sys/types.h>
+#ifndef WIN32
 #include <sys/shm.h>
+#endif
 
 #define MEM_SUCCESS	(0)
 #define MEM_BADARG	(1)
diff --git a/src/bsio/mbbs_memalloc.c b/src/bsio/mbbs_memalloc.c
index 87ad429..49e7674 100644
--- a/src/bsio/mbbs_memalloc.c
+++ b/src/bsio/mbbs_memalloc.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_memalloc.c	3/3/2014
- *	$Id: mbbs_memalloc.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_memalloc.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -37,7 +37,9 @@
 /* maximum allocation size allowed (0 => no limit) */
 static unsigned long mem_maxallocsz= 0;
 
+#ifndef WIN32
 static key_t mem_key= (key_t) IPC_PRIVATE;
+#endif
 static int mem_shmflag= 0666;
 
 void
@@ -79,6 +81,7 @@ mbbs_memalloc(MemType **buf, unsigned int *bufsz, unsigned int nobj, size_t objs
 	return MEM_SUCCESS;
 }
 
+#ifndef WIN32
 int
 mbbs_memallocsh(MemType **buf, int *shmid, unsigned int *bufsz, unsigned int nobj, size_t objsz)
 {
@@ -128,3 +131,4 @@ mbbs_memallocsh(MemType **buf, int *shmid, unsigned int *bufsz, unsigned int nob
 
 	return MEM_SUCCESS;
 }
+#endif
diff --git a/src/bsio/mbbs_misc.c b/src/bsio/mbbs_misc.c
index 8c34e56..c0d6ac9 100644
--- a/src/bsio/mbbs_misc.c
+++ b/src/bsio/mbbs_misc.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_misc.c	3/3/2014
- *	$Id: mbbs_misc.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_misc.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -35,7 +35,9 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <sys/time.h>
+#ifndef WIN32
+#include <sys/time.h>		/* Why this include? time.h is included by mbbs_defines.h */
+#endif
 #include <math.h>
 
 #include "mbbs_defines.h"
@@ -601,12 +603,15 @@ mbbs_nanf()
 	unsigned int ui;
 	float f;
 
+/* mbbs_misc.c(607) : error C2124: divide or mod by zero */
+/*
 	if (sizeof(float) != sizeof(unsigned int))
 		f= 0./0.;
 	else {
+*/
 		ui= 0xffc00000;
 		MemCopy(&ui, &f, sizeof(float));
-	}
+/*	} */
 
 	return f;
 }
@@ -617,12 +622,13 @@ mbbs_nand()
 	unsigned long long ull;
 	double d;
 
-	if (sizeof(double) != sizeof(unsigned long long))
+/*	if (sizeof(double) != sizeof(unsigned long long))
 		d= 0./0.;
 	else {
+*/
 		ull= 0xfff8000000000000ULL;
 		MemCopy(&ull, &d, sizeof(double));
-	}
+/*	} */
 
 	return d;
 }
diff --git a/src/bsio/mbbs_swapbytes.c b/src/bsio/mbbs_swapbytes.c
index 6df40ef..885a680 100644
--- a/src/bsio/mbbs_swapbytes.c
+++ b/src/bsio/mbbs_swapbytes.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_swapbytes.c	3/3/2014
- *	$Id: mbbs_swapbytes.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_swapbytes.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/bsio/mbbs_tm.c b/src/bsio/mbbs_tm.c
index f2cb5c9..c1700ca 100644
--- a/src/bsio/mbbs_tm.c
+++ b/src/bsio/mbbs_tm.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_tm.c	3/3/2014
- *	$Id: mbbs_tm.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_tm.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/bsio/mbbs_utils.c b/src/bsio/mbbs_utils.c
index dc04340..c36ce8b 100644
--- a/src/bsio/mbbs_utils.c
+++ b/src/bsio/mbbs_utils.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_utils.c	3/3/2014
- *	$Id: mbbs_utils.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_utils.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -42,6 +42,14 @@
 
 #include "mbbs_defines.h"
 
+/* Ugly patch because Windows has no fchdir() function */ 
+#ifdef WIN32
+#define fchdir(lixo) chdir(".")
+#	ifndef F_OK
+#		define F_OK 00
+	#endif
+#endif
+
 extern int	mbbs_appendstr(char **, char *);
 extern int	mbbs_copypng(int, XDR *, XDR *, int);
 extern int	mbbs_freebsfmem(BSFile *);
diff --git a/src/bsio/mbbs_wrhdrfields.c b/src/bsio/mbbs_wrhdrfields.c
index 8a3bc86..5f9d05f 100644
--- a/src/bsio/mbbs_wrhdrfields.c
+++ b/src/bsio/mbbs_wrhdrfields.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_wrhdrfields.c	3/3/2014
- *	$Id: mbbs_wrhdrfields.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_wrhdrfields.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/bsio/mbbs_wrsampflags.c b/src/bsio/mbbs_wrsampflags.c
index 005f7ff..cb5228b 100644
--- a/src/bsio/mbbs_wrsampflags.c
+++ b/src/bsio/mbbs_wrsampflags.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbs_wrsampflags.c	3/3/2014
- *	$Id: mbbs_wrsampflags.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbbs_wrsampflags.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/gmt/Makefile.am b/src/gmt/Makefile.am
index a2211db..16bddd2 100644
--- a/src/gmt/Makefile.am
+++ b/src/gmt/Makefile.am
@@ -1,22 +1,15 @@
-bin_PROGRAMS = mbcontour mbgrdtiff mbswath
+lib_LTLIBRARIES = libmbgmt.la
 
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
+include_HEADERS = 
 
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      -I${top_srcdir}/src/mbaux \
 	      ${libgmt_CPPFLAGS} \
 	      ${libnetcdf_CPPFLAGS}
+AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
 
-AM_LDFLAGS = 
-
-LIBS = $(top_builddir)/src/mbio/libmbio.la \
-	${libgmt_LIBS} ${libnetcdf_LIBS} \
-	$(LIBM)
-
-mbcontour_SOURCES = mbcontour.c
-mbcontour_LDADD = $(top_builddir)/src/mbaux/libmbaux.la $(top_builddir)/src/mbaux/libmbps.la
-
-mbgrdtiff_SOURCES = mbgrdtiff.c
-
-mbswath_SOURCES = mbswath.c
-mbswath_LDADD = $(top_builddir)/src/mbaux/libmbaux.la
+libmbgmt_la_LDFLAGS = -no-undefined -version-info 0:0:0
+libmbgmt_la_SOURCES = mbswath.c mbcontour.c mbgrdtiff.c
+libmbgmt_la_LIBADD = ${top_builddir}/src/mbio/libmbio.la \
+			${top_builddir}/src/mbaux/libmbaux.la \
+			${libgmt_LIBS} ${libnetcdf_LIBS}
diff --git a/src/gmt/Makefile.in b/src/gmt/Makefile.in
index 4759254..adbf396 100644
--- a/src/gmt/Makefile.in
+++ b/src/gmt/Makefile.in
@@ -14,6 +14,7 @@
 
 @SET_MAKE@
 
+
 VPATH = @srcdir@
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
@@ -78,10 +79,9 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-bin_PROGRAMS = mbcontour$(EXEEXT) mbgrdtiff$(EXEEXT) mbswath$(EXEEXT)
 subdir = src/gmt
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
+	$(top_srcdir)/depcomp $(include_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -93,22 +93,48 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbcontour_OBJECTS = mbcontour.$(OBJEXT)
-mbcontour_OBJECTS = $(am_mbcontour_OBJECTS)
-mbcontour_DEPENDENCIES = $(top_builddir)/src/mbaux/libmbaux.la \
-	$(top_builddir)/src/mbaux/libmbps.la
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libmbgmt_la_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
+	${top_builddir}/src/mbaux/libmbaux.la $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_libmbgmt_la_OBJECTS = mbswath.lo mbcontour.lo mbgrdtiff.lo
+libmbgmt_la_OBJECTS = $(am_libmbgmt_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
-am_mbgrdtiff_OBJECTS = mbgrdtiff.$(OBJEXT)
-mbgrdtiff_OBJECTS = $(am_mbgrdtiff_OBJECTS)
-mbgrdtiff_LDADD = $(LDADD)
-am_mbswath_OBJECTS = mbswath.$(OBJEXT)
-mbswath_OBJECTS = $(am_mbswath_OBJECTS)
-mbswath_DEPENDENCIES = $(top_builddir)/src/mbaux/libmbaux.la
+libmbgmt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(libmbgmt_la_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -143,14 +169,14 @@ AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(mbcontour_SOURCES) $(mbgrdtiff_SOURCES) $(mbswath_SOURCES)
-DIST_SOURCES = $(mbcontour_SOURCES) $(mbgrdtiff_SOURCES) \
-	$(mbswath_SOURCES)
+SOURCES = $(libmbgmt_la_SOURCES)
+DIST_SOURCES = $(libmbgmt_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+HEADERS = $(include_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -199,8 +225,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -211,15 +235,13 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBM = @LIBM@
 LIBOBJS = @LIBOBJS@
-LIBS = $(top_builddir)/src/mbio/libmbio.la \
-	${libgmt_LIBS} ${libnetcdf_LIBS} \
-	$(LIBM)
-
+LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -283,19 +305,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -308,8 +337,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -323,18 +350,20 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
+lib_LTLIBRARIES = libmbgmt.la
+include_HEADERS = 
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      -I${top_srcdir}/src/mbaux \
 	      ${libgmt_CPPFLAGS} \
 	      ${libnetcdf_CPPFLAGS}
 
-AM_LDFLAGS = 
-mbcontour_SOURCES = mbcontour.c
-mbcontour_LDADD = $(top_builddir)/src/mbaux/libmbaux.la $(top_builddir)/src/mbaux/libmbps.la
-mbgrdtiff_SOURCES = mbgrdtiff.c
-mbswath_SOURCES = mbswath.c
-mbswath_LDADD = $(top_builddir)/src/mbaux/libmbaux.la
+AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
+libmbgmt_la_LDFLAGS = -no-undefined -version-info 0:0:0
+libmbgmt_la_SOURCES = mbswath.c mbcontour.c mbgrdtiff.c
+libmbgmt_la_LIBADD = ${top_builddir}/src/mbio/libmbio.la \
+			${top_builddir}/src/mbaux/libmbaux.la \
+			${libgmt_LIBS} ${libnetcdf_LIBS}
+
 all: all-am
 
 .SUFFIXES:
@@ -369,67 +398,44 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbcontour$(EXEEXT): $(mbcontour_OBJECTS) $(mbcontour_DEPENDENCIES) $(EXTRA_mbcontour_DEPENDENCIES) 
-	@rm -f mbcontour$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbcontour_OBJECTS) $(mbcontour_LDADD) $(LIBS)
-
-mbgrdtiff$(EXEEXT): $(mbgrdtiff_OBJECTS) $(mbgrdtiff_DEPENDENCIES) $(EXTRA_mbgrdtiff_DEPENDENCIES) 
-	@rm -f mbgrdtiff$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbgrdtiff_OBJECTS) $(mbgrdtiff_LDADD) $(LIBS)
-
-mbswath$(EXEEXT): $(mbswath_OBJECTS) $(mbswath_DEPENDENCIES) $(EXTRA_mbswath_DEPENDENCIES) 
-	@rm -f mbswath$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbswath_OBJECTS) $(mbswath_LDADD) $(LIBS)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libmbgmt.la: $(libmbgmt_la_OBJECTS) $(libmbgmt_la_DEPENDENCIES) $(EXTRA_libmbgmt_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libmbgmt_la_LINK) -rpath $(libdir) $(libmbgmt_la_OBJECTS) $(libmbgmt_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -437,9 +443,9 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbcontour.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgrdtiff.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbswath.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbcontour.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgrdtiff.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbswath.Plo at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -467,6 +473,27 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	done
+
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
@@ -552,9 +579,9 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-am
-all-am: Makefile $(PROGRAMS)
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -589,7 +616,8 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
@@ -609,13 +637,13 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-includeHEADERS
 
 install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-binPROGRAMS
+install-exec-am: install-libLTLIBRARIES
 
 install-html: install-html-am
 
@@ -655,23 +683,25 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS
+uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am \
+	install-includeHEADERS install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
+	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
+	uninstall-libLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/gmt/Makefile.template b/src/gmt/Makefile.template
deleted file mode 100644
index f9efccf..0000000
--- a/src/gmt/Makefile.template
+++ /dev/null
@@ -1,105 +0,0 @@
-#     The MB-system:	Makefile.template  5/23/94
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 1993-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system in the src/gmt directory level
-# Author:	D. W. Caress
-# Date:		May 23, 1994
-#
-# $Log: Makefile.template,v $
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of GMT libraries, binaries, and include files:
-GMTLIBDIR = /usr/local/gmt/lib
-GMTINCDIR = /usr/local/gmt/include
-NETCDFINCDIR = /usr/local/netcdf/include
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -O2
-LFLAGS = -lm
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the MB-system macros and man pages
-all:	$(BINDIR)/mbcontour \
-	$(BINDIR)/mbswath \
-	$(BINDIR)/mbgrdtiff
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### link or copy the executables
-$(BINDIR)/mbcontour: mbcontour.o \
-		$(LIBDIR)/libmbio.a  \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a  \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbps.a
-	$(CC) $(CFLAGS) mbcontour.o \
-		$(LIBDIR)/libmbio.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbps.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a $(GMTLIBDIR)/libgmtps.a \
-		$(LFLAGS) -o $(BINDIR)/mbcontour
-$(BINDIR)/mbswath: mbswath.o \
-		$(LIBDIR)/libmbio.a  \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a
-	$(CC) $(CFLAGS) mbswath.o \
-		$(LIBDIR)/libmbio.a  \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a $(GMTLIBDIR)/libgmtps.a \
-		$(LFLAGS) -o $(BINDIR)/mbswath
-$(BINDIR)/mbgrdtiff: mbgrdtiff.o \
-		$(LIBDIR)/libmbio.a
-	$(CC) $(CFLAGS) mbgrdtiff.o \
-		$(LIBDIR)/libmbio.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a $(GMTLIBDIR)/libgmtps.a \
-		$(LFLAGS) -o $(BINDIR)/mbgrdtiff
-
-### compile the source files
-mbcontour.o:	mbcontour.c ../mbio/mb_status.h ../mbio/mb_define.h ../mbaux/mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux -I$(GMTINCDIR) mbcontour.c
-mbswath.o:	mbswath.c ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mb_format.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbswath.c
-mbgrdtiff.o:	mbgrdtiff.c ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mb_format.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbgrdtiff.c
diff --git a/src/gmt/common_byteswap.h b/src/gmt/common_byteswap.h
new file mode 100644
index 0000000..dac45a0
--- /dev/null
+++ b/src/gmt/common_byteswap.h
@@ -0,0 +1,135 @@
+/*--------------------------------------------------------------------
+ *	$Id: common_byteswap.h 2244 2015-05-27 05:32:38Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * common_byteswap.h contains inline functions for byteswapping
+ *
+ * Author:  Florian Wobbe
+ * Date:    12-APR-2012
+ * Version: 5
+ */
+
+#pragma once
+#ifndef _COMMON_BYTESWAP_H
+#define _COMMON_BYTESWAP_H
+
+#include "gmt_config.h"
+
+#ifdef HAVE_STDINT_H_          /* VS 2010 has stdint.h */
+#	include <stdint.h>
+#else
+#	include "compat/stdint.h"    /* msinttypes for VC++ */
+#endif /* HAVE_STDINT_H_ */
+
+/*
+ * Default inline functions that the compiler should optimize properly. Use
+ * these functions if you know that you are dealing with constant values.
+ */
+static inline uint16_t inline_bswap16 (uint16_t x) {
+	return
+		(((x & 0x00FFU) << 8) |
+		 ((x & 0xFF00U) >> 8));
+}
+
+static inline uint32_t inline_bswap32 (uint32_t x) {
+	return
+		(((x & 0xFF000000U) >> 24) |
+		 ((x & 0x00FF0000U) >>  8) |
+		 ((x & 0x0000FF00U) <<  8) |
+		 ((x & 0x000000FFU) << 24));
+}
+
+static inline uint64_t inline_bswap64 (uint64_t x) {
+	return
+		(((x & 0x00000000000000FFULL) << 56) |
+		 ((x & 0x000000000000FF00ULL) << 40) |
+		 ((x & 0x0000000000FF0000ULL) << 24) |
+		 ((x & 0x00000000FF000000ULL) << 8) |
+		 ((x & 0x000000FF00000000ULL) >> 8) |
+		 ((x & 0x0000FF0000000000ULL) >> 24) |
+		 ((x & 0x00FF000000000000ULL) >> 40) |
+		 ((x & 0xFF00000000000000ULL) >> 56));
+}
+
+/*
+ * Use builtin functions for bswap16, bswap32, and bswap64 or - if not
+ * available - use the default inline functions defined above.
+ */
+
+/* Define bswap16 */
+#undef bswap16
+#ifdef HAVE___BUILTIN_BSWAP16
+#	define bswap16 __builtin_bswap16
+#elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
+#	define bswap16 gnuc_bswap16
+	static inline uint16_t gnuc_bswap16(uint16_t x) {
+		if (__builtin_constant_p(x))
+			x = inline_bswap16(x);
+		else {
+#		ifdef __x86_64__
+			__asm__("xchgb %h0, %b0" : "+Q" (x));
+#		elif defined __i386__
+			__asm__("xchgb %h0, %b0" : "+q" (x));
+#		endif
+		}
+		return x;
+	}
+#elif defined HAVE__BYTESWAP_USHORT /* HAVE___BUILTIN_BSWAP16 */
+#	define bswap16 _byteswap_ushort
+#else /* HAVE___BUILTIN_BSWAP16 */
+#	define bswap16 inline_bswap16
+#endif /* HAVE___BUILTIN_BSWAP16 */
+
+/* Define bswap32 */
+#undef bswap32
+#ifdef HAVE___BUILTIN_BSWAP32
+#	define bswap32 __builtin_bswap32
+#elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
+#	define bswap32 gnuc_bswap32
+	static inline uint32_t gnuc_bswap32(uint32_t x) {
+		if (__builtin_constant_p(x))
+			x = inline_bswap32(x);
+		else
+			__asm__("bswap %0" : "+r" (x));
+		return x;
+	}
+#elif defined HAVE__BYTESWAP_ULONG /* HAVE___BUILTIN_BSWAP32 */
+#	define bswap32 _byteswap_ulong
+#else /* HAVE___BUILTIN_BSWAP32 */
+#	define bswap32 inline_bswap32
+#endif /* HAVE___BUILTIN_BSWAP32 */
+
+/* Define bswap64 */
+#undef bswap64
+#ifdef HAVE___BUILTIN_BSWAP64
+#	define bswap64 __builtin_bswap64
+#elif defined __GNUC__ && defined __x86_64__
+#	define bswap64 gnuc_bswap64
+	static inline uint64_t gnuc_bswap64(uint64_t x) {
+		if (__builtin_constant_p(x))
+			x = inline_bswap64(x);
+		else
+			__asm__ ("bswap  %0" : "+r" (x));
+		return x;
+	}
+#elif defined HAVE__BYTESWAP_UINT64 /* HAVE___BUILTIN_BSWAP64 */
+#	define bswap64 _byteswap_uint64
+#else /* HAVE___BUILTIN_BSWAP64 */
+#	define bswap64 inline_bswap64
+#endif /* HAVE___BUILTIN_BSWAP64 */
+
+#endif /* !_COMMON_BYTESWAP_H */
diff --git a/src/gmt/common_math.h b/src/gmt/common_math.h
new file mode 100644
index 0000000..3a2c896
--- /dev/null
+++ b/src/gmt/common_math.h
@@ -0,0 +1,107 @@
+/*--------------------------------------------------------------------
+ * $Id: common_math.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ * Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ * See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3 or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * common_math.h declares shared math functions
+ *
+ * Author:  Florian Wobbe
+ * Date:    10-MAR-2012
+ * Version: 5
+ */
+
+#pragma once
+#ifndef _COMMON_MATH_H
+#define _COMMON_MATH_H
+
+#ifdef __cplusplus      /* Basic C++ support */
+extern "C" {
+#endif
+
+	/* CMake definitions: This must be first! */
+//#include "gmt_config.h"
+
+	/* Declaration modifiers for DLL support (MSC et al) */
+#include "declspec.h"
+
+//#ifdef HAVE_STDINT_H_       /* VS 2010 has stdint.h */
+#	include <stdint.h>
+//#else
+//#	include "compat/stdint.h" /* msinttypes for VC++ */
+//#endif /* HAVE_STDINT_H_ */
+
+//#ifdef HAVE_STDBOOL_H_
+#	include <stdbool.h>
+//#else
+//#	include "compat/stdbool.h"
+//#endif /* HAVE_STDBOOL_H_ */
+
+	/* int32_abs function that works with int32_t */
+#if defined(SIZEOF_INT) && SIZEOF_INT == 4 && defined(HAVE_ABS)
+#	define int32_abs abs
+#elif defined(SIZEOF_LONG) && SIZEOF_LONG == 4
+#	define int32_abs labs
+#else
+#	define int32_abs(x) ((int32_t)(((x) >= 0) ? (x) : -(x)))
+#endif
+
+	/* int64_abs function that works with int64_t */
+#if defined(_WIN64)
+#	define int64_abs _abs64
+#elif defined(SIZEOF_INT) && SIZEOF_INT == 8 && defined(HAVE_ABS)
+#	define int64_abs abs
+#elif defined(SIZEOF_LONG) && SIZEOF_LONG == 8
+#	define int64_abs labs
+#elif defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG == 8 && defined(HAVE_LLABS)
+#	define int64_abs llabs
+#else
+#	define int64_abs(x) ((int64_t)(((x) >= 0) ? (x) : -(x)))
+#endif
+
+	/* Limit casting to one place (here) for dropping lrint output to signed or unsigned ints */
+#define irint(x) ((int)lrint(x))
+#define urint(x) ((unsigned int)lrint(x))
+#define irintf(x) ((int)lrintf(x))
+#define urintf(x) ((unsigned int)lrintf(x))
+
+	/* Safe rounding of float and double to signed and unsigned 64 bit ints */
+#if defined(SIZEOF_INT) && SIZEOF_LONG == 8
+#	define irint64(x) lrint(x)
+#	define urint64(x) ((uint64_t)lrint(x))
+#	define irint64f(x) lrintf(x)
+#	define urint64f(x) ((uint64_t)lrintf(x))
+#else /* SIZEOF_LONG_LONG == 8 by ISO C definition */
+#	define irint64(x) llrint(x)
+#	define urint64(x) ((uint64_t)llrint(x))
+#	define irint64f(x) llrintf(x)
+#	define urint64f(x) ((uint64_t)llrintf(x))
+#endif
+
+	EXTERN_MSC bool floatAlmostEqualUlpsAndAbs(float A, float B, float maxDiff, int maxUlpsDiff);
+	EXTERN_MSC bool doubleAlmostEqualUlpsAndAbs(double A, double B, double maxDiff, int maxUlpsDiff);
+	EXTERN_MSC bool floatAlmostEqualUlps(float A, float B, int maxUlpsDiff);
+	EXTERN_MSC bool doubleAlmostEqualUlps(double A, double B, int maxUlpsDiff);
+
+#	define floatAlmostEqual(A, B) (floatAlmostEqualUlps(A, B, 5))
+#	define doubleAlmostEqual(A, B) (doubleAlmostEqualUlps(A, B, 5))
+#	define floatAlmostEqualZero(A, B) (floatAlmostEqualUlpsAndAbs(A, B, 5*FLT_EPSILON, 5))
+#	define doubleAlmostEqualZero(A, B) (doubleAlmostEqualUlpsAndAbs(A, B, 5*DBL_EPSILON, 5))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_COMMON_MATH_H */
diff --git a/src/gmt/common_runpath.h b/src/gmt/common_runpath.h
new file mode 100644
index 0000000..687e054
--- /dev/null
+++ b/src/gmt/common_runpath.h
@@ -0,0 +1,59 @@
+/*--------------------------------------------------------------------
+ *	$Id: common_runpath.h 2244 2015-05-27 05:32:38Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * common_runpath.h contains prototypes of functions shared between GMT and PSL
+ *
+ * Author:  Florian Wobbe
+ * Date:    3-MAR-2012
+ * Version: 5
+ */
+
+#pragma once
+#ifndef _COMMON_RUNPATH_H
+#define _COMMON_RUNPATH_H
+
+#ifdef __cplusplus      /* Basic C++ support */
+extern "C" {
+#endif
+
+/* CMake definitions: This must be first! */
+#include "gmt_config.h"
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#include "declspec.h"
+
+/* Prototypes */
+#if defined (__APPLE__)
+#	define GMT_runtime_bindir(result, argv) GMT_runtime_bindir_osx(result)
+	EXTERN_MSC char *GMT_runtime_bindir_osx (char *result);
+#elif defined (_WIN32)
+#	define GMT_runtime_bindir(result, argv) GMT_runtime_bindir_win32(result)
+	EXTERN_MSC char *GMT_runtime_bindir_win32 (char *result);
+#else
+	EXTERN_MSC char *GMT_runtime_bindir (char *result, const char *candidate);
+#endif
+
+EXTERN_MSC char *GMT_runtime_libdir (char *result);
+EXTERN_MSC char *GMT_guess_sharedir (char *sharedir, const char *runpath);
+EXTERN_MSC int GMT_verify_sharedir_version (const char *dir);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* !_COMMON_RUNPATH_H */
diff --git a/src/gmt/common_sighandler.h b/src/gmt/common_sighandler.h
new file mode 100644
index 0000000..e793229
--- /dev/null
+++ b/src/gmt/common_sighandler.h
@@ -0,0 +1,34 @@
+/*--------------------------------------------------------------------
+ *	$Id: common_sighandler.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * common_sighandler.h contains the prototype of a signal-handling function
+ *
+ * Author:  Florian Wobbe
+ * Date:    5-SEP-2013
+ * Version: 5
+ */
+
+#pragma once
+#ifndef _COMMON_SIGHANDLER_H
+#define _COMMON_SIGHANDLER_H
+
+#if !(defined WIN32 || defined NO_SIGHANDLER)
+void sig_handler(int sig_num, siginfo_t *info, void *ucontext);
+#endif /* !(defined WIN32 || defined NO_SIGHANDLER) */
+
+#endif /* !_COMMON_SIGHANDLER_H */
diff --git a/src/gmt/common_string.h b/src/gmt/common_string.h
new file mode 100644
index 0000000..f2b554c
--- /dev/null
+++ b/src/gmt/common_string.h
@@ -0,0 +1,88 @@
+/*--------------------------------------------------------------------
+ *	$Id: common_string.h 2244 2015-05-27 05:32:38Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * common_string.h contains prototypes of functions shared between GMT and PSL
+ *
+ * Author:  Florian Wobbe
+ * Date:    3-MAR-2012
+ * Version: 5
+ */
+
+#pragma once
+#ifndef _COMMON_STRING_H
+#define _COMMON_STRING_H
+
+#ifdef __cplusplus      /* Basic C++ support */
+extern "C" {
+#endif
+
+/* CMake definitions: This must be first! */
+//#include "gmt_config.h"
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#include "declspec.h"
+
+//#ifdef HAVE_STDBOOL_H_
+//#	include <stdbool.h>
+//#else
+//#	include "compat/stdbool.h"
+//#endif /* HAVE_STDBOOL_H_ */
+
+#include <limits.h> /* defines PATH_MAX */
+#include <stdlib.h> /* defines _MAX_PATH on WIN32 */
+#if ! defined PATH_MAX && defined _MAX_PATH
+#	define PATH_MAX _MAX_PATH
+#endif
+#ifndef PATH_MAX
+#	define PATH_MAX 1024
+#endif
+
+EXTERN_MSC unsigned int GMT_strtok (const char *string, const char *sep, unsigned int *start, char *token);
+EXTERN_MSC void GMT_chop (char *string);
+EXTERN_MSC char *GMT_chop_ext (char *string);
+EXTERN_MSC void GMT_strstrip(char *string, bool strip_leading);
+EXTERN_MSC void GMT_cr2lf (char *string);
+EXTERN_MSC void GMT_strlshift (char *string, size_t n);
+EXTERN_MSC void GMT_strrepc (char *string, int c, int r);
+EXTERN_MSC size_t GMT_strlcmp (char *str1, char *str2);
+
+#ifdef WIN32
+EXTERN_MSC void DOS_path_fix (char *dir);
+#else
+# define DOS_path_fix(e) ((void)0) /* dummy function */
+#endif
+
+//#if !defined(HAVE_STRTOK_R) && !defined(HAVE_STRTOK_S)
+//EXTERN_MSC char *strtok_r (char *s, const char *delim, char **save_ptr);
+//#endif
+
+//#ifndef DECLARED_STRSEP
+//EXTERN_MSC char *strsep (char **stringp, const char *delim);
+//#endif
+EXTERN_MSC char *strsepz (char **stringp, const char *delim);
+EXTERN_MSC char *stresep (char **stringp, const char *delim, int esc);
+
+EXTERN_MSC int match_string_in_file (const char *filename, const char *string);
+
+EXTERN_MSC char *GMT_basename(const char *path);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_COMMON_STRING_H */
diff --git a/src/gmt/gmt_calclock.h b/src/gmt/gmt_calclock.h
new file mode 100644
index 0000000..cc3103f
--- /dev/null
+++ b/src/gmt/gmt_calclock.h
@@ -0,0 +1,68 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_calclock.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/* Header file for Generic Mapping Tools conversions
+ *      between [calendar, clock] and time.
+ *      
+ *      Calendar conversions are inspired partly by
+ *      Dershowitz and Reingold.
+ *      
+ * Author:	W H F Smith
+ * Date:	1 JAN 2010
+ * Version:	5 API
+ *
+ */
+
+#pragma once
+#ifndef _GMT_CALCLOCK_H
+#define _GMT_CALCLOCK_H
+
+struct GMT_gcal {	/* (proleptic) Gregorian calendar  */
+	int year;		/* signed; negative and 0 allowed  */
+	unsigned int month;	/* Always between 1 and 12  */
+	unsigned int day_m;	/* Day of month; always in 1 - 31  */
+	unsigned int day_y;	/* Day of year; 1 thru 366  */
+	unsigned int day_w;	/* Day of week; 0 (Sun) thru 6 (Sat)  */
+	int iso_y;		/* ISO year; not necessarily == year */
+	unsigned int iso_w;	/* ISO week of iso_y; must be in 1 -- 53  */
+	unsigned int iso_d;	/* ISO day of iso_w; uses 1 (Mon) thru 7 (Sun)  */
+	unsigned int hour;	/* 00 through 23  */
+	unsigned int min;	/* 00 through 59  */
+	double sec;		/* 00 through 59.xxxx; leap not yet handled  */
+};
+
+struct GMT_Y2K_FIX {	/* The issue that refuses to go away... */
+	unsigned int y2_cutoff;	/* The 2-digit offset year.  If y2 >= y2_cuttoff, add y100 else add y200 */
+	int y100;	/* The multiple of 100 to add to the 2-digit year if we are above the time_Y2K_offset_year */
+	int y200;	/* The multiple of 100 to add to the 2-digit year if we are below the time_Y2K_offset_year */
+};
+
+struct GMT_MOMENT_INTERVAL {
+	struct GMT_gcal	cc[2];		
+	double dt[2];		
+	double sd[2];		/* Seconds since the start of the day.  */
+	int64_t rd[2];
+	unsigned int step;
+	char unit;
+};
+
+struct GMT_TRUNCATE_TIME {		/* Used when TIME_IS_INTERVAL is not OFF */
+	struct GMT_MOMENT_INTERVAL T;
+	unsigned int direction;		/* 0 [+] to center on next interval, 1 [-] for previous interval */
+};
+
+#endif /* !_GMT_CALCLOCK_H */
diff --git a/src/gmt/gmt_colors.h b/src/gmt/gmt_colors.h
new file mode 100644
index 0000000..60af0a7
--- /dev/null
+++ b/src/gmt/gmt_colors.h
@@ -0,0 +1,60 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_colors.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * Miscellaneous definitions and structures related to color.
+ *
+ * Author: Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ */
+
+#ifndef _GMT_COLORS_H
+#define _GMT_COLORS_H
+
+/* Copy two RGB[T] arrays (a = b) */
+#define GMT_rgb_copy(a,b) memcpy (a, b, 4 * sizeof(double))
+
+/* To compare is two colors are ~ the same */
+#define GMT_eq(a,b) (fabs((a)-(b)) < GMT_CONV4_LIMIT)
+#define GMT_same_rgb(a,b) (GMT_eq(a[0],b[0]) && GMT_eq(a[1],b[1]) && GMT_eq(a[2],b[2]) && GMT_eq(a[3],b[3]))
+
+/* Macros for conversion of RGB in 0-1 range to 0-255 range */
+#define GMT_s255(s) ((s) * 255.0)
+#define GMT_t255(t) GMT_q(GMT_s255(t[0])),GMT_q(GMT_s255(t[1])),GMT_q(GMT_s255(t[2]))
+#define GMT_u255(s) ((unsigned char)rint(GMT_s255(s)))
+
+/* Macros for conversion of RGB in 0-255 range to 0-1 range */
+#define GMT_is255(s) ((s) / 255.0)
+#define GMT_it255(t) GMT_is255(t[0]),GMT_is255(t[1]),GMT_is255(t[2])
+
+/* Macro to avoid small numbers in color codes */
+#define GMT_q(s) ((s) < 1e-5 ? 0.0 : (s))
+
+/* How B/W TV's convert RGB to Gray */
+#define GMT_YIQ(rgb) (0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2])
+
+/* Determine if a RGB combination is grayshade */
+#define GMT_is_gray(rgb) (GMT_eq(rgb[0],rgb[1]) && GMT_eq(rgb[1],rgb[2]))
+
+/* Determine if a RGB combination is in fact B/W */
+#define GMT_is_bw(rgb) (GMT_is_gray(rgb) && (GMT_eq(rgb[0],0.0) || GMT_eq(rgb[0],1.0)))
+
+/* Force component to be in 0 <= s <= 255 range */
+#define GMT_0_255_truncate(s) ((s < 0) ? 0 : ((s > 255) ? 255 : s))	/* Truncate to allowable 0-255 range */
+
+#endif /* _GMT_COLORS_H */
diff --git a/src/gmt/gmt_common.h b/src/gmt/gmt_common.h
new file mode 100644
index 0000000..0a5ff54
--- /dev/null
+++ b/src/gmt/gmt_common.h
@@ -0,0 +1,187 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_common.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+ 
+/*
+ * Holds current selections for the family of common GMT options.
+ *
+ * Author: 	Paul Wessel
+ * Date:	01-JAN-2011
+ * Version:	5 API
+ */
+ 
+#ifndef _GMT_COMMON_H
+#define _GMT_COMMON_H
+
+/* Constants related to detecting data gaps which should be treated as segment boundaries */
+enum GMT_enum_gaps {GMT_NEGGAP_IN_COL = 0,	/* Check if previous minus current column value exceeds <gap> */
+	GMT_POSGAP_IN_COL,			/* Check if current minus previous column value exceeds <gap> */
+	GMT_ABSGAP_IN_COL,			/* Check if |current minus previous column value| exceeds <gap> */
+	GMT_NEGGAP_IN_MAP_COL,			/* Check if previous minus current column value exceeds <gap> after map projection */
+	GMT_POSGAP_IN_MAP_COL,			/* Check if current minus previous column value exceeds <gap> after map projection */
+	GMT_ABSGAP_IN_MAP_COL,			/* Check if |current minus previous column value| exceeds <gap> after map projection */
+	GMT_GAP_IN_GDIST,			/* Check if great-circle distance between successive points exceeds <gap> (in km,m,nm, etc)*/
+	GMT_GAP_IN_CDIST,			/* Check if Cartesian distance between successive points exceeds <gap> */
+	GMT_GAP_IN_PDIST,			/* Check if Cartesian distance between successive points exceeds <gap> after map projection */
+	GMT_GAP_IN_DDIST,			/* Check if great-circle distance between successive points exceeds <gap> (in arc degrees,min,sec) */
+	GMT_N_GAP_METHODS};
+
+#define MAX_ASPATIAL 64		/* No more than 64 aspatial options in -a */
+
+#define GMT_SHORTHAND_OPTIONS	"BJRXYcp"	/* All of the shorthand options */
+#define GMT_CRITICAL_OPT_ORDER "-VJfRb"		/* If given options among these must be parsed first and in this order */
+
+struct GMT_COMMON {
+	/* Structure with all information given via the common GMT command-line options -R -J .. */
+	struct synopsis {	/* \0 (zero) or ^ */
+		bool active;
+		bool extended;	/* + to also show non-common options */
+	} synopsis;
+	struct B {	/* -B<params> */
+		bool active[2];	/* 0 = primary annotation, 1 = secondary annotations */
+		int mode;	/* 5 = GMT 5 syntax, 4 = GMT 4 syntax, 1 = Either, -1 = mix (error), 0 = not set yet */
+		char string[2][GMT_LEN256];
+	} B;	
+	struct API_I {	/* -I<xinc>[/<yinc>] grids only, and for API use only */
+		bool active;
+		double inc[2];
+	} API_I;	
+	struct J {	/* -J<params> */
+		bool active, zactive;
+		unsigned int id;
+		double par[6];
+		char string[GMT_LEN256];
+	} J;		
+	struct K {	/* -K */
+		bool active;
+	} K;	
+	struct O {	/* -O */
+		bool active;
+	} O;
+	struct P {	/* -P */
+		bool active;
+	} P;
+	struct R {	/* -Rw/e/s/n[/z_min/z_max][r] */
+		bool active;
+		bool oblique;	/* true when -R...r was given (oblique map, probably), else false (map borders are meridians/parallels) */
+		double wesn[6];		/* Boundaries of west, east, south, north, low-z and hi-z */
+		double wesn_orig[4];	/* Original Boundaries of west, east, south, north (oblique projection may reset wesn above) */
+		char string[GMT_LEN256];
+	} R;
+	struct U {	/* -U */
+		bool active;
+		unsigned int just;
+		double x, y;
+		char *label;		/* Content not counted by sizeof (struct) */
+	} U;
+	struct V {	/* -V */
+		bool active;
+	} V;
+	struct X {	/* -X */
+		bool active;
+		double off;
+		char mode;	/* r, a, or c */
+	} X;
+	struct Y {	/* -Y */
+		bool active;
+		double off;
+		char mode;	/* r, a, or c */
+	} Y;
+	struct a {	/* -a<col>=<name>[:<type>][,col>=<name>[:<type>], etc][+g<geometry>] */
+		bool active;
+		unsigned int geometry;
+		unsigned int n_aspatial;
+		bool clip;		/* true if we wish to clip lines/polygons at Dateline [false] */
+		bool output;		/* true when we wish to build OGR output */
+		int col[MAX_ASPATIAL];	/* Col id, include negative items such as GMT_IS_T (-5) */
+		int ogr[MAX_ASPATIAL];	/* Column order, or -1 if not set */
+		unsigned int type[MAX_ASPATIAL];
+		char *name[MAX_ASPATIAL];
+	} a;
+	struct b {	/* -b[i][o][s|S][d|D][#cols][cvar1/var2/...] */
+		bool active[2];		/* true if current input/output is in native binary format */
+		bool o_delay;		/* true if we dont know number of output columns until we have read at least one input record */
+		enum GMT_swap_direction swab[2];	/* k_swap_in or k_swap_out if current binary input/output must be byte-swapped, else k_swap_none */
+		uint64_t ncol[2];		/* Number of expected columns of input/output
+						   0 means it will be determined by program */
+		char type[2];			/* Default column type, if set [d for double] */
+		char varnames[GMT_BUFSIZ];	/* List of variable names to be input/output in netCDF mode [GMT4 COMPATIBILITY ONLY] */
+	} b;
+	struct c {	/* -c */
+		bool active;
+		unsigned int copies;
+	} c;
+	struct f {	/* -f[i|o]<col>|<colrange>[t|T|g],.. */
+		bool active[2];	/* For GMT_IN|OUT */
+	} f;
+	struct g {	/* -g[+]x|x|y|Y|d|Y<gap>[unit]  */
+		bool active;
+		unsigned int n_methods;			/* How many different criteria to apply */
+		uint64_t n_col;				/* Largest column-number needed to be read */
+		bool match_all;			/* If true then all specified criteria must be met to be a gap [default is any of them] */
+		enum GMT_enum_gaps method[GMT_N_GAP_METHODS];	/* How distances are computed for each criteria */
+		uint64_t col[GMT_N_GAP_METHODS];	/* Which column to use (-1 for x,y distance) */
+		double gap[GMT_N_GAP_METHODS];		/* The critical distances for each criteria */
+		double (*get_dist[GMT_N_GAP_METHODS]) (struct GMT_CTRL *GMT, uint64_t);	/* Pointers to functions that compute those distances */
+	} g;
+	struct h {	/* -h[i|o][<nrecs>][+d][+c][+r<remark>][+t<title>] */
+		bool active;
+		bool add_colnames;
+		unsigned int mode;
+		unsigned int n_recs;
+		char *title;
+		char *remark;
+		char *colnames;	/* Not set by -h but maintained here */
+	} h;	
+	struct i {	/* -i<col>|<colrange>,.. */
+		bool active;
+		uint64_t n_cols;
+	} i;
+	struct n {	/* -n[b|c|l|n][+a][+b<BC>][+c][+t<threshold>] */
+		bool active;
+		bool antialias;	/* Defaults to true, if supported */
+		bool truncate;	/* Defaults to false */
+		unsigned int interpolant;	/* Defaults to BCR_BICUBIC */
+		bool bc_set;	/* true if +b was parsed */
+		char BC[4];		/* For BC settings via +bg|n[x|y]|p[x|y] */
+		double threshold;	/* Defaults to 0.5 */
+	} n;
+	struct o {	/* -o<col>|<colrange>,.. */
+		bool active;
+		uint64_t n_cols;
+	} o;
+	struct p {	/* -p<az>/<el>[+wlon0/lat0[/z0]][+vx0[cip]/y0[cip]] */
+		bool active;
+	} p;
+	struct r {	/* -r */
+		bool active;
+		unsigned int registration;
+	} r;
+	struct s {	/* -s[r] */
+		bool active;
+	} s;
+	struct t {	/* -t<transparency> */
+		bool active;
+		double value;
+	} t;
+	struct colon {	/* -:[i|o] */
+		bool active;
+		bool toggle[2];
+	} colon;
+};
+
+#endif /* _GMT_COMMON_H */
diff --git a/src/gmt/gmt_config.h b/src/gmt/gmt_config.h
new file mode 100644
index 0000000..e69de29
diff --git a/src/gmt/gmt_constants.h b/src/gmt/gmt_constants.h
new file mode 100644
index 0000000..ccac745
--- /dev/null
+++ b/src/gmt/gmt_constants.h
@@ -0,0 +1,224 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_constants.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_constants.h contains definitions of constants used throught GMT.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_CONSTANTS_H
+#define _GMT_CONSTANTS_H
+
+/*=====================================================================================
+ *	GMT API CONSTANTS DEFINITIONS
+ *===================================================================================*/
+
+#include "gmt_error_codes.h"			/* All API error codes are defined here */
+#include "gmt_define.h"			/* All constant values are defined here */
+
+/*--------------------------------------------------------------------
+ *			GMT CONSTANTS MACRO DEFINITIONS
+ *--------------------------------------------------------------------*/
+
+#ifndef TWO_PI
+#define TWO_PI        6.28318530717958647692
+#endif
+#ifndef M_PI
+#define M_PI          3.14159265358979323846
+#endif
+#ifndef M_PI_2
+#define M_PI_2          1.57079632679489661923
+#endif
+#ifndef M_PI_4
+#define M_PI_4          0.78539816339744830962
+#endif
+#ifndef M_E
+#define	M_E		2.7182818284590452354
+#endif
+#ifndef M_SQRT2
+#define	M_SQRT2		1.41421356237309504880
+#endif
+#ifndef M_LN2_INV
+#define	M_LN2_INV	(1.0 / 0.69314718055994530942)
+#endif
+#ifndef M_EULER
+#define M_EULER		0.577215664901532860606512	/* Euler's constant (gamma) */
+#endif
+
+#define GMT_CONV8_LIMIT	1.0e-8		/* Fairly tight convergence limit or "close to zero" limit */
+#define GMT_CONV6_LIMIT 1.0e-6		/* 1 ppm */
+#define GMT_CONV4_LIMIT	1.0e-4		/* Less tight convergence limit or "close to zero" limit */
+
+/* Various allocation-length parameters */
+enum GMT_enum_length {
+	GMT_TINY_CHUNK  = 8U,
+	GMT_SMALL_CHUNK = 64U,
+	GMT_CHUNK       = 2048U,
+	GMT_BIG_CHUNK   = 65536U,
+	GMT_LEN16	= 16U,		/* All strings used to format date/clock output must be this length */
+	GMT_LEN32  = 32U,          /* Small length of texts */
+	GMT_LEN64  = 64U,          /* Intermediate length of texts */
+	GMT_LEN128 = 128U,         /* Double of 64 */
+	GMT_LEN256 = 256U,         /* Max size of some text items */
+	GMT_MAX_COLUMNS = 4096U,        /* Limit on number of columns in data tables (not grids) */
+	GMT_BUFSIZ      = 4096U,        /* Size of char record for i/o */
+	GMT_MIN_MEMINC  = 1U,        /* E.g., 16 kb of 8-byte doubles */
+	GMT_MAX_MEMINC  = 67108864U};   /* E.g., 512 Mb of 8-byte doubles */
+
+/* The four plot length units [m just used internally] */
+enum GMT_enum_unit {
+	GMT_CM = 0,
+	GMT_INCH,
+	GMT_M,
+	GMT_PT};
+
+/* Handling of swap/no swap in i/o */
+enum GMT_swap_direction {
+	k_swap_none = 0,
+	k_swap_in,
+	k_swap_out};
+
+#define GMT_DIM_UNITS	"cip"		/* Plot dimensions in cm, inch, or point */
+#define GMT_LEN_UNITS2	"efkMnu"	/* Distances in meter, foot, survey foot, km, Mile, nautical mile */
+#define GMT_LEN_UNITS	"dmsefkMnu"	/* Distances in arc-{degree,minute,second} or meter, foot, km, Mile, nautical mile, survey foot */
+#define GMT_DIM_UNITS_DISPLAY	"c|i|p"			/* Same, used to display as options */
+#define GMT_LEN_UNITS_DISPLAY	"d|m|s|e|f|k|M|n|u"	/* Same, used to display as options */
+#define GMT_LEN_UNITS2_DISPLAY	"e|f|k|M|n|u"		/* Same, used to display as options */
+#define GMT_DEG2SEC_F	3600.0
+#define GMT_DEG2SEC_I	3600
+#define GMT_SEC2DEG	(1.0 / GMT_DEG2SEC_F)
+#define GMT_DEG2MIN_F	60.0
+#define GMT_DEG2MIN_I	60
+#define GMT_MIN2DEG	(1.0 / GMT_DEG2MIN_F)
+#define GMT_MIN2SEC_F	60.0
+#define GMT_MIN2SEC_I	60
+#define GMT_SEC2MIN	(1.0 / GMT_MIN2SEC_F)
+#define GMT_DAY2HR_F	24.0
+#define GMT_DAY2HR_I	24
+#define GMT_HR2DAY	(1.0 / GMT_DAY2HR_F)
+#define GMT_DAY2MIN_F	1440.0
+#define GMT_DAY2MIN_I	1440
+#define GMT_MIN2DAY	(1.0 / GMT_DAY2MIN_F)
+#define GMT_DAY2SEC_F	86400.0
+#define GMT_DAY2SEC_I	86400
+#define GMT_SEC2DAY	(1.0 / GMT_DAY2SEC_F)
+#define GMT_HR2SEC_F	3600.0
+#define GMT_HR2SEC_I	3600
+#define GMT_SEC2HR	(1.0 / GMT_HR2SEC_F)
+#define GMT_HR2MIN_F	60.0
+#define GMT_HR2MIN_I	60
+#define GMT_MIN2HR	(1.0 / GMT_HR2MIN_F)
+
+#define GMT_YR2SEC_F	(365.2425 * 86400.0)
+#define GMT_MON2SEC_F	(365.2425 * 86400.0 / 12.0)
+
+#define GMT_DEC_SIZE	0.54	/* Size of a decimal number compared to point size */
+#define GMT_PER_SIZE	0.30	/* Size of a decimal point compared to point size */
+
+#define GMT_PEN_LEN	128
+#define GMT_PENWIDTH	0.25	/* Default pen width in points */
+
+/* Various options for FFT calculations [Default is 0] */
+enum FFT_implementations {
+	k_fft_auto = 0,    /* Automatically select best FFT algorithm */
+	k_fft_accelerate,  /* Select Accelerate Framework vDSP FFT [OS X only] */
+	k_fft_fftw,        /* Select FFTW */
+	k_fft_kiss,        /* Select Kiss FFT (always available) */
+	k_fft_brenner,     /* Select Brenner FFT (Legacy*/
+	k_n_fft_algorithms /* Number of FFT implementations available in GMT */
+};
+
+/* Various algorithms for triangulations */
+enum GMT_enum_tri {
+	GMT_TRIANGLE_WATSON = 0, /* Select Watson's algorithm */
+	GMT_TRIANGLE_SHEWCHUK};  /* Select Shewchuk's algorithm */
+
+/* Various 1-D interpolation modes */
+enum GMT_enum_spline {
+	GMT_SPLINE_LINEAR = 0, /* Linear spline */
+	GMT_SPLINE_AKIMA,      /* Akima spline */
+	GMT_SPLINE_CUBIC,      /* Cubic spline */
+	GMT_SPLINE_NONE};      /* No spline set */
+
+enum GMT_enum_extrap {
+	GMT_EXTRAPOLATE_NONE = 0,   /* No extrapolation; set to NaN outside bounds */
+	GMT_EXTRAPOLATE_SPLINE,     /* Let spline extrapolate beyond bounds */
+	GMT_EXTRAPOLATE_CONSTANT};  /* Set extrapolation beyond bound to specifiec constant */
+
+/* Timer reporting modes */
+enum GMT_enum_timer {
+	GMT_NO_TIMER = 0,	/* No timer reported */
+	GMT_ABS_TIMER,		/* Report absolute time */
+	GMT_ELAPSED_TIMER};	/* Report elapsed time since start of session */
+
+/* Various line/grid/image interpolation modes */
+enum GMT_enum_track {
+	GMT_TRACK_FILL = 0,	/* Normal fix_up_path behavior: Keep all (x,y) points but add intermediate if gap > cutoff */
+	GMT_TRACK_FILL_M,	/* Fill in, but navigate via meridians (y), then parallels (x) */
+	GMT_TRACK_FILL_P,	/* Fill in, but navigate via parallels (x), then meridians (y) */
+	GMT_TRACK_SAMPLE_FIX,	/* Resample the track at equidistant points; old points may be lost. Use given spacing */
+	GMT_TRACK_SAMPLE_ADJ};	/* Resample the track at equidistant points; old points may be lost. Adjust spacing to fit length of track exactly */
+
+enum GMT_enum_bcr {
+	BCR_NEARNEIGHBOR = 0, /* Nearest neighbor algorithm */
+	BCR_BILINEAR,         /* Bilinear spline */
+	BCR_BSPLINE,          /* B-spline */
+	BCR_BICUBIC};         /* Bicubic spline */
+
+/* Various grid/image boundary conditions */
+enum GMT_enum_bc {
+	GMT_BC_IS_NOTSET = 0, /* BC not yet set */
+	GMT_BC_IS_NATURAL,    /* Use natural BC */
+	GMT_BC_IS_PERIODIC,   /* Use periodic BC */
+	GMT_BC_IS_GEO,        /* Geographic BC condition */
+	GMT_BC_IS_DATA};      /* Fill in BC with actual data */
+
+enum GMT_enum_radius {	/* Various "average" radii for an ellipsoid with axes a,a,b */
+	GMT_RADIUS_MEAN = 0,	/* Mean radius IUGG R_1 = (2*a+b)/3 = a (1 - f/3) */
+	GMT_RADIUS_AUTHALIC,	/* Authalic radius 4*pi*r^2 = surface area of ellipsoid, R_2 = sqrt (0.5a^2 + 0.5b^2 (tanh^-1 e)/e) */
+	GMT_RADIUS_VOLUMETRIC,	/* Volumetric radius 3/4*pi*r^3 = volume of ellipsoid, R_3 = (a*a*b)^(1/3) */
+	GMT_RADIUS_MERIDIONAL,	/* Meridional radius, M_r = [(a^3/2 + b^3/2)/2]^2/3 */
+	GMT_RADIUS_QUADRATIC};	/* Quadratic radius, Q_r = 1/2 sqrt (3a^2 + b^2) */
+
+enum GMT_enum_latswap {GMT_LATSWAP_NONE = -1,	/* Deactivate latswapping */
+	GMT_LATSWAP_G2A = 0,	/* input = geodetic;   output = authalic   */
+	GMT_LATSWAP_A2G,	/* input = authalic;   output = geodetic   */
+	GMT_LATSWAP_G2C,	/* input = geodetic;   output = conformal  */
+	GMT_LATSWAP_C2G,	/* input = conformal;  output = geodetic   */
+	GMT_LATSWAP_G2M,	/* input = geodetic;   output = meridional */
+	GMT_LATSWAP_M2G,	/* input = meridional; output = geodetic   */
+	GMT_LATSWAP_G2O,	/* input = geodetic;   output = geocentric */
+	GMT_LATSWAP_O2G,	/* input = geocentric; output = geodetic   */
+	GMT_LATSWAP_G2P,	/* input = geodetic;   output = parametric */
+	GMT_LATSWAP_P2G,	/* input = parametric; output = geodetic   */
+	GMT_LATSWAP_O2P,	/* input = geocentric; output = parametric */
+	GMT_LATSWAP_P2O,	/* input = parametric; output = geocentric */
+	GMT_LATSWAP_N};		/* number of defined swaps  */
+
+/* Help us with big and little endianness */
+#ifdef WORDS_BIGENDIAN
+#define GMT_BIGENDIAN	true
+#define GMT_ENDIAN		'B'
+#else
+#define GMT_BIGENDIAN	false
+#define GMT_ENDIAN		'L'
+#endif
+
+#endif  /* _GMT_CONSTANTS_H */
diff --git a/src/gmt/gmt_contour.h b/src/gmt/gmt_contour.h
new file mode 100644
index 0000000..784cbc4
--- /dev/null
+++ b/src/gmt/gmt_contour.h
@@ -0,0 +1,158 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_contour.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/* gmt_contour.h - structures and variables needed for contour labels.
+
+   Author:	Paul Wessel
+   Date:	1 JAN 2010
+   Version:	5 API
+
+   This include file defines structures and functions used.
+*/
+
+#ifndef _GMT_CONTOUR_H
+#define _GMT_CONTOUR_H
+
+/* Various settings for contour label placements at crossing lines */
+enum GMT_enum_contline {
+	GMT_CONTOUR_NONE = 0,	/* No contour/line crossing  */
+	GMT_CONTOUR_XLINE,	/* Contour labels where crossing straight lines (via key points) */
+	GMT_CONTOUR_XCURVE};	/* Contour labels where crossing arbitrary lines (via file) */
+
+/* Various settings for quoted line/contour label types */
+enum GMT_enum_label {
+	GMT_LABEL_IS_NONE = 0,	/* No contour/line crossing  */
+	GMT_LABEL_IS_CONSTANT,	/* Label is constant, given by +l<label> */
+	GMT_LABEL_IS_HEADER,	/* Label is taken from header, given by +Lh */
+	GMT_LABEL_IS_PDIST,	/* Label is computed from plot distances, via +Ld */
+	GMT_LABEL_IS_MDIST,	/* Label is computed from map distances, via +LD */
+	GMT_LABEL_IS_FFILE,	/* Label is taken from 3rd column in given file, via +Lf */
+	GMT_LABEL_IS_XFILE,	/* Label is taken from segment header in crossing file, via +Lx */
+	GMT_LABEL_IS_SEG,	/* Label is computed from segment number, via +Ln */
+	GMT_LABEL_IS_FSEG};	/* Label is computed from file and segment number, via +LN */
+
+struct GMT_XOVER {		/* Structure with info on all track cross-over */
+	double *x;		/* x or Longitude */
+	double *y;		/* y or Latitude */
+	double *xnode[2];	/* Decimal Node index at cross-over along track 1 and 2 */
+};
+
+struct GMT_XSEGMENT {
+	uint64_t start;		/* y-array index for minimum y endpoint */
+	uint64_t stop;		/* y-array index for maximum y endpoint */
+};
+
+struct GMT_LABEL {	/* Contains information on contour/lineation labels */
+	double x, y;		/* Point where label goes */
+	double angle;		/* Angle of text unless curved text */
+	double line_angle;	/* Angle of line at label unless curved text */
+	double dist;
+	double rgb[4];		/* Font rgb */
+	uint64_t node;		/* Node of label on the line */
+	int end;		/* If N is used then -1 is start, +1 is end label */
+	char *label;
+};
+
+struct GMT_CONTOUR_LINE {
+	uint64_t n;			/* Length of the contour */
+	unsigned int n_labels;		/* Number of labels; if 0 we just have a line segment */
+	bool annot;			/* true if we want labels */
+	double z;			/* Datum of this contour (z-value) */
+	double rgb[4];			/* Box rgb */
+	double *x, *y;			/* Coordinates of the contour */
+	struct GMT_PEN pen;		/* Pen for drawing contour */
+	struct GMT_LABEL *L;		/* Pointer to array of structures with labels */
+	char *name;			/* Contour name */
+};
+
+struct GMT_CONTOUR {
+	/* Control section */
+	double label_isolation;		/* Only have one label inside a circle of this radius */
+	double label_dist_spacing;	/* Min distance between labels */
+	double label_dist_frac;		/* Fraction of Min distance between labels offset for closed labels [0.25] */
+	double d_scale;			/* Scale to yield correct units */
+	double L_d_scale;		/* Scale to yield correct units for label content only*/
+	double min_radius;		/* Do not place labels if the radius of curvature drops below this value [0] */
+	double min_dist;		/* Do not place labels closer than this value [0] */
+	double slop;			/* slop distance in being close to points */
+	double *f_xy[2];		/* Array for fixed points */
+	double label_angle;		/* For fixed-angle labels only */
+	double clearance[2];		/* Spacing between text and textbox */
+	double nudge[2];		/* Shift between calculated and desired text placement */
+	double rgb[4];			/* Opaque box fill */
+	uint64_t current_seg_no;	/* Number (0->) of current segment in current data file */
+	unsigned int current_file_no;	/* Number (0->) of current input data file */
+	unsigned int line_type;	/* Kind of line: contour (1) or line (0) */
+	unsigned int dist_kind;	/* What kind of distance [0 = xy, 1 = map ] */
+	unsigned int dist_unit;	/* Units for labelled distances along tracks [cip] */
+	unsigned int proj_type;	/* type of scaling */
+	unsigned int L_proj_type;	/* type of scaling for label content only */
+	unsigned int half_width;	/* Number of points to use in smoothing the angle [10/2] */
+	unsigned int n_cont;		/* Number of labels per segment */
+	enum GMT_enum_contline crossing;	/* 1 for crossing simple lines, 2 for file with crossing lines */
+	enum GMT_enum_label label_type;	/* 0-7; see above for enums */
+	unsigned int nx;		/* Number of crossovers at any time */
+	unsigned int f_n;			/* Number of such points */
+	unsigned int clearance_flag;	/* 1 if spacing given in % of labelfont size, 0 otherwise */
+	unsigned int nudge_flag;	/* 0 if off, 1 if nudging relative to x/y axis, 2 if following local line coordinate system */
+	unsigned int box;		/* Textbox bits [1 = outline, 2 = rect box shape, 4 = rounded rect shape] */
+	unsigned int n_label;		/* Length of list */
+	unsigned int just;		/* Label justification */
+	unsigned int end_just[2];	/* Justification for end of lines */
+	unsigned int angle_type;	/* 0 = contour-parallel, 1 = contour-normal, 2 = fixed angle */
+	unsigned int n_segments;		/* The number of segments */
+	unsigned int save_labels;	/* 1 if we wish to save label locations to a text file, 2 if we wish to include label angles [1 = no angles] */
+	int number_placement;	/* How the n_cont labels are distributed [-1/0/+1]*/
+	int hill_label;		/* -1/+1 = make label readable when looking down/up gradient, 0 = no special treatment  */
+	bool annot;			/* true if we want labels */
+	bool isolate;		/* true if we have a limit on how close labels may appear (see below) */
+	bool spacing;		/* true if we have spacing constraints to apply */
+	bool number;			/* true if we have constraints on the number of labels to apply */
+	bool do_interpolate;		/* true if we must resample the crossing lines */
+	bool fixed;			/* true if we chose fixed positions */
+	bool fillbox;			/* true for filling the textbox, false for none */
+	bool must_clip;			/* true for transparent textbox, false for opaque */
+	bool curved_text;		/* true for text to follow curved lines */
+	bool no_gap;		/* Clip contour or not depends on label placement */
+	bool data_col;		/* true if there is data in the zz arrays passed, false if they are NULL */
+	bool debug;			/* true of we want to draw helper lines/points */
+	bool delay;			/* true of we want to delay the actual annotation plotting until later */
+	size_t n_alloc;			/* How many allocated so far */
+	char file[GMT_BUFSIZ];		/* File with crossing lines, if specified */
+	char option[GMT_BUFSIZ];	/* Copy of the option string */
+	char label[GMT_BUFSIZ];		/* Fixed label */
+	char label_file[GMT_BUFSIZ];	/* Output files for text dump of label locations */
+	char unit[GMT_LEN64];	/* Unit for labels */
+	char prefix[GMT_LEN64];	/* prefix for labels */
+	char line_name[16];		/* Name of line: contour or line */
+	char flag;			/* Char for the option key */
+	char **f_label;			/* Array for fixed labels */
+	struct GMT_FONT font_label;	/* Which font */
+	struct GMT_DATATABLE *xp;		/* Table with list of structures with crossing-line coordinates */
+	struct GMT_XSEGMENT *ylist_XP;	/* Sorted y-segments for crossing-lines */
+	struct GMT_XSEGMENT *ylist;	/* y-indices sorted in increasing order */
+	struct GMT_XOVER XC;		/* Structure with resulting crossovers */
+	struct GMT_PEN pen;		/* Pen for drawing textbox outline */
+	struct GMT_PEN line_pen;	/* Pen for drawing the contour line */
+	struct GMT_LABEL **L;		/* Pointers to sorted list of labels */
+	FILE *fp;			/* File pointer for writing labels and positions to text file */
+	/* Contour line section */
+	
+	struct GMT_CONTOUR_LINE **segment;	/* Array of segments */
+};
+
+#endif /* _GMT_CONTOUR_H */
diff --git a/src/gmt/gmt_core_module.h b/src/gmt/gmt_core_module.h
new file mode 100644
index 0000000..21f801e
--- /dev/null
+++ b/src/gmt/gmt_core_module.h
@@ -0,0 +1,114 @@
+/* $Id: gmt_core_module.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ * Copyright (c) 2012-2015
+ * by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
+ * See LICENSE.TXT file for copying and redistribution conditions.
+ */
+
+/* gmt_core_module.h declares the prototypes for core module functions
+ * and the array that contains core GMT module parameters such as name
+ * and purpose strings.
+ * DO NOT edit this file directly! Instead edit 
+ * and regenerate this file with gmt_make_module_src.sh core. */
+
+#pragma once
+#ifndef _GMT_CORE_MODULE_H
+#define _GMT_CORE_MODULE_H
+
+#ifdef __cplusplus /* Basic C++ support */
+extern "C" {
+#endif
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#include "declspec.h"
+
+/* Prototypes of all modules in the GMT core library */
+EXTERN_MSC int GMT_blockmean (void *API, int mode, void *args);
+EXTERN_MSC int GMT_blockmedian (void *API, int mode, void *args);
+EXTERN_MSC int GMT_blockmode (void *API, int mode, void *args);
+EXTERN_MSC int GMT_filter1d (void *API, int mode, void *args);
+EXTERN_MSC int GMT_fitcircle (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmt2kml (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtconnect (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtconvert (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtdefaults (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtget (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtinfo (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtmath (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtselect (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtset (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtsimplify (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtspatial (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtvector (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtwhich (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grd2cpt (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grd2rgb (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grd2xyz (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdblend (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdclip (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdcontour (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdcut (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdedit (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdfft (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdfilter (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdgradient (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdhisteq (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdimage (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdinfo (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdlandmask (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdmask (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdmath (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdpaste (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdproject (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdraster (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdreformat (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdsample (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdtrack (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdtrend (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdvector (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdview (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdvolume (void *API, int mode, void *args);
+EXTERN_MSC int GMT_greenspline (void *API, int mode, void *args);
+EXTERN_MSC int GMT_kml2gmt (void *API, int mode, void *args);
+EXTERN_MSC int GMT_makecpt (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mapproject (void *API, int mode, void *args);
+EXTERN_MSC int GMT_nearneighbor (void *API, int mode, void *args);
+EXTERN_MSC int GMT_project (void *API, int mode, void *args);
+EXTERN_MSC int GMT_ps2raster (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psbasemap (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psclip (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pscoast (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pscontour (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pshistogram (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psimage (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pslegend (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psmask (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psrose (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psscale (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pstext (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pswiggle (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psxyz (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psxy (void *API, int mode, void *args);
+EXTERN_MSC int GMT_read (void *API, int mode, void *args);
+EXTERN_MSC int GMT_sample1d (void *API, int mode, void *args);
+EXTERN_MSC int GMT_spectrum1d (void *API, int mode, void *args);
+EXTERN_MSC int GMT_sph2grd (void *API, int mode, void *args);
+EXTERN_MSC int GMT_sphdistance (void *API, int mode, void *args);
+EXTERN_MSC int GMT_sphinterpolate (void *API, int mode, void *args);
+EXTERN_MSC int GMT_sphtriangulate (void *API, int mode, void *args);
+EXTERN_MSC int GMT_splitxyz (void *API, int mode, void *args);
+EXTERN_MSC int GMT_surface (void *API, int mode, void *args);
+EXTERN_MSC int GMT_trend1d (void *API, int mode, void *args);
+EXTERN_MSC int GMT_trend2d (void *API, int mode, void *args);
+EXTERN_MSC int GMT_triangulate (void *API, int mode, void *args);
+EXTERN_MSC int GMT_write (void *API, int mode, void *args);
+EXTERN_MSC int GMT_xyz2grd (void *API, int mode, void *args);
+
+/* Pretty print all modules in the GMT core library and their purposes */
+EXTERN_MSC void gmt_core_module_show_all (void *API);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_GMT_CORE_MODULE_H */
diff --git a/src/gmt/gmt_crossing.h b/src/gmt/gmt_crossing.h
new file mode 100644
index 0000000..0a42a68
--- /dev/null
+++ b/src/gmt/gmt_crossing.h
@@ -0,0 +1,40 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_crossing.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_crossing.h contains definition of the structure for map crossings.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_CROSSING_H
+#define _GMT_CROSSING_H
+
+/*--------------------------------------------------------------------
+ *			GMT XINGS STRUCTURE DEFINITION
+ *--------------------------------------------------------------------*/
+
+struct GMT_XINGS {
+        double xx[2], yy[2];    /* Cartesian coordinates of intersection with map boundary */
+        double angle[2];        /* Angles of intersection */
+        unsigned int sides[2];	/* Side id of intersection */
+        unsigned int nx;	/* Number of intersections (1 or 2) */
+};
+
+#endif  /* _GMT_CROSSING_H */
diff --git a/src/gmt/gmt_customio.h b/src/gmt/gmt_customio.h
new file mode 100644
index 0000000..3464fa8
--- /dev/null
+++ b/src/gmt/gmt_customio.h
@@ -0,0 +1,55 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_customio.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+ 
+/*
+ * Include file for gmt_customio functions.
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ *
+ */
+
+#ifndef GMT_CUSTOMIO_H
+#define GMT_CUSTOMIO_H
+
+/* Definition for Sun rasterfiles [THESE MUST REMAIN int32_t]  */
+struct rasterfile {
+	int32_t magic;     /* magic number */
+	int32_t width;     /* width (pixels) of image */
+	int32_t height;    /* height (pixels) of image */
+	int32_t depth;     /* depth (1, 8, or 24 bits) of pixel */
+	int32_t length;    /* length (bytes) of image */
+	int32_t type;      /* type of file; see RT_* below */
+	int32_t maptype;   /* type of colormap; see RMT_* below */
+	int32_t maplength; /* length (bytes) of following map */
+	/* color map follows for maplength bytes, followed by image */
+};
+
+#define	RAS_MAGIC	0x59a66a95	/* Magic number for Sun rasterfile */
+#define EPS_MAGIC	0x25215053	/* Magic number for EPS file */
+#define RT_OLD		0		/* Old-style, unencoded Sun rasterfile */
+#define RT_STANDARD	1		/* Standard, unencoded Sun rasterfile */
+#define RT_BYTE_ENCODED	2		/* Run-length-encoded Sun rasterfile */
+#define RT_FORMAT_RGB	3		/* [X]RGB instead of [X]BGR Sun rasterfile */
+#define RMT_NONE	0		/* maplength is expected to be 0 */
+#define RMT_EQUAL_RGB	1		/* red[maplength/3], green[], blue[] follow */
+
+EXTERN_MSC char **GMT_grdformats_sorted (struct GMT_CTRL *Ctrl);
+
+#endif /* GMT_CUSTOMIO_H */
diff --git a/src/gmt/gmt_dcw.h b/src/gmt/gmt_dcw.h
new file mode 100644
index 0000000..6da86f4
--- /dev/null
+++ b/src/gmt/gmt_dcw.h
@@ -0,0 +1,55 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_dcw.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_dwc.h contains definitions for using the DCW in GMT.
+ * DCW - The Digital Chart of the World
+ *
+ * Author:	Paul Wessel
+ * Date:	10-MAR-2013
+ * Version:	5 API
+ */
+
+#ifndef _GMT_DCW_H
+#define _GMT_DCW_H
+
+#define DCW_OPT "-F<code1,code2,...>[+l|L][+g<fill>][+p<pen>][+r|R[<incs>]]"
+
+enum GMT_DCW_modes {
+	GMT_DCW_REGION	= 1,
+	GMT_DCW_PLOT	= 2,
+	GMT_DCW_DUMP	= 4,
+	GMT_DCW_EXTRACT	= 8
+};
+
+struct GMT_DCW_SELECT {	/* -F<DWC-options> */
+	bool region;		/* Determine region from polygons instead of -R */
+	bool adjust;		/* Round/adjust the region from polygons using the incs */
+	bool extend;		/* Extend region rather than quantize it */
+	char *codes;		/* Comma separated list of codes with modifiers */
+	unsigned int mode;	/* 0 = get -R, 1 = paint, 2 = dump */
+	double inc[4];		/* Increments for rounded region */
+	struct GMT_PEN pen;	/* Pen for outline [no outline] */
+	struct GMT_FILL fill;	/* Fill for polygons */
+};
+
+EXTERN_MSC unsigned int GMT_DCW_list (struct GMT_CTRL *GMT, unsigned list_mode);
+EXTERN_MSC unsigned int GMT_DCW_parse (struct GMT_CTRL *GMT, char option, char *args, struct GMT_DCW_SELECT *F);
+EXTERN_MSC void GMT_DCW_option (struct GMTAPI_CTRL *API, char option, unsigned int plot);
+EXTERN_MSC struct GMT_DATASET * GMT_DCW_operation (struct GMT_CTRL *GMT, struct GMT_DCW_SELECT *F, double wesn[], unsigned int mode);
+
+#endif /* _GMT_DCW_H */
diff --git a/src/gmt/gmt_defaults.h b/src/gmt/gmt_defaults.h
new file mode 100644
index 0000000..09ca3e1
--- /dev/null
+++ b/src/gmt/gmt_defaults.h
@@ -0,0 +1,170 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_defaults.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_defaults.h contains definition of the structure with default settings.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_DEFAULTS_H
+#define _GMT_DEFAULTS_H
+
+/*--------------------------------------------------------------------
+ *			GMT DEFAULTS STRUCTURE DEFINITION
+ *--------------------------------------------------------------------*/
+
+struct ELLIPSOID {	/* Information about a particular ellipsoid */
+	/* Table taken from Snyder "Map projection - a working manual", p 12 Table 1 */
+	char name[GMT_LEN64];
+	int date;
+	double eq_radius;
+	double flattening;
+};
+
+struct DATUM {	/* Information about a particular datum */
+	char name[GMT_LEN64];	/* Datum name */
+	char ellipsoid[GMT_LEN64];	/* Ellipsoid GMT ID name */
+	char region[GMT_LEN256];	/* Region of use */
+	double xyz[3];		/* Coordinate shifts in meter for x, y, and z */
+};
+
+struct gmt_encoding {
+	char name[GMT_LEN64];
+	int code[5]; /* Codes for symbols we print. */
+};
+
+struct GMT_DEFAULTS {	/* Holds all variables directly controlled by GMT Default parameters */
+	/* COLOR group [sorted by type to optimize storage] */
+	unsigned int color_model;		/* 1 = read RGB, 2 = use RGB, 4 = read HSV, 8 = use HSV, 16 = read CMYK, 32 = use CMYK [1+2]
+									 * Add 128 to disallow output of color names */
+	double color_patch[3][4];		/* Color of background, foreground, nan [black,white,127.5] */
+	double color_hsv_min_s;			/* For smallest or most negative intensity [1.0] */
+	double color_hsv_max_s;			/* For largest or most positive intensity [0.1] */
+	double color_hsv_min_v;			/* For smallest or most negative intensity [0.3] */
+	double color_hsv_max_v;			/* For largest or most positive intensity [1.0] */
+	/* DIR group */
+	/* FONT group */
+	struct GMT_FONT font_annot[2];		/* Font for primary and secondary annotations [14p|16p,Helvetica,black] */
+	struct GMT_FONT font_label;		/* Font for labels [24p,Helvetica,black] */
+	struct GMT_FONT font_logo;		/* Font for GMT logo [8p,Helvetica,black] */
+	struct GMT_FONT font_title;		/* Font for headers [36p,Helvetica,black] */
+	/* FORMAT group */
+	char format_clock_in[GMT_LEN64];	/* How to decode an incoming clock string [hh:mm:ss] */
+	char format_clock_out[GMT_LEN64];	/* Controls how clocks are written on output [hh:mm:ss] */
+	char format_clock_map[GMT_LEN64];	/* Controls how clocks are plotted on maps [hh:mm:ss] */
+	char format_date_in[GMT_LEN64];	/* How to decode an incoming date string [yyyy-mm-dd] */
+	char format_date_out[GMT_LEN64];	/* Controls how dates are written on output [yyyy-mm-dd] */
+	char format_date_map[GMT_LEN64];	/* Controls how dates are plotted on maps [yyyy-mm-dd] */
+	char format_geo_out[GMT_LEN64];	/* Controls how degrees are written on output [000 = dd.xxxx] */
+	char format_geo_map[GMT_LEN64];	/* Controls how degrees are plotted on maps [020 = dd:mm:ss as in old DEGREE_FORMAT = 0] */
+	char format_float_out[GMT_LEN64];	/* Default double output format [%g] */
+	char format_float_map[GMT_LEN64];	/* Default double plot format [%g] */
+	char format_time[2][GMT_LEN64];	/* Controls annotation format for Months/Weeks/Weekdays for primary and secondary axes */
+	char format_time_stamp[GMT_LEN256];	/* Specify the format for writing time stamps (see strftime) */
+	/* GMT group */
+	unsigned int compatibility; /* Choose between 4 (GMT4) and up to latest version (5 for now) */
+	unsigned int interpolant; /* Choose between 0 (Linear), 1 (Akima), or 2 (Cubic spline) */
+	unsigned int triangulate; /* 0 for Watson [Default], 1 for Shewchuk (if configured) */
+	unsigned int verbose;     /* Level of verbosity 0-4 [1] */
+	unsigned int fft;         /* Any of FFT_implementations: k_fft_auto, k_fft_accelerate, k_fft_fftw3, k_fft_kiss, k_fft_brenner */
+#ifdef HAVE_FFTW3F
+	unsigned int fftw_plan;   /* Any of FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */
+#ifdef HAVE_FFTW3F_THREADS
+	bool fftwf_threads;   /* Any of FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */
+#endif
+#endif
+	unsigned int history;     /* mode to pass information via history file gmt.history (k_history_off, k_history_read, k_history_write) */
+	double extrapolate_val[2];/* Choose between [0] = 0, 1D extrapolated vals are NaN, = 1 -> extrapolate, = 2 -> set to const stored in [1] */
+	/* IO group */
+	uint64_t n_bin_header_cols;		/* Minimum number of columns in a binary file for which the all cols == NaN means segment header [2] */
+	unsigned int io_n_header_items;		/* Number of header records expected when -h is used [1]; else 0 */
+	unsigned int io_nan_mode;		/* -s: 1 means skip NaN (x,y) records on output, 2 = inverse (only output nan-records; -sr), 0 reports all records */
+	size_t io_nc4_chunksize[2]; /* NetCDF chunk size (lat,lon) on output [0] */
+	unsigned int io_nc4_deflation_level;	/* NetCDF deflation level on output [0] */
+	bool io_gridfile_shorthand;		/* Use shorthand suffix notation for embedded grid file formats [false] */
+	bool io_header[2];			/* Input & Output data has header records [false, false] */
+	bool io_nan_records;			/* Determines what NaNs in input records should mean (beyond skipping the record) */
+	bool io_lonlat_toggle[2];		/* true means read/write I/O as lat/lon instead of lon/lat [false,false] */
+	bool io_blankline[2];		/* true means blank lines should be treated as segment breaks [false,false] */
+	bool io_nanline[2];			/* true means lines with all NaNs should be treated as segment breaks [false,false] */
+	char io_col_separator[8];		/* Separator between output ascii data columns [tab] */
+	char io_gridfile_format[GMT_LEN64];	/* Default grid file format */
+	char io_seg_marker[2];			/* Character used to recognize and write segment headers [>,>] */
+	/* MAP group */
+	double map_annot_offset[2];		/* Distance between primary or secondary annotation and tickmarks [5p/5p] */
+	double map_annot_min_angle;		/* If angle between map boundary and annotation is less, no annotation is drawn [20] */
+	double map_annot_min_spacing;		/* If an annotation is closer that this to an older annotation, the annotation is skipped [0.0] */
+	double map_frame_width;			/* Thickness of fancy map frame [5p] */
+	double map_grid_cross_size[2];		/* Size of primary & secondary gridcrosses.  0 means draw continuous gridlines */
+	double map_label_offset;		/* Distance between lowermost annotation and top of label [8p] */
+	double map_line_step;			/* Maximum straight linesegment length for arcuate lines [0.75p] */
+	double map_logo_pos[2];			/* Where to plot timestamp relative to origin [BL/-54p/-54p] */
+	double map_origin[2];			/* x- and y-origin of plot, i.e. where lower left corner plots on paper [1i/1i] */
+	double map_polar_cap[2];		/* Latitude of polar cap and delta_lon for gridline spacing [85/90] */
+	double map_scale_height;		/* Height of map scale drawn on a map [0.075] */
+	double map_tick_length[4];			/* Length of primary and secondary major and minor tickmarks [5p/2.5p/15p/3.75p] */
+	double map_title_offset;		/* Distance between lowermost annotation (or label) and base of plot title [14p] */
+	double map_vector_shape;		/* 0.0 = straight vectorhead, 1.0 = arrowshape, with continuous range in between */
+	unsigned int map_annot_oblique;	/* Controls annotations and tick angles etc. [0] */
+	unsigned int map_logo_justify;		/* Justification of the GMT timestamp box [1 (BL)] */
+	unsigned int map_frame_type;		/* Fancy (0), plain (1), or graph (2) [0] */
+	bool map_logo;			/* Plot time and map projection on map [false] */
+	struct GMT_PEN map_default_pen;		/* Default pen for most pens [0.25p] */
+	struct GMT_PEN map_frame_pen;		/* Pen attributes for map boundary [1.25p] */
+	struct GMT_PEN map_grid_pen[2];		/* Pen attributes for primary and secondary gridlines [default,black/thinner,black] */
+	struct GMT_PEN map_tick_pen[2];		/* Pen attributes for primary and secondary tickmarks [thinner,black] */
+	char map_frame_axes[6];			/* Which axes to draw and annotate ["WESNZ"]  */
+	char map_annot_ortho[6];		/* Which axes have orthogonal annotations in linear projections ["we"] */
+	enum GMT_enum_symbol { gmt_none = -1, gmt_ring, gmt_degree, gmt_colon, gmt_squote, gmt_dquote, gmt_lastsym } map_degree_symbol;
+	/* PROJ group */
+	double proj_scale_factor;		/* Central mapscale factor, typically 0.9996-1 (or -1 for default action) */
+	unsigned int proj_ellipsoid;		/* Which ellipsoid to use [0 = GRS 80] */
+	unsigned int proj_length_unit;	/* Choose 0 (cm), 1 (inch), 2 (m) or 3 (point) [1] */
+	enum GMT_enum_radius proj_mean_radius;	/* Choose 0 (mean), 1 (authalic), 2 (volumetric), 3 (meridional) or 4 (quadratic) [0] */
+	enum GMT_enum_latswap proj_aux_latitude;	/* Choose GMT_LATSWAP_NONE, GMT_LATSWAP_G2A, GMT_LATSWAP_G2C, GMT_LATSWAP_G2M, GMT_LATSWAP_G2O, GMT_LATSWAP_G2P [GMT_LATSWAP_NONE] */
+	struct DATUM proj_datum[GMT_N_DATUMS];	/* Datum parameters */
+	struct ELLIPSOID ref_ellipsoid[GMT_N_ELLIPSOIDS];	/* Ellipsoid parameters */
+	/* PS group [These are arguments to pass to PSL_beginsession and PSL_setdefaults] */
+	/* [All other internal PSL settings are set directly when parsing PSL settings ] */
+	double ps_page_size[2];			/* Width and height of paper to plot on in points [Letter or A4] */
+	double ps_page_rgb[4];			/* Default paper color [white] */
+	double ps_magnify[2];			/* Width and height of paper to plot on in points [Letter or A4] */
+	double ps_transparency;			/* Later transparency [0] */
+	unsigned int ps_color_mode;		/* Postscript encoding of color [PSL_RGB | PSL_CMYK | PSL_HSV | PSL_GRAY] */
+	unsigned int ps_copies;		/* How man copies of each plot [>=1] [GMT4 COMPATIBILITY ONLY] */
+	int ps_media;			/* Default paper media [25(Letter)]; negative if custom size */
+	bool ps_orientation;			/* Orientation of page [false = Landscape, true = Portrait] */
+	bool ps_comments;			/* true if we write comments in the PS file */
+	char ps_transpmode[16];			/* Transparency mode for PDF only */
+	struct gmt_encoding ps_encoding;
+	/* TIME group */
+	enum GMT_enum_timer timer_mode;	/* Choose GMT_NO_TIMER, GMT_ABS_TIMER, GMT_ELAPSED_TIMER [GMT_NO_TIMER] */
+	double time_interval_fraction;		/* How much of a partial interval is needed in order to annotate it */
+	bool time_is_interval;		/* Does a time given as a month (or year or day) mean the middle of the interval? */
+	bool time_leap_seconds;		/* Do we need to worry about leap seconds? */
+	unsigned int time_week_start;		/* Which day (Sun = 0, Sat = 7) is start of week */
+	unsigned int time_Y2K_offset_year;	/* Cutoff for making 4-digit years from 2-digit years (1900 vs 2000) */
+	struct GMT_TIME_SYSTEM time_system;	/* All the information about the selected time system */
+	char time_language[GMT_LEN64];	/* Language file for time support */
+	/* Related parameters */
+	char given_unit[GMT_N_KEYS];		/* Unit given or implied for each setting */
+};
+
+#endif  /* _GMT_DEFAULTS_H */
diff --git a/src/gmt/gmt_define.h b/src/gmt/gmt_define.h
new file mode 100644
index 0000000..f99fcb8
--- /dev/null
+++ b/src/gmt/gmt_define.h
@@ -0,0 +1,45 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_define.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+#ifndef _GMT_DEFINE_H
+#define _GMT_DEFINE_H
+
+enum GMT_enum_api {
+	GMT_USAGE	= 0,	/* Want to report full program usage message */
+	GMT_SYNOPSIS	= 1,	/* Just want the synopsis of usage */
+	GMT_STR16	= 16	/* Bytes needed to hold the @GMTAPI at -###### resource names */
+};
+
+/* These data primitive identifiers are as follows: */
+enum GMT_enum_type {
+	GMT_CHAR = 0,  /* int8_t, 1-byte signed integer type */
+	GMT_UCHAR,     /* uint8_t, 1-byte unsigned integer type */
+	GMT_SHORT,     /* int16_t, 2-byte signed integer type */
+	GMT_USHORT,    /* uint16_t, 2-byte unsigned integer type */
+	GMT_INT,       /* int32_t, 4-byte signed integer type */
+	GMT_UINT,      /* uint32_t, 4-byte unsigned integer type */
+	GMT_LONG,      /* int64_t, 8-byte signed integer type */
+	GMT_ULONG,     /* uint64_t, 8-byte unsigned integer type */
+	GMT_FLOAT,     /* 4-byte data float type */
+	GMT_DOUBLE,    /* 8-byte data float type */
+	GMT_TEXT,      /* Arbitrarily long text string [OGR/GMT use only] */
+	GMT_DATETIME,  /* string with date/time info [OGR/GMT use only] */
+	GMT_N_TYPES};  /* The number of supported data types above */
+
+
+#endif /* _GMT_DEFINE_H */
diff --git a/src/gmt/gmt_dev.h b/src/gmt/gmt_dev.h
new file mode 100644
index 0000000..093f786
--- /dev/null
+++ b/src/gmt/gmt_dev.h
@@ -0,0 +1,146 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_dev.h 2244 2015-05-27 05:32:38Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_dev.h is the main include file for the main development of gmt.
+ * It includes the API (gmt.h) and contains lower-level definitions
+ * for several of the structures and parameters used by all libraries.
+ * It also includes all of the other include files that are needed.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-AUG-2011
+ * Version:	5 API
+ */
+
+/* Note on data type:  GMT will generally use double precision for
+ * all floating point values except for grids which are held in single
+ * precision floats.  All integer values are standard int (presumably
+ * 32-bit) except for quantities that may be very large, such as
+ * counters of data records, which will be declared as uint64_t, and
+ * variables that holds allocated number of bytes and similar, which
+ * will be declared as size_t.  Occasionally, arrays of integer values
+ * will be stored in smaller memory containers such as short int of
+ * unsigned/signed char when the program logic places limits on their
+ * possible ranges (e.g., true/false variables).
+ */
+
+#pragma once
+#ifndef _GMT_DEV_H
+#define _GMT_DEV_H
+
+#ifdef __cplusplus	/* Basic C++ support */
+extern "C" {
+#endif
+
+/* Note: GMT functions will sometimes have arguments that are unused by design, i.e., to ensure that
+ * a family of functions have the same number and type of arguments so that pointers to these functions
+ * can be passed, even though in some cases not all arguments are used.  These will result in compiler
+ * warnings [-Wunused-variable]. To suppress those (and only those), we can define GMT_UNUSED as this:
+ */
+
+#define GMT_UNUSED(x) (void)(x)
+
+/* and then call GMT_UNUSED() on all such variables at the beginning of a routine. For example:
+ * bool func (int x) { GMT_UNUSED(x); return(true); }
+ * This should work for all compilers, GCC and others.
+ * Just grep for GMT_UNUSED to see where these situations occur.
+ */
+
+/* CMake definitions: This must be first! */
+//#include "gmt_config.h"
+
+/* Declaration modifiers for DLL support (MSC et al) */
+//#include "declspec.h"
+
+/* Declaration for PSL */
+#include "pslib.h"
+
+/*--------------------------------------------------------------------
+ *      SYSTEM HEADER FILES
+ *--------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <float.h>
+#include <math.h>
+#include <limits.h>
+
+#include <time.h>
+
+#include "common_math.h"     /* Shared math functions */
+#include "gmt.h"             /* All GMT high-level API */
+#include "gmt_private.h"     /* API declaration needed by libraries */
+
+struct GMT_CTRL; /* forward declaration of GMT_CTRL */
+
+//#include "gmt_notposix.h"       /* Non-POSIX extensions */
+
+#include "gmt_constants.h"      /* All basic constant definitions */
+#include "gmt_macros.h"         /* All basic macros definitions */
+#include "gmt_dimensions.h"     /* Constant definitions created by configure */
+#include "gmt_time.h"           /* Declarations of structures for dealing with time */
+#include "gmt_texture.h"        /* Declarations of structures for dealing with pen, fill, etc. */
+#include "gmt_defaults.h"       /* Declarations of structure for GMT default settings */
+#include "gmt_ps.h"             /* Declarations of structure for GMT PostScript settings */
+#include "gmt_hash.h"           /* Declarations of structure for GMT hashing */
+#include "gmt_crossing.h"       /* Declarations of structure for GMT map crossings */
+
+#ifdef HAVE_GDAL
+#	include "gmt_gdalread.h"      /* GDAL support */
+#endif
+
+#include "gmt_common.h"         /* For holding the GMT common option settings */
+#include "gmt_fft.h"            /* Structures and enums used by programs needing FFTs */
+#include "gmt_nan.h"            /* Machine-dependent macros for making and testing NaNs */
+#include "gmt_error.h"          /* Only contains error codes */
+#include "gmt_synopsis.h"       /* Only contains macros for synopsis lines */
+#include "gmt_version.h"        /* Only contains the current GMT version number */
+#include "gmt_core_module.h" 	/* Core module modes and properties */
+#include "gmt_supplements_module.h" 	/* Suppl module modes and properties */
+#include "gmt_project.h"        /* Define GMT->current.proj and GMT->current.map.frame structures */
+#include "gmt_grd.h"            /* Define grd file header structure */
+#include "gmt_grdio.h"          /* Defines function pointers for grd i/o operations */
+#include "gmt_io.h"             /* Defines structures and macros for table i/o */
+#include "gmt_colors.h"         /* Defines color/shading global structure */
+#include "gmt_shore.h"          /* Defines structures used when reading shore database */
+#include "gmt_dcw.h"            /* Defines structure and functions used when using DCW polygons */
+#include "gmt_calclock.h"       /* Calendar/time functions */
+#include "gmt_symbol.h"         /* Custom symbol functions */
+#include "gmt_contour.h"        /* Contour label structure and functions */
+#include "gmt_map.h"            /* extern functions defined in gmt_map.c */
+#include "gmt_plot.h"           /* extern functions defined in gmt_plot.c */
+#include "gmt_memory.h"         /* extern functions defined in gmt_memory.c */
+#include "gmt_support.h"        /* extern functions defined in gmt_support.c */
+#include "gmt_types.h"          /* GMT type declarations */
+
+//#ifdef _OPENMP                  /* Using open MP parallelization */
+//#include "omp.h"
+//#endif
+
+#include "gmt_prototypes.h"     /* All GMT low-level API */
+#include "gmt_init.h"           /* extern functions defined in gmt_init.c */
+#include "gmt_stat.h"           /* extern functions defined in gmt_stat.c */
+#include "common_string.h"      /* All code shared between GMT and PSL */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* !_GMT_DEV_H */
diff --git a/src/gmt/gmt_dimensions.h b/src/gmt/gmt_dimensions.h
new file mode 100644
index 0000000..6a11535
--- /dev/null
+++ b/src/gmt/gmt_dimensions.h
@@ -0,0 +1,29 @@
+/*
+ * $Id: gmt_dimensions.h.in 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *  Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo,
+ *  F. Wobbe, and J. Luis
+ *
+ * See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3 or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * Contact info: gmt.soest.hawaii.edu
+ */
+
+#define GMT_N_COLOR_NAMES 663 /* Lines in gmt_colornames.h */
+#define GMT_N_DATUMS      222 /* Lines in gmt_datums.h */
+#define GMT_N_ELLIPSOIDS  75 /* Lines in gmt_ellipsoids.h */
+#define GMT_N_KEYS        199 /* Lines in gmt_keywords.h */
+#define GMT_N_MEDIA       31 /* Lines in gmt_media_name.h */
+#define GMT_N_PEN_NAMES   12 /* Lines in gmt_pennames.h */
+#define GMT_N_UNIQUE      69 /* Lines in gmt_unique.h */
+
+/* vim: set ft=c: */
diff --git a/src/gmt/gmt_error.h b/src/gmt/gmt_error.h
new file mode 100644
index 0000000..bfb9655
--- /dev/null
+++ b/src/gmt/gmt_error.h
@@ -0,0 +1,139 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_error.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+/*
+ * Include file for GMT error codes
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ */
+
+#ifndef GMT_ERROR_H
+#define GMT_ERROR_H
+
+/* Grid i/o error codes */
+
+/* external array with error descriptions */
+EXTERN_MSC const char* g_error_string[];
+
+enum Gmt_error_code {
+	GMT_NOERROR_UNUSED=0,	/* The real GMT_NOERROR is declared in gmt_resources.h and is part of API */
+	GMT_GRDIO_NONUNIQUE_FORMAT,
+	GMT_GRDIO_UNKNOWN_FORMAT,
+	GMT_GRDIO_UNKNOWN_TYPE,
+	GMT_GRDIO_UNKNOWN_ID,
+	GMT_GRDIO_PIPE_CODECHECK,
+	GMT_GRDIO_DOMAIN_VIOLATION,
+	GMT_GRDIO_OPEN_FAILED,
+	GMT_GRDIO_CREATE_FAILED,
+	GMT_GRDIO_READ_FAILED,
+	GMT_GRDIO_WRITE_FAILED,
+	GMT_GRDIO_STAT_FAILED,
+	GMT_GRDIO_SEEK_FAILED,
+	GMT_GRDIO_FILE_NOT_FOUND,
+	GMT_GRDIO_BAD_VAL,
+	GMT_GRDIO_BAD_XINC,
+	GMT_GRDIO_BAD_XRANGE,
+	GMT_GRDIO_BAD_YINC,
+	GMT_GRDIO_BAD_YRANGE,
+	GMT_GRDIO_BAD_IMG_LAT,
+	GMT_GRDIO_NO_2DVAR,
+	GMT_GRDIO_NO_VAR,
+	GMT_GRDIO_BAD_DIM,
+	GMT_GRDIO_NC_NO_PIPE,
+	GMT_GRDIO_NOT_RAS,
+	GMT_GRDIO_NOT_8BIT_RAS,
+	GMT_GRDIO_NOT_SURFER,
+	GMT_GRDIO_SURF7_UNSUPPORTED,
+	GMT_GRDIO_GRD98_XINC,
+	GMT_GRDIO_GRD98_YINC,
+	GMT_GRDIO_GRD98_BADMAGIC,
+	GMT_GRDIO_GRD98_BADLENGTH,
+	GMT_GRDIO_ESRI_NONSQUARE,
+	GMT_GRDIO_RI_OLDBAD,
+	GMT_GRDIO_RI_NEWBAD,
+	GMT_GRDIO_RI_NOREPEAT,
+	GMT_IO_BAD_PLOT_DEGREE_FORMAT,
+	GMT_CHEBYSHEV_NEG_ORDER,
+	GMT_CHEBYSHEV_BAD_DOMAIN,
+	GMT_MAP_EXCEEDS_360,
+	GMT_MAP_BAD_ELEVATION_MIN,
+	GMT_MAP_BAD_ELEVATION_MAX,
+	GMT_MAP_BAD_LAT_MIN,
+	GMT_MAP_BAD_LAT_MAX,
+	GMT_MAP_NO_REGION,
+	GMT_MAP_NO_PROJECTION,
+	GMT_MAP_BAD_DIST_FLAG,
+	GMT_MAP_BAD_MEASURE_UNIT
+};
+
+/* Definition for an error trap */
+#ifdef DEBUG
+#define GMT_err_trap(func_call) if ((err = (func_call)) != GMT_NOERROR) {GMT_Report(GMT->parent,GMT_MSG_NORMAL,"GMT_err_trap: %d\n", err);return(err);}
+#else
+#define GMT_err_trap(func_call) if ((err = (func_call)) != GMT_NOERROR) return(err)
+#endif
+
+EXTERN_MSC const char * GMT_strerror (int err);
+
+#define GMT_is_verbose(C,level) (C->current.setting.verbose >= level)
+
+/* Check condition and report error if true */
+#define GMT_check_condition(C,condition,...) ((condition) ? 1+GMT_Report(C->parent,GMT_MSG_NORMAL,__VA_ARGS__) : 0)
+
+/* Set __func__ identifier */
+#ifndef HAVE___FUNC__
+#	ifdef HAVE___FUNCTION__
+#		define __func__ __FUNCTION__
+#	else
+#		define __func__ "<unknown>"
+#	endif
+#endif
+
+/* Concatenate __FILE__ and __LINE__ as string */
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+#define __SOURCE_LINE __FILE__ ":" TOSTRING(__LINE__)
+static inline char* __source_line_func (const char* src_line, const char* func) {
+	/* This function is not thread-safe */
+	static char str[256];
+	const char *c = src_line;
+	size_t len;
+  *str = '\0';
+	while ((c = strpbrk (c, "/\\"))) /* get basename of src_line */
+		src_line = ++c;
+	strncat (str, src_line, 255);
+	len = strlen (src_line);
+	strncat (str, "(", 255 - 1 - len);
+	strncat (str, func, 255 - 2 - len);
+	strcat (str, ")");
+	return str;
+}
+#define __SOURCE_LINE_FUNC __source_line_func (__FILE__ ":" TOSTRING(__LINE__), __func__)
+
+/* Convenience functions to GMT_err_func */
+#ifdef DEBUG
+#	define GMT_err_pass(C,err,file) GMT_err_func(C,err,false,file,__SOURCE_LINE_FUNC)
+#	define GMT_err_fail(C,err,file) GMT_err_func(C,err,true,file,__SOURCE_LINE_FUNC)
+#else
+#	define GMT_err_pass(C,err,file) GMT_err_func(C,err,false,file,__func__)
+#	define GMT_err_fail(C,err,file) GMT_err_func(C,err,true,file,__func__)
+#endif
+
+#endif /* GMT_ERROR_H */
diff --git a/src/gmt/gmt_error_codes.h b/src/gmt/gmt_error_codes.h
new file mode 100644
index 0000000..f2a8b64
--- /dev/null
+++ b/src/gmt/gmt_error_codes.h
@@ -0,0 +1,107 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_error_codes.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+/*
+ * Include file for GMT API error codes
+ *
+ * Author:	Paul Wessel
+ * Date:	22-JUN-2012
+ * Version:	5 API
+ */
+
+#ifndef GMT_ERROR_CODES_H
+#define GMT_ERROR_CODES_H
+
+#include "declspec.h"
+/* external array with error descriptions */
+EXTERN_MSC const char* g_api_error_string[];
+
+enum Gmt_api_error_code {
+	GMT_OK = 0,
+	GMT_WRONG_MATRIX_SHAPE,
+	GMT_ACCESS_NOT_ENABLED,
+	GMT_ARGV_LIST_NULL,
+	GMT_ARG_IS_NULL,
+	GMT_COUNTER_IS_NEGATIVE,
+	GMT_BAD_GEOMETRY,
+	GMT_BAD_PERMISSION,
+	GMT_CPT_READ_ERROR,
+	GMT_DATA_READ_ERROR,
+	GMT_DATA_WRITE_ERROR,
+	GMT_DIM_TOO_LARGE,
+	GMT_DIM_TOO_SMALL,
+	GMT_ERROR_ON_FCLOSE,
+	GMT_ERROR_ON_FDOPEN,
+	GMT_ERROR_ON_FOPEN,
+	GMT_FILE_NOT_FOUND,
+	GMT_GRID_BC_ERROR,
+	GMT_GRID_READ_ERROR,
+	GMT_GRID_WRITE_ERROR,
+	GMT_ID_TOO_LARGE,
+	GMT_IMAGE_BC_ERROR,
+	GMT_IMAGE_READ_ERROR,
+	GMT_MEMORY_ERROR,
+	GMT_FREE_EXTERNAL_NOT_ALLOWED,
+	GMT_FREE_WRONG_LEVEL,
+	GMT_NOT_A_SESSION,
+	GMT_NOT_A_VALID_ARG,
+	GMT_NOT_A_VALID_DIRECTION,
+	GMT_NOT_A_VALID_FAMILY,
+	GMT_NOT_A_VALID_ID,
+	GMT_NOT_A_VALID_IO_ACCESS,
+	GMT_NOT_A_VALID_IO_MODE,
+	GMT_NOT_A_VALID_IO_SESSION,
+	GMT_NOT_A_VALID_METHOD,
+	GMT_NOT_A_VALID_MODE,
+	GMT_NOT_A_VALID_MODULE,
+	GMT_NOT_A_VALID_TYPE,
+	GMT_NOT_INPUT_OBJECT,
+	GMT_NOT_OUTPUT_OBJECT,
+	GMT_NO_GRDHEADER,
+	GMT_NO_INPUT,
+	GMT_NO_OUTPUT,
+	GMT_NO_PARAMETERS,
+	GMT_NO_RESOURCES,
+	GMT_N_COLS_NOT_SET,
+	GMT_N_COLS_VARY,
+	GMT_N_ROWS_NOT_SET,
+	GMT_OBJECT_NOT_FOUND,
+	GMT_OGR_ONE_TABLE_ONLY,
+	GMT_ONLY_ONE_ALLOWED,
+	GMT_OPTION_EXIST,
+	GMT_OPTION_HISTORY_ERROR,
+	GMT_OPTION_IS_NULL,
+	GMT_OPTION_LIST_NULL,
+	GMT_OPTION_NOT_FOUND,
+	GMT_OPTION_SORT_ERROR,
+	GMT_OUTPUT_NOT_SET,
+	GMT_PADDING_NOT_ALLOWED,
+	GMT_PARSE_ERROR,
+	GMT_PROG_NOT_FOUND,
+	GMT_PTR_IS_NULL,
+	GMT_PTR_NOT_NULL,
+	GMT_PTR_NOT_UNIQUE,
+	GMT_READ_ONCE,
+	GMT_RUNTIME_ERROR,
+	GMT_SIZE_IS_ZERO,
+	GMT_STREAM_NOT_ALLOWED,
+	GMT_SUBSET_NOT_ALLOWED,
+	GMT_VALUE_NOT_SET,
+	GMT_WRITTEN_ONCE
+};
+#endif /* GMT_ERROR_CODES_H */
diff --git a/src/gmt/gmt_fft.h b/src/gmt/gmt_fft.h
new file mode 100644
index 0000000..f57bdb1
--- /dev/null
+++ b/src/gmt/gmt_fft.h
@@ -0,0 +1,102 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_fft.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ *  Structures in support of FFT use.
+ *
+ * Author:	P. Wessel, derived from W.H.F. Smith implementation
+ * Date:	12-FEB-2013
+ * Version:	5 API
+ *
+ */
+
+#ifndef GMT_FFT_H
+#define GMT_FFT_H
+#ifdef __APPLE__ /* Accelerate framework */
+#include <Accelerate/Accelerate.h>
+#endif
+
+enum GMT_FFT_EXTEND {
+	GMT_FFT_EXTEND_POINT_SYMMETRY = 0,
+	GMT_FFT_EXTEND_MIRROR_SYMMETRY,
+	GMT_FFT_EXTEND_NONE,
+	GMT_FFT_EXTEND_NOT_SET};
+	
+enum GMT_FFT_TREND {
+	GMT_FFT_REMOVE_NOT_SET = -1,
+	GMT_FFT_REMOVE_NOTHING = 0,
+	GMT_FFT_REMOVE_MEAN,
+	GMT_FFT_REMOVE_MID,
+	GMT_FFT_REMOVE_TREND};
+	
+enum GMT_FFT_KCHOICE {
+	GMT_FFT_K_IS_KX = 0,
+	GMT_FFT_K_IS_KY,
+	GMT_FFT_K_IS_KR,
+	};
+	
+enum GMT_FFT_DIMSET {
+	GMT_FFT_EXTEND = 0,
+	GMT_FFT_FORCE,
+	GMT_FFT_SET,
+	GMT_FFT_LIST,
+	GMT_FFT_QUERY};
+
+struct GMT_FFT_WAVENUMBER {	/* Holds parameters needed to calculate kx, ky, kr */
+	int nx2, ny2;
+	unsigned int dim;	/* FFT dimension as setup by Init */
+	double delta_kx, delta_ky;
+	double (*k_ptr) (uint64_t k, struct GMT_FFT_WAVENUMBER *K);	/* pointer to function returning either kx, ky, or kr */
+	double coeff[3];		/* Detrending coefficients returned, if used */
+	struct GMT_FFT_INFO *info;	/* Pointer back to GMT_FFT_INFO */
+};
+
+struct GMT_FFT_INFO {
+	bool set;			/* true if we parsed options; false we must take default settings */
+	bool save[2];			/* save[GMT_IN] means save the input grid just before calling the FFT */
+					/* save[GMT_OUT] means save the complex output grid just after calling the FFT */
+	bool polar;			/* true if we are to save the complex output grid in polar form */
+	char suffix[GMT_LEN64];		/* Suffix used to form output names if save[GMT_IN] is true [tapered] */
+	unsigned int nx;		/* Desired hard FFT nx dimensionl or 0 if free to adjust */
+	unsigned int ny;		/* Desired hard FFT ny dimensionl or 0 if free to adjust */
+	unsigned int taper_mode;	/* One of the GMT_FFT_EXTEND for extension/mirroring */
+	unsigned int info_mode;		/* One of the GMT_FFT_INFO for setting nx/ny or inquire */
+	int trend_mode;			/* One of the GMT_FFT_TREND for handling detrending */
+	double taper_width;		/* Amount of tapering in percent */
+	struct GMT_FFT_WAVENUMBER *K;	/* Pointer to wavenumber structure */
+};
+
+struct GMT_FFT_SUGGESTION {
+	unsigned int nx;
+	unsigned int ny;
+	size_t worksize;	/* # single-complex elements needed in work array  */
+	size_t totalbytes;	/* (8*(nx*ny + worksize))  */
+	double run_time;
+	double rms_rel_err;
+}; /* [0] holds fastest, [1] most accurate, [2] least storage  */
+
+
+struct GMT_FFT_HIDDEN {	/* Items needed by various FFT packages */
+	unsigned int n_1d, n_2d;	/* Bill Gates says: error C2016: C requires that a struct or union has at least one member */
+#ifdef __APPLE__ /* Accelerate framework */
+	FFTSetup setup_1d, setup_2d;
+	DSPSplitComplex dsp_split_complex_1d;
+	DSPSplitComplex dsp_split_complex_2d;
+#endif
+};
+
+#endif
diff --git a/src/gmt/gmt_gdalread.h b/src/gmt/gmt_gdalread.h
new file mode 100644
index 0000000..1a39848
--- /dev/null
+++ b/src/gmt/gmt_gdalread.h
@@ -0,0 +1,177 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_gdalread.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+#include <gdal.h>
+#include <ogr_srs_api.h>
+#include <cpl_string.h>
+#include <cpl_conv.h>
+
+/* Structure to control which options are transmited to GMT_gdalwrite */
+struct GDALWRITE_CTRL {
+	char *driver;		/* The GDAL diver name */
+	char *type;			/* Data type */
+	char *command;		/* command line */
+	char *title;
+	char *remark;
+	int  geog;
+	int  nx, ny;		/* Number of columns & rows of the region to be saved */
+	int  nXSizeFull;	/* Total number of columns of the data array including padding */
+	int  n_bands;
+	int  pad[4];
+	int  flipud;
+	int  registration;		/* Registration type. 0 -> grid registration; 1 -> pixel reg */
+	double	ULx, ULy;		/* x_min & y_max */
+	double	x_inc, y_inc;	/* Grid/Image increments */
+	double	nan_value; /* unlike the nan_value in struct GMT_GRID_HEADER this one is of type double */
+	void	*data;
+	struct GW_C {	/* Color map */
+		int active;
+		int n_colors;
+		float *cpt;
+	} C;
+	struct GW_P {			/* Proj4 string */
+		int	active;
+		char	*ProjectionRefPROJ4;
+	} P;
+};
+
+/* Structure to control which options are transmited to GMT_gdalread */
+struct GDALREAD_CTRL {
+	struct GD_B {	/* Band selection */
+		int active;
+		char *bands;
+	} B;
+	struct GD_I {	/* Interleaving by pixel (only for char data) */
+		int active;
+	} I;
+	struct GD_L {	/* Left-Right flip */
+		int active;
+	} L;
+	struct GD_M {	/* Metadata only */
+		int active;
+	} M;
+	struct GD_N {	/* For floats, replace this value by NaN */
+		float nan_value;
+	} N;
+	struct GD_P {	/* Preview mode */
+		int active;
+		char *jump;
+	} P;
+	struct GD_p {	/* Pad array in output */
+		int active;
+		int pad;
+	} p;
+	struct GD_W {	/* Convert proj4 string into WKT */
+		int active;
+	} W;
+	struct GD_R {	/* Sub-region in referenced coords */
+		int active;
+		char *region;
+	} R;
+	struct GD_Z {	/* Tell to store data in a complex array */
+		int active;
+		int complex_mode; /* 1|2 if complex array is to hold real (1) and imaginary (2) parts (0 = read as real only) */
+	} Z;
+	struct GD_cp {	/* Send in a pointer with allocated chars */
+		int active;
+		unsigned char *grd;
+	} c_ptr;
+	struct GD_fp {	/* Send in a pointer with allocated floats */
+		int active;
+		float *grd;
+	} f_ptr;
+	struct GD_r {	/* Sub-region in row/column coords */
+		int active;
+		char *region;
+	} r;
+	struct GD_reg {	/* Registration type. Used only when sending a sub-region request. Than we need to know this */
+		double x_inc, y_inc;	/* Grid increments */
+		int val;	/* 0 [default] means grid registration, 1 -> pixel registration */
+	} registration;
+	struct GD_hdr {	/* Some fields of the header structure */
+		int active;
+		unsigned int mx, my;
+		char side[1];		/* If array is going to pasted (grdpaste), tell in what side 'lrtb' */
+		int offset;
+	} mini_hdr;
+};
+
+/* Structure to hold metadata info in a per bands basis read */
+struct GDAL_BAND_FNAMES {
+	char		*DataType;
+	int	XSize;
+	int	YSize;
+	double		nodata;
+	double		MinMax[2];
+	double		ScaleOffset[2];
+};
+
+/* Structure with the output data transmited by GMT_gdalread */
+struct GD_CTRL {
+	/* active is true if the option has been activated */
+	struct UInt8 {			/* Declare byte pointer */
+		int active;
+		unsigned char *data;
+	} UInt8;
+	struct UInt16 {			/* Declare short int pointers */
+		int active;
+		unsigned short int *data;
+	} UInt16;
+	struct Int16 {			/* Declare unsigned short int pointers */
+		int active;
+		short int *data;
+	} Int16;
+	struct UInt32 {			/* Declare unsigned int pointers */
+		int active;
+		int *data;
+	} UInt32;
+	struct Int32 {			/* Declare int pointers */
+		int active;
+		int *data;
+	} Int32;
+	struct Float {			/* Declare float pointers */
+		int active;
+		float *data;
+	} Float;
+	struct Double {			/* Declare double pointers */
+		int active;
+		double *data;
+	} Double;
+
+	double	hdr[9];
+	double	GeoTransform[6];
+	double	nodata;
+	char	*ProjectionRefPROJ4;
+	char	*ProjectionRefWKT;
+	const char	*DriverShortName;
+	const char	*DriverLongName;
+	const char	*ColorInterp;
+	int	*ColorMap;
+	int	RasterXsize;
+	int	RasterYsize;
+	int	RasterCount;	/* Total number of bands in file */
+	int	nActualBands;	/* Number of bands that were actually sent back */
+	struct Corners {
+		double LL[2], UL[2], UR[2], LR[2];
+	} Corners;
+	struct GEOGCorners {
+		double LL[2], UL[2], UR[2], LR[2];
+	} GEOGCorners;
+
+	struct GDAL_BAND_FNAMES *band_field_names;
+};
diff --git a/src/gmt/gmt_grd.h b/src/gmt/gmt_grd.h
new file mode 100644
index 0000000..a2dfeac
--- /dev/null
+++ b/src/gmt/gmt_grd.h
@@ -0,0 +1,193 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_grd.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * grd.h contains the definition for a GMT-SYSTEM Version >= 2 grd file
+ *
+ * grd is stored in rows going from west (xmin) to east (xmax)
+ * first row in file has yvalue = north (ymax).  
+ * This is SCANLINE orientation.
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ */
+
+#ifndef _GMT_GRID_H
+#define _GMT_GRID_H
+
+/* netcdf convention */
+#define GMT_NC_CONVENTION "COARDS, CF-1.5"
+
+enum GMT_enum_grdtype {
+	/* Special cases of geographic grids with periodicity */
+	GMT_GRID_CARTESIAN=0,			/* Cartesian data, no periodicity involved */
+	GMT_GRID_GEOGRAPHIC_LESS360,		/* x is longitude, but range is < 360 degrees */
+	GMT_GRID_GEOGRAPHIC_EXACT360_NOREPEAT,	/* x is longitude, range is 360 degrees, no repeat node */
+	GMT_GRID_GEOGRAPHIC_EXACT360_REPEAT,	/* x is longitude, range is 360 degrees, gridline registered and repeat node at 360*/
+	GMT_GRID_GEOGRAPHIC_MORE360		/* x is longitude, and range exceeds 360 degrees */
+};
+
+enum GMT_enum_grdlayout {	/* Grid layout for complex grids */
+	GMT_GRID_IS_SERIAL = 0,		/* Grid is RRRRRR...[IIIIII...] */
+	GMT_GRID_IS_INTERLEAVED = 1};	/* Grid is RIRIRIRI... - required layout for FFT */
+
+/*
+ * GMT's internal representation of grids is north-up, i.e., the index of the
+ * least dimension (aka y or lat) increases to the south. NetCDF files are
+ * usually written bottom-up, i.e., the index of the least dimension increases
+ * from south to north (k_nc_start_south):
+ *
+ * k_nc_start_north:  k_nc_start_south:
+ *
+ * y ^ 0 1 2            -------> x
+ *   | 3 4 5            | 0 1 2
+ *   | 6 7 8            | 3 4 5
+ *   -------> x       y V 6 7 8
+ */
+
+enum Netcdf_row_order {
+	/* Order of rows in z variable */
+	k_nc_start_north = -1, /* The least dimension (i.e., lat or y) decreases */
+	k_nc_start_south = 1   /* The least dimension (i.e., lat or y) increases */
+};
+
+enum Netcdf_chunksize {
+	k_netcdf_io_classic = 0, /* netCDF classic format */
+	k_netcdf_io_chunked_auto /* netCDF 4 auto-determined optimal chunk size */
+};
+
+/* The array wesn in the header has a name that indicates the order (west, east, south, north).
+ * However, to avoid using confusing indices 0-5 we define very brief constants
+ * XLO, XHI, YLO, YHI, ZLO, ZHI that should be used instead: */
+enum GMT_enum_wesnIDs {
+	XLO = 0, /* Index for west or xmin value */
+	XHI,     /* Index for east or xmax value */
+	YLO,     /* Index for south or ymin value */
+	YHI,     /* Index for north or ymax value */
+	ZLO,     /* Index for zmin value */
+	ZHI      /* Index for zmax value */
+};
+
+/* These macros should be used to convert between (column,row) and (x,y).  It will eliminate
+ * one source of typos and errors, and since macros are done at compilation time there is no
+ * overhead.  Note: gmt_x_to_col does not need nx but we included it for symmetry reasons.
+ * gmt_y_to_row must first compute j', the number of rows in the increasing y-direction (to
+ * match the sense of truncation used for x) then we revert to row number increasing down
+ * by flipping: j = ny - 1 - j'.
+ * Note that input col, row _may_ be negative, hence we do the cast to (int) here. */
+
+#define gmt_x_to_col(x,x0,dx,off,nx) (irint((((x) - (x0)) / (dx)) - (off)))
+#define gmt_y_to_row(y,y0,dy,off,ny) ((ny) - 1 - irint(((((y) - (y0)) / (dy)) - (off))))
+#define GMT_col_to_x(C,col,x0,x1,dx,off,nx) (((int)(col) == (int)((nx)-1)) ? (x1) - (off) * (dx) : (x0) + ((col) + (off)) * (dx))
+#define GMT_row_to_y(C,row,y0,y1,dy,off,ny) (((int)(row) == (int)((ny)-1)) ? (y0) + (off) * (dy) : (y1) - ((row) + (off)) * (dy))
+
+/* The follow macros simplify using the 4 above macros when all info is in the struct header h. */
+
+#define GMT_grd_col_to_x(C,col,h) GMT_col_to_x(C,col,h->wesn[XLO],h->wesn[XHI],h->inc[GMT_X],h->xy_off,h->nx)
+#define GMT_grd_row_to_y(C,row,h) GMT_row_to_y(C,row,h->wesn[YLO],h->wesn[YHI],h->inc[GMT_Y],h->xy_off,h->ny)
+#define GMT_grd_x_to_col(C,x,h) gmt_x_to_col(x,h->wesn[XLO],h->inc[GMT_X],h->xy_off,h->nx)
+#define GMT_grd_y_to_row(C,y,h) gmt_y_to_row(y,h->wesn[YLO],h->inc[GMT_Y],h->xy_off,h->ny)
+
+/* These macros calculate the number of nodes in x or y for the increment dx, dy */
+
+#define GMT_get_n(C,min,max,inc,off) (urint ((((max) - (min)) / (inc)) + 1 - (off)) )
+#define GMT_get_inc(C,min,max,n,off) (((max) - (min)) / ((n) + (off) - 1))
+
+/* The follow macros simplify using the 2 above macros when all info is in the struct header */
+
+#define GMT_grd_get_nx(C,h) (GMT_get_n(C,h->wesn[XLO],h->wesn[XHI],h->inc[GMT_X],h->registration))
+#define GMT_grd_get_ny(C,h) (GMT_get_n(C,h->wesn[YLO],h->wesn[YHI],h->inc[GMT_Y],h->registration))
+
+/* The follow macros gets the full length or rows and columns when padding is considered (i.e., mx and my) */
+
+#define gmt_grd_get_nxpad(h,pad) ((h->nx) + pad[XLO] + pad[XHI])
+#define gmt_grd_get_nypad(h,pad) ((h->ny) + pad[YLO] + pad[YHI])
+
+/* 64-bit-safe macros to return the number of points in the grid given its dimensions */
+
+#define GMT_get_nm(C,nx,ny) (((uint64_t)(nx)) * ((uint64_t)(ny)))
+#define gmt_grd_get_nm(h) (((uint64_t)(h->nx)) * ((uint64_t)(h->ny)))
+
+/* GMT_grd_setpad copies the given pad into the header */
+
+#define GMT_grd_setpad(C,h,newpad) memcpy ((h)->pad, newpad, 4*sizeof(unsigned int))
+
+/* gmt_grd_get_size computes grid size including the padding, and doubles it if complex values */
+
+#define gmt_grd_get_size(h) ((((h->complex_mode & GMT_GRID_IS_COMPLEX_MASK) > 0) + 1ULL) * h->mx * h->my)
+
+/* Calculate 1-D index a[ij] corresponding to 2-D array a[row][col], with 64-bit precision.
+ * Use GMT_IJP when array is padded by BC rows/cols, else use GMT_IJ0.  In all cases
+ * we pass the interior row,col as padding is added by the macro. Note that row,col may
+ * be negative as we seek to address nodes within the padding itself.  Hence calculations
+ * use int64_t for signed integers, but cast final index to uint64_t.  Finally, there is
+ * GMT_IJPGI which is GMT_IJP for when there are more than 1 band (it uses h->n_bands). */
+
+/* IJP macro using h and the pad info */
+#define GMT_IJP(h,row,col) ((uint64_t)(((int64_t)(row)+(int64_t)h->pad[YHI])*((int64_t)h->mx)+(int64_t)(col)+(int64_t)h->pad[XLO]))
+/* IJ0 macro using h but ignores the pad info */
+#define GMT_IJ0(h,row,col) ((uint64_t)(((int64_t)(row))*((int64_t)h->nx)+(int64_t)(col)))
+/* IJ macro using h but treats the entire grid with pad as no-pad grid, i.e. using mx as width */
+#define GMT_IJ(h,row,col) ((uint64_t)(((int64_t)(row))*((int64_t)h->mx)+(int64_t)(col)))
+/* IJPGI macro using h and the pad info that works for either grids (n_bands = 1) or images (n_bands = 1,3,4) */
+#define GMT_IJPGI(h,row,col) ((uint64_t)(((int64_t)(row)+(int64_t)h->pad[YHI])*((int64_t)h->mx*(int64_t)h->n_bands)+(int64_t)(col)+(int64_t)h->pad[XLO]*(int64_t)h->n_bands))
+
+/* Obtain row and col from index */
+#define GMT_col(h,ij) (((ij) % h->mx) - h->pad[XLO])
+#define GMT_row(h,ij) (((ij) / h->mx) - h->pad[YHI])
+
+/* To set up a standard double for-loop over rows and columns to visit all nodes in a padded array by computing the node index, use GMT_grd_loop */
+/* Note: All arguments must be actual variables and not expressions.
+ * Note: that input col, row _may_ be signed, hence we do the cast to (int) here. */
+
+#define GMT_row_loop(C,G,row) for (row = 0; (int)row < (int)G->header->ny; row++)
+#define GMT_col_loop(C,G,row,col,ij) for (col = 0, ij = GMT_IJP (G->header, row, 0); (int)col < (int)G->header->nx; col++, ij++)
+#define GMT_grd_loop(C,G,row,col,ij) GMT_row_loop(C,G,row) GMT_col_loop(C,G,row,col,ij)
+/* Just a loop over columns */
+#define GMT_col_loop2(C,G,col) for (col = 0; (int)col < (int)G->header->nx; col++)
+/* Loop over all nodes including the pad */
+#define GMT_row_padloop(C,G,row,ij) for (row = 0, ij = 0; (int)row < (int)G->header->my; row++)
+#define GMT_col_padloop(C,G,col,ij) for (col = 0; (int)col < (int)G->header->mx; col++, ij++)
+#define GMT_grd_padloop(C,G,row,col,ij) GMT_row_padloop(C,G,row,ij) GMT_col_padloop(C,G,col,ij)
+/* Just a loop over columns */
+#define GMT_col_padloop2(C,G,col) for (col = 0; (int)col < (int)G->header->mx; col++)
+
+/* The usage could be:
+	GMT_grd_loop (GMT, Grid, row, col, node) fprintf (stderr, "Value at row = %d and col = %d is %g\n", row, col, Grid->data[node]);
+*/
+/* The GMT_y_is_outside macro returns true if y is outside the given domain.
+ * For GMT_x_is_outside, see the function in gmt_support.c since we must also deal with longitude periodicity.
+ */
+
+/* GMT_is_subset is true if wesn is set and wesn cuts through the grid region */
+#define GMT_is_subset(C,h,R) (R[XHI] > R[XLO] && R[YHI] > R[YLO] && (R[XLO] > h->wesn[XLO] || R[XHI] < h->wesn[XHI] || R[YLO] > h->wesn[YLO] || R[YHI] < h->wesn[YHI]))
+/* GMT_grd_same_region is true if two grids have the exact same regions */
+#define GMT_grd_same_region(C,G1,G2) (G1->header->wesn[XLO] == G2->header->wesn[XLO] && G1->header->wesn[XHI] == G2->header->wesn[XHI] && G1->header->wesn[YLO] == G2->header->wesn[YLO] && G1->header->wesn[YHI] == G2->header->wesn[YHI])
+/* GMT_grd_same_inc is true if two grids have the exact same grid increments */
+#define GMT_grd_same_inc(C,G1,G2) (G1->header->inc[GMT_X] == G2->header->inc[GMT_X] && G1->header->inc[GMT_Y] == G2->header->inc[GMT_Y])
+/* GMT_grd_same_dim is true if two grids have the exact same dimensions and registrations */
+#define GMT_grd_same_shape(C,G1,G2) (G1->header->nx == G2->header->nx && G1->header->ny == G2->header->ny && G1->header->registration == G2->header->registration)
+/* GMT_y_is_outside is true if y is outside the given range */
+#define GMT_y_is_outside(C,y,bottom,top) ((GMT_is_dnan(y) || (y) < bottom || (y) > top) ? true : false)
+/* GMT_grd_is_global is true for a geographic grid with exactly 360-degree range (with or without repeating column) */
+#define GMT_grd_is_global(C,h) (h->grdtype == GMT_GRID_GEOGRAPHIC_EXACT360_NOREPEAT || h->grdtype == GMT_GRID_GEOGRAPHIC_EXACT360_REPEAT)
+
+/* GMT_grd_duplicate_column is true for geographical global grid where first and last data columns are identical */
+#define GMT_grd_duplicate_column(C,h,way) (C->current.io.col_type[way][GMT_X] == GMT_IS_LON && GMT_360_RANGE (h->wesn[XHI], h->wesn[XLO]) && h->registration == GMT_GRID_NODE_REG)
+
+#endif /* _GMT_GRID_H */
diff --git a/src/gmt/gmt_grdio.h b/src/gmt/gmt_grdio.h
new file mode 100644
index 0000000..1f3d7e1
--- /dev/null
+++ b/src/gmt/gmt_grdio.h
@@ -0,0 +1,157 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_grdio.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+/*
+ * Include file for grd i/o
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ */
+
+#ifndef GMT_GRDIO_H
+#define GMT_GRDIO_H
+
+/* Constants for *.img grids */
+
+#define GMT_IMG_MINLON		0.0
+#define GMT_IMG_MAXLON		360.0
+#define GMT_IMG_MINLAT_72	-72.0059773539
+#define GMT_IMG_MAXLAT_72	+72.0059773539
+#define GMT_IMG_MINLAT_80	-80.7380086280
+#define GMT_IMG_MAXLAT_80	+80.7380086280
+#define GMT_IMG_MINLAT_85	-85.0511287798
+#define GMT_IMG_MAXLAT_85	+85.0511287798
+
+enum GMT_enum_img {
+	GMT_IMG_NLON_1M    = 21600U, /* At 1 min resolution */
+	GMT_IMG_NLON_2M    = 10800U, /* At 2 min resolution */
+	GMT_IMG_NLAT_1M_72 = 12672U, /* At 1 min resolution */
+	GMT_IMG_NLAT_2M_72 = 6336U,  /* At 2 min resolution */
+	GMT_IMG_NLAT_1M_80 = 17280U, /* At 1 min resolution */
+	GMT_IMG_NLAT_2M_80 = 8640U,  /* At 2 min resolution */
+	GMT_IMG_NLAT_1M_85 = 21600U, /* At 1 min resolution */
+	GMT_IMG_NLAT_2M_85 = 10800U, /* At 2 min resolution */
+	GMT_IMG_ITEMSIZE   = 2U      /* Size of 2 byte short ints */
+};
+
+/* Special grid format IDs */
+
+enum Gmt_grid_id {
+	/* DO NOT change the order because id values have grown historically.
+	 * Append newly introduced id's at the end. */
+	k_grd_unknown_fmt = 0, /* if grid format cannot be auto-detected */
+	GMT_GRID_IS_BF,         /* GMT native, C-binary format (32-bit float) */
+	GMT_GRID_IS_BS,         /* GMT native, C-binary format (16-bit integer) */
+	GMT_GRID_IS_RB,         /* SUN rasterfile format (8-bit standard) */
+	GMT_GRID_IS_BB,         /* GMT native, C-binary format (8-bit integer) */
+	GMT_GRID_IS_BM,         /* GMT native, C-binary format (bit-mask) */
+	GMT_GRID_IS_SF,         /* Golden Software Surfer format 6 (32-bit float) */
+	GMT_GRID_IS_CB,         /* GMT netCDF format (8-bit integer) */
+	GMT_GRID_IS_CS,         /* GMT netCDF format (16-bit integer) */
+	GMT_GRID_IS_CI,         /* GMT netCDF format (32-bit integer) */
+	GMT_GRID_IS_CF,         /* GMT netCDF format (32-bit float) */
+	GMT_GRID_IS_CD,         /* GMT netCDF format (64-bit float) */
+	GMT_GRID_IS_RF,         /* GEODAS grid format GRD98 (NGDC) */
+	GMT_GRID_IS_BI,         /* GMT native, C-binary format (32-bit integer) */
+	GMT_GRID_IS_BD,         /* GMT native, C-binary format (64-bit float) */
+	GMT_GRID_IS_NB,         /* GMT netCDF format (8-bit integer) */
+	GMT_GRID_IS_NS,         /* GMT netCDF format (16-bit integer) */
+	GMT_GRID_IS_NI,         /* GMT netCDF format (32-bit integer) */
+	GMT_GRID_IS_NF,         /* GMT netCDF format (32-bit float) */
+	GMT_GRID_IS_ND,         /* GMT netCDF format (64-bit float) */
+	GMT_GRID_IS_SD,         /* Golden Software Surfer format 7 (64-bit float, read-only) */
+	GMT_GRID_IS_AF,         /* Atlantic Geoscience Center format AGC (32-bit float) */
+	GMT_GRID_IS_GD,         /* Import through GDAL */
+	GMT_GRID_IS_EI,         /* ESRI Arc/Info ASCII Grid Interchange format (ASCII integer) */
+	GMT_GRID_IS_EF          /* ESRI Arc/Info ASCII Grid Interchange format (ASCII float, write-only) */
+};
+#define GMT_N_GRD_FORMATS 25 /* Number of formats above plus 1 */
+
+#define GMT_GRID_IS_GOLDEN7	GMT_GRID_IS_SD
+#define GMT_GRID_IS_GDAL	GMT_GRID_IS_GD
+
+#include "gmt_customio.h"
+
+struct GMT_GRID_INFO {	/* Holds any -R -I -F settings passed indirectly via -R<grdfile> */
+	struct GMT_GRID_HEADER grd;	/* Header of grid file passed via -R */
+	bool active;		/* true if initialized via -R */
+};
+
+struct GMT_GRID_ROWBYROW {	/* Holds book-keeping information needed for row-by-row actions */
+	size_t size;		/* Bytes per item [4 for float, 1 for byte, etc] */
+	size_t n_byte;		/* Number of bytes for row */
+	unsigned int row;	/* Current row */
+	bool open;		/* true if we have already opened the file */
+	bool check;		/* true if we must replace NaNs with another representation on i/o */
+	bool auto_advance;	/* true if we want to read file sequentially */
+
+	int fid;		/* NetCDF file number [netcdf files only] */
+	size_t edge[2];		/* Dimension arrays [netcdf files only] */
+	size_t start[2];	/* Position arrays [netcdf files only] */
+
+	FILE *fp;		/* File pointer [for native files] */
+
+	void *v_row;		/* Void Row pointer for any data format */
+};
+
+#ifdef __APPLE__ /* Accelerate framework */
+#include <Accelerate/Accelerate.h>
+#undef I /* because otherwise we are in trouble with, e.g., struct GMT_IMAGE *I */
+#endif
+
+static inline void scale_and_offset_f (float *data, size_t length, float scale, float offset) {
+	/* Routine that scales and offsets the data in a vector
+	 *  data:   Single-precision real input vector
+	 *  length: The number of elements to process
+	 * This function uses the vDSP portion of the Accelerate framework if possible */
+#ifndef __APPLE__
+	size_t n;
+#endif
+	if (scale == 1.0) /* offset only */
+#ifdef __APPLE__ /* Accelerate framework */
+		vDSP_vsadd (data, 1, &offset, data, 1, length);
+#else
+		for (n = 0; n < length; ++n)
+			data[n] += offset;
+#endif
+	else if (offset == 0.0) /* scale only */
+#ifdef __APPLE__ /* Accelerate framework */
+		vDSP_vsmul (data, 1, &scale, data, 1, length);
+#else
+		for (n = 0; n < length; ++n)
+			data[n] *= scale;
+#endif
+	else /* scale + offset */
+#ifdef __APPLE__ /* Accelerate framework */
+		vDSP_vsmsa (data, 1, &scale, &offset, data, 1, length);
+#else
+		for (n = 0; n < length; ++n)
+			data[n] = data[n] * scale + offset;
+#endif
+}
+
+EXTERN_MSC int GMT_grd_format_decoder (struct GMT_CTRL *GMT, const char *code, unsigned int *type_id);
+EXTERN_MSC int GMT_grd_get_format (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header, bool magic);
+EXTERN_MSC int GMT_grd_prep_io (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, double wesn[], unsigned int *width, unsigned int *height, int *first_col, int *last_col, int *first_row, int *last_row, unsigned int **index);
+EXTERN_MSC int GMT_update_grd_info (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header);
+EXTERN_MSC void GMT_scale_and_offset_f (struct GMT_CTRL *GMT, float *data, size_t length, double scale, double offset);
+EXTERN_MSC int gmt_grd_layout (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, float *grid, unsigned int complex_mode, unsigned int direction);
+EXTERN_MSC void GMT_grd_mux_demux (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, float *data, unsigned int mode);
+
+#endif /* GMT_GRDIO_H */
diff --git a/src/gmt/gmt_hash.h b/src/gmt/gmt_hash.h
new file mode 100644
index 0000000..fe5db97
--- /dev/null
+++ b/src/gmt/gmt_hash.h
@@ -0,0 +1,48 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_hash.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_hash.h contains definition of the structure used for hashing.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_HASH_H
+#define _GMT_HASH_H
+
+/*--------------------------------------------------------------------
+ *			GMT HASH STRUCTURE DEFINITION
+ *--------------------------------------------------------------------*/
+
+/* To avoid lots of dynamic memory allocation for the hash lookup tables we
+ * use a statically allocated structure.  By determining that the max number
+ * of identical hash numbers across all the keywords is 16, we simply allocate
+ * space for 16 entries for each structure.  Should later additions to GMT's
+ * default parameters, colornames, etc increase this value we will be warned
+ * and can change the entry GMT_HASH_MAXDEPTH below accordingly.
+ */
+#define GMT_HASH_MAXDEPTH	16
+
+struct GMT_HASH {	/* Used to relate text keywords to array indices */
+	unsigned int id[GMT_HASH_MAXDEPTH];	/* Indices of corresponding keyword with identical hash value */
+	unsigned int n_id;			/* Number of hash entries for this item */
+	char *key[GMT_HASH_MAXDEPTH];		/* Name of these entries */
+};
+
+#endif  /* _GMT_HASH_H */
diff --git a/src/gmt/gmt_init.h b/src/gmt/gmt_init.h
new file mode 100644
index 0000000..f02f0a2
--- /dev/null
+++ b/src/gmt/gmt_init.h
@@ -0,0 +1,118 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_init.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * Include file for gmt_init.c
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ */
+
+#ifndef GMT_INIT_H
+#define GMT_INIT_H
+
+#ifdef HAVE_FFTW3F
+/* FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */
+#	include <fftw3.h>
+#endif
+
+/* Macro to do conversion to inches with PROJ_LENGTH_UNIT as default */
+
+#define GMT_to_inch(GMT,value) GMT_convert_units (GMT, value, GMT->current.setting.proj_length_unit, GMT_INCH)
+#define GMT_to_points(GMT,value) GMT_convert_units (GMT, value, GMT->current.setting.proj_length_unit, GMT_PT)
+
+/* Extern functions */
+
+EXTERN_MSC int GMT_get_V (char arg);
+EXTERN_MSC bool GMT_check_filearg (struct GMT_CTRL *GMT, char option, char *file, unsigned int direction, unsigned int family);
+EXTERN_MSC int GMT_parse_dash_option (struct GMT_CTRL *GMT, char *text);
+EXTERN_MSC struct GMT_CTRL * GMT_begin (struct GMTAPI_CTRL *API, char *session, unsigned int pad);
+EXTERN_MSC void GMT_end (struct GMT_CTRL *GMT);
+EXTERN_MSC struct GMT_CTRL * GMT_begin_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, struct GMT_CTRL **Ccopy);
+EXTERN_MSC void GMT_end_module (struct GMT_CTRL *GMT, struct GMT_CTRL *Ccopy);
+EXTERN_MSC int GMT_Complete_Options (struct GMT_CTRL *GMT, struct GMT_OPTION *options);
+EXTERN_MSC int GMT_init_time_system_structure (struct GMT_CTRL *GMT, struct GMT_TIME_SYSTEM *time_system);
+EXTERN_MSC int GMT_init_scales (struct GMT_CTRL *GMT, unsigned int unit, double *fwd_scale, double *inv_scale, double *inch_to_unit, double *unit_to_inch, char *unit_name);
+EXTERN_MSC int GMT_set_measure_unit (struct GMT_CTRL *GMT, char unit);
+EXTERN_MSC char * GMT_putfill (struct GMT_CTRL *GMT, struct GMT_FILL *F);
+EXTERN_MSC char * GMT_putcolor (struct GMT_CTRL *GMT, double *rgb);
+EXTERN_MSC char * GMT_putrgb (struct GMT_CTRL *GMT, double *rgb);
+EXTERN_MSC char * GMT_putcmyk (struct GMT_CTRL *GMT, double *cmyk);
+EXTERN_MSC char * GMT_puthsv (struct GMT_CTRL *GMT, double *hsv);
+EXTERN_MSC double GMT_convert_units (struct GMT_CTRL *GMT, char *value, unsigned int from_default, unsigned int target_unit);
+EXTERN_MSC enum GMT_enum_units GMT_get_unit_number (struct GMT_CTRL *GMT, char unit);
+EXTERN_MSC unsigned int GMT_check_scalingopt (struct GMT_CTRL *GMT, char option, char unit, char *unit_name);
+EXTERN_MSC int GMT_parse_common_options (struct GMT_CTRL *GMT, char *list, char option, char *item);
+EXTERN_MSC int GMT_default_error (struct GMT_CTRL *GMT, char option);
+EXTERN_MSC bool GMT_get_time_system (struct GMT_CTRL *GMT, char *name, struct GMT_TIME_SYSTEM *time_system);
+EXTERN_MSC int GMT_hash_lookup (struct GMT_CTRL *GMT, char *key, struct GMT_HASH *hashnode, unsigned int n, unsigned int n_hash);
+EXTERN_MSC void GMT_syntax (struct GMT_CTRL *GMT, char option);
+EXTERN_MSC void GMT_cont_syntax (struct GMT_CTRL *GMT, unsigned int indent, unsigned int kind);
+EXTERN_MSC void GMT_mapscale_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_maprose_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_mapinsert_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_fill_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_pen_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_rgb_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_inc_syntax (struct GMT_CTRL *GMT, char option, bool error);
+EXTERN_MSC void GMT_label_syntax (struct GMT_CTRL *GMT, unsigned int indent, unsigned int kind);
+EXTERN_MSC void GMT_dist_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_vector_syntax (struct GMT_CTRL *GMT, unsigned int mode);
+EXTERN_MSC void GMT_img_syntax (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_fft_syntax (struct GMT_CTRL *GMT, char option, char *string);
+EXTERN_MSC void GMT_explain_options (struct GMT_CTRL *GMT, char *options);
+EXTERN_MSC void GMT_getdefaults (struct GMT_CTRL *GMT, char *this_file);
+EXTERN_MSC void GMT_putdefaults (struct GMT_CTRL *GMT, char *this_file);
+EXTERN_MSC int GMT_hash_init (struct GMT_CTRL *GMT, struct GMT_HASH *hashnode , char **keys, unsigned int n_hash, unsigned int n_keys);
+EXTERN_MSC int GMT_getdefpath (struct GMT_CTRL *GMT, char get, char **path);
+EXTERN_MSC void GMT_extract_label (struct GMT_CTRL *GMT, char *line, char *label, struct GMT_OGR_SEG *G);
+EXTERN_MSC void GMT_check_lattice (struct GMT_CTRL *GMT, double *inc, unsigned int *registration, bool *active);
+EXTERN_MSC int GMT_check_binary_io (struct GMT_CTRL *GMT, uint64_t n_req);
+EXTERN_MSC char * GMT_putparameter (struct GMT_CTRL *GMT, char *keyword);
+EXTERN_MSC void GMT_set_pad (struct GMT_CTRL *GMT, unsigned int npad);
+EXTERN_MSC int GMT_get_ellipsoid (struct GMT_CTRL *GMT, char *name);
+EXTERN_MSC int GMT_init_vector_param (struct GMT_CTRL *GMT, struct GMT_SYMBOL *S, bool set, bool outline, struct GMT_PEN *pen, bool do_fill, struct GMT_FILL *fill);
+EXTERN_MSC int GMT_parse_vector (struct GMT_CTRL *GMT, char symbol, char *text, struct GMT_SYMBOL *S);
+EXTERN_MSC bool GMT_check_region (struct GMT_CTRL *GMT, double wesn[]);
+EXTERN_MSC int GMT_pickdefaults (struct GMT_CTRL *GMT, bool lines, struct GMT_OPTION *options);
+EXTERN_MSC unsigned int GMT_setdefaults (struct GMT_CTRL *GMT, struct GMT_OPTION *options);
+EXTERN_MSC int GMT_geo_C_format (struct GMT_CTRL *GMT);
+EXTERN_MSC int GMT_loaddefaults (struct GMT_CTRL *GMT, char *file);
+EXTERN_MSC int GMT_parse_symbol_option (struct GMT_CTRL *GMT, char *text, struct GMT_SYMBOL *p, unsigned int mode, bool cmd);
+EXTERN_MSC int GMT_message (struct GMT_CTRL *GMT, char *format, ...);
+EXTERN_MSC int GMT_report_func (struct GMT_CTRL *GMT, unsigned int level, const char *source_line, const char *format, ...);
+EXTERN_MSC int GMT_rectR_to_geoR (struct GMT_CTRL *GMT, char unit, double rect[], double out_wesn[], bool get_R);
+
+#ifdef WIN32
+EXTERN_MSC void GMT_setmode (struct GMT_CTRL *GMT, int direction);
+#endif
+
+/* Inline functions */
+
+#if 0
+/* Wrapper around GMT_begin_module for internally registered GMT modules */
+static inline struct GMT_CTRL* GMT_begin_gmt_module (struct GMTAPI_CTRL *api_ctrl, const char *lib, const char *module, struct GMT_CTRL **gmt_ctrl_copy)
+{
+	/* Init module with NULL-name */
+	struct GMT_CTRL *gmt_ctrl = GMT_begin_module (api_ctrl, lib, module, gmt_ctrl_copy);
+	/* Return GMT_CTRL */
+	return gmt_ctrl;
+}
+#endif
+
+#endif /* GMT_INIT_H */
diff --git a/src/gmt/gmt_internals.h b/src/gmt/gmt_internals.h
new file mode 100644
index 0000000..080ea15
--- /dev/null
+++ b/src/gmt/gmt_internals.h
@@ -0,0 +1,282 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_internals.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/* gmt_internals.h  --  All lower-level functions needed within library.
+
+   Authors:	P. Wessel, W. H. F. Smith, R. Scharroo, and J. Luis
+   Date:	1-OCT-2009
+   Version:	5 API
+
+*/
+
+#ifndef _GMT_INTERNALS_H
+#define _GMT_INTERNALS_H
+
+enum GMT_enum_cplx {GMT_RE = 0, GMT_IM = 1};	/* Real and imaginary indices */
+
+EXTERN_MSC void GMT_set_dataset_minmax (struct GMT_CTRL *GMT, struct GMT_DATASET *D);
+
+EXTERN_MSC struct GMT_PALETTE * GMT_duplicate_palette (struct GMT_CTRL *GMT, struct GMT_PALETTE *P_from, unsigned int mode);
+EXTERN_MSC unsigned int GMT_unit_lookup (struct GMT_CTRL *GMT, int c, unsigned int unit);
+EXTERN_MSC void GMT_get_annot_label (struct GMT_CTRL *GMT, double val, char *label, bool do_minutes, bool do_seconds, unsigned int lonlat, bool worldmap);
+EXTERN_MSC unsigned int GMT_coordinate_array (struct GMT_CTRL *GMT, double min, double max, struct GMT_PLOT_AXIS_ITEM *T, double **array, char ***labels);
+EXTERN_MSC unsigned int GMT_linear_array (struct GMT_CTRL *GMT, double min, double max, double delta, double phase, double **array);
+EXTERN_MSC unsigned int GMT_pow_array (struct GMT_CTRL *GMT, double min, double max, double delta, unsigned int x_or_y_or_z, double **array);
+EXTERN_MSC int GMT_prepare_label (struct GMT_CTRL *GMT, double angle, unsigned int side, double x, double y, unsigned int type, double *line_angle, double *text_angle, unsigned int *justify);
+EXTERN_MSC unsigned int GMT_time_array (struct GMT_CTRL *GMT, double min, double max, struct GMT_PLOT_AXIS_ITEM *T, double **array);
+EXTERN_MSC void GMT_get_lon_minmax (struct GMT_CTRL *GMT, double *lon, uint64_t n, double *min, double *max);
+EXTERN_MSC struct GMT_OGR * GMT_duplicate_ogr (struct GMT_CTRL *GMT, struct GMT_OGR *G);
+EXTERN_MSC void GMT_free_ogr (struct GMT_CTRL *GMT, struct GMT_OGR **G, unsigned int mode);
+EXTERN_MSC int gmt_ogr_get_geometry (char *item);
+EXTERN_MSC int gmt_ogr_get_type (char *item);
+EXTERN_MSC void gmt_plot_C_format (struct GMT_CTRL *GMT);
+EXTERN_MSC void gmt_clock_C_format (struct GMT_CTRL *GMT, char *form, struct GMT_CLOCK_IO *S, unsigned int mode);
+EXTERN_MSC void gmt_date_C_format (struct GMT_CTRL *GMT, char *form, struct GMT_DATE_IO *S, unsigned int mode);
+EXTERN_MSC void * GMT_ascii_textinput (struct GMT_CTRL *GMT, FILE *fp, uint64_t *ncol, int *status);
+EXTERN_MSC double GMT_get_map_interval (struct GMT_CTRL *GMT, struct GMT_PLOT_AXIS_ITEM *T);
+EXTERN_MSC unsigned int GMT_log_array (struct GMT_CTRL *GMT, double min, double max, double delta, double **array);
+EXTERN_MSC int GMT_nc_get_att_text (struct GMT_CTRL *GMT, int ncid, int varid, char *name, char *text, size_t textlen);
+EXTERN_MSC int GMT_akima (struct GMT_CTRL *GMT, double *x, double *y, uint64_t nx, double *c);
+EXTERN_MSC int GMT_cspline (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double *c);
+EXTERN_MSC bool GMT_annot_pos (struct GMT_CTRL *GMT, double min, double max, struct GMT_PLOT_AXIS_ITEM *T, double coord[], double *pos);
+EXTERN_MSC int GMT_comp_int_asc (const void *p_1, const void *p_2);
+EXTERN_MSC float GMT_decode (struct GMT_CTRL *GMT, void *vptr, uint64_t k, unsigned int type);
+EXTERN_MSC void GMT_encode (struct GMT_CTRL *GMT, void *vptr, uint64_t k, float z, unsigned int type);
+EXTERN_MSC int GMT_flip_justify (struct GMT_CTRL *GMT, unsigned int justify);
+EXTERN_MSC struct GMT_CUSTOM_SYMBOL * GMT_get_custom_symbol (struct GMT_CTRL *GMT, char *name);
+EXTERN_MSC void GMT_free_custom_symbols (struct GMT_CTRL *GMT);
+EXTERN_MSC bool GMT_geo_to_dms (double val, int n_items, double fact, int *d, int *m,  int *s,  int *ix);
+EXTERN_MSC double GMT_get_annot_offset (struct GMT_CTRL *GMT, bool *flip, unsigned int level);
+EXTERN_MSC int GMT_get_coordinate_label (struct GMT_CTRL *GMT, char *string, struct GMT_PLOT_CALCLOCK *P, char *format, struct GMT_PLOT_AXIS_ITEM *T, double coord);
+EXTERN_MSC void GMT_get_time_label (struct GMT_CTRL *GMT, char *string, struct GMT_PLOT_CALCLOCK *P, struct GMT_PLOT_AXIS_ITEM *T, double t);
+EXTERN_MSC int GMT_getrgb_index (struct GMT_CTRL *GMT, double *rgb);
+EXTERN_MSC char * GMT_getuserpath (struct GMT_CTRL *GMT, const char *stem, char *path);	/* Look for user file */
+EXTERN_MSC size_t GMT_grd_data_size (struct GMT_CTRL *GMT, unsigned int format, float *nan_value);
+EXTERN_MSC void GMT_init_ellipsoid (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_io_init (struct GMT_CTRL *GMT);			/* Initialize pointers */
+EXTERN_MSC uint64_t GMT_latpath (struct GMT_CTRL *GMT, double lat, double lon1, double lon2, double **x, double **y);
+EXTERN_MSC uint64_t GMT_lonpath (struct GMT_CTRL *GMT, double lon, double lat1, double lat2, double **x, double **y);
+EXTERN_MSC uint64_t GMT_map_path (struct GMT_CTRL *GMT, double lon1, double lat1, double lon2, double lat2, double **x, double **y);
+EXTERN_MSC double GMT_left_boundary (struct GMT_CTRL *GMT, double y);
+EXTERN_MSC double GMT_right_boundary (struct GMT_CTRL *GMT, double y);
+EXTERN_MSC unsigned int GMT_map_latcross (struct GMT_CTRL *GMT, double lat, double west, double east, struct GMT_XINGS **xings);
+EXTERN_MSC unsigned int GMT_map_loncross (struct GMT_CTRL *GMT, double lon, double south, double north, struct GMT_XINGS **xings);
+EXTERN_MSC void GMT_rotate2D (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, double x0, double y0, double angle, double xp[], double yp[]);
+EXTERN_MSC void GMT_set_bin_io (struct GMT_CTRL *GMT);
+EXTERN_MSC uint64_t * GMT_split_line (struct GMT_CTRL *GMT, double **xx, double **yy, uint64_t *nn, bool add_crossings);
+EXTERN_MSC int GMT_verify_time_step (struct GMT_CTRL *GMT, int step, char unit);	/* Check that time step and unit for time axis are OK  */
+EXTERN_MSC double GMT_xx_to_x (struct GMT_CTRL *GMT, double xx);
+EXTERN_MSC double GMT_yy_to_y (struct GMT_CTRL *GMT, double yy);
+EXTERN_MSC double GMT_zz_to_z (struct GMT_CTRL *GMT, double zz);
+EXTERN_MSC int GMT_y2_to_y4_yearfix (struct GMT_CTRL *GMT, unsigned int y2);	/* Convert a 2-digit year to a 4-digit year */
+EXTERN_MSC bool GMT_g_ymd_is_bad (int y, int m, int d);	/* Check range of month and day for Gregorian YMD calendar values  */
+EXTERN_MSC bool GMT_iso_ywd_is_bad (int y, int w, int d);	/* Check range of week and day for ISO W calendar.  */
+EXTERN_MSC int GMT_genper_map_clip_path (struct GMT_CTRL *GMT, uint64_t np, double *work_x, double *work_y);
+EXTERN_MSC double GMT_half_map_width (struct GMT_CTRL *GMT, double y);
+EXTERN_MSC void GMT_moment_interval (struct GMT_CTRL *GMT, struct GMT_MOMENT_INTERVAL *p, double dt_in, bool init); /* step a time axis by time units */
+EXTERN_MSC int64_t GMT_rd_from_iywd (struct GMT_CTRL *GMT, int iy, int iw, int id);
+EXTERN_MSC void GMT_scale_eqrad (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_enforce_rgb_triplets (struct GMT_CTRL *GMT, char *text, unsigned int size);
+EXTERN_MSC struct GMT_TEXTSET * GMT_create_textset (struct GMT_CTRL *GMT, uint64_t n_tables, uint64_t n_segments, uint64_t n_rows, bool alloc_only);
+EXTERN_MSC struct GMT_PALETTE * GMT_create_palette (struct GMT_CTRL *GMT, uint64_t n_colors);
+EXTERN_MSC struct GMT_TEXTTABLE * GMT_read_texttable (struct GMT_CTRL *GMT, void *source, unsigned int source_type);
+EXTERN_MSC int GMT_write_textset (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, struct GMT_TEXTSET *D, int table);
+EXTERN_MSC struct GMT_TEXTSET * GMT_alloc_textset (struct GMT_CTRL *GMT, struct GMT_TEXTSET *Din, unsigned int mode);
+EXTERN_MSC bool GMT_init_complex (struct GMT_GRID_HEADER *h, unsigned int complex_mode, uint64_t *imag_offset);
+EXTERN_MSC struct GMT_MATRIX * GMT_duplicate_matrix (struct GMT_CTRL *GMT, struct GMT_MATRIX *M_in, bool duplicate_data);
+EXTERN_MSC struct GMT_VECTOR * GMT_duplicate_vector (struct GMT_CTRL *GMT, struct GMT_VECTOR *V_in, bool duplicate_data);
+EXTERN_MSC void gmt_init_rot_matrix (double R[3][3], double E[]);
+EXTERN_MSC void gmt_load_rot_matrix (double w, double R[3][3], double E[]);
+EXTERN_MSC void gmt_matrix_vect_mult (double a[3][3], double b[3], double c[3]);
+EXTERN_MSC void gmt_geo_polygon (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n);
+EXTERN_MSC int GMT_io_banner (struct GMT_CTRL *GMT, unsigned int direction);
+
+EXTERN_MSC int GMT_gmonth_length (int year, int month);
+EXTERN_MSC void GMT_gcal_from_dt (struct GMT_CTRL *GMT, double t, struct GMT_gcal *cal);	/* Break internal time into calendar and clock struct info  */
+EXTERN_MSC int GMT_great_circle_intersection (struct GMT_CTRL *GMT, double A[], double B[], double C[], double X[], double *CX_dist);
+EXTERN_MSC double GMT_great_circle_dist_degree (struct GMT_CTRL *GMT, double lon1, double lat1, double lon2, double lat2);
+EXTERN_MSC void GMT_get_point_from_r_az (struct GMT_CTRL *GMT, double lon0, double lat0, double r, double azim, double *lon1, double *lat1);
+EXTERN_MSC int gmt_parse_b_option (struct GMT_CTRL *GMT, char *text);
+EXTERN_MSC bool GMT_check_url_name (char *fname);
+EXTERN_MSC int64_t GMT_splitinteger (double value, int epsilon, double *doublepart);
+EXTERN_MSC bool GMT_is_gleap (int gyear);
+EXTERN_MSC void GMT_str_tolower (char *string);
+EXTERN_MSC void GMT_str_toupper (char *string);
+EXTERN_MSC char *GMT_file_unitscale (char *name);
+EXTERN_MSC void gmt_set_oblique_pole_and_origin (struct GMT_CTRL *GMT, double plon, double plat, double olon, double olat);
+
+/* Functions declared in gmt_proj.c */
+
+EXTERN_MSC void GMT_vpolar (struct GMT_CTRL *GMT, double lon0);
+EXTERN_MSC void GMT_vmerc (struct GMT_CTRL *GMT, double lon0, double slat);
+EXTERN_MSC void GMT_vcyleq (struct GMT_CTRL *GMT, double lon0, double slat);
+EXTERN_MSC void GMT_vcyleqdist (struct GMT_CTRL *GMT, double lon0, double slat);
+EXTERN_MSC void GMT_vcylstereo (struct GMT_CTRL *GMT, double lon0, double slat);
+EXTERN_MSC void GMT_vmiller (struct GMT_CTRL *GMT, double lon0);
+EXTERN_MSC void GMT_vstereo (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
+EXTERN_MSC void GMT_vlamb (struct GMT_CTRL *GMT, double lon0, double lat0, double pha, double phb);
+EXTERN_MSC void GMT_vtm (struct GMT_CTRL *GMT, double lon0, double lat0);
+EXTERN_MSC void GMT_vlambeq (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
+EXTERN_MSC void GMT_vortho (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
+EXTERN_MSC void GMT_vgenper (struct GMT_CTRL *GMT, double lon0, double lat0, double altitude, double azimuth, double tilt, double rotation, double width, double height);
+EXTERN_MSC void GMT_vgnomonic (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
+EXTERN_MSC void GMT_vazeqdist (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
+EXTERN_MSC void GMT_vmollweide (struct GMT_CTRL *GMT, double lon0, double scale);
+EXTERN_MSC void GMT_vhammer (struct GMT_CTRL *GMT, double lon0, double scale);
+EXTERN_MSC void GMT_vwinkel (struct GMT_CTRL *GMT, double lon0, double scale);
+EXTERN_MSC void GMT_veckert4 (struct GMT_CTRL *GMT, double lon0);
+EXTERN_MSC void GMT_veckert6 (struct GMT_CTRL *GMT, double lon0);
+EXTERN_MSC void GMT_vrobinson (struct GMT_CTRL *GMT, double lon0);
+EXTERN_MSC void GMT_vsinusoidal (struct GMT_CTRL *GMT, double lon0);
+EXTERN_MSC void GMT_vcassini (struct GMT_CTRL *GMT, double lon0, double lat0);
+EXTERN_MSC void GMT_valbers (struct GMT_CTRL *GMT, double lon0, double lat0, double ph1, double ph2);
+EXTERN_MSC void GMT_valbers_sph (struct GMT_CTRL *GMT, double lon0, double lat0, double ph1, double ph2);
+EXTERN_MSC void GMT_veconic (struct GMT_CTRL *GMT, double lon0, double lat0, double ph1, double ph2);
+EXTERN_MSC void GMT_vpolyconic (struct GMT_CTRL *GMT, double lon0, double lat0);
+EXTERN_MSC void GMT_vgrinten (struct GMT_CTRL *GMT, double lon0, double scale);
+EXTERN_MSC void GMT_polar (struct GMT_CTRL *GMT, double x, double y, double *x_i, double *y_i);		/* Convert x/y (being theta,r) to x,y	*/
+EXTERN_MSC void GMT_ipolar (struct GMT_CTRL *GMT, double *x, double *y, double x_i, double y_i);		/* Convert (theta,r) to x,y	*/
+EXTERN_MSC void GMT_translin (struct GMT_CTRL *GMT, double forw, double *inv);				/* Forward linear	*/
+EXTERN_MSC void GMT_translind (struct GMT_CTRL *GMT, double forw, double *inv);				/* Forward linear, but using 0-360 degrees	*/
+EXTERN_MSC void GMT_itranslin (struct GMT_CTRL *GMT, double *forw, double inv);				/* Inverse linear	*/
+EXTERN_MSC void GMT_itranslind (struct GMT_CTRL *GMT, double *forw, double inv);				/* Inverse linear, but using 0-360 degrees	*/
+EXTERN_MSC void GMT_translog10 (struct GMT_CTRL *GMT, double forw, double *inv);				/* Forward log10	*/
+EXTERN_MSC void GMT_itranslog10 (struct GMT_CTRL *GMT, double *forw, double inv);				/* Inverse log10	*/
+EXTERN_MSC void GMT_transpowx (struct GMT_CTRL *GMT, double x, double *x_in);				/* Forward pow x	*/
+EXTERN_MSC void GMT_itranspowx (struct GMT_CTRL *GMT, double *x, double x_in);				/* Inverse pow x	*/
+EXTERN_MSC void GMT_transpowy (struct GMT_CTRL *GMT, double y, double *y_in);				/* Forward pow y 	*/
+EXTERN_MSC void GMT_itranspowy (struct GMT_CTRL *GMT, double *y, double y_in);				/* Inverse pow y 	*/
+EXTERN_MSC void GMT_transpowz (struct GMT_CTRL *GMT, double z, double *z_in);				/* Forward pow z 	*/
+EXTERN_MSC void GMT_itranspowz (struct GMT_CTRL *GMT, double *z, double z_in);				/* Inverse pow z 	*/
+EXTERN_MSC void GMT_albers (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Albers)	*/
+EXTERN_MSC void GMT_ialbers (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Albers) to lon/lat	*/
+EXTERN_MSC void GMT_econic (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Equidistant Conic)	*/
+EXTERN_MSC void GMT_ieconic (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Equidistant Conic) to lon/lat	*/
+EXTERN_MSC void GMT_polyconic (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Polyconic)	*/
+EXTERN_MSC void GMT_ipolyconic (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Polyconic) to lon/lat	*/
+EXTERN_MSC void GMT_albers_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Albers Spherical)	*/
+EXTERN_MSC void GMT_ialbers_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Albers Spherical) to lon/lat	*/
+EXTERN_MSC void GMT_azeqdist (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Azimuthal equal-distance)*/
+EXTERN_MSC void GMT_iazeqdist (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Azimuthal equal-distance) to lon/lat*/
+EXTERN_MSC void GMT_cassini (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Cassini)	*/
+EXTERN_MSC void GMT_icassini (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cassini) to lon/lat	*/
+EXTERN_MSC void GMT_cassini_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Cassini Spherical)	*/
+EXTERN_MSC void GMT_icassini_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cassini Spherical) to lon/lat	*/
+EXTERN_MSC void GMT_hammer (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Hammer-Aitoff)	*/
+EXTERN_MSC void GMT_ihammer (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Hammer-Aitoff) to lon/lat	*/
+EXTERN_MSC void GMT_grinten (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (van der Grinten)	*/
+EXTERN_MSC void GMT_igrinten (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (van der Grinten) to lon/lat	*/
+EXTERN_MSC void GMT_merc_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Mercator Spherical)	*/
+EXTERN_MSC void GMT_imerc_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Mercator Spherical) to lon/lat	*/
+EXTERN_MSC void GMT_plrs (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Polar)		*/
+EXTERN_MSC void GMT_iplrs (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Polar) to lon/lat		*/
+EXTERN_MSC void GMT_plrs_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Polar Spherical)	*/
+EXTERN_MSC void GMT_iplrs_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Polar Spherical) to lon/lat	*/
+EXTERN_MSC void GMT_lamb (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Lambert)	*/
+EXTERN_MSC void GMT_ilamb (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Lambert) to lon/lat 	*/
+EXTERN_MSC void GMT_lamb_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Lambert Spherical)	*/
+EXTERN_MSC void GMT_ilamb_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Lambert Spherical) to lon/lat 	*/
+EXTERN_MSC void GMT_oblmrc (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Oblique Mercator)	*/
+EXTERN_MSC void GMT_ioblmrc (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Oblique Mercator) to lon/lat 	*/
+EXTERN_MSC void GMT_genper (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (ORTHO)  */
+EXTERN_MSC void GMT_igenper (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (ORTHO) to lon/lat  */
+EXTERN_MSC void GMT_ortho (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (GMT_ORTHO)	*/
+EXTERN_MSC void GMT_iortho (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (GMT_ORTHO) to lon/lat 	*/
+EXTERN_MSC void GMT_gnomonic (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (GMT_GNOMONIC)	*/
+EXTERN_MSC void GMT_ignomonic (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (GMT_GNOMONIC) to lon/lat 	*/
+EXTERN_MSC void GMT_sinusoidal (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (GMT_SINUSOIDAL)	*/
+EXTERN_MSC void GMT_isinusoidal (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (GMT_SINUSOIDAL) to lon/lat 	*/
+EXTERN_MSC void GMT_tm (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (TM)	*/
+EXTERN_MSC void GMT_itm (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (TM) to lon/lat 	*/
+EXTERN_MSC void GMT_tm_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (GMT_TM Spherical)	*/
+EXTERN_MSC void GMT_itm_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (GMT_TM Spherical) to lon/lat 	*/
+EXTERN_MSC void GMT_utm (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (UTM)	*/
+EXTERN_MSC void GMT_iutm (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (UTM) to lon/lat 	*/
+EXTERN_MSC void GMT_utm_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (UTM Spherical)	*/
+EXTERN_MSC void GMT_iutm_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (UTM Spherical) to lon/lat 	*/
+EXTERN_MSC void GMT_winkel (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Winkel)	*/
+EXTERN_MSC void GMT_iwinkel (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Winkel) to lon/lat	*/
+EXTERN_MSC void GMT_eckert4 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Eckert IV)	*/
+EXTERN_MSC void GMT_ieckert4 (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Eckert IV) to lon/lat	*/
+EXTERN_MSC void GMT_eckert6 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Eckert VI)	*/
+EXTERN_MSC void GMT_ieckert6 (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Eckert VI) to lon/lat	*/
+EXTERN_MSC void GMT_robinson (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Robinson)	*/
+EXTERN_MSC void GMT_irobinson (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Robinson) to lon/lat	*/
+EXTERN_MSC void GMT_stereo1 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Stereographic)	*/
+EXTERN_MSC void GMT_stereo2 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Stereographic, equatorial view)*/
+EXTERN_MSC void GMT_istereo (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Stereographic) to lon/lat 	*/
+EXTERN_MSC void GMT_stereo1_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Stereographic Spherical)*/
+EXTERN_MSC void GMT_stereo2_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Stereographic Spherical, equatorial view)	*/
+EXTERN_MSC void GMT_istereo_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Stereographic Spherical) to lon/lat 	*/
+EXTERN_MSC void GMT_lambeq (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Lambert Azimuthal Equal-Area)*/
+EXTERN_MSC void GMT_ilambeq (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Lambert Azimuthal Equal-Area) to lon/lat*/
+EXTERN_MSC void GMT_mollweide (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Mollweide Equal-Area)	*/
+EXTERN_MSC void GMT_imollweide (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Mollweide Equal-Area) to lon/lat 	*/
+EXTERN_MSC void GMT_cyleq (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Cylindrical Equal-Area)	*/
+EXTERN_MSC void GMT_icyleq (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Cylindrical Equal-Area) to lon/lat 	*/
+EXTERN_MSC void GMT_cyleqdist (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Cylindrical Equidistant)	*/
+EXTERN_MSC void GMT_icyleqdist (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cylindrical Equidistant) to lon/lat 	*/
+EXTERN_MSC void GMT_miller (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Miller Cylindrical)	*/
+EXTERN_MSC void GMT_imiller (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Miller Cylindrical) to lon/lat 	*/
+EXTERN_MSC void GMT_cylstereo (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Cylindrical Stereographic)	*/
+EXTERN_MSC void GMT_icylstereo (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cylindrical Stereographic) to lon/lat 	*/
+EXTERN_MSC void GMT_obl (struct GMT_CTRL *GMT, double lon, double lat, double *olon, double *olat);	/* Convert lon/loat to oblique lon/lat		*/
+EXTERN_MSC void GMT_iobl (struct GMT_CTRL *GMT, double *lon, double *lat, double olon, double olat);	/* Convert oblique lon/lat to regular lon/lat	*/
+EXTERN_MSC double GMT_left_winkel (struct GMT_CTRL *GMT, double y);	/* For Winkel maps	*/
+EXTERN_MSC double GMT_right_winkel (struct GMT_CTRL *GMT, double y);	/* For Winkel maps	*/
+EXTERN_MSC double GMT_left_eckert4 (struct GMT_CTRL *GMT, double y);	/* For Eckert IV maps	*/
+EXTERN_MSC double GMT_right_eckert4 (struct GMT_CTRL *GMT, double y);	/* For Eckert IV maps	*/
+EXTERN_MSC double GMT_left_eckert6 (struct GMT_CTRL *GMT, double y);	/* For Eckert VI maps	*/
+EXTERN_MSC double GMT_right_eckert6 (struct GMT_CTRL *GMT, double y);	/* For Eckert VI maps	*/
+EXTERN_MSC double GMT_left_robinson (struct GMT_CTRL *GMT, double y);	/* For Robinson maps	*/
+EXTERN_MSC double GMT_right_robinson (struct GMT_CTRL *GMT, double y);	/* For Robinson maps	*/
+EXTERN_MSC double GMT_left_sinusoidal (struct GMT_CTRL *GMT, double y);	/* For sinusoidal maps	*/
+EXTERN_MSC double GMT_right_sinusoidal (struct GMT_CTRL *GMT, double y);	/* For sinusoidal maps	*/
+EXTERN_MSC double GMT_left_polyconic (struct GMT_CTRL *GMT, double y);	/* For polyconic maps	*/
+EXTERN_MSC double GMT_right_polyconic (struct GMT_CTRL *GMT, double y);	/* For polyconic maps	*/
+EXTERN_MSC double GMT_cartesian_dist (struct GMT_CTRL *GMT, double x0, double y0, double x1, double y1);
+EXTERN_MSC double GMT_cartesian_dist_proj (struct GMT_CTRL *GMT, double lon1, double lat1, double lon2, double lat2);
+
+/* Complex math from gmt_stat.c */
+EXTERN_MSC void gmt_Cmul (double A[], double B[], double C[]);
+EXTERN_MSC void gmt_Cdiv (double A[], double B[], double C[]);
+EXTERN_MSC void gmt_Ccot (double Z[], double cotZ[]);
+EXTERN_MSC double Cabs (double A[]);
+
+/* From gmt_api.c */
+/* Sub function needed by GMT_end to free memory used in modules and at end of session */
+
+EXTERN_MSC void GMT_Garbage_Collection (struct GMTAPI_CTRL *API, int level);
+EXTERN_MSC char * GMT_create_header_item (struct GMTAPI_CTRL *API, unsigned int mode, void *arg);
+
+/* For supplements */
+EXTERN_MSC int backwards_SQ_parsing (struct GMT_CTRL *GMT, char option, char *item);
+EXTERN_MSC int gmt_comp_double_asc (const void *p_1, const void *p_2);
+
+EXTERN_MSC void gmt_set_double_ptr (double **ptr, double *array);
+EXTERN_MSC void gmt_set_char_ptr (char **ptr, char *array);
+EXTERN_MSC void GMT_free_dataset_ptr (struct GMT_CTRL *GMT, struct GMT_DATASET *data);
+EXTERN_MSC void GMT_free_textset_ptr (struct GMT_CTRL *GMT, struct GMT_TEXTSET *data);
+EXTERN_MSC void GMT_free_cpt_ptr (struct GMT_CTRL *GMT, struct GMT_PALETTE *P);
+EXTERN_MSC unsigned int GMT_free_grid_ptr (struct GMT_CTRL *GMT, struct GMT_GRID *G, bool free_grid);
+EXTERN_MSC unsigned int GMT_free_matrix_ptr (struct GMT_CTRL *GMT, struct GMT_MATRIX *M, bool free_matrix);
+EXTERN_MSC unsigned int GMT_free_vector_ptr (struct GMT_CTRL *GMT, struct GMT_VECTOR *V, bool free_vector);
+#ifdef HAVE_GDAL
+EXTERN_MSC void GMT_free_image_ptr (struct GMT_CTRL *GMT, struct GMT_IMAGE *I, bool free_image);
+EXTERN_MSC struct GMT_IMAGE *GMT_duplicate_image (struct GMT_CTRL *GMT, struct GMT_IMAGE *I, unsigned int mode);
+#endif
+#endif /* _GMT_INTERNALS_H */
diff --git a/src/gmt/gmt_io.h b/src/gmt/gmt_io.h
new file mode 100644
index 0000000..c4d530b
--- /dev/null
+++ b/src/gmt/gmt_io.h
@@ -0,0 +1,350 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_io.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * Table input/output in GMT can be either ascii or binary (where supported)
+ * and ASCII tables may consist of single or multiple segments.  When the
+ * latter is the case usually there is a -M option to signal this case.
+ * The structure GMT_IO holds parameters that are used during the reading
+ * and processing of ascii tables.
+ *
+ * Author:	Paul Wessel
+ * Date:	15-NOV-2009
+ * Version:	5 API
+ *
+ */
+
+#ifndef _GMT_IO_H
+#define _GMT_IO_H
+
+#ifdef HAVE_SETLOCALE
+#	include <locale.h>
+#endif
+
+static inline const char* __gmt_token_separators (void) {
+	static const char separators[] = ",; \t";
+#ifdef HAVE_SETLOCALE
+	struct lconv *lc = localeconv();
+	if ( (strcmp (lc->decimal_point, ",") == 0) )
+		return separators + 1; /* Omit comma */
+#endif
+	return separators;
+}
+#define GMT_TOKEN_SEPARATORS __gmt_token_separators() /* Data columns may be separated by any of these characters */
+
+/* Must add M, m, E, Z, and/or S to the common option processing list */
+#define GMT_OPT(opt) opt
+
+/* Three different i/o status: unused, actively using, or used */
+enum GMT_enum_status {
+	GMT_IS_UNUSED = 0,	/* We have not yet read from/written to this resource */
+	GMT_IS_USING,		/* Means we have started reading from/writing to this file */
+	GMT_IS_USED};		/* Means we are done reading from/writing to this file */
+
+/* THere are three GMT/OGR status values */
+enum GMT_ogr_status {
+	GMT_OGR_UNKNOWN = -1,	/* We have not parsed enough records to know yet */
+	GMT_OGR_FALSE,		/* This is NOT a GMT/OGR file */
+	GMT_OGR_TRUE};		/* This is a GMT/OGR file */
+
+#define GMT_polygon_is_hole(S) (S->pol_mode == GMT_IS_HOLE || (S->ogr && S->ogr->pol_mode == GMT_IS_HOLE))
+
+/* Specific feature geometries as obtained from OGR */
+/* Note: As far as registering or reading data, GMT only needs to know if data type is POINT, LINE, or POLY */
+
+enum GMT_enum_ogr {
+	GMT_IS_LINESTRING = 2,
+	GMT_IS_POLYGON,
+	GMT_IS_MULTIPOINT,
+	GMT_IS_MULTILINESTRING,
+	GMT_IS_MULTIPOLYGON};
+
+/* Codes for aspatial assocation with segment header options: */
+
+enum GMT_enum_segopt {
+	GMT_IS_D = -1,	/* -D */
+	GMT_IS_G = -2,			/* -G */
+	GMT_IS_I = -3,			/* -I */
+	GMT_IS_L = -4,			/* -L */
+	GMT_IS_T = -5,			/* -T */
+	GMT_IS_W = -6,			/* -W */
+	GMT_IS_Z = -7};			/* -Z */
+
+/* Macros to simplify check for return status */
+#define GMT_REC_IS_TABLE_HEADER(C)	(C->current.io.status & GMT_IO_TABLE_HEADER)
+#define GMT_REC_IS_SEGMENT_HEADER(C)	(C->current.io.status & GMT_IO_SEGMENT_HEADER)
+#define GMT_REC_IS_ANY_HEADER(C)	(C->current.io.status & GMT_IO_ANY_HEADER)
+#define GMT_REC_IS_ERROR(C)		(C->current.io.status & GMT_IO_MISMATCH)
+#define GMT_REC_IS_EOF(C)		(C->current.io.status & GMT_IO_EOF)
+#define GMT_REC_IS_NAN(C)		(C->current.io.status & GMT_IO_NAN)
+#define GMT_REC_IS_GAP(C)		(C->current.io.status & GMT_IO_GAP)
+#define GMT_REC_IS_NEW_SEGMENT(C)	(C->current.io.status & GMT_IO_NEW_SEGMENT)
+#define GMT_REC_IS_LINE_BREAK(C)	(C->current.io.status & GMT_IO_LINE_BREAK)
+#define GMT_REC_IS_FILE_BREAK(C)	(C->current.io.status & GMT_IO_NEXT_FILE)
+#define GMT_REC_IS_DATA(C)		(C->current.io.status == 0 || C->current.io.status == GMT_IO_NAN)
+
+/* Get current setting for in/out columns */
+
+/* Determine if current binary table has header */
+#define GMT_binary_header(GMT,dir) (GMT->common.b.active[dir] && GMT->current.setting.io_header[dir] && GMT->current.setting.io_n_header_items)
+
+/* Types of possible column entries in a file: */
+
+enum GMT_col_enum {
+	GMT_IS_NAN   =   0,	/* Returned by GMT_scanf routines when read fails */
+	GMT_IS_FLOAT		=   1,	/* Generic (double) data type, no special format */
+	GMT_IS_LAT		=   2,
+	GMT_IS_LON		=   4,
+	GMT_IS_GEO		=   6,	/* data type is either Lat or Lon */
+	GMT_IS_RELTIME		=   8,	/* For I/O of data in user units */
+	GMT_IS_ABSTIME		=  16,	/* For I/O of data in calendar+clock units */
+	GMT_IS_RATIME		=  24,	/* To see if time is either Relative or Absolute */
+	GMT_IS_ARGTIME		=  32,	/* To invoke GMT_scanf_argtime()  */
+	GMT_IS_DIMENSION	=  64,	/* A float with [optional] unit suffix, e.g., 7.5c, 0.4i; convert to inch  */
+	GMT_IS_GEOANGLE		= 128,	/* An angle to be converted via map projection to angle on map  */
+	GMT_IS_STRING		= 256,	/* An text argument [internally used, not via -f]  */
+	GMT_IS_UNKNOWN		= 512};	/* Input type is not knowable without -f */
+
+/* Various ways to report longitudes */
+
+enum GMT_lon_enum {
+	GMT_IS_GIVEN_RANGE 			= 0,	/* Report lon as is */
+	GMT_IS_0_TO_P360_RANGE			= 1,	/* Report 0 <= lon <= 360 */
+	GMT_IS_0_TO_P360			= 2,	/* Report 0 <= lon < 360 */
+	GMT_IS_M360_TO_0_RANGE			= 3,	/* Report -360 <= lon <= 0 */
+	GMT_IS_M360_TO_0			= 4,	/* Report -360 < lon <= 0 */
+	GMT_IS_M180_TO_P180_RANGE		= 5,	/* Report -180 <= lon <= +180 */
+	GMT_IS_M180_TO_P180			= 6,	/* Report -180 <= lon < +180 */
+	GMT_IS_M180_TO_P270_RANGE		= 7};	/* Report -180 <= lon < +270 [GSHHG only] */
+
+/* How to handle NaNs in records */
+
+enum GMT_io_nan_enum {
+	GMT_IO_NAN_OK = 0,	/* NaNs are fine; just ouput the record as is */
+	GMT_IO_NAN_SKIP,	/* -s[cols]	: Skip records with z == NaN in selected cols [z-col only] */
+	GMT_IO_NAN_KEEP,	/* -sr		: Skip records with z != NaN */
+	GMT_IO_NAN_ONE};	/* -sa		: Skip records with at least one NaN */
+
+/* Use POSIX functions ftello() and fseeko(), which represent the
+ * position using the off_t type: */
+#ifdef HAVE_FSEEKO
+#	define fseek fseeko
+#endif
+
+#ifdef HAVE_FTELLO
+#	define ftell ftello
+#endif
+
+/* Windows 64-bit file access */
+//#if defined HAVE__FSEEKI64 && defined HAVE__FTELLI64
+//#	define fseek _fseeki64
+//#	define ftell _ftelli64
+//#	ifndef SIZEOF_OFF_T
+//		typedef __int64 off_t;
+//#	else
+//#		define off_t __int64
+//#	endif /* SIZEOF_OFF_T */
+//#elif !defined SIZEOF_OFF_T /* HAVE__FSEEKI64 && HAVE__FTELLI64 */
+//	typedef long off_t;
+//#endif /* HAVE__FSEEKI64 && HAVE__FTELLI64 */
+
+#define GMT_fdopen(handle, mode) fdopen(handle, mode)
+#define GMT_fgetc(stream) fgetc(stream)
+#define GMT_ungetc(c, stream) ungetc(c, stream)
+#define GMT_fputs(line,fp) fputs(line,fp)
+#define GMT_fread(ptr,size,nmemb,stream) fread(ptr,size,nmemb,stream)
+#define GMT_fwrite(ptr,size,nmemb,stream) fwrite(ptr,size,nmemb,stream)
+#define GMT_rewind(stream) rewind(stream)
+
+/* Low-level structures used internally */
+
+struct GMT_QUAD {	/* Counting parameters needed to determine proper longitude min/max range */
+	uint64_t quad[4];		/* Keeps track if a longitude fell in these quadrants */
+	unsigned int range[2];	/* The format for reporting longitude */
+	double min[2], max[2];		/* Min/max values in either -180/180 or 0/360 counting */
+};
+
+struct GMT_CLOCK_IO {
+	bool skip;			/* Only true if a format string was pass as NULL */
+	double f_sec_to_int;		/* Scale to convert 0.xxx seconds to integer xxx (used for formatting) */
+	int order[3];		/* The relative order of hour, mn, sec in input clock string (-ve if unused) */
+	unsigned int n_sec_decimals;	/* Number of digits in decimal seconds (0 for whole seconds) */
+	bool compact;		/* true if we do not want leading zeros in items (e.g., 03) */
+	bool twelve_hr_clock;	/* true if we are doing am/pm on output */
+	char ampm_suffix[2][8];		/* Holds the strings to append am or pm */
+	char format[GMT_LEN64];	/* Actual C format used to output clock */
+	char delimiter[2][2];		/* Delimiter strings in clock, e.g. ":" */
+};
+
+struct GMT_DATE_IO {
+	bool skip;			/* Only true if a format string was pass as NULL */
+	bool watch;			/* Only true if input format has month last and is monthname */
+	int item_order[4];		/* The sequence year, month, day, day-of-year in input calendar string (-ve if unused) */
+	int item_pos[4];		/* Which position year, month, day, day-of-year has in calendar string (-ve if unused) */
+	bool Y2K_year;		/* true if we have 2-digit years */
+	bool truncated_cal_is_ok;	/* true if we have YMD or YJ order so smallest unit is to the right */
+	bool iso_calendar;		/* true if we do ISO week calendar */
+	bool day_of_year;		/* true if we do day-of-year rather than month/day */
+	bool mw_text;		/* true if we must plot the month name or Week rather than a numeral */
+	bool compact;		/* true if we do not want leading zeros in items (e.g., 03) */
+	char format[GMT_LEN64];	/* Actual C format used to input/output date */
+	char delimiter[2][2];		/* Delimiter strings in date, e.g. "-" */
+};
+
+struct GMT_GEO_IO {			/* For geographic output and plotting */
+	double f_sec_to_int;		/* Scale to convert 0.xxx seconds to integer xxx (used for formatting) */
+	unsigned int n_sec_decimals;	/* Number of digits in decimal seconds (0 for whole seconds) */
+	unsigned int range;		/* 0 for 0/360, 1 for -360/0, 2 for -180/+180 */
+	unsigned int wesn;		/* 1 if we want sign encoded with suffix W, E, S, N, 2 if also want space before letter */
+	int order[3];			/* The relative order of degree, minute, seconds in form (-ve if unused) */
+	bool decimal;			/* true if we want to use the D_FORMAT for decimal degrees only */
+	bool no_sign;			/* true if we want absolute values (plot only) */
+	char x_format[GMT_LEN64];	/* Actual C format used to plot/output longitude */
+	char y_format[GMT_LEN64];	/* Actual C format used to plot/output latitude */
+	char delimiter[2][2];		/* Delimiter strings in date, e.g. "-" */
+};
+
+struct GMT_COL_INFO {	/* Used by -i and input parsing */
+	unsigned int col;	/* The column number in the order requested via -i */
+	unsigned int order;	/* The initial order (0,1,...) but this will be sorted on col */
+	unsigned int convert;	/* 2 if we must convert the data by log10, 1 if scale, offset */
+	double scale;		/* Multiplier for raw in value */
+	double offset;		/* Offset applied after multiplier */ 
+};
+
+struct GMT_COL_TYPE {	/* Used by -b for binary formatting */
+	unsigned int type;	/* Data type e.g., GMT_FLOAT */
+	off_t skip;		/* Rather than read/write an item, jump |skip| bytes before (-ve) or after (+ve) read/write */
+	int (*io) (struct GMT_CTRL *, FILE *, uint64_t, double *);	/* Pointer to the correct read or write function given type/swab */
+};
+
+struct GMT_IO {				/* Used to process input data records */
+	void * (*input) (struct GMT_CTRL *, FILE *, uint64_t *, int *);	/* Pointer to function reading ascii or binary tables */
+	int (*output) (struct GMT_CTRL *, FILE *, uint64_t, double *);	/* Pointer to function writing ascii or binary tables */
+	int (*read_item) (struct GMT_CTRL *, FILE *, uint64_t, double *);		/* Pointer to function reading 1-col z tables in grd2xyz */
+	int (*write_item) (struct GMT_CTRL *, FILE *, uint64_t, double *);		/* Pointer to function writing 1-col z tables in xyz2grd */
+	bool (*ogr_parser) (struct GMT_CTRL *, char *);				/* Set to handle either header or data OGR records */
+
+	unsigned int pad[4];		/* pad[0] = west, pad[1] = east, pad[2] = south, pad[3] = north */
+	unsigned int inc_code[2];
+	double curr_rec[GMT_MAX_COLUMNS];	/* The most recently processed data record */
+	double prev_rec[GMT_MAX_COLUMNS];	/* The previous data record */
+	struct GMT_GRID_INFO grd_info;
+
+	bool multi_segments[2];	/* true if current Ascii input/output file has multiple segments */
+	bool skip_bad_records;	/* true if records where x and/or y are NaN or Inf */
+	bool give_report;		/* true if functions should report how many bad records were skipped */
+	bool skip_duplicates;	/* true if we should ignore duplicate x,y records */
+	bool read_mixed;		/* true if we are reading ascii x y [z] [variable numbers of text] */
+	bool need_previous;		/* true if when parsing a record we need access to previous record values (e.g., for gap or duplicate checking) */
+	bool warn_geo_as_cartesion;	/* true if we should warn if we read a record with geographic data while the expected format has not been set (i.e., no -J or -fg) */
+
+	uint64_t seg_no;		/* Number of current multi-segment in entire data set */
+	uint64_t seg_in_tbl_no;		/* Number of current multi-segment in current table */
+	uint64_t n_clean_rec;		/* Number of clean records read (not including skipped records or comments or blanks) */
+	uint64_t n_bad_records;		/* Number of bad records encountered during i/o */
+	unsigned int tbl_no;		/* Number of current table in entire data set */
+	unsigned int io_nan_ncols;	/* Number of columns to consider for -s option */
+	enum GMT_ogr_status ogr;	/* Tells us if current input source has OGR/GMT metadata (GMT_OGR_TRUE) or not (GMT_OGR_FALSE) or not set (GMT_OGR_UNKNOWN) */
+	unsigned int status;		/* 0	All is ok
+					   1	Current record is segment header
+					   2	Mismatch between actual and expected fields
+					   4	EOF
+					   8	NaNs encountered in first 2/3 cols */
+	uint64_t rec_no;		/* Number of current records (counts headers etc) in entire data set */
+	uint64_t rec_in_tbl_no;		/* Number of current record (counts headers etc) in current table */
+	uint64_t pt_no;			/* Number of current valid points in a row  */
+	uint64_t curr_pos[2][3];	/* Keep track of current input/output table, segment, and row (for rec-by-rec action) */
+	char r_mode[4];			/* Current file opening mode for reading (r or rb) */
+	char w_mode[4];			/* Current file opening mode for writing (w or wb) */
+	char a_mode[4];			/* Current file append mode for writing (a+ or ab+) */
+	char current_record[GMT_BUFSIZ];	/* Current ascii record */
+	char segment_header[GMT_BUFSIZ];	/* Current ascii segment header */
+	char current_filename[2][GMT_BUFSIZ];	/* Current filenames (or <stdin>/<stdout>) */
+	char *o_format[GMT_MAX_COLUMNS];	/* Custom output ascii format to overrule format_float_out */
+	int ncid;			/* NetCDF file ID (when opening netCDF file) */
+	int nvars;			/* Number of requested variablesin netCDF file */
+	uint64_t ncols;			/* Number of total columns in netCDF file */
+	size_t t_index[GMT_MAX_COLUMNS][5];		/* Indices for cross-sections (netCDF only) */
+	size_t count[GMT_MAX_COLUMNS][5];		/* Count used for cross-sections (netCDF only) */
+	size_t ndim;			/* Length of the column dimension */
+	size_t nrec;			/* Record count */
+	struct GMT_DATE_IO date_input;	/* Has all info on how to decode input dates */
+	struct GMT_DATE_IO date_output;	/* Has all info on how to write output dates */
+	struct GMT_CLOCK_IO clock_input;	/* Has all info on how to decode input clocks */
+	struct GMT_CLOCK_IO clock_output;	/* Has all info on how to write output clocks */
+	struct GMT_GEO_IO geo;		/* Has all the info on how to write geographic coordinates */
+	bool skip_if_NaN[GMT_MAX_COLUMNS];	/* true if column j cannot be NaN and we must skip the record */
+	bool col_skip[GMT_MAX_COLUMNS];	/* true of input column is to be ignored [Default reads all columns, but see -i] */
+	unsigned int col_type[2][GMT_MAX_COLUMNS];	/* Type of column on input and output: Time, geographic, etc, see GMT_IS_<TYPE> */
+	unsigned int io_nan_col[GMT_MAX_COLUMNS];	/* Array of columns to consider for -s option ir true */
+	struct GMT_COL_INFO col[2][GMT_MAX_COLUMNS];	/* Order of columns on input and output unless 0,1,2,3,... */
+	struct GMT_COL_TYPE fmt[2][GMT_MAX_COLUMNS];	/* Formatting information for binary data */
+	struct GMT_OGR *OGR;		/* Pointer to GMT/OGR info used during reading */
+	/* The remainder are just pointers to memory allocated elsewhere */
+	int *varid;			/* Array of variable IDs (netCDF only) */
+	double *scale_factor;		/* Array of scale factors (netCDF only) */
+	double *add_offset;		/* Array of offsets (netCDF only) */
+	double *missing_value;		/* Array of missing values (netCDF only) */
+};
+
+struct GMT_Z_IO {		/* Used when processing z(x,y) table input when (x,y) is implicit */
+	bool swab;		/* true if we must swap byte-order */
+	bool binary;		/* true if we are reading/writing binary data */
+	bool input;		/* true if we are reading, false if we are writing */
+	int x_step;	/* +1 if logical x values increase to right, else -1 */
+	int y_step;	/* +1 if logical y values increase upwards, else -1 */
+	unsigned int x_missing;	/* 1 if a periodic (right) column is implicit (i.e., not stored) */
+	unsigned int y_missing;	/* 1 if a periodic (top) row is implicit (i.e., not stored) */
+	unsigned int format;	/* Either GMT_IS_COL_FORMAT or GMT_IS_ROW_FORMAT */
+	unsigned int x_period;	/* length of a row in the input data ( <= nx, see x_missing) */
+	unsigned int y_period;	/* length of a col in the input data ( <= ny, see y_missing) */
+	unsigned int start_col;	/* First logical column in file */
+	unsigned int start_row;	/* First logical row in file */
+	unsigned int gmt_i;		/* Current column number in the GMT registered grid */
+	unsigned int gmt_j;		/* Current row number in the GMT registered grid */
+	uint64_t n_expected;	/* Number of data element expected to be read */
+	off_t skip;		/* Number of bytes to skip before reading data */
+	uint64_t (*get_gmt_ij) (struct GMT_Z_IO *, struct GMT_GRID *, uint64_t);	/* Pointer to function that converts running number to GMT ij */
+};
+
+struct GMT_PARSE_Z_IO {	/* -Z[<flags>] */
+	bool active;		/* true if selected */
+	bool not_grid;		/* false if binary data file is a grid so organization matters */
+	bool repeat[2];		/* true if periodic in x|y and repeating row/col is missing */
+	enum GMT_swap_direction swab;	/* k_swap_none = no byte swapping, k_swap_inswaps input, k_swap_out swaps output, combine to swap both */
+	off_t skip;		/* Initial bytes to skip before reading */
+	char type;		/* Data type flag A|a|c|u|h|H|i|I|l|L|f|d */
+	char format[2];		/* 2-char code describing row/col organization for grids */
+};
+
+struct GMT_PLOT_CALCLOCK {
+	struct GMT_DATE_IO date;
+	struct GMT_CLOCK_IO clock;
+	struct GMT_GEO_IO geo;
+};
+
+/* Byteswap widths used with gmt_byteswap_file */
+typedef enum {
+	Int16len = 2,
+	Int32len = 4,
+	Int64len = 8
+} SwapWidth;
+
+/* For the GMT_GRID container, see gmt_grdio.h */
+
+#endif /* _GMT_IO_H */
diff --git a/src/gmt/gmt_macros.h b/src/gmt/gmt_macros.h
new file mode 100644
index 0000000..2191dbf
--- /dev/null
+++ b/src/gmt/gmt_macros.h
@@ -0,0 +1,109 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_macros.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_macros.h contains definitions of macros used throught GMT.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_MACROS_H
+#define _GMT_MACROS_H
+
+/*--------------------------------------------------------------------
+ *			GMT MACROS DEFINITIONS
+ *--------------------------------------------------------------------*/
+
+#define GMT_compat_check(C,version) (C->current.setting.compatibility <= version)	/* true if this section should be processed with backwards compatibility to given version */
+
+#ifndef MIN
+#define MIN(x, y) (((x) < (y)) ? (x) : (y))	/* min and max value macros */
+#endif
+#ifndef MAX
+#define MAX(x, y) (((x) > (y)) ? (x) : (y))
+#endif
+#ifndef MOD			/* Knuth-style modulo function (remainder after floored division) */
+#define MOD(x, y) (x - y * floor((double)(x)/(double)(y)))
+#endif
+
+/* Checking of h,m,s */
+
+#define GMT_hms_is_bad(h,m,s) ((h) < 0 || (h) > 23 || (m) < 0 || (m) > 59 || (s) < 0.0 || (s) >= 61.0)
+
+/* Safe math macros that check arguments */
+
+#define d_log10(C,x) ((x) <= 0.0 ? C->session.d_NaN : log10 (x))
+#define d_log10f(C,x) ((x) <= 0.0f ? C->session.f_NaN : log10f (x))
+#define d_log101p(C,x) ((x) <= -1.0 ? C->session.d_NaN : log10 (1.0+(x)))
+#define d_log101pf(C,x) ((x) <= -1.0f ? C->session.f_NaN : log10f (1.0f+(x)))
+#define d_sqrt(x) ((x) < 0.0 ? 0.0 : sqrt (x))
+#define d_acos(x) (fabs(x) >= 1.0 ? ((x) < 0.0 ? M_PI : 0.0) : acos(x))
+#define d_acosf(x) (fabsf(x) >= 1.0 ? ((x) < 0.0f ? (float)M_PI : 0.0f) : acosf(x))
+#define d_asin(x) (fabs(x) >= 1.0 ? copysign (M_PI_2, x) : asin(x))
+#define d_asinf(x) (fabsf(x) >= 1.0 ? copysignf ((float)M_PI_2, x) : asinf(x))
+#define d_atan2(y,x) ((x) == 0.0 && (y) == 0.0 ? 0.0 : atan2(y, x))
+#define d_atan2f(y,x) ((x) == 0.0f && (y) == 0.0f ? 0.0f : atan2f(y, x))
+#define d_log(C,x) ((x) <= 0.0 ? C->session.d_NaN : log (x))
+#define d_log2(C,x) ((x) <= 0.0f ? C->session.f_NaN : logf (x))
+#define d_logf(C,x) ((x) <= 0.0f ? C->session.f_NaN : logf (x))
+#define d_log1p(C,x) ((x) <= -1.0 ? C->session.d_NaN : log1p (x))
+#define d_log1pf(C,x) ((x) <= -1.0f ? C->session.f_NaN : log1pf (x))
+
+/* Macros for degree-based trig */
+
+#define sind(x) sin((x) * D2R)
+#define sindf(x) sinf((x) * D2R)
+#define cosd(x) cos((x) * D2R)
+#define cosdf(x) cosf((x) * D2R)
+#define tand(x) tan((x) * D2R)
+#define tandf(x) tanf((x) * D2R)
+#define sincosd(x,s,c) sincos((x) * D2R,s,c)
+#define asind(x) (asin(x) * R2D)
+#define acosd(x) (acos(x) * R2D)
+#define atand(x) (atan(x) * R2D)
+#define atan2d(y,x) (atan2(y,x) * R2D)
+#define atan2df(y,x) (atan2f(y,x) * R2D)
+
+/* Safe versions of the degree-based trig */
+
+#define d_acosd(x) (fabs(x) >= 1.0 ? ((x) < 0.0 ? 180.0 : 0.0) : acosd(x))
+#define d_asind(x) (fabs(x) >= 1.0 ? copysign (90.0, (x)) : asind(x))
+#define d_atan2d(y,x) ((x) == 0.0 && (y) == 0.0 ? 0.0 : atan2d(y,x))
+
+/* Macros for swapping misc data types */
+
+#define bool_swap(x, y) {bool bool_tmp; bool_tmp = x, x = y, y = bool_tmp;}
+#define uint64_swap(x, y) {uint64_t uint64_t_tmp; uint64_t_tmp = x, x = y, y = uint64_t_tmp;}
+#define int_swap(x, y) {int int_tmp; int_tmp = x, x = y, y = int_tmp;}
+#define uint_swap(x, y) {unsigned int uint_tmp; uint_tmp = x, x = y, y = uint_tmp;}
+#define double_swap(x, y) {double double_tmp; double_tmp = x, x = y, y = double_tmp;}
+#define float_swap(x, y) {float float_tmp; float_tmp = x, x = y, y = float_tmp;}
+
+/* Macro to ensure proper value and sign of a change in longitude from lon1 to lon2 */
+#define GMT_set_delta_lon(lon1,lon2,delta) {delta = lon2 - lon1; if (fabs (delta) > 180.0) delta = copysign (360.0 - fabs (delta), -delta);}
+
+/* Macro to simplify call to memcpy when duplicating values and memset when zeroing out */
+#define GMT_memcpy(to,from,n,type) memcpy(to, from, (n)*sizeof(type))
+#define GMT_memset(array,n,type) memset(array, 0, (n)*sizeof(type))
+/* Macro to set all items in an array to the given value */
+#define GMT_setnval(array,n,value) {uint64_t k; for (k = 0; k < (uint64_t)n; k++) array[k] = value;}
+/* Macro to simplify assignment of one 3-vector to another */
+#define GMT_cpy3v(to,from) memcpy(to, from, 3*sizeof(double))
+
+#endif  /* _GMT_MACROS_H */
diff --git a/src/gmt/gmt_map.h b/src/gmt/gmt_map.h
new file mode 100644
index 0000000..8c93106
--- /dev/null
+++ b/src/gmt/gmt_map.h
@@ -0,0 +1,68 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_map.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_map.h contains definitions of macros used in GMT.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_MAP_H
+#define _GMT_MAP_H
+
+#define METERS_IN_A_FOOT		0.3048			/* 2.54 * 12 / 100 */
+#define METERS_IN_A_SURVEY_FOOT		(1200.0/3937.0)		/* ~0.3048006096 m */
+#define METERS_IN_A_KM			1000.0
+#define METERS_IN_A_MILE		1609.433	/* meters in statute mile */
+#define METERS_IN_A_NAUTICAL_MILE	1852.0
+#define GMT_MAP_DIST_UNIT		'e'		/* Default distance is the meter */
+
+enum GMT_enum_coord {GMT_GEOGRAPHIC = 0,	/* Means coordinates are lon,lat : compute spherical distances */
+	GMT_CARTESIAN,	/* Means coordinates are Cartesian x,y : compute Cartesian distances */
+	GMT_GEO2CART,	/* Means coordinates are lon,lat but must be mapped to (x,y) : compute Cartesian distances */
+	GMT_CART2GEO};	/* Means coordinates are lon,lat but must be mapped to (x,y) : compute Cartesian distances */
+
+enum GMT_enum_dist {GMT_MAP_DIST = 0,	/* Distance in the map */
+	GMT_CONT_DIST,		/* Distance along a contour or line in dist units */
+	GMT_LABEL_DIST};	/* Distance along a contour or line in dist label units */
+
+enum GMT_enum_path {GMT_RESAMPLE_PATH = 0,	/* Default: Resample geographic paths based in a max gap allowed (path_step) */
+	GMT_LEAVE_PATH};	/* Options like -A can turn of this resampling, where available */
+
+enum GMT_enum_cdist {GMT_CARTESIAN_DIST	 = 0,	/* Cartesian 2-D x,y data, r = hypot */
+	GMT_CARTESIAN_DIST2,		/* Cartesian 2-D x,y data, return r^2 to avoid hypot */
+	GMT_CARTESIAN_DIST_PROJ,	/* Project lon,lat to Cartesian 2-D x,y data, then get distance */
+	GMT_CARTESIAN_DIST_PROJ2,	/* Same as --"-- but return r^2 to avoid hypot */
+	GMT_CARTESIAN_DIST_PROJ_INV};	/* Project Cartesian 2-D x,y data to lon,lat, then get distance */
+enum GMT_enum_mdist {GMT_FLATEARTH = 1,	/* Compute Flat Earth distances */
+	GMT_GREATCIRCLE,	/* Compute great circle distances */
+	GMT_GEODESIC,		/* Compute geodesic distances */
+	GMT_LOXODROME};		/* Compute loxodrome distances (otherwise same as great circle machinery) */
+enum GMT_enum_sph {GMT_DIST_M = 10,	/* 2-D lon, lat data, convert distance to meter */
+	GMT_DIST_DEG = 20,	/* 2-D lon, lat data, convert distance to spherical degree */
+	GMT_DIST_COS = 30};	/* 2-D lon, lat data, convert distance to cos of spherical degree */
+
+struct GMT_DIST {	/* Holds info for a particular distance calculation */
+	bool init;	/* true if we have initialized settings for this type via GMT_init_distaz */
+	bool arc;	/* true if distances are in deg/min/sec or arc; otherwise they are e|f|k|M|n or Cartesian */
+	double (*func) (struct GMT_CTRL *, double, double, double, double);	/* pointer to function returning distance between two points points */
+	double scale;	/* Scale to convert function output to desired unit */
+};
+
+#endif /* _GMT_MAP_H */
diff --git a/src/gmt/gmt_media_name.h b/src/gmt/gmt_media_name.h
new file mode 100644
index 0000000..be3dee5
--- /dev/null
+++ b/src/gmt/gmt_media_name.h
@@ -0,0 +1,31 @@
+"a0",
+"a1",
+"a2",
+"a3",
+"a4",
+"a5",
+"a6",
+"a7",
+"a8",
+"a9",
+"a10",
+"b0",
+"b1",
+"b2",
+"b3",
+"b4",
+"b5",
+"archa",
+"archb",
+"archc",
+"archd",
+"arche",
+"flsa",
+"halfletter",
+"statement",
+"note",
+"letter",
+"legal",
+"11x17",
+"tabloid",
+"ledger"
diff --git a/src/gmt/gmt_media_size.h b/src/gmt/gmt_media_size.h
new file mode 100644
index 0000000..6a959ad
--- /dev/null
+++ b/src/gmt/gmt_media_size.h
@@ -0,0 +1,31 @@
+{2380.0, 3368.0},
+{1684.0, 2380.0},
+{1190.0, 1684.0},
+{842.0, 1190.0},
+{595.0, 842.0},
+{421.0, 595.0},
+{297.0, 421.0},
+{210.0, 297.0},
+{148.0, 210.0},
+{105.0, 148.0},
+{74.0, 105.0},
+{2836.0, 4008.0},
+{2004.0, 2836.0},
+{1418.0, 2004.0},
+{1002.0, 1418.0},
+{709.0, 1002.0},
+{501.0, 709.0},
+{648.0, 864.0},
+{864.0, 1296.0},
+{1296.0, 1728.0},
+{1728.0, 2592.0},
+{2592.0, 3456.0},
+{612.0, 936.0},
+{396.0, 612.0},
+{396.0, 612.0},
+{540.0, 720.0},
+{612.0, 792.0},
+{612.0, 1008.0},
+{792.0, 1224.0},
+{792.0, 1224.0},
+{1224.0, 792.0}
diff --git a/src/gmt/gmt_memory.h b/src/gmt/gmt_memory.h
new file mode 100644
index 0000000..a0302af
--- /dev/null
+++ b/src/gmt/gmt_memory.h
@@ -0,0 +1,92 @@
+/*--------------------------------------------------------------------
+ *	$Id$
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+#ifndef _GMT_MEMORY_H
+#define _GMT_MEMORY_H
+
+enum GMT_enum_mem_alloc {	/* Initial memory for 2 double columns is 32 Mb */
+	GMT_INITIAL_MEM_COL_ALLOC	= 2U,
+	GMT_INITIAL_MEM_ROW_ALLOC	= 2097152U	/* 2^21 */	
+};
+
+/* Macros to reallocate memory for groups of 2, 3 or 4 arrays at a time of the same size/type */
+#if defined (DEBUG) || defined (MEMDEBUG)
+#define GMT_malloc(C,a,n,n_alloc,type) GMT_malloc_func(C,a,n,n_alloc,sizeof(type),__SOURCE_LINE_FUNC)
+#else
+#define GMT_malloc(C,a,n,n_alloc,type) GMT_malloc_func(C,a,n,n_alloc,sizeof(type),__func__)
+#endif
+/* The __kp = n_alloc below is needed since NULL may be passed. __k is used to ensure only the final GMT_malloc call changes n_alloc (unless it is NULL) */
+#define GMT_malloc2(C,a,b,n,n_alloc,type) { size_t __k, *__kp = n_alloc; __k = (__kp) ? *__kp : 0U; a = GMT_malloc(C,a,n,&__k,type); b = GMT_malloc(C,b,n,n_alloc,type); }
+#define GMT_malloc3(C,a,b,c,n,n_alloc,type) { size_t __k, *__kp = n_alloc; __k = (__kp) ? *__kp : 0U; a = GMT_malloc(C,a,n,&__k,type); __k = (__kp) ? *__kp : 0U; b = GMT_malloc(C,b,n,&__k,type); c = GMT_malloc(C,c,n,n_alloc,type); }
+#define GMT_malloc4(C,a,b,c,d,n,n_alloc,type) { size_t __k, *__kp = n_alloc; __k = (__kp) ? *__kp : 0U; a = GMT_malloc(C,a,n,&__k,type); __k = (__kp) ? *__kp : 0U; b = GMT_malloc(C,b,n,&__k,type); __k = (__kp) ? *__kp : 0U; c = GMT_malloc(C,c,n,&__k,type); d = GMT_malloc(C,d,n,n_alloc,type); }
+
+/* Convenience macro for GMT_memory_func */
+#if defined (DEBUG) || defined (MEMDEBUG)
+#define GMT_memory(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),false,__SOURCE_LINE_FUNC)
+#define GMT_memory_aligned(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),true,__SOURCE_LINE_FUNC)
+#else
+#define GMT_memory(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),false,__func__)
+#define GMT_memory_aligned(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),true,__func__)
+#endif
+
+/* Convenience macro for GMT_free_func */
+#if defined (DEBUG) || defined (MEMDEBUG)
+#define GMT_free(C,ptr) (GMT_free_func(C,ptr,false,__SOURCE_LINE_FUNC),(ptr)=NULL)
+#define GMT_free_aligned(C,ptr) (GMT_free_func(C,ptr,true,__SOURCE_LINE_FUNC),(ptr)=NULL)
+#else
+#define GMT_free(C,ptr) (GMT_free_func(C,ptr,false,__func__),(ptr)=NULL)
+#define GMT_free_aligned(C,ptr) (GMT_free_func(C,ptr,true,__func__),(ptr)=NULL)
+#endif
+
+#ifdef MEMDEBUG
+
+struct MEMORY_ITEM {
+	size_t size;	/* Size of memory allocated */
+	void *ptr;	/* Memory pointer */
+	char *name;	/* Source filename and line or function name */
+	size_t ID;	/* Unique ID for this allocation */
+	struct MEMORY_ITEM *l, *r;
+};
+
+struct MEMORY_TRACKER {
+	bool active;	/* Normally true but can be changed to focus on just some allocations */
+	bool search;	/* Normally true but can be changed to skip searching when we know we add a new item */
+	bool do_log;	/* true if we wish to write detailed alloc/free log */
+	uint64_t n_ptr;		/* Number of unique pointers to allocated memory */
+	uint64_t n_allocated;	/* Number of items allocated by GMT_memory */
+	uint64_t n_reallocated;	/* Number of items reallocated by GMT_memory */
+	uint64_t n_freed;	/* Number of items freed by GMT_free */
+	uint64_t n_ID;		/* Running number assigned to new allocations */
+	uint64_t find;		/* If > 0 then we look for this ID to be allocated */
+	size_t current;		/* Memory allocated at current time */
+	size_t maximum;		/* Highest memory count during execution */
+	size_t largest;		/* Highest memory allocation to a single variable */
+	size_t n_alloc;		/* Allocated size of memory pointer array */
+	struct MEMORY_ITEM *root; /* Pointer to splay tree */
+	FILE *fp;	/* For logging if GMT_TRACK_MEMORY is 2 */
+};
+
+/* Items needed if -DMEMDEBUG is in effect */
+EXTERN_MSC int GMT_memtrack_init (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_memtrack_report (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_memtrack_on (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_memtrack_off (struct GMT_CTRL *GMT);
+
+#endif
+
+#endif /* _GMT_MEMORY_H */
diff --git a/src/gmt/gmt_mgg_header2.h b/src/gmt/gmt_mgg_header2.h
new file mode 100644
index 0000000..24ce219
--- /dev/null
+++ b/src/gmt/gmt_mgg_header2.h
@@ -0,0 +1,41 @@
+/*	$Id: gmt_mgg_header2.h 12822 2014-01-31 23:39:56Z remko $
+ *
+ *	Code donated by David Divens, NOAA/NGDC
+ *	Distributed under the GNU Public License (see LICENSE.TXT for details)
+ */
+#ifndef _H_MGG_HEADER_2
+#define _H_MGG_HEADER_2
+
+enum GMT_enum_grd98 {GRD98_MAGIC_NUM = 1000000000,
+	GRD98_VERSION		= 1,
+	GRD98_NAN_VALUE		= 999999,
+	GRD98_DEFAULT_PREC	= 10,
+	GRD98_N_UNUSED		= 10};
+
+typedef struct {
+	int	version;		/* 1,000,000,001 Magic_Num + Version */
+	int	length;			/* 128 bytes */
+	int     dataType;       /* 1=data, 2=density, 3=radius, -1=template */
+	int	latDeg;
+	int	latMin;
+	int	latSec;
+	int	latSpacing;
+	int	latNumCells;
+	int	lonDeg;
+	int	lonMin;
+	int	lonSec;
+	int	lonSpacing;
+	int	lonNumCells;
+	int	minValue;		/* Whole meters */
+	int	maxValue;		/* Whole meters */
+	int	gridRadius;		/* -1 for grid radius not performed */
+	int	precision;     	 /* 1 = whole meters, 10 = tenths of meters */
+	int	nanValue;
+	int     numType;        /* bytesize, pos=int, neg=float */
+	int     waterDatum;     /* Vertical datum 0 = Mean Sea Level, 1 = local */
+	int	dataLimit;		/* 2-byte, 4-byte -1 = float */
+	int	cellRegistration;	/* 1 for pixel (cell centered), 0 for gridline */
+	int    unused[GRD98_N_UNUSED];	/* Unused 4byte ints */
+} MGG_GRID_HEADER_2;
+
+#endif
diff --git a/src/gmt/gmt_nan.h b/src/gmt/gmt_nan.h
new file mode 100644
index 0000000..262090d
--- /dev/null
+++ b/src/gmt/gmt_nan.h
@@ -0,0 +1,50 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_nan.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * Machine-dependent macros for generation and testing of NaNs.
+ *
+ * These routines use the IEEE definition of Silent NaNs to set NaNs and
+ * use the avialable isnan* routines to test NaNs whenever available.
+ *
+ * Notes:
+ *    If your system has no IEEE support, add -DNO_IEEE to CFLAGS
+ *    We will then use the max double/float values to signify NaNs.
+ *
+ * Author:	Remko Scharroo
+ * Date:	1-JAN-2010
+ * Ver:		5 API
+ */
+
+#ifndef _GMT_NAN_H
+#define _GMT_NAN_H
+
+//#include "gmt_notposix.h"
+
+#ifdef NO_IEEE
+#	define GMT_make_fnan(x) (x = FLT_MAX)
+#	define GMT_make_dnan(x) (x = DBL_MAX)
+#	define GMT_is_fnan(x) ((x) == FLT_MAX)
+#	define GMT_is_dnan(x) ((x) == DBL_MAX)
+#else
+#	define GMT_make_fnan(x) (x = (float) NAN)
+#	define GMT_make_dnan(x) (x = NAN)
+#	define GMT_is_fnan isnan
+#	define GMT_is_dnan isnan
+#endif
+
+#endif /* _GMT_NAN_H */
diff --git a/src/gmt/gmt_notposix.h b/src/gmt/gmt_notposix.h
new file mode 100644
index 0000000..b30c801
--- /dev/null
+++ b/src/gmt/gmt_notposix.h
@@ -0,0 +1,570 @@
+/*--------------------------------------------------------------------
+ * $Id: gmt_notposix.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ * Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
+ * See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3 or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------
+ *
+ * This include file contains ifdefs that tell us if this system has
+ * some of the several functions that are not part of POSIX but are
+ * often distributed anyway as part of ANSI C.  The set of defines
+ * below is automatically assigned by CMake and determines if the
+ * required functions are present or not.  These macros are then used
+ * to choose between a function prototype (if found), an alternative
+ * GMT function, or simply a macro.  The purpose is to take advantage
+ * of the built-in functions if they exist and provide alternative
+ * definitions otherwise.
+ */
+
+#ifndef _GMT_NOTPOSIX_H
+#define _GMT_NOTPOSIX_H
+
+/* HAVE_<func> is undefined or defined as 1 depending on
+ * whether or not <func> is available on this system.
+ * The definitions are stored in gmt_config.h */
+#include "gmt_config.h"
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#include "declspec.h"
+
+/*
+ * Include POSIX headers
+ */
+
+#include <stdlib.h>
+
+#ifdef HAVE_ASSERT_H_
+#	include <assert.h>
+#else
+#	define assert(e) ((void)0)
+#endif
+
+#ifdef HAVE_BASENAME
+#	include <libgen.h>
+#else
+#	define basename GMT_basename
+#endif
+
+#ifdef HAVE_CTYPE_H_
+#	include <ctype.h>
+#endif
+
+#ifdef HAVE_STDBOOL_H_
+#	include <stdbool.h>
+#else
+#	include "compat/stdbool.h"
+#endif
+
+#ifdef HAVE_SYS_TYPES_H_
+#	include <sys/types.h>
+#endif
+
+#ifndef SIZEOF_MODE_T
+  /* MSC does not define mode_t */
+	typedef unsigned int mode_t;
+#endif
+
+#ifdef HAVE_FCNTL_H_
+#	include <fcntl.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H_
+#	include <sys/stat.h>
+#endif
+
+#ifdef HAVE_STDDEF_H_
+#	include <stddef.h>
+#endif
+
+#ifdef HAVE_UNISTD_H_
+#	include <unistd.h>
+#endif
+
+#ifdef HAVE_STDINT_H_          /* VS 2010 has stdint.h */
+#	include <stdint.h>
+#else
+#	include "compat/stdint.h"    /* msinttypes for VC++ */
+#endif /* HAVE_STDINT_H_ */
+
+#ifdef HAVE_INTTYPES_H_
+#	include <inttypes.h>         /* Exact-width integer types */
+#else
+#	include "compat/inttypes.h"  /* msinttypes for VC++ */
+#endif /* HAVE_INTTYPES_H_ */
+
+/* Size prefixes for printf/scanf for size_t and ptrdiff_t */
+#ifdef _MSC_VER
+#	define PRIxS "Ix"  /* printf size_t */
+#	define PRIuS "Iu"  /* printf size_t */
+#	define PRIdS "Id"  /* printf ptrdiff_t */
+#	define SCNuS "u"   /* scanf  size_t (__int32 even on 64-bit platforms) */
+#	define SCNdS "d"   /* scanf  ptrdiff_t (__int32 even on 64-bit platforms) */
+#else
+#	define PRIxS "zx"  /* printf size_t */
+#	define PRIuS "zu"  /* printf size_t */
+#	define PRIdS "zd"  /* printf ptrdiff_t */
+#	define SCNuS PRIuS /* scanf  size_t */
+#	define SCNdS PRIdS /* scanf  ptrdiff_t */
+#endif
+
+/*
+ * Windows headers
+ */
+
+#ifdef HAVE_DIRECT_H_
+#	include <direct.h>
+#endif
+
+#ifdef HAVE_IO_H_
+#	include <io.h>
+#endif
+
+#ifdef HAVE_PROCESS_H_
+#	include <process.h>
+#endif
+
+/*
+ * Math headers
+ */
+
+#include <math.h>
+#include <float.h>
+
+#if defined (HAVE_IEEEFP_H_) && defined(__ultrix__) && defined(__mips)
+/* Needed to get isnan[fd] macros */
+#	include <ieeefp.h>
+#endif
+
+#ifdef HAVE_FLOATINGPOINT_H_
+#	include <floatingpoint.h>
+#endif
+
+/*
+ * Make sure Cygwin does not use Windows related tweaks
+ */
+
+#ifdef __CYGWIN__
+#	undef _WIN32
+#	undef WIN32
+#endif
+
+/*
+ * Windows tweaks
+ */
+
+#if defined _WIN32
+
+#	ifndef WIN32
+#		define WIN32
+#	endif
+
+	/* Reduce the size of the Win32 header files and speed up compilation. */
+#	define WIN32_LEAN_AND_MEAN
+
+#	define PATH_SEPARATOR ';' /* Win uses ; while Unix uses : */
+
+#	define SET_IO_MODE   /* Need to force binary i/o upon request */
+
+#	if defined(USE_VLD) && defined(DEBUG)
+#		include <vld.h>
+#	endif
+
+#	ifdef _MSC_VER
+		/* Suppress Visual Studio deprecation warnings */
+#		pragma warning( disable : 4996 )
+		/* Issue warning 4244 (conversion of int64_t to int32_t) only once */
+/*#		pragma warning( once : 4244 4267 ) */
+#	 	if (_MSC_VER <= 1600)
+			/* Older Visual Studio do not understand C99 restrict keyword */
+#			define restrict
+# 		endif
+
+		/* isspace, isalpha, ...: avoid assert (only happens with debug CRT) 
+		   if passed a parameter that isn't EOF or in the range of 0 through 0xFF. */
+#		ifdef _DEBUG
+#			define isspace(c) (c > 0 && c < 0xFF && isspace(c))
+#			define isalpha(c) (c > 0 && c < 0xFF && isalpha(c))
+#		endif /* _DEBUG */
+
+#	endif /* defined _MSC_VER */
+
+#endif /* defined _WIN32 */
+
+#ifndef PATH_SEPARATOR
+#	define PATH_SEPARATOR ':' /* Win uses ; while Unix uses : */
+#endif
+
+/* Misc. ANSI-C math functions used by grdmath and gmtmath.
+ * These functions are available on many platforms and we
+ * seek to use them.  If not available then we compile in
+ * replacements from gmt_notposix.c */
+
+#ifndef HAVE_ABS
+#	define abs(x) (int)labs(x)
+#endif
+#ifndef HAVE_ACOSF
+#	define acosf(x) (float)acos((double)(x))
+#endif
+#ifndef HAVE_ACOSH
+#	define acosh(x) log((x) + (d_sqrt((x) + 1.0)) * (d_sqrt((x) - 1.0)))
+#endif
+#ifndef HAVE_ACOSHF
+#	define acoshf(x) (float)acosh((double)(x))
+#endif
+#ifndef HAVE_ASINF
+#	define asinf(x) (float)asin((double)(x))
+#endif
+#ifndef HAVE_ASINH
+#	define asinh(x) log((x) + (hypot((x), 1.0)))
+#endif
+#ifndef HAVE_ASINHF
+#	define asinhf(x) (float)asinh((double)(x))
+#endif
+#ifndef HAVE_ATANF
+#	define atanf(x) (float)atan((double)(x))
+#endif
+#ifndef HAVE_ATAN2F
+#	define atan2f(y,x) (float)atan2((double)(y),(double)(x))
+#endif
+#ifndef HAVE_ATANH
+	EXTERN_MSC double atanh(double x);
+#endif
+#ifndef HAVE_ATANHF
+#	define atanhf(x) (float)atanh((double)(x))
+#endif
+
+#if defined HAVE__COPYSIGN && !defined HAVE_COPYSIGN
+#	define copysign _copysign
+#elif !defined HAVE_COPYSIGN
+#	define copysign(x,y) ((y) < 0.0 ? -fabs(x) : fabs(x))
+#endif
+#ifndef HAVE_COPYSIGNF
+#	define copysignf(x,y) (float)copysign((double)(x),(double)(y))
+#endif
+
+#ifndef HAVE_CEILF
+#	define ceilf(x) (float)ceil((double)(x))
+#endif
+#ifndef HAVE_COSF
+#	define cosf(x) (float)cos((double)(x))
+#endif
+#ifndef HAVE_COSHF
+#	define coshf(x) (float)cosh((double)(x))
+#endif
+#ifndef HAVE_ERF
+	EXTERN_MSC double erf(double x);
+#endif
+#ifndef HAVE_ERFF
+#	define erff(x) (float)erf((double)(x))
+#endif
+#ifndef HAVE_ERFC
+	EXTERN_MSC double erfc(double x);
+#endif
+#ifndef HAVE_ERFCF
+#	define erfcf(x) (float)erfc((double)(x))
+#endif
+#ifndef HAVE_EXPF
+#	define expf(x) (float)exp((double)(x))
+#endif
+#ifndef HAVE_FLOORF
+#	define floorf(x) (float)floor((double)(x))
+#endif
+#ifndef HAVE_FMODF
+#	define fmodf(x,y) (float)fmod((double)(x),(double)(y))
+#endif
+#ifndef HAVE_HYPOT
+	EXTERN_MSC double hypot(double x, double y);
+#endif
+#ifndef HAVE_HYPOTF
+#	define hypotf(x,y) (float)hypot((double)(x),(double)(y))
+#endif
+#ifndef HAVE_LOGF
+#	define logf(x) (float)log((double)(x))
+#endif
+#ifndef HAVE_LOG2F
+#	define log2f(x) (float)log2((double)(x))
+#endif
+#ifndef HAVE_LOG10F
+#	define log10f(x) (float)log10((double)(x))
+#endif
+#ifndef HAVE_LOG1PF
+#	define log1pf(x) (float)log1p((double)(x))
+#endif
+#ifndef HAVE_LRINT
+#	define lrint(x) (long)rint(x)
+#endif
+#ifndef HAVE_LRINTF
+#	define lrintf(x) lrint((double)(x))
+#endif
+#ifndef HAVE_LLRINT
+#	define llrint(x) (long long)rint(x)
+#endif
+#ifndef HAVE_LLRINTF
+#	define llrintf(x) llrint((double)(x))
+#endif
+#ifndef HAVE_RINTF
+#	define rintf(x) (float)rint((double)(x))
+#endif
+#ifndef HAVE_POWF
+#	define powf(x) (float)pow((double)(x))
+#endif
+#ifndef HAVE_SINF
+#	define sinf(x) (float)sin((double)(x))
+#endif
+
+/* Handle IEEE NaNs */
+
+#ifndef NAN
+#	ifdef _MSC_VER
+#		include <ymath.h>
+#		define NAN _Nan._Double
+#	else /* _MSC_VER */
+		static const double _NAN = (HUGE_VAL-HUGE_VAL);
+#		define NAN _NAN
+#	endif /* _MSC_VER */
+#endif /* !NAN */
+
+#ifndef HAVE_ISNAN
+#	if defined HAVE__ISNAN /* only WIN32 */
+#		define isnan _isnan
+#	elif defined HAVE_ISNAND && defined HAVE_ISNANF
+#		define isnan \
+			( sizeof (x) == sizeof(double) ? isnand((double)(x)) \
+			: sizeof (x) == sizeof(float) ? isnanf((float)(x)) \
+			: (x != x) )
+#	else /* defined HAVE__ISNAN */
+#		define isnan (x != x)
+#	endif
+#endif /* !HAVE_ISNAN */
+
+/* End IEEE NaNs */
+
+/* floating-point classes */
+
+#ifndef isinf
+#	ifdef HAVE__FPCLASS
+		/* only WIN32 */
+		static __inline int isinf (double x) {
+			int fpc = _fpclass (x);
+			return fpc == _FPCLASS_PINF || fpc == _FPCLASS_NINF;
+		}
+#	else
+#		define isinf(x) \
+			( sizeof (x) == sizeof (float)  ? __inline_isinf_f (x) \
+			: sizeof (x) == sizeof (double) ? __inline_isinf_d (x) \
+			:                                 __inline_isinf (x))
+		static inline int __inline_isinf_f (float x) {
+			return !isnan (x) && isnan (x - x);
+		}
+		static inline int __inline_isinf_d (double x) {
+			return !isnan (x) && isnan (x - x);
+		}
+		static inline int __inline_isinf   (long double x) {
+			return !isnan (x) && isnan (x - x);
+		}
+#	endif /* HAVE__FPCLASS */
+#endif /* !isinf */
+
+#ifndef isfinite
+#	ifdef HAVE__FINITE /* only WIN32 */
+#		define isfinite _finite
+#	else
+#		define isfinite(x) (!isinf(x) && !isnan(x))
+#	endif
+#endif
+
+#ifndef isnormal
+#	ifdef HAVE__FPCLASS
+		/* only WIN32 */
+		static __inline int isnormal (double x) {
+			int fpc = _fpclass (x);
+			return fpc == _FPCLASS_PN || fpc == _FPCLASS_NN;
+		}
+#	else
+#		define isnormal(x) \
+			( sizeof (x) == sizeof (float)  ? __inline_isnormal_f (x) \
+			: sizeof (x) == sizeof (double) ? __inline_isnormal_d (x) \
+			:                                 __inline_isnormal (x))
+		static inline int __inline_isnormal_f ( float x ) {
+			float abs_x = fabsf(x);
+			if ( x != x )
+				return 0;
+			return abs_x < HUGE_VALF && abs_x >= FLT_MIN;
+		}
+		static inline int __inline_isnormal_d ( double x ) {
+			double abs_x = fabs(x);
+			if ( x != x )
+				return 0;
+			return abs_x < HUGE_VAL && abs_x >= DBL_MIN;
+		}
+		static inline int __inline_isnormal ( long double x ) {
+			long double abs_x = fabsl(x);
+			if ( x != x )
+				return 0;
+			return abs_x < HUGE_VALL && abs_x >= LDBL_MIN;
+		}
+#	endif /* HAVE__FPCLASS */
+#endif /* !isnormal */
+
+/* End floating-point classes */
+
+#ifndef HAVE_J0
+	EXTERN_MSC double j0(double x);
+#endif
+
+#ifndef HAVE_J1
+	EXTERN_MSC double j1(double x);
+#endif
+
+#ifndef HAVE_JN
+	EXTERN_MSC double jn(int n, double x);
+#endif
+
+#ifndef HAVE_LOG1P
+	EXTERN_MSC double log1p(double x);
+#endif
+
+#ifndef HAVE_LOG2
+#	define log2(x) (log10(x)/0.30102999566398114250631579125183634459972381591796875)
+#endif
+
+#ifndef HAVE_RINT
+	/* #define rint(x) (floor((x)+0.5f)) does not work reliable.
+	 * We use s_rint.c from sun instead. */
+	EXTERN_MSC double rint(double x);
+#endif
+
+#ifndef HAVE_SINCOS
+	EXTERN_MSC void sincos (double x, double *s, double *c);
+#endif
+
+#ifndef HAVE_Y0
+	EXTERN_MSC double y0(double x);
+#endif
+
+#ifndef HAVE_Y1
+	EXTERN_MSC double y1(double x);
+#endif
+
+#ifndef HAVE_YN
+	EXTERN_MSC double yn(int n, double x);
+#endif
+
+/*
+ * System specific
+ */
+
+/* GMT normally gets these macros from unistd.h */
+#ifndef HAVE_UNISTD_H_
+#	define R_OK 4
+#	define W_OK 2
+#	ifdef WIN32
+#		define X_OK R_OK /* X_OK == 1 crashes on Windows */
+#	else
+#		define X_OK 1
+#	endif
+#	define F_OK 0
+#endif /* !HAVE_UNISTD_H_ */
+
+/* access is usually in unistd.h; we use a macro here
+ * since the same function under WIN32 is prefixed with _
+ * and defined in io.h */
+#if defined HAVE__ACCESS && !defined HAVE_ACCESS
+#	define access _access
+#endif
+
+/* fileno is usually in stdio.h; we use a macro here
+ * since the same function under WIN32 is prefixed with _
+ * and defined in stdio.h */
+#if defined HAVE__FILENO && !defined HAVE_FILENO
+#	define fileno _fileno
+#endif
+
+/* getcwd is usually in unistd.h; we use a macro here
+ * since the same function under WIN32 is prefixed with _
+ * and defined in direct.h */
+#ifdef HAVE__GETCWD
+#	define getcwd _getcwd
+#endif
+
+/* getpid is usually in unistd.h; we use a macro here
+ * since the same function under WIN32 is prefixed with _
+ * and defined in process.h */
+#if defined HAVE__GETPID && !defined HAVE_GETPID
+#	define getpid _getpid
+#endif
+
+/* MSVC implementation of popen and pclose */
+#if defined HAVE__PCLOSE && !defined HAVE_PCLOSE
+#	define pclose _pclose
+#endif
+#if defined HAVE__POPEN && !defined HAVE_POPEN
+#	define popen _popen
+#endif
+
+#if defined HAVE__SETMODE && !defined HAVE_SETMODE
+#	define setmode _setmode
+#endif
+
+#if defined HAVE__SNPRINTF_ && !defined HAVE_SNPRINTF_
+#	define snprintf _snprintf
+#elif !defined HAVE_SNPRINTF_
+#	define snprintf(s, n, format , ...) sprintf(s, format , ##__VA_ARGS__)
+#endif
+
+#if defined HAVE__VSNPRINTF_ && !defined HAVE_VSNPRINTF_
+#	define vsnprintf _vsnprintf
+#elif !defined HAVE_VSNPRINTF_
+#	define vsnprintf(s, n, format, arg) vsprintf(s, format, arg)
+#endif
+
+#ifdef HAVE__STATI64
+#	define stat _stati64
+#elif defined HAVE__STAT
+#	define stat _stat
+#endif
+
+#if defined(HAVE_STRICMP) && !defined(HAVE_STRCASECMP)
+#	define strcasecmp stricmp
+#endif
+#if defined(HAVE_STRNICMP) && !defined(HAVE_STRNCASECMP)
+#	define strncasecmp strnicmp
+#endif
+
+#ifndef DECLARED_STRDUP
+	EXTERN_MSC char *strdup(const char *s);
+#endif
+
+#ifndef HAVE_STRTOD
+	EXTERN_MSC double strtod(const char *nptr, char **endptr);
+#endif
+
+#ifndef HAVE_STRTOF_
+	static inline float strtof(const char *nptr, char **endptr) {
+		return (float)strtod(nptr, endptr);
+	}
+#endif
+
+#if defined HAVE_STRTOK_S && !defined HAVE_STRTOK_R
+#	define strtok_r strtok_s
+#elif !defined HAVE_STRTOK_R
+/* define custom function */
+#endif
+
+/* If GLIBC compatible qsort_r is not available */
+#ifndef HAVE_QSORT_R_GLIBC
+#	include "compat/qsort.h"
+#endif
+
+#endif /* _GMT_NOTPOSIX_H */
diff --git a/src/gmt/gmt_option.h b/src/gmt/gmt_option.h
new file mode 100644
index 0000000..18d1504
--- /dev/null
+++ b/src/gmt/gmt_option.h
@@ -0,0 +1,87 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_option.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_option.h contains the definitions for the GMT_OPTION structure
+ * option-related named constants, and macros for synopsis writing.
+ *
+ * Author:	Paul Wessel
+ * Date:	17-MAY-2013
+ * Version:	5 API
+ */
+
+#ifndef _GMT_OPTION_H
+#define _GMT_OPTION_H
+
+/*============================================================ */
+/*=============== GMT_OPTION Public Declaration ============== */
+/*============================================================ */
+
+/* Macros for the common GMT options used in a program's usage synopsis */
+
+#define GMT_B_OPT	"-B<args>"
+#define GMT_I_OPT	"-I<xinc>[<unit>][=|+][/<yinc>[<unit>][=|+]]"
+#define GMT_J_OPT	"-J<args>"
+#define GMT_R2_OPT	"-R[<unit>]<xmin>/<xmax>/<ymin>/<ymax>[r]"
+#define GMT_R3_OPT	"-R[<unit>]<xmin>/<xmax>/<ymin>/<ymax>[/<zmin>/<zmax>][r]"
+#define GMT_U_OPT	"-U[<just>/<dx>/<dy>/][c|<label>]"
+#define GMT_V_OPT	"-V[<level>]"
+#define GMT_X_OPT	"-X[a|c|r]<xshift>[<unit>]"
+#define GMT_Y_OPT	"-Y[a|c|r]<yshift>[<unit>]"
+#define GMT_a_OPT	"-a<col>=<name>[,...]"
+#define GMT_b_OPT	"-b[i|o][<ncol>][t][w][+L|B]"
+#define GMT_c_OPT	"-c<ncopies>"
+#define GMT_f_OPT	"-f[i|o]<info>"
+#define GMT_g_OPT	"-g[a]x|y|d|X|Y|D|[<col>]z[-|+]<gap>[<unit>]"
+#define GMT_h_OPT	"-h[i|o][<nrecs>][+c][+d][+r<remark>][+t<title>]"
+#define GMT_i_OPT	"-i<cols>[l][s<scale>][o<offset>][,...]"
+#define GMT_n_OPT	"-n[b|c|l|n][+a][+b<BC>][+c][+t<threshold>]"
+#define GMT_o_OPT	"-o<cols>[,...]"
+#define GMT_p_OPT	"-p[x|y|z]<azim>/<elev>[/<zlevel>][+w<lon0>/<lat0>[/<z0>][+v<x0>/<y0>]"
+#define GMT_r_OPT	"-r"
+#define GMT_s_OPT	"-s[<cols>][a|r]"
+#define GMT_t_OPT	"-t<transp>"
+#define GMT_colon_OPT	"-:[i|o]"
+
+/* Macro for tools that need to specify FFT information (prepend option flag, e.g., -N and put GMT_FFT_OPT inside [] ) */
+
+#define GMT_FFT_OPT "[f|q|s|<nx>/<ny>][+a|d|l][+e|m|n][+t<width>][+w<suffix>][+z[p]]"
+
+/* Macros for printing a tic/toc elapsed time message*/
+
+#define GMT_tic(C) {if (C->current.setting.verbose >= GMT_MSG_TICTOC) GMT_Message(C->parent,GMT_TIME_RESET,"");}
+#define GMT_toc(C,...) {if (C->current.setting.verbose >= GMT_MSG_TICTOC) GMT_Message(C->parent,GMT_TIME_ELAPSED, \
+		"(%s) | %s\n", C->init.module_name, __VA_ARGS__);}
+
+/* These are the 5 named option codes */
+enum GMT_enum_opt {
+	GMT_OPT_USAGE =     '?',	/* Command-line option for full usage */
+	GMT_OPT_SYNOPSIS =  '^',	/* Command-line option for synopsis */
+	GMT_OPT_PARAMETER = '-',	/* Command-line option for GMT defaults parameter */
+	GMT_OPT_INFILE =    '<',	/* Command-line option for input file */
+	GMT_OPT_OUTFILE =   '>'};	/* Command-line option for output file */
+
+/* This struct is used to pass program options in/out of GMT modules */
+
+struct GMT_OPTION {              /* Structure for a single GMT command option */
+	char option;                 /* 1-char command line -<option> (e.g. D in -D) identifying the option (* if file) */
+	char *arg;                   /* If not NULL, contains the argument for this option */
+	struct GMT_OPTION *next;     /* Pointer to next option in a linked list */
+	struct GMT_OPTION *previous; /* Pointer to previous option in a linked list */
+};
+
+#endif /* _GMT_OPTION_H */
diff --git a/src/gmt/gmt_pennames.h b/src/gmt/gmt_pennames.h
new file mode 100644
index 0000000..ef2704c
--- /dev/null
+++ b/src/gmt/gmt_pennames.h
@@ -0,0 +1,12 @@
+{"faint",	0.00},
+{"default",	0.25},
+{"thinnest",	0.25},
+{"thinner",	0.50},
+{"thin",	0.75},
+{"thick",	1.00},
+{"thicker",	1.50},
+{"thickest",	2.00},
+{"fat",		3.00},
+{"fatter",	6.00},
+{"fattest",	10.0},
+{"obese",	18.0}
diff --git a/src/gmt/gmt_plot.h b/src/gmt/gmt_plot.h
new file mode 100644
index 0000000..aeef012
--- /dev/null
+++ b/src/gmt/gmt_plot.h
@@ -0,0 +1,188 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_plot.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+#ifndef _GMT_PLOT_H
+#define _GMT_PLOT_H
+
+/* Identifier for GMT_plane_perspective. The others come from GMT_io.h */
+
+#define GMT_ZW	3
+
+/* GMT symbol identifiers. Mostly the same as PSL_<symbol> but with
+   extensions for custom symbols, psxy and psxyz */
+
+#define GMT_SYMBOL_STAR		((int)'a')
+#define GMT_SYMBOL_BARX		((int)'B')
+#define GMT_SYMBOL_BARY		((int)'b')
+#define GMT_SYMBOL_CIRCLE	((int)'c')
+#define GMT_SYMBOL_DIAMOND	((int)'d')
+#define GMT_SYMBOL_ELLIPSE	((int)'e')
+#define GMT_SYMBOL_FRONT	((int)'f')
+#define GMT_SYMBOL_OCTAGON	((int)'g')
+#define GMT_SYMBOL_HEXAGON	((int)'h')
+#define GMT_SYMBOL_INVTRIANGLE	((int)'i')
+#define GMT_SYMBOL_ROTRECT	((int)'j')
+#define GMT_SYMBOL_CUSTOM	((int)'k')
+#define GMT_SYMBOL_TEXT		((int)'l')
+#define GMT_SYMBOL_MARC		((int)'m')
+#define GMT_SYMBOL_PENTAGON	((int)'n')
+#define GMT_SYMBOL_COLUMN	((int)'o')
+#define GMT_SYMBOL_DOT		((int)'p')
+#define GMT_SYMBOL_QUOTED_LINE	((int)'q')
+#define GMT_SYMBOL_RECT		((int)'r')
+#define GMT_SYMBOL_RNDRECT	((int)'R')
+#define GMT_SYMBOL_SQUARE	((int)'s')
+#define GMT_SYMBOL_TRIANGLE	((int)'t')
+#define GMT_SYMBOL_CUBE		((int)'u')
+#define GMT_SYMBOL_VECTOR	((int)'v')
+#define GMT_SYMBOL_WEDGE	((int)'w')
+#define GMT_SYMBOL_CROSS	((int)'x')
+#define GMT_SYMBOL_YDASH	((int)'y')
+#define GMT_SYMBOL_ZDASH	((int)'z')
+#define GMT_SYMBOL_PLUS		((int)'+')
+#define GMT_SYMBOL_XDASH	((int)'-')
+
+#define GMT_SYMBOL_MOVE		((int)'M')
+#define GMT_SYMBOL_DRAW		((int)'D')
+#define GMT_SYMBOL_STROKE	((int)'S')
+#define GMT_SYMBOL_ARC		((int)'A')
+#define GMT_SYMBOL_ROTATE	((int)'R')
+#define GMT_SYMBOL_VARROTATE	((int)'V')
+#define GMT_SYMBOL_AZIMROTATE	((int)'Z')
+#define GMT_SYMBOL_TEXTURE	((int)'T')
+#define GMT_SYMBOL_GEOVECTOR	((int)'=')
+#define GMT_SYMBOL_VARTEXT	((int)'L')
+
+#define GMT_SYMBOL_LINE		0
+#define GMT_SYMBOL_NONE		((int)' ')
+#define GMT_SYMBOL_NOT_SET	((int)'*')
+
+#define GMT_DOT_SIZE 0.005	/* Size of a "dot" on a GMT PS map [in inches] */
+
+/* FRONT symbols */
+
+enum GMT_enum_front {GMT_FRONT_FAULT = 0,
+	GMT_FRONT_TRIANGLE,
+	GMT_FRONT_SLIP,
+	GMT_FRONT_CIRCLE,
+	GMT_FRONT_BOX};
+
+/* Direction of FRONT symbols: */
+
+enum GMT_enum_frontdir {GMT_FRONT_RIGHT = -1,
+	GMT_FRONT_CENTERED,
+	GMT_FRONT_LEFT};
+
+struct GMT_FRONTLINE {		/* A sub-symbol for symbols along a front */
+	double f_gap;		/* Gap between front symbols in inches */
+	double f_len;		/* Length of front symbols in inches */
+	double f_off;		/* Offset of first symbol from start of front in inches */
+	int f_sense;	/* Draw symbols to left (+1), centered (0), or right (-1) of line */
+	int f_symbol;	/* Which symbol to draw along the front line */
+};
+
+/* Note: If changes are made to GMT_enum_vecattr you must also change pslib.h: PSL_enum_vecattr */
+
+enum GMT_enum_vecattr {GMT_VEC_BEGIN = 1,	/* Place vector head at beginning of vector. Add GMT_VEC_BEGIN_L for left only, GMT_VEC_BEGIN_R for right only */
+	GMT_VEC_END		= 2,		/* Place vector head at end of vector.  Add GMT_VEC_END_L for left only, and GMT_VEC_END_R for right only */
+	GMT_VEC_HEADS		= 3,		/* Mask for either head end */
+	GMT_VEC_BEGIN_L		= 4,		/* Left-half head at beginning */
+	GMT_VEC_BEGIN_R		= 8,		/* Right-half head at beginning */
+	GMT_VEC_END_L		= 16,		/* Left-half head at end */
+	GMT_VEC_END_R		= 32,		/* Right-half head at end */
+	GMT_VEC_JUST_B		= 0,		/* Align vector beginning at (x,y) */
+	GMT_VEC_JUST_C		= 64,		/* Align vector center at (x,y) */
+	GMT_VEC_JUST_E		= 128,		/* Align vector end at (x,y) */
+	GMT_VEC_JUST_S		= 256,		/* Align vector center at (x,y) */
+	GMT_VEC_ANGLES		= 512,		/* Got start/stop angles instead of az, length */
+	GMT_VEC_POLE		= 1024,		/* Got pole of small/great circle */
+	GMT_VEC_OUTLINE		= 2048,		/* Draw vector head outline using default pen */
+	GMT_VEC_OUTLINE2	= 4096,		/* Draw vector head outline using supplied v_pen */
+	GMT_VEC_FILL		= 8192,		/* Fill vector head using default fill */
+	GMT_VEC_FILL2		= 16384,	/* Fill vector head using supplied v_fill) */
+	GMT_VEC_MARC90		= 32768,	/* Matharc only: if angles subtend 90, draw straight angle symbol */
+	GMT_VEC_SCALE		= 65536};	/* Not needed in pslib: If not set we determine the required inch-to-degree scale */
+
+/* Make sure the next three macros are in sync with any changes to GMT_enum_vecattr above! */
+
+#define GMT_vec_justify(status) ((status>>6)&3)			/* Return justification as 0-3 */
+#define GMT_vec_head(status) ((status)&3)			/* Return head selection as 0-3 */
+#define GMT_vec_side(status,head) (((status>>(2+2*head))&3) ? 2*((status>>(2+2*head))&3)-3 : 0)	/* Return side selection for this head as 0,-1,+1 */
+
+#define GMT_vec_outline(status) ((status&GMT_VEC_OUTLINE) || (status&GMT_VEC_OUTLINE2))	/* Return true if outline is currently selected */
+#define GMT_vec_fill(status) ((status&GMT_VEC_FILL) || (status&GMT_VEC_FILL2))		/* Return true if fill is currently selected */
+
+struct GMT_VECT_ATTR {
+	/* Container for common attributes for plot attributes of vectors */
+	unsigned int status;	/* Bit flags for vector information (see GMT_enum_vecattr above) */
+	bool parsed_v4;		/* true if we parsed old-style <vectorwidth/headlength/headwidth> attribute */
+	float v_angle;		/* Head angle */
+	float v_norm;		/* shrink when lengths are smaller than this */
+	float v_stem;		/* Min length in % of visible vector when head is large [10%] */
+	float v_width;		/* Width of vector stem in inches */
+	float h_length;		/* Length of vector head in inches */
+	float h_width;		/* Width of vector head in inches */
+	float pole[2];		/* Longitude and latitude of geovector pole */
+	float scale;		/* Converts inches to spherical degrees */
+	struct GMT_PEN pen;	/* Pen for outline of head */
+	struct GMT_FILL fill;	/* Fill for head [USED IN PSROSE] */
+};
+
+#define GMT_MAX_SYMBOL_COLS	6	/* Maximum number of columns required for the most complicated symbol input */
+
+struct GMT_SYMBOL {
+	/* Voodoo: If next line is not the first member in this struct, psxy -Sl<size>/Text will have corrupt 'Text'
+		   in non-debug binaries compiled with VS2010 */
+	char string[GMT_LEN256];	/* Character code to plot (could be octal) */
+
+	int symbol;	/* Symbol id */
+	unsigned int n_required;	/* Number of additional columns necessary to decode chosen symbol */
+	unsigned int justify;	/* Justification of text item for -Sl symbol [PSL_MC = centered] */
+	unsigned int u;		/* Measure unit id (0 = cm, 1 = inch, 2 = m, 3 = point */
+	bool u_set;		/* true if u was set */
+	double size_x;		/* Current symbol size in x */
+	double size_y;		/* Current symbol size in y */
+	double given_size_x;	/* Symbol size read from file or command line */
+	double given_size_y;	/* Symbol size read from file or command line */
+	bool read_size_cmd;	/* true when -S indicated we must read symbol sizes from file */
+	bool read_symbol_cmd;	/* true when -S indicated we must read symbol type from file */
+	bool read_size;	/* true when we must read symbol size from file for the current record */
+	bool shade3D;	/* true when we should simulate shading of 3D symbols cube and column */
+	bool fq_parse;	/* true -Sf or -Sq were given with no args on command line and must be parsed via segment headers */
+	struct GMT_FONT font;	/* Font to use for the -Sl symbol */
+	unsigned int convert_angles;	/* If 2, convert azimuth to angle on map, 1 special case for -JX, 0 plain case */
+	unsigned int n_nondim;	/* Number of columns that has angles or km (and not dimensions with units) */
+	unsigned int nondim_col[GMT_MAX_SYMBOL_COLS];	/* Which columns has angles or km for this symbol */
+
+	/* These apply to bar|column symbols */
+
+	double base;		/* From what level to draw the bar|column */
+	bool user_unit[2];	/* If true then we must project the base via R -J to get base values, otherwise they are in c|i|p units */
+	unsigned int base_set;	/* 1 if user provided a custom base, 2 if we should read it from last column [otherwise 0: default to bottom axis] */
+
+	/* These apply to vectors */
+
+	struct GMT_VECT_ATTR v;	/* All attributes for vector shapes etc. [see struct above] */
+
+	struct GMT_FRONTLINE f;	/* parameters needed for a front */
+	struct GMT_CUSTOM_SYMBOL *custom;	/* pointer to a custom symbol */
+
+	struct GMT_CONTOUR G;	/* For quoted lines */
+};
+
+#endif /* _GMT_PLOT_H */
diff --git a/src/gmt/gmt_private.h b/src/gmt/gmt_private.h
new file mode 100644
index 0000000..f1eb311
--- /dev/null
+++ b/src/gmt/gmt_private.h
@@ -0,0 +1,165 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_private.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+/*
+ * THese are the private parts of the GMTAPI_CTRL which we will not expose
+ * to the API users; they are only accessible by GMT developers.
+ *
+ * Author: 	Paul Wessel
+ * Date:	06-FEB-2013
+ * Version:	5 API
+ */
+
+#ifndef _GMTAPI_PRIVATE_H
+#define _GMTAPI_PRIVATE_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+/*
+ * Visual C++ only implements C90, which has no bool type. C99 added support
+ * for bool via the <stdbool.h> header, but Visual C++ does not support this.
+ */
+#ifndef __bool_true_false_are_defined
+#	if defined _MSC_VER
+#		define bool _Bool
+#		define true 1
+#		define false 0
+#		define __bool_true_false_are_defined 1
+#	else
+#		include <stdbool.h>
+#	endif /* _MSC_VER */
+#endif /* !__bool_true_false_are_defined */
+
+#ifdef __cplusplus /* Basic C++ support */
+extern "C" {
+#endif
+
+enum GMT_enum_apidim {
+	GMTAPI_N_GRID_ARGS	= 4,	/* Minimum size of information array used to specify grid parameters */
+	GMTAPI_N_ARRAY_ARGS	= 8	/* Minimum size of information array used to specify array parameters */
+};
+
+/* Index parameters used to access the information arrays [PW: Is this still relevant?] */
+
+#if 0
+enum GMT_enum_pars {GMTAPI_TYPE = 0,	/* ipar[0] = data type (GMTAPI_{BYTE|SHORT|FLOAT|INT|DOUBLE}) */
+	GMTAPI_NDIM,		/* ipar[1] = dimensionality of data (1, 2, or 3) (GMT grids = 2 yet stored internally as 1D) */
+	GMTAPI_NROW,		/* ipar[2] = number_of_rows (or length of 1-D array) */
+	GMTAPI_NCOL,		/* ipar[3] = number_of_columns (1 for 1-D array) */
+	GMTAPI_KIND,		/* ipar[4] = arrangment of rows/col (0 = rows (C), 1 = columns (Fortran)) */
+	GMTAPI_DIML,		/* ipar[5] = length of dimension for row (C) or column (Fortran) */
+	GMTAPI_FREE,		/* ipar[6] = 1 to free array after use (IN) or before filling with output (OUT), 0 to leave alone */
+	GMTAPI_NODE};		/* ipar[7] = 1 for pixel registration, 0 for node */
+#endif
+
+
+/*=====================================================================================
+ *	GMT API STRUCTURE DEFINITIONS
+ *===================================================================================*/
+
+struct GMT_CTRL; /* forward declaration of GMT_CTRL */
+
+struct GMTAPI_DATA_OBJECT {
+	/* Information for each input or output data entity, including information
+	 * needed while reading/writing from a table (file or array) */
+	uint64_t n_rows;			/* Number or rows in this array [GMT_DATASET and GMT_TEXTSET to/from MATRIX/VETOR only] */
+	uint64_t n_columns;			/* Number of columns to process in this dataset [GMT_DATASET only] */
+	uint64_t n_expected_fields;		/* Number of expected columns for this dataset [GMT_DATASET only] */
+	size_t n_alloc;				/* Number of items allocated so far if writing to memory */
+	unsigned int ID;			/* Unique identifier which is >= 0 */
+	unsigned int alloc_level;		/* Nested module level when object was allocated */
+	unsigned int status;			/* 0 when first registered, 1 after reading/writing has started, 2 when finished */
+	bool selected;				/* true if requested by current module, false otherwise */
+	bool close_file;			/* true if we opened source as a file and thus need to close it when done */
+	bool region;				/* true if wesn was passed, false otherwise */
+	bool no_longer_owner;			/* true if the data pointed to by the object was passed on to another object */
+	bool messenger;				/* true for output objects passed from the outside to receive data from GMT. If true we destroy data pointer before writing */
+	enum GMT_enum_alloc alloc_mode;		/* GMT_ALLOCATED_{BY_GMT|EXTERNALLY} */
+	enum GMT_io_enum direction;		/* GMT_IN or GMT_OUT */
+	enum GMT_enum_family family;		/* One of GMT_IS_{DATASET|TEXTSET|CPT|IMAGE|GRID|MATRIX|VECTOR|COORD} */
+	enum GMT_enum_family actual_family;	/* May be GMT_IS_MATRIX|VECTOR when one of the others are created via those */
+	unsigned method;		/* One of GMT_IS_{FILE,STREAM,FDESC,DUPLICATE,REFERENCE} or sum with enum GMT_enum_via (GMT_VIA_{NONE,VECTOR,MATRIX,OUTPUT}); using unsigned type because sum exceeds enum GMT_enum_method */
+	enum GMT_enum_geometry geometry;	/* One of GMT_IS_{POINT|LINE|POLY|PLP|SURFACE|NONE} */
+	double wesn[GMTAPI_N_GRID_ARGS];	/* Grid domain limits */
+	void *resource;				/* Points to registered filename, memory location, etc., where data can be obtained from with GMT_Get_Data. */
+	void *data;				/* Points to GMT object that was read from a resource */
+	FILE *fp;				/* Pointer to source/destination stream [For rec-by-rec procession, NULL if memory location] */
+	char *filename;				/* Filename, stream, of file handle (otherwise NULL) */
+	void * (*import) (struct GMT_CTRL *, FILE *, uint64_t *, int *);	/* Pointer to input function (for DATASET/TEXTSET only) */
+#ifdef DEBUG
+	struct GMT_GRID *G;
+	struct GMT_DATASET *D;
+	struct GMT_TEXTSET *T;
+	struct GMT_PALETTE *C;
+	struct GMT_MATRIX *M;
+	struct GMT_VECTOR *V;
+#endif
+#ifdef HAVE_GDAL
+	struct GMT_IMAGE *I;
+#endif
+};
+
+struct GMTAPI_CTRL {
+	/* Master controller which holds all GMT API related information at run-time for a single session.
+	 * Users can run several GMT sessions concurrently; each session requires its own structure.
+	 * Use GMTAPI_Create_Session to initialize a new session and GMTAPI_Destroy_Session to end it. */
+
+	uint64_t current_rec[2];		/* Current record number >= 0 in the combined virtual dataset (in and out) */
+	unsigned int n_objects;			/* Number of currently active input and output data objects */
+	unsigned int unique_ID;			/* Used to create unique IDs for duration of session */
+	unsigned int session_ID;		/* ID of this session */
+	unsigned int unique_var_ID;		/* Used to create unique object IDs (grid,dataset, etc) for duration of session */
+	unsigned int current_item[2];		/* Array number of current dataset being processed (in and out)*/
+	unsigned int pad;			/* Session default for number of rows/cols padding for grids [2] */
+	unsigned int mode;			/* 1 if called via external API (Matlab, Python) [0] */
+	unsigned int leave_grid_scaled;		/* 1 if we dont want to unpack a grid after we packed it for writing [0] */
+	unsigned int verbose;			/* Used until GMT is set up */
+	bool registered[2];			/* true if at least one source/destination has been registered (in and out) */
+	bool io_enabled[2];			/* true if access has been allowed (in and out) */
+	size_t n_objects_alloc;			/* Allocation counter for data objects */
+	int error;				/* Error code from latest API call [GMT_OK] */
+	int last_error;				/* Error code from previous API call [GMT_OK] */
+	int shelf;				/* Place to pass hidden values within API */
+	unsigned int io_mode[2];		/* 1 if access as set, 0 if record-by-record */
+	struct GMT_CTRL *GMT;			/* Key structure with low-level GMT internal parameters */
+	struct GMTAPI_DATA_OBJECT **object;	/* List of registered data objects */
+	char *session_tag;			/* Name tag for this session (or NULL) */
+	bool internal;				/* true if session was initiated by gmt.c */
+	bool deep_debug;			/* temporary for debugging */
+	int (*print_func) (FILE *, const char *);	/* Pointer to fprintf function (may be reset by external APIs like MEX) */
+	unsigned int do_not_exit;		/* 0 by default, mieaning it is OK to call exit  (may be reset by external APIs like MEX to call return instead) */
+	struct Gmt_libinfo *lib;		/* List of shared libs to consider */
+	unsigned int n_shared_libs;		/* How many in lib */
+};
+
+#ifdef DEBUG
+EXTERN_MSC void GMT_list_API (struct GMTAPI_CTRL *ptr, char *txt);
+#endif
+EXTERN_MSC int GMTAPI_report_error	(void *C, int error);
+
+/* Macro to test if filename is a special name indicating memory location */
+
+#define GMT_File_Is_Memory(file) (file && !strncmp (file, "@GMTAPI at -", 9U))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GMTAPI_PRIVATE_H */
diff --git a/src/gmt/gmt_project.h b/src/gmt/gmt_project.h
new file mode 100644
index 0000000..47b5bf1
--- /dev/null
+++ b/src/gmt/gmt_project.h
@@ -0,0 +1,482 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_project.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * Include file for programs that use the map-projections functions.  Note
+ * that most programs will include this by including gmt_dev.h
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ *
+ */
+#ifndef _GMT_PROJECT_H
+#define _GMT_PROJECT_H
+
+#define HALF_DBL_MAX (DBL_MAX/2.0)
+
+/* GMT_180 is used to see if a value really is exceeding it (beyond roundoff) */
+#define GMT_180	(180.0 + GMT_CONV8_LIMIT)
+/* GMT_WIND_LON will remove central meridian value and adjust so lon fits between -180/+180 */
+#define GMT_WIND_LON(C,lon) {lon -= C->current.proj.central_meridian; while (lon < -GMT_180) lon += 360.0; while (lon > +GMT_180) lon -= 360.0;}
+
+/* Some shorthand notation for GMT specific cases */
+
+#define GMT_latg_to_latc(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_G2C])
+#define GMT_latg_to_lata(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_G2A])
+#define GMT_latc_to_latg(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_C2G])
+#define GMT_lata_to_latg(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_A2G])
+
+/* Macros returns true if the two coordinates are lon/lat; way should be GMT_IN or GMT_OUT */
+#define GMT_x_is_lon(C,way) (C->current.io.col_type[way][GMT_X] == GMT_IS_LON)
+#define GMT_y_is_lat(C,way) (C->current.io.col_type[way][GMT_Y] == GMT_IS_LAT)
+#define GMT_is_geographic(C,way) (GMT_x_is_lon(C,way) && GMT_y_is_lat(C,way))
+#define GMT_axis_is_geo(C,axis) (C->current.io.col_type[GMT_IN][axis] & GMT_IS_GEO)
+
+#define GMT_N_PROJECTIONS	29	/* Total number of projections in GMT */
+
+/* These numbers should remain flexible. Do not use them in any programming. Use only their symbolic names.
+   However, all the first items in each section (i.e. GMT_LINEAR, GMT_MERCATOR,...) should remain the first.
+*/
+#define GMT_NO_PROJ		-1	/* Projection not specified (initial value) */
+
+/* Linear projections tagged 0-99 */
+#define GMT_IS_LINEAR(C) (C->current.proj.projection / 100 == 0)
+enum GMT_enum_annot {GMT_LINEAR = 0,
+	GMT_LOG10,	/* These numbers are only used for GMT->current.proj.xyz_projection[3], */
+	GMT_POW,	/* while GMT->current.proj.projection = 0 */
+	GMT_TIME,
+	GMT_ANNOT_CPT,
+	GMT_CUSTOM};
+
+#define GMT_ZAXIS		50
+
+/* Cylindrical projections tagged 100-199 */
+#define GMT_IS_CYLINDRICAL(C) (C->current.proj.projection / 100 == 1)
+enum GMT_enum_cyl {GMT_MERCATOR = 100,
+	GMT_CYL_EQ,
+	GMT_CYL_EQDIST,
+	GMT_CYL_STEREO,
+	GMT_MILLER,
+	GMT_TM,
+	GMT_UTM,
+	GMT_CASSINI,
+	GMT_OBLIQUE_MERC = 150,
+	GMT_OBLIQUE_MERC_POLE};
+
+/* Conic projections tagged 200-299 */
+#define GMT_IS_CONICAL(C) (C->current.proj.projection / 100 == 2)
+enum GMT_enum_conic {GMT_ALBERS = 200,
+	GMT_ECONIC,
+	GMT_POLYCONIC,
+	GMT_LAMBERT = 250};
+
+/* Azimuthal projections tagged 300-399 */
+#define GMT_IS_AZIMUTHAL(C) (C->current.proj.projection / 100 == 3)
+#define GMT_IS_PERSPECTIVE(C) (C->current.proj.projection == GMT_ORTHO || C->current.proj.projection == GMT_GENPER)
+enum GMT_enum_azim {GMT_STEREO = 300,
+	GMT_LAMB_AZ_EQ,
+	GMT_ORTHO,
+	GMT_AZ_EQDIST,
+	GMT_GNOMONIC,
+	GMT_GENPER,
+	GMT_POLAR = 350};
+
+/* Misc projections tagged 400-499 */
+#define GMT_IS_MISC(C) (C->current.proj.projection / 100 == 4)
+enum GMT_enum_misc {GMT_MOLLWEIDE = 400,
+	GMT_HAMMER,
+	GMT_SINUSOIDAL,
+	GMT_VANGRINTEN,
+	GMT_ROBINSON,
+	GMT_ECKERT4,
+	GMT_ECKERT6,
+	GMT_WINKEL};
+
+/* The various GMT measurement units */
+enum GMT_enum_units {GMT_IS_METER = 0,
+	GMT_IS_KM,
+	GMT_IS_MILE,
+	GMT_IS_NAUTICAL_MILE,
+	GMT_IS_INCH,
+	GMT_IS_CM,
+	GMT_IS_PT,
+	GMT_IS_FOOT,
+	GMT_IS_SURVEY_FOOT,
+	GMT_N_UNITS,
+	GMT_IS_NOUNIT = -1};
+
+/* GMT_IS_RECT_GRATICULE means parallels and meridians are orthogonal, but does not imply linear spacing */
+#define GMT_IS_RECT_GRATICULE(C) (C->current.proj.projection <= GMT_MILLER)
+
+/* GMT_IS_NONLINEAR_GRATICULE means parallels and meridians are not orthogonal or have nonlinear spacing */
+#define GMT_IS_NONLINEAR_GRATICULE(C)	(!(C->current.proj.projection == GMT_CYL_EQDIST || C->current.proj.projection == GMT_LINEAR) || \
+	C->current.proj.xyz_projection[GMT_X] == GMT_LOG10 || C->current.proj.xyz_projection[GMT_X] == GMT_POW || \
+	C->current.proj.xyz_projection[GMT_Y] == GMT_LOG10 || C->current.proj.xyz_projection[GMT_Y] == GMT_POW)
+
+#define GMT_POLE_IS_POINT(C) (C->current.proj.projection >= GMT_LAMBERT && C->current.proj.projection <= GMT_VANGRINTEN)
+
+#define GMT_IS_SPHERICAL(C) (C->current.setting.ref_ellipsoid[C->current.setting.proj_ellipsoid].flattening < 1.0e-10)
+#define GMT_IS_FLATEARTH(C) (!strcmp (C->current.setting.ref_ellipsoid[C->current.setting.proj_ellipsoid].name, "FlatEarth"))
+
+#define GMT_is_grdmapproject(C) (!strncmp (C->init.module_name, "grdproject", 10U) || !strncmp (C->init.module_name, "mapproject", 10U))
+
+/* Return 0 for Flat Earth, 1 for Great-circles, 2 for geodesics, and 3 for loxodromes */
+#define GMT_sph_mode(C) (GMT_IS_FLATEARTH (C) ? GMT_FLATEARTH : (GMT_IS_SPHERICAL (C) ? GMT_GREATCIRCLE : (C->current.map.loxodrome ? GMT_LOXODROME : GMT_GEODESIC)))
+
+#define GMT_360_RANGE(w,e) (doubleAlmostEqual (fabs((e) - (w)), 360.0))
+#define GMT_180_RANGE(s,n) (doubleAlmostEqual (fabs((n) - (s)), 180.0))
+#define GMT_IS_POLE(y) (doubleAlmostEqual (fabs(y), 90.0))
+#define GMT_IS_ZERO(x) (fabs (x) < GMT_CONV8_LIMIT)
+
+#ifndef D2R
+#define D2R (M_PI / 180.0)
+#endif
+#ifndef R2D
+#define R2D (180.0 / M_PI)
+#endif
+
+/* UTM offsets */
+
+#define GMT_FALSE_EASTING    500000.0
+#define GMT_FALSE_NORTHING 10000000.0
+
+/* Number of proj4 look-ups */
+
+#define GMT_N_PROJ4 31
+
+/* Number of nodes in Robinson interpolation */
+
+#define GMT_N_ROBINSON	19
+
+struct GMT_LATSWAP_CONSTS {
+	double  c[GMT_LATSWAP_N][4];	/* Coefficients in 4-term series  */
+	double	ra;			/* Authalic   radius (sphere for equal-area)  */
+	double	rm;			/* Meridional radius (sphere for N-S distance)  */
+	bool spherical;		/* True if no conversions need to be done.  */
+};
+
+struct GMT_THREE_D {
+	double view_azimuth, view_elevation;
+	double cos_az, sin_az, cos_el, sin_el;
+	double corner_x[4], corner_y[4];
+	double xmin, xmax, ymin, ymax;
+	double world_x, world_y, world_z;	/* Users coordinates of fixed point */
+	double view_x, view_y;			/* Desired projected 2-D coordinates of fixed point */
+	double x_off, y_off;			/* Offsets to the final projected coordinates */
+	double sign[4];		/* Used to determine direction of tickmarks etc */
+	double level;		/* Indicates the last level of the perspective plane (if any) */
+	unsigned int view_plane;	/* Determines on which plane needs to be projected */
+	int plane;		/* Indicates which last plane was plotted in perspective (-1 = none) */
+	unsigned int quadrant;	/* quadrant we're looking from */
+	unsigned int z_axis;	/* Which z-axis to draw. */
+	unsigned int face[3];	/* Tells if this facet has normal in pos direction */
+	bool draw[4];	/* axes to draw */
+	bool fixed;		/* true if we want a given point to be fixed in the projection [for animations] */
+	bool world_given;	/* true if a fixed world point was given in -E ..+glon/lat/z */
+	bool view_given;	/* true if a fixed projected point was given in -E ..+cx0/y0 */
+};
+
+struct GMT_DATUM {	/* Main parameter for a particular datum */
+	double a, b, f, e_squared, ep_squared;
+	double xyz[3];
+	int ellipsoid_id;	/* Ellipsoid GMT ID number (or -1) */
+};
+
+struct GMT_DATUM_CONV {
+	bool h_given;	/* true if we have incoming height data [h = 0] */
+	double da;		/* Major semi-axis in meters */
+	double df;		/* Flattening */
+	double e_squared;	/* Eccentricity squared (e^2 = 2*f - f*f) */
+	double one_minus_f;	/* 1 - f */
+	double dxyz[3];		/* Ellipsoids offset in meter from Earth's center of mass for x,y, and z */
+	struct GMT_DATUM from, to;	/* The old and new datums */
+};
+
+struct GMT_PROJ4 {	/* Used to assign proj4 projections from GMT projections */
+	char *name;
+	unsigned int id;
+};
+
+struct GMT_PROJ {
+
+	struct GMT_THREE_D z_project;
+	struct GMT_DATUM_CONV datum;	/* For datum conversions */
+	struct GMT_PROJ4 *proj4;	/* A read-only resource we allocate once and pass pointer around */
+	void (*fwd) (struct GMT_CTRL *, double, double, double *, double *);/* Pointers to the selected forward mapping function */
+	void (*inv) (struct GMT_CTRL *, double *, double *, double, double);/* Pointers to the selected inverse mapping function */
+	void (*fwd_x) (struct GMT_CTRL *, double, double *);	/* Pointers to the selected linear x forward function */
+	void (*fwd_y) (struct GMT_CTRL *, double, double *);	/* Pointers to the selected linear y forward function */
+	void (*fwd_z) (struct GMT_CTRL *, double, double *);	/* Pointers to the selected linear z forward function */
+	void (*inv_x) (struct GMT_CTRL *, double *, double);	/* Pointers to the selected linear x inverse function */
+	void (*inv_y) (struct GMT_CTRL *, double *, double);	/* Pointers to the selected linear y inverse function */
+	void (*inv_z) (struct GMT_CTRL *, double *, double);	/* Pointers to the selected linear z inverse function */
+
+	double pars[10];		/* Raw unprocessed map-projection parameters as passed on command line */
+	double z_pars[2];		/* Raw unprocessed z-projection parameters as passed on command line */
+
+	/* Common projection parameters */
+
+	int projection;		/* Gives the id number for the projection used (-1 if not set) */
+
+	bool units_pr_degree;	/* true if scale is given as inch (or cm)/degree.  false for 1:xxxxx */
+	bool north_pole;		/* true if projection is on northern hemisphere, false on southern */
+	bool edge[4];		/* true if the edge is a map boundary */
+	bool three_D;		/* Parameters for 3-D projections */
+	bool JZ_set;		/* true if -Jz|Z was set */
+	bool GMT_convert_latitudes;	/* true if using spherical code with authalic/conformal latitudes */
+	bool inv_coordinates;	/* true if -fp[unit] was given and we must first recover lon,lat during reading */
+	unsigned int n_antipoles;	/* Number of antipole coordinates so far [used for -JE only] */
+	struct GMT_LATSWAP_CONSTS GMT_lat_swap_vals;
+
+	enum GMT_enum_units inv_coord_unit;		/* Index to scale that converts input map coordinates to meter before inverting for lon,lat */
+	char unit_name[GMT_N_UNITS][GMT_LEN16];	/* Names of the various distance units */
+	double m_per_unit[GMT_N_UNITS];	/* Meters in various units.  Use to scale units to meters */
+	double origin[3];		/* Projected values of the logical origin for the projection (x, y, z) */
+	double rect[4], zmin, zmax;	/* Extreme projected values */
+	double rect_m[4];		/* Extreme projected original meter values */
+	double scale[3];		/* Scaling for meters to map-distance (typically inch) conversion (x, y, z) */
+	double i_scale[3];		/* Inverse Scaling for meters to map-distance (typically inch) conversion (x, y, z) */
+	double z_level;			/* Level at which to draw basemap [0] */
+	double unit;			/* Gives meters pr plot unit (0.01 or 0.0254) */
+	double central_meridian;	/* Central meridian for projection [NaN] */
+	double lon0, lat0;		/* Projection center [NaN/NaN if not specified in -J] */
+	double pole;			/* +90 pr -90, depending on which pole */
+	double mean_radius;		/* Mean radius given the PROJ_* settings */
+	double EQ_RAD, i_EQ_RAD;	/* Current ellipsoid parameters */
+	double ECC, ECC2, ECC4, ECC6;	/* Powers of eccentricity */
+	double M_PR_DEG, KM_PR_DEG;	/* Current spherical approximations to convert degrees to dist */
+	double DIST_M_PR_DEG;		/* Current spherical approximations to convert degrees to m even if -J was not set */
+	double DIST_KM_PR_DEG;		/* Current spherical approximations to convert degrees to km even if -J was not set */
+	double half_ECC, i_half_ECC;	/* 0.5 * ECC and 0.5 / ECC */
+	double one_m_ECC2, i_one_m_ECC2; /* 1.0 - ECC2 and inverse */
+	unsigned int gave_map_width;	/* nonzero if map width (1), height (2), max dim (3) or min dim (4) is given instead of scale.  0 for 1:xxxxx */
+
+	uint64_t n_geodesic_calls;	/* Number of calls for geodesics in this session */
+	uint64_t n_geodesic_approx;	/* Number of calls for geodesics in this session that exceeded iteration limit */
+
+	double f_horizon, rho_max;	/* Azimuthal horizon (deg) and in plot coordinates */
+
+	/* Linear plot parameters */
+
+	unsigned int xyz_projection[3];	/* For linear projection, 0 = linear, 1 = log10, 2 = pow */
+	bool xyz_pos[3];		/* true if x,y,z-axis increases in normal positive direction */
+	bool compute_scale[3];	/* true if axes lengths were set rather than scales */
+	double xyz_pow[3];		/* For GMT_POW projection */
+	double xyz_ipow[3];
+
+	/* Center of radii for all conic projections */
+
+	double c_x0, c_y0;
+
+	/* Lambert conformal conic parameters. */
+
+	double l_N, l_i_N, l_Nr, l_i_Nr;
+	double l_F, l_rF, l_i_rF;
+	double l_rho0;
+
+	/* Oblique Mercator Projection (Spherical version )*/
+
+	double o_sin_pole_lat, o_cos_pole_lat;	/* Pole of rotation */
+	double o_pole_lon, o_pole_lat;	/* In degrees */
+	double o_beta;			/* lon' = beta for central_meridian (degrees) */
+	double o_FP[3], o_FC[3], o_IP[3], o_IC[3];
+
+	/* TM and UTM Projections */
+
+	double t_lat0;
+	double t_e2, t_M0;
+	double t_c1, t_c2, t_c3, t_c4;
+	double t_i1, t_i2, t_i3, t_i4, t_i5;
+	double t_r, t_ir;		/* Short for GMT->current.proj.EQ_RAD * GMT->current.setting.proj_scale_factor and its inverse */
+	int utm_hemisphere;	/* -1 for S, +1 for N, 0 if to be set by -R */
+	unsigned int utm_zonex;	/* The longitude component 1-60 */
+	char utm_zoney;			/* The latitude component A-Z */
+
+	/* Lambert Azimuthal Equal-Area Projection */
+
+	double sinp;
+	double cosp;
+	double Dx, Dy, iDx, iDy;	/* Fudge factors for projections w/authalic lats */
+
+	/* Stereographic Projection */
+
+	double s_c, s_ic;
+	double r;		/* Radius of projected sphere in plot units (inch or cm) */
+	bool polar;		/* True if projection pole coincides with S or N pole */
+
+	/* Mollweide, Hammer-Aitoff and Winkel Projection */
+
+	double w_x, w_y, w_iy, w_r;
+
+	/* Winkel Tripel Projection */
+
+	double r_cosphi1;	/* = cos (50.467) */
+
+	/* Robinson Projection */
+
+	double n_cx, n_cy;	/* = = 0.8487R, 1.3523R */
+	double n_i_cy;
+	double n_phi[GMT_N_ROBINSON], n_X[GMT_N_ROBINSON], n_Y[GMT_N_ROBINSON];
+	double n_x_coeff[3*GMT_N_ROBINSON], n_y_coeff[3*GMT_N_ROBINSON], n_iy_coeff[3*GMT_N_ROBINSON];
+
+	/* Eckert IV Projection */
+
+	double k4_x, k4_y, k4_ix, k4_iy;
+
+	/* Eckert VI Projection */
+
+	double k6_r, k6_ir;
+
+	/* Cassini Projection */
+
+	double c_M0, c_c1, c_c2, c_c3, c_c4;
+	double c_i1, c_i2, c_i3, c_i4, c_i5, c_p;
+
+	/* All Cylindrical Projections */
+
+	double j_x, j_y, j_ix, j_iy;
+
+	/* Albers Equal-area conic parameters. */
+
+	double a_n, a_i_n;
+	double a_C, a_n2ir2, a_test, a_Cin;
+	double a_rho0;
+
+	/* Equidistant conic parameters. */
+
+	double d_n, d_i_n;
+	double d_G, d_rho0;
+
+	/* Van der Grinten parameters. */
+
+	double v_r, v_ir;
+
+        /* General Perspective parameters */
+        double g_H, g_R;
+        double g_P, g_P_inverse;
+        double g_lon0;
+        double g_sphi1, g_cphi1;
+        double g_phig, g_sphig, g_cphig;
+        double g_sdphi, g_cdphi;
+        double g_B, g_D, g_L, g_G, g_J;
+        double g_BLH, g_DG, g_BJ, g_DHJ, g_LH2, g_HJ;
+        double g_sin_tilt, g_cos_tilt;
+        double g_azimuth, g_sin_azimuth, g_cos_azimuth;
+        double g_sin_twist, g_cos_twist;
+        double g_width;
+        double g_yoffset;
+        double g_rmax;
+        double g_max_yt;
+        double g_xmin, g_xmax;
+        double g_ymin, g_ymax;
+
+        unsigned int g_debug;
+        int g_box, g_outside, g_longlat_set, g_sphere, g_radius, g_auto_twist;
+	bool windowed;
+	
+	/* Polar (cylindrical) projection */
+
+	double p_base_angle;
+	bool got_azimuths, got_elevations, z_down;
+
+};
+
+enum GMT_enum_frame {GMT_IS_PLAIN = 0,	/* Plain baseframe */
+	GMT_IS_INSIDE	= 1,	/* Plain frame ticks/annotations on the inside of boundary */
+	GMT_IS_GRAPH	= 2,	/* Plain fram with arrow extensions on axes */
+	GMT_IS_FANCY	= 4,	/* Fancy baseframe */
+	GMT_IS_ROUNDED	= 12};	/* Fancy baseframe, rounded */
+
+/* Define the 6 axis items that each axis can have (some are mutually exclusive: only one ANNOT/INTV for upper and lower) */
+
+enum GMT_enum_tick {GMT_ANNOT_UPPER = 0,	/* Tick annotations closest to the axis */
+	GMT_ANNOT_LOWER,	/* Tick annotations farthest from the axis*/
+	GMT_TICK_UPPER,		/* Frame tick marks closest to the axis */
+	GMT_TICK_LOWER,		/* Frame tick marks closest to the axis */
+	GMT_GRID_UPPER,		/* Gridline spacing */
+	GMT_GRID_LOWER};	/* Gridline spacing */
+
+/* Some convenient macros for axis routines */
+
+#define GMT_uneven_interval(unit) ((unit == 'o' || unit == 'O' || unit == 'k' || unit == 'K' || unit == 'R' || unit == 'r' || unit == 'D' || unit == 'd') ? true : false)	/* true for uneven units */
+
+/* The array side in GMT_PLOT_FRAME follows the order south, east, north, west (CCW loop) + z.
+ * Ro avoid using confusing indices 0-4 we define very brief constants S_SIDE, E_SIDE, N_SIDE
+ * W_SIDE and Z_SIDE that should be used instead. */
+
+#ifndef S_SIDE
+#define S_SIDE 0
+#endif
+#ifndef E_SIDE
+#define E_SIDE 1
+#endif
+#ifndef N_SIDE
+#define N_SIDE 2
+#endif
+#ifndef W_SIDE
+#define W_SIDE 3
+#endif
+#ifndef Z_SIDE
+#define Z_SIDE 4
+#endif
+
+struct GMT_PLOT_AXIS_ITEM {		/* Information for one type of tick/annotation */
+	double interval;		/* Distance between ticks in user units */
+	unsigned int parent;		/* Id of axis this item belongs to (0,1,2) */
+	bool active;			/* true if we want to use this item */
+	bool generated;			/* true if this is an auto-generated interval */
+	bool special;			/* true if custom interval annotations */
+	unsigned int flavor;		/* Index into month/day name abbreviation array (0-2) */
+	bool upper_case;		/* true if we want upper case text (used with flavor) */
+	char type;			/* One of a, A, i, I, f, F, g, G */
+	char unit;			/* User's interval unit (y, M, u, d, h, m, c) */
+};
+
+struct GMT_PLOT_AXIS {		/* Information for one time axis */
+	unsigned int id;		/* 0 (x), 1(y), or 2(z) */
+	unsigned int type;		/* GMT_LINEAR, GMT_LOG10, GMT_POW, GMT_TIME */
+	unsigned int special;		/* 0, GMT_CUSTOM, GMT_CPT */
+	struct GMT_PLOT_AXIS_ITEM item[6];	/* see above defines for which is which */
+	double phase;			/* Phase offset for strides: (knot-phase)%interval = 0  */
+	char label[GMT_LEN256];	/* Label of the axis */
+	char unit[GMT_LEN64];	/* Axis unit appended to annotations */
+	char prefix[GMT_LEN64];	/* Axis prefix starting all annotations */
+	char *file_custom;		/* File with custom annotations */
+};
+
+struct GMT_PLOT_FRAME {		/* Various parameters for plotting of time axis boundaries */
+	struct GMT_PLOT_AXIS axis[3];	/* One each for x, y, and z */
+	char header[GMT_LEN256];	/* Plot title */
+	struct GMT_FILL fill;		/* Fill for the basemap inside, if paint == true */
+	bool plotted_header;		/* true if header has been plotted */
+	bool init;			/* true if -B was used at all */
+	bool set;			/* true if -B was used to set any increments */
+	bool draw;			/* true if -B<int> was used, even -B0, as sign to draw axes */
+	bool paint;			/* true if -B +g<fill> was used */
+	bool draw_box;			/* true is a 3-D Z-box is desired */
+	bool check_side;		/* true if lon and lat annotations should be on x and y axis only */
+	bool primary;			/* true if current axis is primary, false if secondary */
+	bool slash;			/* true if slashes were used in the -B argument */
+	bool obl_grid;			/* true if +o was given to draw oblique gridlines */
+	unsigned int set_frame[2];	/* 1 if a -B<WESNframe> setting was given */
+	unsigned int horizontal;	/* 1 is S/N annotations should be parallel to axes, 2 if forced */
+	unsigned int side[5];		/* Which sides (0-3 in plane; 4 = z) to plot. 2 is annot/draw, 1 is draw, 0 is not */
+	unsigned int z_axis[4];		/* Which axes to use for the 3-D z-axis [auto] */
+};
+
+#endif /* _GMT_PROJECT_H */
diff --git a/src/gmt/gmt_prototypes.h b/src/gmt/gmt_prototypes.h
new file mode 100644
index 0000000..d8a6878
--- /dev/null
+++ b/src/gmt/gmt_prototypes.h
@@ -0,0 +1,448 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_prototypes.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/* gmt_prototypes.h  --  All low-level GMT API function prototypes.
+
+   Authors:	P. Wessel, W. H. F. Smith, R. Scharroo, and J. Luis
+   Date:	1-OCT-2009
+   Version:	5 API
+
+*/
+
+#ifndef _GMT_PROTOTYPES_H
+#define _GMT_PROTOTYPES_H
+
+#ifdef DEBUG
+EXTERN_MSC void grd_dump (struct GMT_GRID_HEADER *header, float *grid, bool is_complex, char *txt);
+#endif
+
+/* Temporary redef of strdup to allow check of memory leaks due to usage of strdup */
+#ifdef FISH_STRDUP_LEAKS
+EXTERN_MSC char *GMT_strdup (struct GMT_CTRL *GMT, const char *s);
+#endif
+
+/* gmt_bcr.c: */
+EXTERN_MSC double GMT_get_bcr_z (struct GMT_CTRL *GMT, struct GMT_GRID *G, double xx, double yy);		/* Compute z(x,y) from bcr structure and grid */
+EXTERN_MSC int GMT_get_bcr_img (struct GMT_CTRL *GMT, struct GMT_IMAGE *G, double xx, double yy, unsigned char *z);		/* Compute z(x,y) from bcr structure and image */
+
+/* gmt_customio.c: */
+
+#ifdef HAVE_GDAL
+/* Format # 22 */
+EXTERN_MSC int GMT_gdalread (struct GMT_CTRL *GMT, char *gdal_filename, struct GDALREAD_CTRL *prhs, struct GD_CTRL *Ctrl);
+EXTERN_MSC int GMT_gdalwrite (struct GMT_CTRL *GMT, char *filename, struct GDALWRITE_CTRL *prhs);
+#endif
+
+/* gmt_fft.c: */
+
+EXTERN_MSC void GMT_fft_initialization (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_fft_cleanup (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_fft_set_k (struct GMT_CTRL *GMT, unsigned int mode, struct GMT_FFT_WAVENUMBER *K);
+EXTERN_MSC int GMT_fft_set_wave (struct GMT_CTRL *GMT, unsigned int mode, struct GMT_FFT_WAVENUMBER *K);
+EXTERN_MSC double GMT_fft_get_wave (uint64_t k, struct GMT_FFT_WAVENUMBER *K);
+EXTERN_MSC double GMT_fft_any_wave (uint64_t k, unsigned int mode, struct GMT_FFT_WAVENUMBER *K);
+EXTERN_MSC void GMT_suggest_fft_dim (struct GMT_CTRL *GMT, unsigned int nx, unsigned int ny, struct GMT_FFT_SUGGESTION *fft_sug, bool do_print);
+
+/* gmt_grdio.c: */
+
+EXTERN_MSC void GMT_grd_detrend (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, unsigned int mode, double *a);
+EXTERN_MSC void GMT_grd_minmax (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, double xyz[2][3]);
+EXTERN_MSC struct GMT_GRID * GMT_create_grid (struct GMT_CTRL *GMT);
+EXTERN_MSC struct GMT_GRID * GMT_duplicate_grid (struct GMT_CTRL *GMT, struct GMT_GRID *G, unsigned int mode);
+EXTERN_MSC struct GMT_GRID_HEADER * GMT_duplicate_gridheader (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
+EXTERN_MSC void GMT_grd_init (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, struct GMT_OPTION *options, bool update);
+EXTERN_MSC void GMT_decode_grd_h_info (struct GMT_CTRL *GMT, char *input, struct GMT_GRID_HEADER *h);
+EXTERN_MSC void GMT_free_grid (struct GMT_CTRL *GMT, struct GMT_GRID **G, bool free_grid);
+EXTERN_MSC void GMT_set_grdinc (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
+EXTERN_MSC void GMT_set_grddim (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
+EXTERN_MSC void GMT_grd_pad_on (struct GMT_CTRL *GMT, struct GMT_GRID *G, unsigned int *pad);
+EXTERN_MSC void GMT_grd_pad_off (struct GMT_CTRL *GMT, struct GMT_GRID *G);
+EXTERN_MSC void GMT_grd_pad_zero (struct GMT_CTRL *GMT, struct GMT_GRID *G);
+EXTERN_MSC void GMT_grd_zminmax (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, float *z);
+EXTERN_MSC int GMT_read_grd_info (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header);
+EXTERN_MSC int GMT_write_grd_info (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header);
+EXTERN_MSC int GMT_read_grd (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header, float *grid, double *wesn, unsigned int *pad, int complex_mode);
+EXTERN_MSC int GMT_write_grd (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header, float *grid, double *wesn, unsigned int *pad, int complex_mode);
+EXTERN_MSC int GMT_adjust_loose_wesn (struct GMT_CTRL *GMT, double wesn[], struct GMT_GRID_HEADER *header);
+EXTERN_MSC int GMT_grd_setregion (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, double *wesn, unsigned int interpolant);
+EXTERN_MSC int GMT_grd_RI_verify (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, unsigned int mode);
+EXTERN_MSC int GMT_read_img (struct GMT_CTRL *GMT, char *imgfile, struct GMT_GRID *G, double *wesn, double scale, unsigned int mode, double lat, bool init);
+EXTERN_MSC int GMT_conv_intext2dbl (struct GMT_CTRL *GMT, char *record, unsigned int ncols);
+EXTERN_MSC bool GMT_grd_pad_status (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, unsigned int *pad);
+EXTERN_MSC int GMT_set_outgrid (struct GMT_CTRL *GMT, char *file, struct GMT_GRID *G, struct GMT_GRID **Out);
+EXTERN_MSC int GMT_change_grdreg (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, unsigned int registration);
+EXTERN_MSC void GMT_grd_shift (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, double shift);
+EXTERN_MSC void GMT_grd_set_ij_inc (struct GMT_CTRL *GMT, unsigned int nx, int *ij_inc);
+EXTERN_MSC double * GMT_grd_coord (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, int dir);
+#ifdef HAVE_GDAL
+EXTERN_MSC int GMT_read_image (struct GMT_CTRL *GMT, char *file, struct GMT_IMAGE *I, double *wesn,
+			unsigned int *pad, unsigned int complex_mode);		/* Function to read true images via GDAL */
+int GMT_read_image_info (struct GMT_CTRL *GMT, char *file, struct GMT_IMAGE *I);
+#endif
+
+#ifdef _PSLIB_H
+/* gmt_plot.c prototypes only included if pslib has been included */
+
+EXTERN_MSC char * GMT_export2proj4 (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_textpath_init (struct GMT_CTRL *GMT, struct GMT_PEN *BP, double Brgb[]);
+EXTERN_MSC void GMT_draw_map_rose (struct GMT_CTRL *GMT, struct GMT_MAP_ROSE *mr);
+EXTERN_MSC int GMT_draw_map_scale (struct GMT_CTRL *GMT, struct GMT_MAP_SCALE *ms);
+EXTERN_MSC void GMT_draw_map_insert (struct GMT_CTRL *GMT, struct GMT_MAP_INSERT *B);
+EXTERN_MSC void GMT_geo_line (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n);
+EXTERN_MSC void GMT_geo_polygons (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
+EXTERN_MSC void GMT_geo_ellipse (struct GMT_CTRL *GMT, double lon, double lat, double major, double minor, double azimuth);
+EXTERN_MSC void GMT_geo_rectangle (struct GMT_CTRL *GMT, double lon, double lat, double width, double height, double azimuth);
+EXTERN_MSC unsigned int GMT_geo_vector (struct GMT_CTRL *GMT, double lon0, double lat0, double azimuth, double length, struct GMT_PEN *pen, struct GMT_SYMBOL *S);
+EXTERN_MSC void GMT_draw_front (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, struct GMT_FRONTLINE *f);
+EXTERN_MSC void GMT_map_basemap (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_map_clip_off (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_map_clip_on (struct GMT_CTRL *GMT, double rgb[], unsigned int flag);
+EXTERN_MSC void GMT_plot_line (struct GMT_CTRL *GMT, double *x, double *y, unsigned int *pen, uint64_t n);
+EXTERN_MSC void GMT_setpen (struct GMT_CTRL *GMT, struct GMT_PEN *pen);
+EXTERN_MSC void GMT_setfill (struct GMT_CTRL *GMT, struct GMT_FILL *fill, int outline);
+EXTERN_MSC void GMT_vertical_axis (struct GMT_CTRL *GMT, unsigned int mode);
+EXTERN_MSC void GMT_xy_axis (struct GMT_CTRL *GMT, double x0, double y0, double length, double val0, double val1, struct GMT_PLOT_AXIS *A, bool below, bool annotate);
+EXTERN_MSC int GMT_draw_custom_symbol (struct GMT_CTRL *GMT, double x0, double y0, double size[], struct GMT_CUSTOM_SYMBOL *symbol, struct GMT_PEN *pen, struct GMT_FILL *fill, unsigned int outline);
+EXTERN_MSC void GMT_contlabel_plot (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
+EXTERN_MSC void GMT_plane_perspective (struct GMT_CTRL *GMT, int plane, double level);
+EXTERN_MSC void GMT_plotcanvas (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_write_label_record (struct GMT_CTRL *GMT, FILE *fp, double x, double y, double angle, char *label, bool save_angle);
+EXTERN_MSC int GMT_contlabel_save_begin (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
+EXTERN_MSC int GMT_contlabel_save_end (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
+EXTERN_MSC unsigned int GMT_setfont (struct GMT_CTRL *GMT, struct GMT_FONT *F);
+EXTERN_MSC void GMT_plotend (struct GMT_CTRL *GMT);
+EXTERN_MSC struct PSL_CTRL * GMT_plotinit (struct GMT_CTRL *GMT, struct GMT_OPTION *options);
+#endif
+
+/* gmt_io.c: */
+
+EXTERN_MSC bool GMT_is_a_blank_line (char *line);	/* Checks if line is a blank line or comment */
+EXTERN_MSC void GMT_eliminate_lon_jumps (struct GMT_CTRL *GMT, double *lon, uint64_t n_rows);
+EXTERN_MSC void GMT_set_geographic (struct GMT_CTRL *GMT, unsigned int dir);
+EXTERN_MSC void GMT_set_cartesian (struct GMT_CTRL *GMT, unsigned int dir);
+EXTERN_MSC void GMT_set_xycolnames (struct GMT_CTRL *GMT, char *string);
+EXTERN_MSC p_to_io_func GMT_get_io_ptr (struct GMT_CTRL *GMT, int direction, enum GMT_swap_direction swap, char type);
+EXTERN_MSC bool GMT_is_ascii_record (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_set_segmentheader (struct GMT_CTRL *GMT, int direction, bool true_false);
+EXTERN_MSC void GMT_set_tableheader (struct GMT_CTRL *GMT, int direction, bool true_false);
+EXTERN_MSC void GMT_io_binary_header (struct GMT_CTRL *GMT, FILE *fp, unsigned int dir);
+EXTERN_MSC void * GMT_z_input (struct GMT_CTRL *GMT, FILE *fp, uint64_t *n, int *status);
+EXTERN_MSC int GMT_z_output (struct GMT_CTRL *GMT, FILE *fp, uint64_t n, double *data);
+EXTERN_MSC int GMT_get_io_type (struct GMT_CTRL *GMT, char type);
+EXTERN_MSC struct GMT_QUAD * GMT_quad_init (struct GMT_CTRL *GMT, uint64_t n_items);
+EXTERN_MSC void GMT_quad_reset (struct GMT_CTRL *GMT, struct GMT_QUAD *Q, uint64_t n_items);
+EXTERN_MSC void GMT_quad_add (struct GMT_CTRL *GMT, struct GMT_QUAD *Q, double x);
+EXTERN_MSC unsigned int GMT_quad_finalize (struct GMT_CTRL *GMT, struct GMT_QUAD *Q);
+EXTERN_MSC char * GMT_fgets (struct GMT_CTRL *GMT, char *str, int size, FILE *stream);
+EXTERN_MSC int GMT_fclose (struct GMT_CTRL *GMT, FILE *stream);
+EXTERN_MSC int GMT_access (struct GMT_CTRL *GMT, const char *filename, int mode);		/* access wrapper */
+EXTERN_MSC FILE * GMT_fopen (struct GMT_CTRL *GMT, const char *filename, const char *mode);
+EXTERN_MSC char * GMT_getdatapath (struct GMT_CTRL *GMT, const char *stem, char *path, int mode);	/* Look for data file */
+EXTERN_MSC char * GMT_getsharepath (struct GMT_CTRL *GMT, const char *subdir, const char *stem, const char *suffix, char *path, int mode);	/* Look for shared file */
+EXTERN_MSC void GMT_write_tableheader (struct GMT_CTRL *GMT, FILE *fp, char *txt);
+EXTERN_MSC void GMT_write_segmentheader (struct GMT_CTRL *GMT, FILE *fp, uint64_t n_cols);		/* Write segment header back out */
+EXTERN_MSC void GMT_write_textrecord (struct GMT_CTRL *GMT, FILE *fp, char *txt);
+EXTERN_MSC void GMT_ascii_format_col (struct GMT_CTRL *GMT, char *text, double x, unsigned int direction, uint64_t col);
+EXTERN_MSC void GMT_lon_range_adjust (unsigned int range, double *lon);		/* Adjust the longitude given the desired range */
+EXTERN_MSC void GMT_add_to_record (struct GMT_CTRL *GMT, char *record, double val, uint64_t col, unsigned int sep);
+EXTERN_MSC int GMT_scanf (struct GMT_CTRL *GMT, char *p, unsigned int expectation, double *val);	/* Convert strings to double, handling special formats [Data records only ] */
+EXTERN_MSC int GMT_scanf_arg (struct GMT_CTRL *GMT, char *p, unsigned int expectation, double *val);	/* Convert strings to double, handling special formats [ command line only ] */
+EXTERN_MSC int GMT_ascii_output_col (struct GMT_CTRL *GMT, FILE *fp, double x, uint64_t col);
+EXTERN_MSC bool GMT_not_numeric (struct GMT_CTRL *GMT, char *text);				/* Rules out _some_ text as possible numerics */
+EXTERN_MSC bool GMT_parse_segment_item (struct GMT_CTRL *GMT, char *in_string, char *pattern, char *out_string);
+EXTERN_MSC int GMT_set_cols (struct GMT_CTRL *GMT, unsigned int direction, uint64_t expected);
+EXTERN_MSC uint64_t GMT_get_cols (struct GMT_CTRL *GMT, unsigned int direction);
+EXTERN_MSC struct GMT_DATASET * GMT_create_dataset (struct GMT_CTRL *GMT, uint64_t n_tables, uint64_t n_segments, uint64_t n_rows, uint64_t n_columns, unsigned int geometry, bool alloc_only);
+EXTERN_MSC struct GMT_DATATABLE * GMT_create_table (struct GMT_CTRL *GMT, uint64_t n_segments, uint64_t n_rows, uint64_t n_columns, bool alloc_only);
+EXTERN_MSC void GMT_free_textset (struct GMT_CTRL *GMT, struct GMT_TEXTSET **data);
+EXTERN_MSC struct GMT_TEXTSET * GMT_duplicate_textset (struct GMT_CTRL *GMT, struct GMT_TEXTSET *Din, unsigned int mode);
+EXTERN_MSC void GMT_adjust_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET *D, uint64_t n_columns);
+EXTERN_MSC struct GMT_DATASET * GMT_alloc_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, uint64_t n_rows, uint64_t n_columns, unsigned int mode);
+EXTERN_MSC struct GMT_DATASET * GMT_duplicate_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, unsigned int mode, unsigned int *geometry);
+EXTERN_MSC struct GMT_DATATABLE * GMT_read_table (struct GMT_CTRL *GMT, void *source, unsigned int source_type, bool greenwich, unsigned int *geometry, bool use_GMT_io);
+EXTERN_MSC int GMT_write_dataset (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, struct GMT_DATASET *D, bool use_GMT_io, int table);
+EXTERN_MSC int GMT_write_table (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, struct GMT_DATATABLE *T, bool use_GMT_io, unsigned int io_mode);
+EXTERN_MSC int GMT_alloc_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, uint64_t n_rows, uint64_t n_columns, bool first);
+EXTERN_MSC void GMT_free_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT **segment, enum GMT_enum_alloc alloc_mode);
+EXTERN_MSC void GMT_free_table (struct GMT_CTRL *GMT, struct GMT_DATATABLE *table, enum GMT_enum_alloc alloc_mode);
+EXTERN_MSC void GMT_free_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET **data);
+EXTERN_MSC void GMT_free_palette (struct GMT_CTRL *GMT, struct GMT_PALETTE **P);
+#ifdef HAVE_GDAL
+EXTERN_MSC struct GMT_IMAGE * GMT_create_image (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_free_image (struct GMT_CTRL *GMT, struct GMT_IMAGE **I, bool free_image);
+#endif
+EXTERN_MSC struct GMT_MATRIX * GMT_create_matrix (struct GMT_CTRL *GMT, uint64_t n_layers);
+EXTERN_MSC void GMT_free_matrix (struct GMT_CTRL *GMT, struct GMT_MATRIX **M, bool free_matrix);
+EXTERN_MSC struct GMT_VECTOR * GMT_create_vector (struct GMT_CTRL *GMT, uint64_t n_columns);
+EXTERN_MSC void GMT_free_vector (struct GMT_CTRL *GMT, struct GMT_VECTOR **V, bool free_vector);
+EXTERN_MSC int GMT_load_aspatial_string (struct GMT_CTRL *GMT, struct GMT_OGR *G, uint64_t col, char out[GMT_BUFSIZ]);
+EXTERN_MSC double GMT_get_aspatial_value (struct GMT_CTRL *GMT, uint64_t col, struct GMT_DATASEGMENT *S);
+EXTERN_MSC void GMT_set_seg_minmax (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
+EXTERN_MSC void GMT_set_seg_polar (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
+EXTERN_MSC void GMT_skip_xy_duplicates (struct GMT_CTRL *GMT, bool mode);
+EXTERN_MSC void GMT_duplicate_ogr_seg (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S_to, struct GMT_DATASEGMENT *S_from);
+EXTERN_MSC struct GMT_DATASEGMENT * GMT_duplicate_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *Sin);
+EXTERN_MSC void GMT_write_ogr_header (FILE *fp, struct GMT_OGR *G);
+EXTERN_MSC int GMT_append_ogr_item (struct GMT_CTRL *GMT, char *name, unsigned int type, struct GMT_OGR *S);
+EXTERN_MSC char * GMT_trim_segheader (struct GMT_CTRL *GMT, char *line);
+EXTERN_MSC int GMT_alloc_univector (struct GMT_CTRL *GMT, union GMT_UNIVECTOR *u, unsigned int type, uint64_t n_rows);
+EXTERN_MSC bool gmt_byteswap_file (struct GMT_CTRL *GMT,
+		FILE *outfp, FILE *infp, const SwapWidth nbytes,
+		const uint64_t offset, const uint64_t length);
+EXTERN_MSC int GMT_parse_segment_header (struct GMT_CTRL *GMT, char *header, struct GMT_PALETTE *P, bool *use_fill, struct GMT_FILL *fill, struct GMT_FILL def_fill, bool *use_pen, struct GMT_PEN *pen, struct GMT_PEN def_pen, unsigned int def_outline, struct GMT_OGR_SEG *G);
+EXTERN_MSC int GMT_parse_z_io (struct GMT_CTRL *GMT, char *txt, struct GMT_PARSE_Z_IO *z);
+EXTERN_MSC int GMT_init_z_io (struct GMT_CTRL *GMT, char format[], bool repeat[], enum GMT_swap_direction swab, off_t skip, char type, struct GMT_Z_IO *r);
+EXTERN_MSC int GMT_set_z_io (struct GMT_CTRL *GMT, struct GMT_Z_IO *r, struct GMT_GRID *G);
+EXTERN_MSC void GMT_check_z_io (struct GMT_CTRL *GMT, struct GMT_Z_IO *r, struct GMT_GRID *G);
+EXTERN_MSC void GMT_init_io_columns (struct GMT_CTRL *GMT, unsigned int dir);
+EXTERN_MSC void GMT_write_newheaders (struct GMT_CTRL *GMT, FILE *fp, uint64_t n_columns);
+EXTERN_MSC char **GMT_get_dir_list (struct GMT_CTRL *GMT, char *path, char *ext);
+EXTERN_MSC void GMT_free_dir_list (struct GMT_CTRL *GMT, char ***list);
+EXTERN_MSC void GMT_assign_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, uint64_t n_rows, uint64_t n_columns);
+EXTERN_MSC double *GMT_assign_vector (struct GMT_CTRL *GMT, uint64_t n_rows, uint64_t col);
+EXTERN_MSC bool GMT_input_is_bin (struct GMT_CTRL *GMT, const char *filename);
+
+/* gmt_memory.c: */
+
+EXTERN_MSC void GMT_prep_tmp_arrays (struct GMT_CTRL *GMT, size_t row, size_t n_cols);
+EXTERN_MSC void GMT_free_tmp_arrays (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_set_meminc (struct GMT_CTRL *GMT, size_t increment);
+EXTERN_MSC void GMT_reset_meminc (struct GMT_CTRL *GMT);
+EXTERN_MSC void * GMT_memory_func (struct GMT_CTRL *GMT, void *prev_addr, size_t nelem, size_t size, bool align, const char *where);
+EXTERN_MSC void GMT_free_func (struct GMT_CTRL *GMT, void *addr, bool align, const char *where);
+
+/* gmt_support.c: */
+
+EXTERN_MSC void GMT_flip_angle_d (struct GMT_CTRL *GMT, double *angle);
+EXTERN_MSC void GMT_flip_angle_f (struct GMT_CTRL *GMT, float *angle);
+EXTERN_MSC struct GMT_DATATABLE *GMT_make_profile (struct GMT_CTRL *GMT, char option, char *args, bool resample, bool project, bool get_distances, double step, enum GMT_enum_track mode, double xyz[2][3]);
+EXTERN_MSC unsigned int GMT_split_line_at_dateline (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, struct GMT_DATASEGMENT ***Lout);
+EXTERN_MSC unsigned int GMT_split_poly_at_dateline (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, struct GMT_DATASEGMENT ***Lout);
+EXTERN_MSC bool GMT_x_is_outside (struct GMT_CTRL *GMT, double *x, double left, double right);
+EXTERN_MSC void GMT_set_xy_domain (struct GMT_CTRL *GMT, double wesn_extended[], struct GMT_GRID_HEADER *h);
+EXTERN_MSC int GMT_BC_init (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
+EXTERN_MSC int GMT_grd_BC_set (struct GMT_CTRL *GMT, struct GMT_GRID *G, unsigned int direction);
+EXTERN_MSC void GMT_inplace_transpose (float *A, unsigned int n_rows, unsigned int n_cols);
+EXTERN_MSC struct GMT_PALETTE * GMT_truncate_cpt (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double z_low, double z_high);
+EXTERN_MSC void GMT_free_int_selection (struct GMT_CTRL *GMT, struct GMT_INT_SELECTION **S);
+EXTERN_MSC struct GMT_INT_SELECTION * GMT_set_int_selection (struct GMT_CTRL *GMT, char *item);
+EXTERN_MSC bool GMT_get_int_selection (struct GMT_CTRL *GMT, struct GMT_INT_SELECTION *S, uint64_t this);
+EXTERN_MSC void GMT_free_text_selection (struct GMT_CTRL *GMT, struct GMT_TEXT_SELECTION **S);
+EXTERN_MSC bool GMT_get_text_selection (struct GMT_CTRL *GMT, struct GMT_TEXT_SELECTION *S, struct GMT_DATASEGMENT *T, bool last_match);
+EXTERN_MSC struct GMT_TEXT_SELECTION * GMT_set_text_selection (struct GMT_CTRL *GMT, char *arg);
+
+#ifdef HAVE_GDAL
+EXTERN_MSC int GMT_image_BC_set (struct GMT_CTRL *GMT, struct GMT_IMAGE *I);
+#endif
+EXTERN_MSC bool GMT_y_out_of_bounds (struct GMT_CTRL *GMT, int *j, struct GMT_GRID_HEADER *h, bool *wrap_180);
+EXTERN_MSC bool GMT_x_out_of_bounds (struct GMT_CTRL *GMT, int *i, struct GMT_GRID_HEADER *h, bool wrap_180);
+EXTERN_MSC bool GMT_row_col_out_of_bounds (struct GMT_CTRL *GMT, double *in, struct GMT_GRID_HEADER *h, unsigned int *row, unsigned int *col);
+EXTERN_MSC int GMT_list_cpt (struct GMT_CTRL *GMT, char option);
+EXTERN_MSC struct GMT_PALETTE * GMT_sample_cpt (struct GMT_CTRL *GMT, struct GMT_PALETTE *Pin, double z[], int nz, bool continuous, bool reverse, bool log_mode, bool no_inter);
+EXTERN_MSC int GMT_write_cpt (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, unsigned int cpt_flags, struct GMT_PALETTE *P);
+EXTERN_MSC void GMT_cpt_transparency (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double transparency, unsigned int mode);
+EXTERN_MSC void GMT_copy_palette (struct GMT_CTRL *GMT, struct GMT_PALETTE *P_to, struct GMT_PALETTE *P_from);
+EXTERN_MSC int GMT_contlabel_info (struct GMT_CTRL *GMT, char flag, char *txt, struct GMT_CONTOUR *G);
+EXTERN_MSC void GMT_contlabel_init (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G, unsigned int mode);
+EXTERN_MSC int GMT_contlabel_specs (struct GMT_CTRL *GMT, char *txt, struct GMT_CONTOUR *G);
+EXTERN_MSC int GMT_contlabel_prep (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G, double xyz[2][3]);
+EXTERN_MSC void GMT_contlabel_free (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
+EXTERN_MSC void GMT_hold_contour (struct GMT_CTRL *GMT, double **xx, double **yy, uint64_t nn, double zval, char *label, char ctype, double cangle, bool closed, struct GMT_CONTOUR *G);
+EXTERN_MSC void GMT_x_free (struct GMT_CTRL *GMT, struct GMT_XOVER *X);
+EXTERN_MSC int GMT_init_track (struct GMT_CTRL *GMT, double y[], uint64_t n, struct GMT_XSEGMENT **S);
+EXTERN_MSC uint64_t GMT_crossover (struct GMT_CTRL *GMT, double xa[], double ya[], uint64_t sa[], struct GMT_XSEGMENT A[], uint64_t na, double xb[], double yb[], uint64_t sb[], struct GMT_XSEGMENT B[], uint64_t nb, bool internal, bool geo, struct GMT_XOVER *X);
+EXTERN_MSC void * GMT_malloc_func (struct GMT_CTRL *GMT, void *ptr, size_t n, size_t *n_alloc, size_t element_size, const char *where);
+EXTERN_MSC char * GMT_make_filename (struct GMT_CTRL *GMT, char *template, unsigned int fmt[], double z, bool closed, unsigned int count[]);
+EXTERN_MSC void GMT_str_setcase (struct GMT_CTRL *GMT, char *value, int mode);
+EXTERN_MSC char * GMT_putusername (struct GMT_CTRL *GMT);
+EXTERN_MSC unsigned int * GMT_prep_nodesearch (struct GMT_CTRL *GMT, struct GMT_GRID *G, double radius, unsigned int mode, unsigned int *d_row, unsigned int *actual_max_d_col);
+EXTERN_MSC int GMT_detrend (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double increment, double *intercept, double *slope, int mode);
+EXTERN_MSC struct GMT_PALETTE * GMT_Get_CPT (struct GMT_CTRL *GMT, char *file, enum GMT_enum_cpt mode, double zmin, double zmax);
+EXTERN_MSC unsigned int GMT_gcd_euclid (unsigned int a, unsigned int b);
+EXTERN_MSC unsigned int GMT_optimal_dim_for_surface (struct GMT_CTRL *GMT, unsigned int factors[], unsigned int nx, unsigned int ny, struct GMT_SURFACE_SUGGESTION **S);
+EXTERN_MSC int GMT_best_dim_choice (struct GMT_CTRL *GMT, unsigned int mode, unsigned int in_dim[], unsigned int out_dim[]);
+EXTERN_MSC void GMT_sprintf_float (char *string, char *format, double x);
+
+/* gmt_calclock.c: */
+
+EXTERN_MSC double GMT_rdc2dt (struct GMT_CTRL *GMT, int64_t rd, double secs);
+EXTERN_MSC void GMT_dt2rdc (struct GMT_CTRL *GMT, double t, int64_t *rd, double *s);
+EXTERN_MSC int64_t GMT_rd_from_gymd (struct GMT_CTRL *GMT, int gy, int gm, int gd);
+EXTERN_MSC void GMT_format_calendar (struct GMT_CTRL *GMT, char *date, char *clock, struct GMT_DATE_IO *D, struct GMT_CLOCK_IO *W, bool upper, unsigned int kind, double dt);
+EXTERN_MSC void GMT_gcal_from_rd (struct GMT_CTRL *GMT, int64_t rd, struct GMT_gcal *gcal);
+
+/* gmt_map.c: */
+
+EXTERN_MSC bool GMT_cart_outside (struct GMT_CTRL *GMT, double x, double y);
+EXTERN_MSC void GMT_auto_frame_interval (struct GMT_CTRL *GMT, unsigned int axis, unsigned int item);
+EXTERN_MSC double GMT_az_backaz (struct GMT_CTRL *GMT, double lonE, double latE, double lonS, double latS, bool baz);
+EXTERN_MSC double GMT_distance (struct GMT_CTRL *GMT, double lonS, double latS, double lonE, double latE);
+EXTERN_MSC double GMT_azim_to_angle (struct GMT_CTRL *GMT, double lon, double lat, double c, double azim);
+EXTERN_MSC uint64_t GMT_clip_to_map (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t np, double **x, double **y);
+EXTERN_MSC uint64_t GMT_compact_line (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, int pen_flag, int *pen);
+EXTERN_MSC uint64_t GMT_geo_to_xy_line (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n);
+EXTERN_MSC uint64_t GMT_graticule_path (struct GMT_CTRL *GMT, double **x, double **y, int dir, bool check, double w, double e, double s, double n);
+EXTERN_MSC int GMT_grd_project (struct GMT_CTRL *GMT, struct GMT_GRID *I, struct GMT_GRID *O, bool inverse);
+EXTERN_MSC int GMT_img_project (struct GMT_CTRL *GMT, struct GMT_IMAGE *I, struct GMT_IMAGE *O, bool inverse);
+EXTERN_MSC uint64_t GMT_map_clip_path (struct GMT_CTRL *GMT, double **x, double **y, bool *donut);
+EXTERN_MSC bool GMT_map_outside (struct GMT_CTRL *GMT, double lon, double lat);
+EXTERN_MSC bool GMT_geo_to_xy (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);
+EXTERN_MSC void GMT_geoz_to_xy (struct GMT_CTRL *GMT, double x, double y, double z, double *x_out, double *y_out);
+EXTERN_MSC int GMT_project_init (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, double *inc, unsigned int nx, unsigned int ny, unsigned int dpi, unsigned int offset);
+EXTERN_MSC int GMT_map_setup (struct GMT_CTRL *GMT, double wesn[]);
+EXTERN_MSC double GMT_x_to_xx (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_y_to_yy (struct GMT_CTRL *GMT, double y);
+EXTERN_MSC double GMT_z_to_zz (struct GMT_CTRL *GMT, double z);
+EXTERN_MSC void GMT_xy_to_geo (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);
+EXTERN_MSC void GMT_xyz_to_xy (struct GMT_CTRL *GMT, double x, double y, double z, double *x_out, double *y_out);
+EXTERN_MSC void GMT_xyz_to_xy_n (struct GMT_CTRL *GMT, double *x, double *y, double z, uint64_t n);
+EXTERN_MSC double * GMT_dist_array (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, bool cumulative);
+EXTERN_MSC double * GMT_dist_array_2 (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, double scale, int dist_flag);
+EXTERN_MSC uint64_t GMT_map_truncate (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, uint64_t start, int side);
+EXTERN_MSC unsigned int GMT_init_distaz (struct GMT_CTRL *GMT, char c, unsigned int mode, unsigned int type);
+EXTERN_MSC bool GMT_near_lines (struct GMT_CTRL *GMT, double lon, double lat, struct GMT_DATATABLE *T, unsigned int return_mindist, double *dist_min, double *x_near, double *y_near);
+EXTERN_MSC bool GMT_near_a_line (struct GMT_CTRL *GMT, double lon, double lat, uint64_t seg, struct GMT_DATASEGMENT *S, unsigned int return_mindist, double *dist_min, double *x_near, double *y_near);
+EXTERN_MSC bool GMT_near_a_point (struct GMT_CTRL *GMT, double x, double y, struct GMT_DATATABLE *T, double dist);
+EXTERN_MSC double GMT_great_circle_dist_meter (struct GMT_CTRL *GMT, double x0, double y0, double x1, double y1);
+EXTERN_MSC double GMT_lat_swap_quick (struct GMT_CTRL *GMT, double lat, double c[]);
+EXTERN_MSC double GMT_lat_swap (struct GMT_CTRL *GMT, double lat, unsigned int itype);
+EXTERN_MSC double GMT_mindist_to_point (struct GMT_CTRL *GMT, double lon, double lat, struct GMT_DATATABLE *T, uint64_t *id);
+EXTERN_MSC bool GMT_UTMzone_to_wesn (struct GMT_CTRL *GMT, unsigned int zone_x, char zone_y, int hemi, double wesn[]);
+EXTERN_MSC void GMT_ECEF_forward (struct GMT_CTRL *GMT, double in[], double out[]);
+EXTERN_MSC void GMT_ECEF_inverse (struct GMT_CTRL *GMT, double in[], double out[]);
+EXTERN_MSC void GMT_ECEF_init (struct GMT_CTRL *GMT, struct GMT_DATUM *D);
+EXTERN_MSC void GMT_datum_init (struct GMT_CTRL *GMT, struct GMT_DATUM *from, struct GMT_DATUM *to, bool heights);
+EXTERN_MSC int GMT_set_datum (struct GMT_CTRL *GMT, char *text, struct GMT_DATUM *D);
+EXTERN_MSC void GMT_conv_datum (struct GMT_CTRL *GMT, double in[], double out[]);
+EXTERN_MSC uint64_t GMT_wesn_clip (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n_orig, double **x, double **y, uint64_t *total_nx);
+EXTERN_MSC void GMT_set_spherical (struct GMT_CTRL *GMT, bool notify);
+
+/* gmt_shore.c: */
+
+EXTERN_MSC int GMT_set_levels (struct GMT_CTRL *GMT, char *info, struct GMT_SHORE_SELECT *I);
+EXTERN_MSC int GMT_get_shore_bin (struct GMT_CTRL *GMT, unsigned int b, struct GMT_SHORE *c);
+EXTERN_MSC int GMT_get_br_bin (struct GMT_CTRL *GMT, unsigned int b, struct GMT_BR *c, unsigned int *level, unsigned int n_levels);
+EXTERN_MSC void GMT_free_shore_polygons (struct GMT_CTRL *GMT, struct GMT_GSHHS_POL *p, unsigned int n);
+EXTERN_MSC void GMT_free_shore (struct GMT_CTRL *GMT, struct GMT_SHORE *c);
+EXTERN_MSC void GMT_free_br (struct GMT_CTRL *GMT, struct GMT_BR *c);
+EXTERN_MSC void GMT_shore_cleanup (struct GMT_CTRL *GMT, struct GMT_SHORE *c);
+EXTERN_MSC void GMT_br_cleanup (struct GMT_CTRL *GMT, struct GMT_BR *c);
+EXTERN_MSC int GMT_init_shore (struct GMT_CTRL *GMT, char res, struct GMT_SHORE *c, double wesn[], struct GMT_SHORE_SELECT *I);
+EXTERN_MSC int GMT_init_br (struct GMT_CTRL *GMT, char which, char res, struct GMT_BR *c, double wesn[]);
+EXTERN_MSC int GMT_assemble_shore (struct GMT_CTRL *GMT, struct GMT_SHORE *c, int dir, bool assemble, double west, double east, struct GMT_GSHHS_POL **pol);
+EXTERN_MSC int GMT_assemble_br (struct GMT_CTRL *GMT, struct GMT_BR *c, bool shift, double edge, struct GMT_GSHHS_POL **pol);
+EXTERN_MSC int GMT_prep_shore_polygons (struct GMT_CTRL *GMT, struct GMT_GSHHS_POL **p, unsigned int np, bool sample, double step, int anti_bin);
+EXTERN_MSC int GMT_set_resolution (struct GMT_CTRL *GMT, char *res, char opt);
+EXTERN_MSC char GMT_shore_adjust_res (struct GMT_CTRL *GMT, char res);
+
+/* gmt_vector.c: */
+
+EXTERN_MSC int GMT_chol_dcmp (struct GMT_CTRL *GMT, double *a, double *d, double *cond, int nr, int n);
+EXTERN_MSC void GMT_chol_recover (struct GMT_CTRL *GMT, double *a, double *d, int nr, int n, int nerr, bool donly);
+EXTERN_MSC void GMT_chol_solv (struct GMT_CTRL *GMT, double *a, double *x, double *y, int nr, int n);
+EXTERN_MSC void GMT_set_tbl_minmax (struct GMT_CTRL *GMT, struct GMT_DATATABLE *T);
+EXTERN_MSC void GMT_matrix_vect_mult (struct GMT_CTRL *GMT, unsigned int dim, double a[3][3], double b[3], double c[3]);
+EXTERN_MSC void GMT_make_rot_matrix (struct GMT_CTRL *GMT, double lonp, double latp, double w, double R[3][3]);
+EXTERN_MSC void GMT_make_rot_matrix2 (struct GMT_CTRL *GMT, double E[3], double w, double R[3][3]);
+
+/* gmt_support.c: */
+
+EXTERN_MSC void GMT_sort_array (struct GMT_CTRL *GMT, void *base, uint64_t n, unsigned int type);
+EXTERN_MSC bool GMT_polygon_is_open (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n);
+EXTERN_MSC double GMT_polygon_area (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n);
+EXTERN_MSC int GMT_polygon_centroid (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double *Cx, double *Cy);
+EXTERN_MSC int GMT_get_distance (struct GMT_CTRL *GMT, char *line, double *dist, char *unit);
+EXTERN_MSC uint64_t GMT_contours (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, unsigned int smooth_factor, unsigned int int_scheme, int orient, unsigned int *edge, bool *first, double **x, double **y);
+EXTERN_MSC int GMT_get_format (struct GMT_CTRL *GMT, double interval, char *unit, char *prefix, char *format);
+EXTERN_MSC int GMT_get_index (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double value);
+EXTERN_MSC int GMT_get_rgb_from_z (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double value, double *rgb);
+EXTERN_MSC int GMT_get_fill_from_z (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double value, struct GMT_FILL *fill);
+EXTERN_MSC bool GMT_getfill (struct GMT_CTRL *GMT, char *line, struct GMT_FILL *fill);
+EXTERN_MSC bool GMT_getinc (struct GMT_CTRL *GMT, char *line, double inc[]);
+EXTERN_MSC int GMT_getincn (struct GMT_CTRL *GMT, char *line, double inc[], unsigned int n);
+EXTERN_MSC int GMT_getfont (struct GMT_CTRL *GMT, char *line, struct GMT_FONT *F);
+EXTERN_MSC bool GMT_getpen (struct GMT_CTRL *GMT, char *line, struct GMT_PEN *pen);
+EXTERN_MSC void GMT_savepen (struct GMT_CTRL *GMT, struct GMT_PEN *pen);
+EXTERN_MSC bool GMT_getrgb (struct GMT_CTRL *GMT, char *line, double *rgb);
+EXTERN_MSC int GMT_getrose (struct GMT_CTRL *GMT, char option, char *text, struct GMT_MAP_ROSE *mr);
+EXTERN_MSC int GMT_getscale (struct GMT_CTRL *GMT, char option, char *text, struct GMT_MAP_SCALE *ms);
+EXTERN_MSC int GMT_getinsert (struct GMT_CTRL *GMT, char option, char *text, struct GMT_MAP_INSERT *B);
+EXTERN_MSC char * GMT_putfont (struct GMT_CTRL *GMT, struct GMT_FONT F);
+EXTERN_MSC char * GMT_putpen (struct GMT_CTRL *GMT, struct GMT_PEN pen);
+EXTERN_MSC unsigned int GMT_inonout (struct GMT_CTRL *GMT, double x, double y, const struct GMT_DATASEGMENT *S);
+EXTERN_MSC unsigned int GMT_inonout_sphpol (struct GMT_CTRL *GMT, double plon, double plat, const struct GMT_DATASEGMENT *P);
+EXTERN_MSC int GMT_intpol (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, uint64_t m, double *u, double *v, int mode);
+EXTERN_MSC int GMT_just_decode (struct GMT_CTRL *GMT, char *key, unsigned int def);
+EXTERN_MSC unsigned int GMT_minmaxinc_verify (struct GMT_CTRL *GMT, double min, double max, double inc, double slop);
+EXTERN_MSC unsigned int GMT_get_arc (struct GMT_CTRL *GMT, double x0, double y0, double r, double dir1, double dir2, double **x, double **y);
+EXTERN_MSC unsigned int GMT_non_zero_winding (struct GMT_CTRL *GMT, double xp, double yp, double *x, double *y, uint64_t n_path);
+EXTERN_MSC unsigned int GMT_getmodopt (struct GMT_CTRL *GMT, const char *string, const char *sep, unsigned int *pos, char *token);
+EXTERN_MSC unsigned int GMT_verify_expectations (struct GMT_CTRL *GMT, unsigned int wanted, unsigned int got, char *item);
+EXTERN_MSC void GMT_RI_prepare (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
+EXTERN_MSC struct GMT_DATASEGMENT * GMT_prepare_contour (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double z);
+EXTERN_MSC void GMT_get_plot_array (struct GMT_CTRL *GMT);
+EXTERN_MSC void GMT_illuminate (struct GMT_CTRL *GMT, double intensity, double *rgb);
+EXTERN_MSC void GMT_init_fill (struct GMT_CTRL *GMT, struct GMT_FILL *fill, double r, double g, double b);
+EXTERN_MSC void GMT_init_pen (struct GMT_CTRL *GMT, struct GMT_PEN *pen, double width);
+EXTERN_MSC int GMT_colorname2index (struct GMT_CTRL *GMT, char *name);
+EXTERN_MSC void GMT_list_custom_symbols (struct GMT_CTRL *GMT);
+EXTERN_MSC struct GMT_PALETTE * GMT_read_cpt (struct GMT_CTRL *GMT, void *source, unsigned int source_type, unsigned int cpt_flags);
+EXTERN_MSC void GMT_smart_justify (struct GMT_CTRL *GMT, int just, double angle, double dx, double dy, double *x_shift, double *y_shift, unsigned int mode);
+EXTERN_MSC struct GMT_DATASET * GMT_resample_data (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, double along_ds, unsigned int mode, unsigned int ex_cols, enum GMT_enum_track smode);
+EXTERN_MSC struct GMT_DATASET * GMT_crosstracks (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, double cross_length, double across_ds, uint64_t n_cols, bool alternate);
+EXTERN_MSC uint64_t GMT_resample_path (struct GMT_CTRL *GMT, double **x, double **y, uint64_t n_in, double step_out, enum GMT_enum_track mode);
+EXTERN_MSC bool GMT_crossing_dateline (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
+EXTERN_MSC int GMT_err_func (struct GMT_CTRL *GMT, int err, bool fail, char *file, const char *where);
+EXTERN_MSC int64_t GMT_delaunay (struct GMT_CTRL *GMT, double *x_in, double *y_in, uint64_t n, int **link);
+EXTERN_MSC void GMT_delaunay_free (struct GMT_CTRL *GMT, int **link);
+EXTERN_MSC unsigned int GMT_get_prime_factors (struct GMT_CTRL *GMT, uint64_t n, unsigned int *f);
+EXTERN_MSC int64_t GMT_voronoi (struct GMT_CTRL *GMT, double *x_in, double *y_in, uint64_t n, double *we, double **x_out, double **y_out);
+
+/* gmt_regexp.c */
+
+EXTERN_MSC int gmt_regexp_match (struct GMT_CTRL *GMT, const char *subject, const char *pattern, bool caseless);
+
+/* gmt_vector.c: */
+
+EXTERN_MSC void GMT_cart_to_geo (struct GMT_CTRL *GMT, double *lat, double *lon, double *a, bool degrees);
+EXTERN_MSC void GMT_geo_to_cart (struct GMT_CTRL *GMT, double lat, double lon, double *a, bool degrees);
+EXTERN_MSC void GMT_add3v (struct GMT_CTRL *GMT, double *a, double *b, double *c);
+EXTERN_MSC void GMT_sub3v (struct GMT_CTRL *GMT, double *a, double *b, double *c);
+EXTERN_MSC double GMT_dot3v (struct GMT_CTRL *GMT, double *a, double *b);
+EXTERN_MSC double GMT_dot2v (struct GMT_CTRL *GMT, double *a, double *b);
+EXTERN_MSC double GMT_mag3v (struct GMT_CTRL *GMT, double *a);
+EXTERN_MSC void GMT_cross3v (struct GMT_CTRL *GMT, double *a, double *b, double *c);
+EXTERN_MSC void GMT_normalize3v (struct GMT_CTRL *GMT, double *a);
+EXTERN_MSC void GMT_normalize2v (struct GMT_CTRL *GMT, double *a);
+EXTERN_MSC uint64_t GMT_fix_up_path (struct GMT_CTRL *GMT, double **a_lon, double **a_lat, uint64_t n, double step, unsigned int mode);
+EXTERN_MSC int GMT_jacobi (struct GMT_CTRL *GMT, double *a, unsigned int n, unsigned int m, double *d, double *v, double *b, double *z, unsigned int *nrots);
+EXTERN_MSC int GMT_gauss (struct GMT_CTRL *GMT, double *a, double *vec, unsigned int n, unsigned int nstore, bool itriag);
+EXTERN_MSC int GMT_gaussjordan (struct GMT_CTRL *GMT, double *a, unsigned int n, unsigned int ndim, double *b, unsigned int m, unsigned int mdim);
+EXTERN_MSC int GMT_svdcmp (struct GMT_CTRL *GMT, double *a, unsigned int m, unsigned int n, double *w, double *v);
+EXTERN_MSC int GMT_solve_svd (struct GMT_CTRL *GMT, double *u, unsigned int m, unsigned int n, double *v, double *w, double *b, unsigned int k, double *x, double *cutoff, unsigned int mode);
+EXTERN_MSC void GMT_polar_to_cart (struct GMT_CTRL *GMT, double r, double theta, double *a, bool degrees);
+EXTERN_MSC void GMT_cart_to_polar (struct GMT_CTRL *GMT, double *r, double *theta, double *a, bool degrees);
+
+/* From gmt_parse.c */
+/* This macro is called via each modules Return macro so API and options are set */
+#define GMT_Free_Options(mode) {if (mode >= 0 && GMT_Destroy_Options (API, &options) != GMT_OK) exit (EXIT_FAILURE);}
+
+/* From gmt_api.c */
+EXTERN_MSC struct GMTAPI_CTRL * GMT_get_API_ptr (struct GMTAPI_CTRL *ptr);
+EXTERN_MSC void GMT_show_name_and_purpose (void *API, const char *name, const char *component, const char *purpose);
+
+#endif /* _GMT_PROTOTYPES_H */
diff --git a/src/gmt/gmt_ps.h b/src/gmt/gmt_ps.h
new file mode 100644
index 0000000..32fd73c
--- /dev/null
+++ b/src/gmt/gmt_ps.h
@@ -0,0 +1,61 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_ps.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_ps.h contains definition of the structure with PostScript settings.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_PS_H
+#define _GMT_PS_H
+
+/*--------------------------------------------------------------------
+ *			GMT PS STRUCTURE DEFINITION
+ *--------------------------------------------------------------------*/
+
+/* Several parameters control the running of PSL.  Some are found among
+ * the GMT default settings (e.g., PS_PAGE_COLOR) and these values are
+ * parsed by the default machinery and stored in the corresponding
+ * GMT->setting.ps_* parameters, e.g., PS_PAGE_COLOR is parsed and stored
+ * as GMT->setting.ps_page_color.  All of these are used as arguments to
+ * PSL_beginsession, PSL_set_defaults, and PSL_beginplot which sets teh
+ * internal PSL variables.
+ * A few of these parameters can also be modified via the GMT command
+ * line options: -P -U -X -Y -c.  These options simply change the values as
+ * currently stored in the corresponding GMT_->setting.ps_*.  Note that
+ * -U has a default position and justification and thus controlled by the
+ * MAP_LOGO_* parameters GMT->setting.ps_map_logo_* while the actual label is
+ * kept in the structure below as given by -U.
+ * Finally, there are a few PSL variables that are not initialized via
+ * PSL_beginsession, PSL_set_defaults, or PSL_plotbegin, such as the
+ * transparency or line_cap settings.  These are all GMT default settings
+ * that are parsed directly into the PSL internal variables.
+ */
+
+struct GMT_PS {	/* PSL settings affected by GMT options -X -Y -U and clipping */
+	/* A structure pointer is passed to GMT_plotinit which calls ps_plotinit */
+	int nclip;				/* +1 if clipping will extend beyond current process, -1 if we terminate clipping */
+	int clip_level;		/* Sum total clip level, should be zero at end of command sequence */
+	int layer;		/* Layer number starting at 1 and incremented for each GMT layer added */
+	char map_logo_label[GMT_BUFSIZ];		/* Label added to GMT time stamp generated by -U */
+	char origin[2];				/* Defines the origin of the map offset ('r', 'a', 'c', or 'f') */
+};
+
+#endif  /* _GMT_PS_H */
diff --git a/src/gmt/gmt_resources.h b/src/gmt/gmt_resources.h
new file mode 100644
index 0000000..3126469
--- /dev/null
+++ b/src/gmt/gmt_resources.h
@@ -0,0 +1,678 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_resources.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_resources.h contains the definitions for the GMT 5 resources
+ * GMT_GRID, GMT_DATASET, GMT_TEXTSET, GMT_PALETTE, and GMT_IMAGE,
+ * the auxilliary resources GMT_VECTOR and GMT_MATRIX, as well as
+ * all named constants.
+ *
+ * Author:	Paul Wessel
+ * Date:	20-FEB-2013
+ * Version:	5 API
+ */
+
+#ifndef _GMT_RESOURCES_H
+#define _GMT_RESOURCES_H
+
+/*============================================================ */
+/*=============== Constants Public Declaration =============== */
+/*============================================================ */
+
+/* Here are structure definitions and constants (enums) needed by the
+ * public GMT API. Note: As this is C, some structures will contain
+ * members we do not disclose in the API documentation but of course
+ * the variables are accessible just like the "public" ones.
+ */
+
+/* These are the 5 methods for i/o; used as arguments in the API that expects a "method" */
+
+enum GMT_enum_method {
+	GMT_IS_FILE = 0,	/* Entity is a filename */
+	GMT_IS_STREAM,		/* Entity is an open stream */
+	GMT_IS_FDESC,		/* Entity is an open file descriptor */
+	GMT_IS_DUPLICATE,	/* Entity is a memory location that should be duplicated */
+	GMT_IS_REFERENCE};	/* Entity is a memory location and we just pass the ref (no copying) */
+
+/* A Grid can come from a GMT grid OR User Matrix, and Data can come from DATASET or via Vectors|Matrix, and Text from TEXTSET or Matrix */
+
+enum GMT_enum_via {
+	GMT_VIA_NONE = 0,	/* No via anything */
+	GMT_VIA_VECTOR = 100,	/* Data passed via user matrix */
+	GMT_VIA_MATRIX = 200,	/* Data passed via user vectors */
+	GMT_VIA_OUTPUT = 2048};	/* For GMT_Create_Data mode to set dir = output */
+
+/* These are the 5 families of data types, + a coordinate array + 2 help containers for vector and matrix */
+enum GMT_enum_family {
+	GMT_IS_DATASET = 0,	/* Entity is data table */
+	GMT_IS_TEXTSET,		/* Entity is a Text table */
+	GMT_IS_GRID,		/* Entity is a GMT grid */
+	GMT_IS_CPT,		/* Entity is a CPT table */
+	GMT_IS_IMAGE,		/* Entity is a 1- or 3-layer unsigned char image */
+	GMT_IS_VECTOR,		/* Entity is set of user vectors */
+	GMT_IS_MATRIX,		/* Entity is user matrix */
+	GMT_IS_COORD};		/* Entity is a double coordinate array */
+
+/* These are modes for handling comments */
+enum GMT_enum_comment {
+	GMT_COMMENT_IS_TEXT	= 0,	/* Comment is a text string */
+	GMT_COMMENT_IS_OPTION	= 1U,	/* Comment is a linked list of GMT_OPTION structures */
+	GMT_COMMENT_IS_COMMAND	= 2U,	/* Comment replaces header->command */
+	GMT_COMMENT_IS_REMARK	= 4U,	/* Comment replaces header->remark */
+	GMT_COMMENT_IS_TITLE	= 8U,	/* Comment replaces header->title */
+	GMT_COMMENT_IS_NAME_X	= 16U,	/* Comment replaces header->x_units [grids only] */
+	GMT_COMMENT_IS_NAME_Y	= 32U,	/* Comment replaces header->y_units [grids only] */
+	GMT_COMMENT_IS_NAME_Z	= 64U,	/* Comment replaces header->z_units [grids only] */
+	GMT_COMMENT_IS_COLNAMES	= 128U,	/* Comment replaces header->colnames [tables only] */
+	GMT_COMMENT_IS_RESET	= 256U};	/* Wipe existing header first [append] */
+
+enum GMT_api_err_enum {
+	GMT_NOTSET  = -1,	/* When something is not set */
+	GMT_NOERROR = 0};	/* Return code when all is well */
+
+enum GMT_module_enum {
+	GMT_MODULE_EXIST	= -3,	/* mode for GMT_Call_Module to return 0 if it exists */
+	GMT_MODULE_PURPOSE	= -2,	/* mode for GMT_Call_Module to print purpose of module, or all modules */
+	GMT_MODULE_OPT		= -1,	/* Gave linked list of option structures to GMT_Call_Module */
+	GMT_MODULE_CMD		=  0};	/* Gave an array of text strings (argv[]) to GMT_Call_Module */
+
+/* Array indices for input/output/stderr variables */
+
+enum GMT_io_enum {
+	GMT_IN = 0,	/* stdin */
+	GMT_OUT,	/* stdout */
+	GMT_ERR};	/* stderr */
+
+/* There are 3 named columns */
+enum GMT_enum_dimensions {
+	GMT_X = 0,	/* x or lon is in 0th column */
+	GMT_Y,		/* y or lat is in 1st column */
+	GMT_Z};		/* z is in 2nd column */
+
+enum GMT_enum_freg {
+	GMT_ADD_FILES_IF_NONE = 1,	/* Tell GMT_Init_IO we conditionally want to register all input files in the option list if nothing else is registered */
+	GMT_ADD_FILES_ALWAYS = 2,	/* Tell GMT_Init_IO to always register all input files in the option list */
+	GMT_ADD_STDIO_IF_NONE = 4,	/* Tell GMT_Init_IO we conditionally want to register std(in|out) if nothing else has been registered */
+	GMT_ADD_STDIO_ALWAYS = 8,	/* Tell GMT_Init_IO to always register std(in|out) */
+	GMT_ADD_EXISTING = 16,		/* Tell GMT_Init_IO to only use already registered resources */
+	GMT_ADD_DEFAULT = 6};		/* Tell GMT_Init_IO to register files, and if none are found then std(in|out), but only if nothing was registered before this call */
+
+enum GMT_enum_ioset {
+	GMT_IO_DONE = 0,		/* Tell GMT_End_IO we are done but nothing special is to be done. */
+	GMT_IO_ASCII = 512,		/* Force ASCII mode for reading (ignoring current io settings). */
+	GMT_IO_RESET = 32768,		/* Tell GMT_End_IO that accessed resources should be made read/write-able again. */
+	GMT_IO_UNREG = 16384};		/* Tell GMT_End_IO to unregister all accessed resources. */
+
+enum GMT_enum_read {
+	GMT_READ_DOUBLE = 0,		/* Read ASCII data record and return double array */
+	GMT_READ_NORMAL = 0,		/* Normal read mode [Default] */
+	GMT_READ_TEXT = 1,		/* Read ASCII data record and return text string */
+	GMT_READ_MIXED = 2,		/* Read ASCII data record and return double array but tolerate conversion errors */
+	GMT_FILE_BREAK = 4};		/* Add to mode to indicate we want to know when each file end is reached [continuous] */
+
+enum GMT_enum_write {
+	GMT_WRITE_DOUBLE = 0,		/* Write double array to output */
+	GMT_WRITE_TEXT,			/* Write ASCII current record to output */
+	GMT_WRITE_SEGMENT_HEADER,	/* Write segment header record to output */
+	GMT_WRITE_TABLE_HEADER,		/* Write current record as table header to output */
+	GMT_WRITE_TABLE_START,		/* Write common header block to output (optional title + command line) */
+	GMT_WRITE_NOLF = 16};		/* Do not write LF at end of ascii record, and not increment output rec number */
+
+enum GMT_enum_header {
+	GMT_HEADER_OFF = 0,		/* Disable header blocks out as default */
+	GMT_HEADER_ON};			/* Enable header blocks out as default */
+
+enum GMT_enum_dest {
+	GMT_WRITE_SET = 0,		/* Write all output tables and all their segments to one destination [Default] */
+	GMT_WRITE_OGR,			/* Output OGR/GMT format [Requires proper -a setting] */
+	GMT_WRITE_TABLE,		/* Write each output table and all their segments to separate destinations */
+	GMT_WRITE_SEGMENT,		/* Write all output tables' segments to separate destinations */
+	GMT_WRITE_TABLE_SEGMENT};	/* Same as 2 but if no filenames we use both tbl and seg with format */
+
+enum GMT_enum_alloc {
+	GMT_ALLOCATED_EXTERNALLY = 0,	/* Allocated outside of GMT: We cannot reallocate or free this memory */
+	GMT_ALLOCATED_BY_GMT = 1};	/* Allocated by GMT: We may reallocate as needed and free when no longer needed */
+
+enum GMT_enum_duplicate {
+	GMT_DUPLICATE_NONE = 0,		/* Duplicate data set structure but no allocate&copy of data records|grid|image */
+	GMT_DUPLICATE_ALLOC,		/* Duplicate data set structure and allocate space for data records|grid|image, but no copy */
+	GMT_DUPLICATE_DATA};		/* Duplicate data set structure, allocate space for data records|grid|image, and copy */
+
+enum GMT_enum_shape {
+	GMT_ALLOC_NORMAL = 0,		/* Normal allocation of new dataset based on shape of input dataset */
+	GMT_ALLOC_VERTICAL = 4,		/* Allocate a single table for data set to hold all input tables by vertical concatenation */
+	GMT_ALLOC_HORIZONTAL = 8};	/* Alocate a single table for data set to hold all input tables by horizontal (paste) concatenations */
+
+enum GMT_enum_out {
+	GMT_WRITE_NORMAL = 0,		/* Write header and contents of this entity (table or segment) */
+	GMT_WRITE_HEADER,		/* Only write header and not the contents of this entity (table or segment) */
+	GMT_WRITE_SKIP};		/* Entirely skip this entity on output (table or segment) */
+
+/* Various directions and modes to call the FFT */
+enum GMT_FFT_mode {
+	GMT_FFT_FWD     = 0U,		/* forward Fourier transform */
+	GMT_FFT_INV     = 1U,		/* inverse Fourier transform */
+	GMT_FFT_REAL    = 0U,		/* real-input FT (currently unsupported) */
+	GMT_FFT_COMPLEX = 1U};		/* complex-input Fourier transform */
+
+/* Various modes to select time in GMT_Message */
+enum GMT_time_mode {
+	GMT_TIME_NONE    = 0U,		/* Do not report time */
+	GMT_TIME_CLOCK   = 1U,		/* Report absolute time formatted via FORMAT_TIME_STAMP */
+	GMT_TIME_ELAPSED = 2U,		/* Report elapsed time since last time mark reset */
+	GMT_TIME_RESET   = 4U};		/* Reset time mark */
+
+/* Verbosity levels */
+enum GMT_enum_verbose {GMT_MSG_QUIET = 0,  /* No messages whatsoever */
+	GMT_MSG_NORMAL,                        /* Default output, e.g., warnings and errors only */
+	GMT_MSG_TICTOC,                        /* To print a tic-toc elapsed time message */
+	GMT_MSG_COMPAT,                        /* Compatibility warnings */
+	GMT_MSG_VERBOSE,                       /* Verbose level */
+	GMT_MSG_LONG_VERBOSE,                  /* Longer verbose */
+	GMT_MSG_DEBUG};                        /* Debug messages for developers mostly */
+
+/*============================================================ */
+/*===============+ GMT_GRID Public Declaration =============== */
+/*============================================================ */
+
+enum GMT_enum_reg {	/* Public constants for grid registration */
+	GMT_GRID_NODE_REG	= 0U,
+	GMT_GRID_PIXEL_REG	= 1U,
+	GMT_GRID_DEFAULT_REG	= 1024U};	/* Means select whatever is implied via -r */
+
+enum GMT_enum_gridindex {
+        GMT_XLO = 0U,	/* Index for west or xmin value */
+        GMT_XHI,	/* Index for east or xmax value */
+        GMT_YLO,	/* Index for south or ymin value */
+        GMT_YHI,	/* Index for north or ymax value */
+        GMT_ZLO,	/* Index for zmin value */
+        GMT_ZHI		/* Index for zmax value */
+};
+
+enum GMT_enum_dimindex {
+        GMT_TBL = 0U,	/* Index for number of tables in dimension array */
+        GMT_SEG,	/* Index for number of segments in dimension array */
+        GMT_ROW,	/* Index for number of rows in dimension array */
+        GMT_COL		/* Index for number of columns in dimension array [DATASET only] */
+};
+
+enum GMT_enum_gridio {
+	GMT_GRID_IS_REAL		= 0U,	/* Read|write a normal real-valued grid */
+	GMT_GRID_ALL			= 0U,	/* Read|write both grid header and the entire grid (no subset) */
+	GMT_GRID_HEADER_ONLY		= 1U,	/* Just read|write the grid header */
+	GMT_GRID_DATA_ONLY		= 2U,	/* Read|write the grid array given w/e/s/n set in the header */
+	GMT_GRID_IS_COMPLEX_REAL	= 4U,	/* Read|write the real component to/from a complex grid */
+	GMT_GRID_IS_COMPLEX_IMAG	= 8U,	/* Read|write the imaginary component to/from a complex grid */
+	GMT_GRID_IS_COMPLEX_MASK	= 12U,	/* To mask out the real|imag flags */
+	GMT_GRID_NO_HEADER		= 16U,	/* Write a native grid without the leading grid header */
+	GMT_GRID_ROW_BY_ROW		= 32U,	/* Read|write the grid array one row at the time sequentially */
+	GMT_GRID_ROW_BY_ROW_MANUAL	= 64U};	/* Read|write the grid array one row at the time in any order */
+
+/* These lengths (except GMT_GRID_VARNAME_LEN80) must NOT be changed as they are part of grd definition */
+enum GMT_enum_grdlen {
+	GMT_GRID_UNIT_LEN80     = 80U,
+	GMT_GRID_TITLE_LEN80    = 80U,
+	GMT_GRID_VARNAME_LEN80  = 80U,
+	GMT_GRID_COMMAND_LEN320 = 320U,
+	GMT_GRID_REMARK_LEN160  = 160U,
+	GMT_GRID_NAME_LEN256	= 256U,
+	GMT_GRID_HEADER_SIZE    = 892U};
+
+/* Note: GMT_GRID_HEADER_SIZE is 4 less than sizeof (struct GMT_GRID_HEADER) on
+ * some 64 bit systems due to alignment.  Since the GMT_GRID_HEADER was designed
+ * during the 32-bit era its sizeof is 892.  For backwards compatibility we
+ * continue to enforce this header size by writing the structure components
+ * separately. */
+
+struct GMT_GRID_HEADER {
+	/* Variables we document for the API:
+	 * == Do not change the type of the following three items.
+	 * == They are copied verbatim to the native grid header and must be 4-byte unsigned ints. */
+	uint32_t nx;                     /* Number of columns */
+	uint32_t ny;                     /* Number of rows */
+	uint32_t registration;           /* GMT_GRID_NODE_REG (0) for node grids, GMT_GRID_PIXEL_REG (1) for pixel grids */
+
+	/* -- Here is the possible location for data structure padding:
+	 *    A double is 8-byte aligned on Windows. */
+
+	/* == The types of the following 12 elements must not be changed.
+	 * == They are also copied verbatim to the native grid header. */
+	double wesn[4];                   /* Min/max x and y coordinates */
+	double z_min;                     /* Minimum z value */
+	double z_max;                     /* Maximum z value */
+	double inc[2];                    /* x and y increment */
+	double z_scale_factor;            /* grd values must be multiplied by this */
+	double z_add_offset;              /* After scaling, add this */
+	char x_units[GMT_GRID_UNIT_LEN80];     /* units in x-direction */
+	char y_units[GMT_GRID_UNIT_LEN80];     /* units in y-direction */
+	char z_units[GMT_GRID_UNIT_LEN80];     /* grid value units */
+	char title[GMT_GRID_TITLE_LEN80];      /* name of data set */
+	char command[GMT_GRID_COMMAND_LEN320]; /* name of generating command */
+	char remark[GMT_GRID_REMARK_LEN160];   /* comments re this data set */
+	/* == End of "untouchable" header. */
+
+	/* ---- Variables "hidden" from the API ----
+	 * This section is flexible.  It is not copied to any grid header
+	 * or stored in any file.  It is considered private */
+	unsigned int type;               /* Grid format */
+	unsigned int bits;               /* Bits per data value (e.g., 32 for ints/floats; 8 for bytes) */
+	unsigned int complex_mode;       /* 0 = normal, GMT_GRID_IS_COMPLEX_REAL = real part of complex grid, GMT_GRID_IS_COMPLEX_IMAG = imag part of complex grid */
+	unsigned int mx, my;             /* Actual dimensions of the grid in memory, allowing for the padding */
+	size_t nm;                       /* Number of data items in this grid (nx * ny) [padding is excluded] */
+	size_t size;                     /* Actual number of items (not bytes) required to hold this grid (= mx * my) */
+	size_t n_alloc;                  /* Bytes allcoated for this grid */
+	unsigned int trendmode;          /* Holds status for detrending of grids.  0 if not detrended, 1 if mean, 2 if mid-value, and 3 if LS plane removed */
+	unsigned int arrangement;        /* Holds status for complex grid as how the read/imag is placed in the grid (interleaved, R only, etc.) */
+	unsigned int n_bands;            /* Number of bands [1]. Used with IMAGE containers and macros to get ij index from row,col, band */
+	unsigned int pad[4];             /* Padding on west, east, south, north sides [2,2,2,2] */
+	unsigned int BC[4];              /* Boundary condition applied on each side via pad [0 = not set, 1 = natural, 2 = periodic, 3 = data] */
+	unsigned int grdtype;            /* 0 for Cartesian, > 0 for geographic and depends on 360 periodicity [see GMT_enum_grdtype above] */
+	char name[GMT_GRID_NAME_LEN256]; /* Actual name of the file after any ?<varname> and =<stuff> has been removed */
+	char varname[GMT_GRID_VARNAME_LEN80];/* NetCDF: variable name */
+	const char  *ProjRefPROJ4;       /* To store a referencing system string in PROJ.4 format */
+	const char  *ProjRefWKT;         /* To store a referencing system string in WKT format */
+	int row_order;                   /* NetCDF: k_nc_start_south if S->N, k_nc_start_north if N->S */
+	int z_id;                        /* NetCDF: id of z field */
+	int ncid;                        /* NetCDF: file ID */
+	int xy_dim[2];                   /* NetCDF: dimension order of x and y; normally {1, 0} */
+	size_t t_index[3];               /* NetCDF: index of higher coordinates */
+	size_t data_offset;              /* NetCDF: distance from the beginning of the in-memory grid */
+	unsigned int stride;             /* NetCDF: distance between two rows in the in-memory grid */
+	float nan_value;                 /* Missing value as stored in grid file */
+	double xy_off;                   /* 0.0 (registration == GMT_GRID_NODE_REG) or 0.5 ( == GMT_GRID_PIXEL_REG) */
+	double r_inc[2];                 /* Reciprocal incs, i.e. 1/inc */
+	char flags[4];                   /* Flags used for ESRI grids */
+	char *pocket;                    /* GDAL: A working variable handy to transmit info between funcs e.g. +b<band_info> to gdalread */
+	double bcr_threshold;            /* sum of cardinals must >= threshold in bilinear; else NaN */
+	unsigned int bcr_interpolant;    /* Interpolation function used (0, 1, 2, 3) */
+	unsigned int bcr_n;              /* Width of the interpolation function */
+	unsigned int nxp;                /* if X periodic, nxp > 0 is the period in pixels  */
+	unsigned int nyp;                /* if Y periodic, nxp > 0 is the period in pixels  */
+	unsigned int no_BC;              /* If true we skip BC stuff entirely */
+	unsigned int gn;                 /* true if top    edge will be set as N pole  */
+	unsigned int gs;                 /* true if bottom edge will be set as S pole  */
+	unsigned int is_netcdf4;         /* true if netCDF-4/HDF5 format */
+	size_t z_chunksize[2];           /* chunk size (lat,lon) */
+	unsigned int z_shuffle;          /* if shuffle filter is turned on */
+	unsigned int z_deflate_level;    /* if deflate filter is in use */
+	unsigned int z_scale_autoadust;  /* if z_scale_factor should be auto-detected */
+	unsigned int z_offset_autoadust; /* if z_add_offset should be auto-detected */
+					 /* xy_*[] is separate settings for GMT_IN and GMT_OUT */
+	unsigned int xy_adjust[2];	 /* 1 if +u<unit> was parsed and scale set, 3 if xy has been adjusted, 0 otherwise */
+	unsigned int xy_mode[2];	 /* 1 if +U<unit> was parsed, 0 otherwise */
+	unsigned int xy_unit[2];	 /* Unit enum specified via +u<unit> */
+	double xy_unit_to_meter[2];	 /* Scale, given xy_unit, to convert xy from <unit> to meters */
+};
+
+/* grd is stored in rows going from west (xmin) to east (xmax)
+ * first row in file has yvalue = north (ymax).  
+ * This is SCANLINE orientation.*/
+
+/*-----------------------------------------------------------------------------------------
+ *	Notes on registration:
+
+	Assume x_min = y_min = 0 and x_max = y_max = 10 and x_inc = y_inc = 1.
+	For a normal node grid we have:
+		(1) nx = (x_max - x_min) / x_inc + 1 = 11
+		    ny = (y_max - y_min) / y_inc + 1 = 11
+		(2) node # 0 is at (x,y) = (x_min, y_max) = (0,10) and represents the surface
+		    value in a box with dimensions (1,1) centered on the node.
+	For a pixel grid we have:
+		(1) nx = (x_max - x_min) / x_inc = 10
+		    ny = (y_max - y_min) / y_inc = 10
+		(2) node # 0 is at (x,y) = (x_min + 0.5*x_inc, y_max - 0.5*y_inc) = (0.5, 9.5)
+		    and represents the surface value in a box with dimensions (1,1)
+		    centered on the node.
+-------------------------------------------------------------------------------------------*/
+
+struct GMT_GRID {	/* To hold a GMT float grid and its header in one container */
+	struct GMT_GRID_HEADER *header;	/* Pointer to full GMT header for the grid */
+	float *data;			/* Pointer to the float grid */
+/* ---- Variables "hidden" from the API ---- */
+	unsigned int id;		/* The internal number of the grid */
+	unsigned int alloc_level;	/* The level it was allocated at */
+	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
+	void *extra;			/* Row-by-row machinery information [NULL] */
+};
+
+/*============================================================ */
+/*============== GMT_DATASET Public Declaration ============== */
+/*============================================================ */
+
+/* GIS geometries, with GMT_IS_NONE as 16 for no such thing */
+enum GMT_enum_geometry {
+	GMT_IS_POINT	= 1U,
+	GMT_IS_LINE	= 2U,
+	GMT_IS_POLY	= 4U,
+	GMT_IS_PLP	= 7U,	/* Could be any one of POINT, LINE, POLY */
+	GMT_IS_SURFACE	= 8U,
+	GMT_IS_NONE	= 16U};	/* Non-geographical items like CPT and text */
+
+/* These are two polygon modes */
+enum GMT_enum_pol {
+	GMT_IS_PERIMETER = 0,
+	GMT_IS_HOLE = 1U};
+
+/* Return codes for GMT_ascii_input: */
+
+enum GMT_enum_ascii_input_return {	/* Bit flag related to record i/o */
+	GMT_IO_DATA_RECORD 	=  0,		/* Read a data record and had no issues */
+	GMT_IO_TABLE_HEADER 	=  1U,		/* Read a table header */
+	GMT_IO_SEGMENT_HEADER	=  2U,		/* Read a segment header */
+	GMT_IO_ANY_HEADER	=  3U,		/* Read either table or segment header */
+	GMT_IO_MISMATCH		=  4U,		/* Read incorrect number of columns */
+	GMT_IO_EOF		=  8U,		/* Read end-of-file */
+	GMT_IO_NAN		= 16U,		/* Read a NaN record */
+	GMT_IO_NEW_SEGMENT	= 18U,		/* Read either segment header or NaN-record */
+	GMT_IO_GAP		= 32U,		/* Determined a gap should occur before this record */
+	GMT_IO_LINE_BREAK	= 58U,		/* Segment break caused by seg header, gap, nan, or EOF */
+	GMT_IO_NEXT_FILE	= 64U};		/* Like EOF except for an individual file (with more files to follow) */
+
+/* Here are the GMT data types used for tables */
+
+struct GMT_OGR {	/* Struct with all things GMT/OGR for a table */
+	/* The first parameters are usually set once per data set and do not change */
+	unsigned int geometry;		/* @G: The geometry of this data set, if known [0 otherwise] */
+	unsigned int n_aspatial;	/* @T: The number of aspatial fields */
+	char *region;			/* @R: The region textstring [NULL if not set] */
+	char *proj[4];			/* @J: The 1-4 projection strings [NULL if not set] */
+	unsigned int *type;		/* @T: The data types of the aspatial fields [NULL if not set]  */
+	char **name;			/* @N The names of the aspatial fields [NULL if not set]  */
+	/* The following are for OGR data only. It is filled during parsing (current segment) but is then copied to the segment header so it can be accessed later */
+	enum GMT_enum_pol pol_mode;	/* @P: Either GMT_IS_PERIMETER or GMT_IS_HOLE (for polygons only) */
+	char **tvalue;			/* @D: The text values of the current aspatial fields */
+	double *dvalue;			/* @D: Same but converted to double (assumed possible) */
+};
+
+struct GMT_OGR_SEG {	/* Struct with GMT/OGR aspatial data for a segment */
+	enum GMT_enum_pol pol_mode;	/* @P: Either GMT_IS_PERIMETER or GMT_IS_HOLE (for polygons only) */
+	unsigned int n_aspatial;	/* @T: The number of aspatial fields */
+	char **tvalue;			/* @D: The values of the current aspatial fields (uses GMT_OGR's n_aspatial as length) */
+	double *dvalue;			/* @D: Same but converted to double (assumed possible) */
+};
+
+struct GMT_DATASEGMENT {		/* For holding segment lines in memory */
+	/* Variables we document for the API: */
+	uint64_t n_rows;		/* Number of points in this segment */
+	uint64_t n_columns;		/* Number of fields in each record (>= 2) */
+	double *min;			/* Minimum coordinate for each column */
+	double *max;			/* Maximum coordinate for each column */
+	double **coord;			/* Coordinates x,y, and possibly other columns */
+	char *label;			/* Label string (if applicable) */
+	char *header;			/* Segment header (if applicable) */
+/* ---- Variables "hidden" from the API ---- */
+	enum GMT_enum_out mode;		/* 0 = output segment, 1 = output header only, 2 = skip segment */
+	enum GMT_enum_pol pol_mode;	/* Either GMT_IS_PERIMETER  [-Pp] or GMT_IS_HOLE [-Ph] (for polygons only) */
+	uint64_t id;			/* The internal number of the segment */
+	size_t n_alloc;			/* The current allocation length of each coord */
+	unsigned int range;		/* Longitude reporting scheme, e.g. GMT_IS_GIVEN_RANGE [0] */
+	int pole;			/* Spherical polygons only: If it encloses the S (-1) or N (+1) pole, or none (0) */
+	double dist;			/* Distance from a point to this feature */
+	double lat_limit;		/* For polar caps: the latitude of the point closest to the pole */
+	struct GMT_OGR_SEG *ogr;	/* NULL unless OGR/GMT metadata exist for this segment */
+	struct GMT_DATASEGMENT *next;	/* NULL unless polygon and has holes and pointing to next hole */
+	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
+};
+
+struct GMT_DATATABLE {	/* To hold an array of line segment structures and header information in one container */
+	/* Variables we document for the API: */
+	unsigned int n_headers;	/* Number of file header records (0 if no header) */
+	uint64_t n_columns;	/* Number of columns (fields) in each record */
+	uint64_t n_segments;	/* Number of segments in the array */
+	uint64_t n_records;	/* Total number of data records across all segments */
+	double *min;			/* Minimum coordinate for each column */
+	double *max;			/* Maximum coordinate for each column */
+	char **header;			/* Array with all file header records, if any) */
+	struct GMT_DATASEGMENT **segment;	/* Pointer to array of segments */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the table */
+	size_t n_alloc;			/* The current allocation length of segments */
+	enum GMT_enum_out mode;		/* 0 = output table, 1 = output header only, 2 = skip table */
+	struct GMT_OGR *ogr;		/* Pointer to struct with all things GMT/OGR (if MULTI-geometry and not MULTIPOINT) */
+	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
+};
+
+/* The main GMT Data Containers used in the API: */
+
+struct GMT_DATASET {	/* Single container for an array of GMT tables (files) */
+	/* Variables we document for the API: */
+	uint64_t n_tables;		/* The total number of tables (files) contained */
+	uint64_t n_columns;		/* The number of data columns */
+	uint64_t n_segments;		/* The total number of segments across all tables */
+	uint64_t n_records;		/* The total number of data records across all tables */
+	double *min;			/* Minimum coordinate for each column */
+	double *max;			/* Maximum coordinate for each column */
+	struct GMT_DATATABLE **table;	/* Pointer to array of tables */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the data set */
+	size_t n_alloc;			/* The current allocation length of tables */
+	uint64_t dim[4];		/* Only used by GMT_Duplicate_Data to override dimensions */
+	unsigned int geometry;		/* The geometry of this dataset */
+	unsigned int alloc_level;	/* The level it was allocated at */
+	enum GMT_enum_dest io_mode;	/* -1 means write OGR format (requires proper -a),
+					 * 0 means write everything to one destination [Default],
+					 * 1 means use table->file[GMT_OUT] to write separate table,
+					 * 2 means use segment->file[GMT_OUT] to write separate segments.
+					 * 3 is same as 2 but with no filenames we create filenames from tbl and seg numbers */
+	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
+	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
+};
+
+/*============================================================ */
+/*============== GMT_TEXTSET Public Declaration ============== */
+/*============================================================ */
+
+struct GMT_TEXTSEGMENT {		/* For holding segment text records in memory */
+	/* Variables we document for the API: */
+	uint64_t n_rows;		/* Number of rows in this segment */
+	char **record;			/* Array of text records */
+	char *label;			/* Label string (if applicable) */
+	char *header;			/* Segment header (if applicable) */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the table */
+	enum GMT_enum_out mode;		/* 0 = output segment, 1 = output header only, 2 = skip segment */
+	size_t n_alloc;			/* Number of rows allocated for this segment */
+	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
+	char **tvalue;			/* The values of the OGR/GMT aspatial fields */	
+};
+
+struct GMT_TEXTTABLE {	/* To hold an array of text segment structures and header information in one container */
+	/* Variables we document for the API: */
+	unsigned int n_headers;		/* Number of file header records (0 if no header) */
+	uint64_t n_segments;		/* Number of segments in the array */
+	uint64_t n_records;		/* Total number of data records across all segments */
+	char **header;			/* Array with all file header records, if any) */
+	struct GMT_TEXTSEGMENT **segment;	/* Pointer to array of segments */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the table */
+	size_t n_alloc;			/* The current allocation length of segments */
+	enum GMT_enum_out mode;		/* 0 = output table, 1 = output header only, 2 = skip table */
+	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
+};
+
+struct GMT_TEXTSET {	/* Single container for an array of GMT text tables (files) */
+	/* Variables we document for the API: */
+	uint64_t n_tables;		/* The total number of tables (files) contained */
+	uint64_t n_segments;		/* The total number of segments across all tables */
+	uint64_t n_records;		/* The total number of data records across all tables */
+	struct GMT_TEXTTABLE **table;	/* Pointer to array of tables */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the data set */
+	size_t n_alloc;			/* The current allocation length of tables */
+	unsigned int geometry;		/* The geometry of this dataset */
+	unsigned int alloc_level;	/* The level it was allocated at */
+	enum GMT_enum_dest io_mode;	/* -1 means write OGR format (requires proper -a),
+					 * 0 means write everything to one destination [Default],
+					 * 1 means use table->file[GMT_OUT] to write separate table,
+					 * 2 means use segment->file[GMT_OUT] to write separate segments.
+					 * 3 is same as 2 but with no filenames we create filenames from tbl and seg numbers */
+	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
+	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
+};
+
+/*============================================================ */
+/*============== GMT_PALETTE Public Declaration ============== */
+/*============================================================ */
+
+enum GMT_enum_color {GMT_RGB	= 0,
+	GMT_CMYK		= 1,
+	GMT_HSV			= 2,
+	GMT_COLORINT		= 4,
+	GMT_NO_COLORNAMES	= 8};
+
+enum GMT_enum_bfn {GMT_BGD, GMT_FGD, GMT_NAN};
+
+enum GMT_enum_cpt {GMT_CPT_REQUIRED, GMT_CPT_OPTIONAL};
+
+enum GMT_enum_cptflags {GMT_CPT_NO_BNF = 1, GMT_CPT_EXTEND_BNF = 2};
+
+/* Here is the definition of the GMT_PALETTE structure that is used in programs
+ * that deals with coloring of items as a function of z-lookup.  Note that rgb
+ * arrays have 4 items as the 4th value could be a non-zero transparency (when supported).
+ */
+ 
+struct GMT_LUT {
+	double z_low, z_high, i_dz;
+	double rgb_low[4], rgb_high[4], rgb_diff[4];
+	double hsv_low[4], hsv_high[4], hsv_diff[4];
+	unsigned int annot;	/* 1 for Lower, 2 for Upper, 3 for Both */
+	unsigned int skip;	/* true means skip this slice */
+	struct GMT_FILL *fill;	/* For patterns instead of color */
+	char *label;		/* For non-number labels */
+};
+
+struct GMT_BFN_COLOR {		/* For back-, fore-, and nan-colors */
+	double rgb[4];		/* Red, green, blue, and alpha */
+	double hsv[4];		/* Hue, saturation, value, alpha */
+	unsigned int skip;	/* true means skip this slice */
+	struct GMT_FILL *fill;	/* For patterns instead of color */
+};
+
+struct GMT_PALETTE {		/* Holds all pen, color, and fill-related parameters */
+	/* Variables we document for the API: */
+	unsigned int n_headers;		/* Number of CPT file header records (0 if no header) */
+	unsigned int n_colors;		/* Number of colors in CPT lookup table */
+	unsigned int cpt_flags;		/* Flags controling use of BFN colors */
+	struct GMT_LUT *range;		/* CPT lookup table read by GMT_read_cpt */
+	struct GMT_BFN_COLOR patch[3];	/* Structures with back/fore/nan colors */
+	char **header;			/* Array with all CPT file header records, if any) */		/* Content not counted by sizeof (struct) */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the data set */
+	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
+	unsigned int alloc_level;	/* The level it was allocated at */
+	unsigned int model;		/* RGB, HSV, CMYK */
+	unsigned int is_gray;		/* true if only grayshades are needed */
+	unsigned int is_bw;		/* true if only black and white are needed */
+	unsigned int is_continuous;	/* true if continuous color tables have been given */
+	unsigned int has_pattern;	/* true if cpt file contains any patterns */
+	unsigned int skip;		/* true if current z-slice is to be skipped */
+	unsigned int categorical;	/* true if CPT applies to categorical data */
+	unsigned int z_adjust[2];	/* 1 if +u<unit> was parsed and scale set, 3 if z has been adjusted, 0 otherwise */
+	unsigned int z_mode[2];	 	/* 1 if +U<unit> was parsed, 0 otherwise */
+	unsigned int z_unit[2];	 	/* Unit enum specified via +u<unit> */
+	double z_unit_to_meter[2];	/* Scale, given z_unit, to convert z from <unit> to meters */
+};
+
+/*============================================================ */
+/*=============== GMT_IMAGE Public Declaration =============== */
+/*============================================================ */
+
+/* The GMT_IMAGE container is used to pass user images in from the GDAL bridge */
+
+struct GMT_IMAGE {	/* Single container for a user image of data */
+	/* Variables we document for the API: */
+	enum GMT_enum_type type;	/* Data type, e.g. GMT_FLOAT */
+	int *ColorMap;			/* Array with color lookup values */
+	struct GMT_GRID_HEADER *header;	/* Pointer to full GMT header for the image */
+	unsigned char *data;		/* Pointer to actual image */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the data set */
+	unsigned int alloc_level;	/* The level it was allocated at */
+	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
+	const char *ColorInterp;
+};
+
+/*============================================================ */
+/*============= GMT_UNIVECTOR Public Declaration ============= */
+/*============================================================ */
+
+/* This union is used to hold any type of array */
+union GMT_UNIVECTOR {
+	/* Universal vector or any data type can be held here */
+	uint8_t  *uc1; /* Unsigned 1-byte int */
+	int8_t   *sc1; /* Signed 1-byte int */
+	uint16_t *ui2; /* Unsigned 2-byte int */
+	int16_t  *si2; /* Signed 2-byte int */
+	uint32_t *ui4; /* Unsigned 4-byte int */
+	int32_t  *si4; /* Signed 4-byte int */
+	uint64_t *ui8; /* Unsigned 8-byte int */
+	int64_t  *si8; /* Signed 8-byte int */
+	float    *f4;  /* 4-byte float */
+	double   *f8;  /* 8-byte float */
+};
+
+/*============================================================ */
+/*=============== GMT_VECTOR Public Declaration ============== */
+/*============================================================ */
+
+struct GMT_VECTOR {	/* Single container for user vector(s) of data */
+	/* Variables we document for the API: */
+	uint64_t n_columns;		/* Number of vectors */
+	uint64_t n_rows;		/* Number of rows in each vector */
+	enum GMT_enum_reg registration;	/* 0 for gridline and 1 for pixel registration  */
+	enum GMT_enum_type *type;	/* Array of data types (type of each uni-vector, e.g. GMT_FLOAT */
+	union GMT_UNIVECTOR *data;	/* Array of uni-vectors */
+	double range[2];		/* Contains tmin/tmax (or 0/0 if not equidistant) */
+	char command[GMT_GRID_COMMAND_LEN320]; /* name of generating command */
+	char remark[GMT_GRID_REMARK_LEN160];   /* comments re this data set */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the data set */
+	unsigned int alloc_level;	/* The level it was allocated at */
+	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
+};
+
+/*============================================================ */
+/*=============== GMT_MATRIX Public Declaration ============== */
+/*============================================================ */
+
+enum GMT_enum_fmt {
+	GMT_IS_ROW_FORMAT	= 0,	/* 2-D grid is C-style with rows: as index increase we move across rows */
+	GMT_IS_COL_FORMAT	= 1};	/* 2-D grid is Fortran-style with columns: as index increase we move down columns  */
+
+/* These containers are used to pass user vectors and matrices in/out of GMT */
+
+struct GMT_MATRIX {	/* Single container for a user matrix of data */
+	/* Variables we document for the API: */
+	uint64_t n_rows;		/* Number of rows in this matrix */
+	uint64_t n_columns;		/* Number of columns in this matrix */
+	uint64_t n_layers;		/* Number of layers in a 3-D matrix [1] */
+	enum GMT_enum_fmt shape;	/* 0 = C (rows) and 1 = Fortran (cols) */
+	enum GMT_enum_reg registration;	/* 0 for gridline and 1 for pixel registration  */
+	size_t dim;			/* Allocated length of longest C or Fortran dim */
+	size_t size;			/* Byte length of data */
+	enum GMT_enum_type type;	/* Data type, e.g. GMT_FLOAT */
+	double range[6];		/* Contains xmin/xmax/ymin/ymax[/zmin/zmax] */
+	union GMT_UNIVECTOR data;	/* Union with pointer to actual matrix of the chosen type */
+	char command[GMT_GRID_COMMAND_LEN320]; /* name of generating command */
+	char remark[GMT_GRID_REMARK_LEN160];   /* comments re this data set */
+/* ---- Variables "hidden" from the API ---- */
+	uint64_t id;			/* The internal number of the data set */
+	unsigned int alloc_level;	/* The level it was allocated at */
+	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
+};
+
+#endif /* _GMT_RESOURCES_H */
diff --git a/src/gmt/gmt_sharedlibs.h b/src/gmt/gmt_sharedlibs.h
new file mode 100644
index 0000000..5de82cf
--- /dev/null
+++ b/src/gmt/gmt_sharedlibs.h
@@ -0,0 +1,37 @@
+/* $Id: gmt_sharedlibs.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ * by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
+ * See LICENSE.TXT file for copying and redistribution conditions.
+ */
+
+/* gmt_module.h declares structures needed by the various modules libraries. */
+
+#pragma once
+#ifndef _GMT_MODULE_H
+#define _GMT_MODULE_H
+
+#ifdef __cplusplus /* Basic C++ support */
+extern "C" {
+#endif
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <dlfcn.h>
+#endif
+
+/* Info for each GMT shared library. This array is filled out when parsing GMT_CUSTOM_LIBS at end of GMT_Create_Session */
+
+struct Gmt_libinfo {
+	char *name;	/* Library tag name [without leading "lib" and extension], e.g. "gmt", "gmtsuppl" */
+	char *path;	/* Full path to library as given in GMT_CUSTOM_LIBS */
+	bool skip;	/* true if we tried to open it and it was not available the first time */
+	void *handle;	/* Handle to the shared library, returned by dlopen or dlopen_special */
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_GMT_MODULE_H */
diff --git a/src/gmt/gmt_shore.h b/src/gmt/gmt_shore.h
new file mode 100644
index 0000000..442a773
--- /dev/null
+++ b/src/gmt/gmt_shore.h
@@ -0,0 +1,240 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_shore.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * Include file for gmt_shore.c
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ */
+
+#ifndef _GMT_SHORE_H
+#define _GMT_SHORE_H
+
+/* Declaration modifier for netcdf DLL support
+ * annoying: why can't netcdf.h do this on its own? */
+#if defined WIN32 && ! defined NETCDF_STATIC
+#define DLL_NETCDF
+#endif
+
+#include "netcdf.h"
+
+enum GMT_enum_gshhs {GSHHS_MAX_DELTA = 65535,	/* Largest value to store in a unsigned short, used as largest dx or dy in bin  */
+	GSHHS_MAX_LEVEL			= 4,	/* Highest hierarchical level of coastlines */
+	GSHHS_N_BLEVELS			= 3,	/* Number of levels for borders */
+	GSHHS_N_RLEVELS			= 11,	/* Number of levels for rivers */
+	GSHHS_RIVER_INTERMITTENT	= 5,	/* Id for intermittent rivers */
+	GSHHS_RIVER_CANALS		= 8,	/* Id for river canals */
+	GSHHS_NO_RIVERLAKES		= 1,	/* Flag value */
+	GSHHS_NO_LAKES			= 2,	/* Flag value */
+	GSHHS_OCEAN_LEVEL		= 0,	/* Level assigned to nodes in the ocean */
+	GSHHS_LAND_LEVEL		= 1,	/* Level assigned to nodes on land */
+	GSHHS_ANTARCTICA_LIMBO		= 7,	/* Level assigned to nodes between ice and grounding lines */
+	GSHHS_ANTARCTICA_ICE_SRC	= 2,	/* Source ID for Antarctica ice line */
+	GSHHS_ANTARCTICA_GROUND_SRC	= 3,	/* Source ID for Antarctica grounding line */
+	GSHHS_ANTARCTICA_GROUND		= 0,	/* Use Antarctica igrounding line as coastline [Default] */
+	GSHHS_ANTARCTICA_ICE		= 1,	/* Use Antarctica ice boundary as coastline */
+	GSHHS_ANTARCTICA_SKIP		= 2,	/* Skip Antarctica coastline */
+	GSHHS_ANTARCTICA_LIMIT		= -60};	/* Data below 60S is Antarctica */
+
+struct GMT_SHORE_SELECT {	/* Information on levels and min area to use */
+	int low;	/* Lowest hierarchical level to use [0] */
+	int high;	/* Highest hierarchical level to use [4] */
+	int flag;	/* 1 = no riverlakes from level 2; 2 = only riverlakes from level 2 */
+	int fraction;	/* If not 0, the microfraction limit on a polygons area vs the full resolution version */
+	int antarctica_mode;	/* If 1, we skip all data south of 60S, i.e. the Antarctica continent and islands */
+	double area;	/* Area of smallest geographical feature to include [0] */
+};
+
+struct GMT_GSHHS_pol {	/* Information pertaining to each GSHHS polygon */
+	int *parent;		/* Array with ids of the parent polygon for each GSHHS polygon (-1 for all level 1 polygons) */
+	double *area;		/* Array with areas in km^2 of the GSHHS polygons */
+	int *area_fraction;	/* Array with micro-fraction fractions of area relative to full res area  */
+};
+
+struct GMT_SHORE {	/* Struct used by pscoast and others */
+
+	/* Global variables that remain fixed for all bins */
+	
+	int nb;		/* Number of bins to use */
+	int *bins;		/* Array with the nb bin numbers to use */
+	int min_level;	/* Lowest level to include [0] */
+	int max_level;	/* Highest level to include [4] */
+	int flag;		/* If riverlakes or lakes are to be excluded */
+	int has_source;		/* 1 if this GSHHG file contains feature source (0 for older files) */
+	int fraction;	/* If not 0, the microfraction limit on a polygons area vs the full resolution version */
+	double min_area;	/* Smallest feature to include in km^2 */
+	double scale;		/* Multiplier to convert dx, dy back to dlon, dlat in degrees */
+	
+	/* Variables associated with the current bin */
+	
+	int ns;			/* Number of segments to use in current bin */
+	unsigned char node_level[4];
+	struct GMT_SHORE_SEGMENT *seg;	/* Array of these segments */
+	struct GSHHS_SIDE *side[4];	/* Has position & id for each side exit/entry */
+	int nside[4];		/* Number of entries per side, including corner */
+	int n_entries;
+	int leftmost_bin;		/* true if current bin is at left edge of map */
+	int skip_feature;		/* true if GSHHS version > 2.0 and +r or +l is in use */
+	int ant_mode;			/* Antarctica mode [0-2] */
+	double bsize;			/* Size of square bins in degrees */
+	double lon_sw;			/* Longitude of SW corner */
+	double lat_sw;			/* Latitude of SW corner */
+	double lon_corner[4];		/* Longitudes of 4 corners (depends on direction) */
+	double lat_corner[4];		/* Latitudes of 4 corners (depends on direction) */
+
+	/* Data variables associated with shoreline database */
+	
+	int bin_size;		/* Size of square bins in minutes */
+	int bin_nx;		/* Number of bins in 360 degrees of longitude */
+	int bin_ny;		/* Number of bins in 180 degrees of latitude */
+	int n_poly;		/* Number of polygons present in the data set */
+	int n_bin;		/* Number of bins present in the data set */
+	int n_seg;		/* Number of segments present in the data set */
+	int n_pt;		/* Number of points present in the data set */
+	int n_nodes;		/* Number of grid nodes present in the data set */
+	
+	int *GSHHS_node;	/* Array with ids of the polygon that enclose each node */
+	int *bin_firstseg;	/* Array with ids of first segment per bin */
+	short int *bin_info;	/* Array with levels of all 4 nodes per bin */
+	short int *bin_nseg;	/* Array with number of segments per bin */
+	
+	int *GSHHS_parent;		/* Array with ids of the parent polygon for each GSHHS polygon (-1 for all level 1 polygons) */
+	double *GSHHS_area;		/* Array with areas in km^2 of the GSHHS polygons */
+	int *GSHHS_area_fraction;	/* Array with micro-fraction fractions of area relative to full res area  */
+
+	char units[80];		/* Units of lon/lat */
+	char title[80];		/* Title of data set */
+	char source[80];	/* Source of data set */
+	char version[8];	/* Version of data set */
+
+	/* netCDF ID variables */
+	
+	int cdfid;		/* netCDF File id for coastbin file */
+	
+	int bin_size_id;	/* Id for variable bin_size */
+	int bin_nx_id;		/* Id for variable bin_nx */
+	int bin_ny_id;		/* Id for variable bin_ny */
+	int n_poly_id;		/* Id for variable n_bin */
+	int n_bin_id;		/* Id for variable n_bin */
+	int n_seg_id;		/* Id for variable n_seg */
+	int n_pt_id;		/* Id for variable n_pt */
+	int n_node_id;		/* Id for variable n_nodes */
+	int bin_firstseg_id;	/* Id for variable bin_firstseg */
+	int bin_info_id;	/* Id for variable bin_info */
+	int bin_nseg_id;	/* Id for variable bin_nseg */
+	
+	int seg_info_id;	/* Id for variable seg_info */
+	int seg_start_id;	/* Id for variable seg_start */
+	int seg_GSHHS_ID_id;	/* Id for variable seg_GSHHS_ID */
+	
+	int GSHHS_parent_id;	/* Id for variable GSHHS_parent */
+	int GSHHS_area_id;	/* Id for variable GSHHS_area */
+	int GSHHS_areafrac_id;	/* Id for variable GSHHS_area_fraction */
+	int GSHHS_node_id;	/* Id for variable GSHHS_node_id */
+	
+	int pt_dx_id;		/* Id for variable pt_dx */
+	int pt_dy_id;		/* Id for variable pt_dy */
+};
+
+struct GMT_SHORE_SEGMENT {
+	unsigned char level;	/* Level of polygon segment (1 i ocean/land, 2 = land/lake, 3 = lake/island, etc) */
+	unsigned char entry;	/* Side (0-3) the segment starts on, or 4 for closed segments */
+	unsigned char exit;	/* Side (0-3) the segment ends on, or 4 for closed segments */
+	unsigned char fid;	/* Fill id (same as level expect for riverlakes which is 5) */
+	unsigned short n;	/* Number of points in segment */
+	short int *dx;		/* Array of scaled longitudes relative to SW corner */
+	short int *dy;		/* Array of scaled latitudes relative to SW corner */
+};
+
+struct GSHHS_SIDE {
+	unsigned short pos;	/* Position along side in 0-65535 range */
+	short int id;		/* Local segment id */
+};
+
+struct GMT_BR {	/* Structure for Borders and Rivers */
+
+	/* Global variables that remain fixed for all bins */
+	
+	int nb;		/* Number of bins to use */
+	int *bins;		/* Array with the nb bin numbers to use */
+	double scale;		/* Multiplier to convert dx, dy back to dlon, dlat in degrees */
+	
+	/* Variables associated with the current bin */
+	
+	int ns;		/* Number of segments to use in current bin */
+	struct GMT_BR_SEGMENT *seg;	/* Array of these segments */
+	double lon_sw;		/* Longitude of SW corner */
+	double lat_sw;		/* Latitude of SW corner */
+	double bsize;		/* Size of square bins in degrees */
+
+	/* Data variables associated with shoreline database */
+	
+	int bin_size;	/* Size of square bins in minutes */
+	int bin_nx;	/* Number of bins in 360 degrees of longitude */
+	int bin_ny;	/* Number of bins in 180 degrees of latitude */
+	int n_bin;		/* Number of bins present in the data set */
+	int n_seg;		/* Number of segments present in the data set */
+	int n_pt;		/* Number of points present in the data set */
+	
+	int *bin_firstseg;	/* Array with ids of first segment per bin */
+	short int *bin_nseg;	/* Array with number of segments per bin */
+	
+	char units[80];		/* Units of lon/lat */
+	char title[80];		/* Title of data set */
+	char source[80];	/* Source of data set */
+	char version[8];	/* Version of data set */
+
+	/* netCDF ID variables */
+	
+	int cdfid;		/* File id for coastbin file */
+	
+	int bin_size_id;	/* Id for variable bin_size */
+	int bin_nx_id;		/* Id for variable bin_nx */
+	int bin_ny_id;		/* Id for variable bin_ny */
+	int n_bin_id;		/* Id for variable n_bin */
+	int n_seg_id;		/* Id for variable n_seg */
+	int n_pt_id;		/* Id for variable n_pt */
+	int bin_firstseg_id;	/* Id for variable bin_firstseg */
+	int bin_nseg_id;	/* Id for variable bin_nseg */
+	
+	int seg_n_id;		/* Id for variable seg_n */
+	int seg_level_id;	/* Id for variable seg_level */
+	int seg_start_id;	/* Id for variable seg_start */
+	
+	int pt_dx_id;		/* Id for variable pt_dx */
+	int pt_dy_id;		/* Id for variable pt_dy */
+};
+
+struct GMT_BR_SEGMENT {
+	unsigned short n;	/* Number of points in segment */
+	unsigned short level;	/* Hierarchical level of segment */
+	short int *dx;		/* Array of scaled longitudes relative to SW corner */
+	short int *dy;		/* Array of scaled latitudes relative to SW corner */
+};
+
+struct GMT_GSHHS_POL {
+	int n;
+	int interior;	/* true if polygon is inside bin */
+	int level;
+	int fid;		/* Fill id; same as level but 5 if riverlake */
+	double *lon;
+	double *lat;
+};
+
+#endif /* _GMT_SHORE_H */
diff --git a/src/gmt/gmt_sph.h b/src/gmt/gmt_sph.h
new file mode 100644
index 0000000..866ca4b
--- /dev/null
+++ b/src/gmt/gmt_sph.h
@@ -0,0 +1,60 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_sph.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 2008-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/* Include file for sph supplement */
+
+#define DELAUNAY	0
+#define VORONOI		1
+#define INTERPOLATE	2
+
+#define TRI_NROW	6	/* Don't request arc indices from STRIPACK  */
+
+/* PW note: We largely use int64_t since it is too hard to determine which variables
+ * in the Fortran-translated code could make unsigned. */
+
+struct STRIPACK_DELAUNAY {	/* Information about Delaunay triangulation */
+	uint64_t n;	/* Number of Delaunay triangles */
+	int64_t *tri;		/* Delaunay triplet node numbers and more */
+};
+
+struct STRIPACK_VORONOI {	/* Information about Voronoi polygons */
+	double *lon, *lat;		/* Voronoi polygon vertices */
+	uint64_t n;		/* Number of boundary nodes for Voronoi */
+	int64_t *lend, *listc, *lptr;	/* Voronoi vertex lists and pointers */
+	int64_t *list;			/* Additional list from trmesh */		
+};
+
+struct STRIPACK_INTERPOLATE {	/* Information about triangles */
+	int64_t *lend, *list, *lptr;	/* lists and pointers */
+};
+
+struct STRIPACK {
+	unsigned int mode;	/* VORONOI, DELAUNAY, or INTERPOLATE */
+	struct STRIPACK_DELAUNAY D;
+	struct STRIPACK_VORONOI V;
+	struct STRIPACK_INTERPOLATE I;
+};
+
+struct STRPACK_ARC {
+	uint64_t begin, end;
+};
+
+EXTERN_MSC int stripack_lists (struct GMT_CTRL *GMT, uint64_t n, double *x, double *y, double *z, struct STRIPACK *T);
+EXTERN_MSC double stripack_areas (double *V1, double *V2, double *V3);
+EXTERN_MSC void cart_to_geo (struct GMT_CTRL *GMT, uint64_t n, double *x, double *y, double *z, double *lon, double *lat);
+EXTERN_MSC int compare_arc (const void *p1, const void *p2);
+EXTERN_MSC int ssrfpack_grid (struct GMT_CTRL *GMT, double *x, double *y, double *z, double *w, uint64_t n, unsigned int mode, double *par, bool vartens, struct GMT_GRID_HEADER *h, double *f);
diff --git a/src/gmt/gmt_stat.h b/src/gmt/gmt_stat.h
new file mode 100644
index 0000000..7f42a43
--- /dev/null
+++ b/src/gmt/gmt_stat.h
@@ -0,0 +1,77 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_stat.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+#ifndef _GMT_STAT_H
+#define _GMT_STAT_H
+
+/* for weighted mean/mode */
+struct OBSERVATION {
+	float value;
+	float weight;
+};
+
+EXTERN_MSC double GMT_bei (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_ber (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_kei (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_ker (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_plm (struct GMT_CTRL *GMT, int l, int m, double x);
+EXTERN_MSC double GMT_plm_bar (struct GMT_CTRL *GMT, int l, int m, double x, bool ortho);
+EXTERN_MSC void GMT_plm_bar_all (struct GMT_CTRL *GMT, int lmax, double x, bool ortho, double *plm);
+EXTERN_MSC double GMT_factorial (struct GMT_CTRL *GMT, int n);
+EXTERN_MSC double GMT_i0 (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_i1 (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_in (struct GMT_CTRL *GMT, unsigned int n, double x);
+EXTERN_MSC double GMT_k0 (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_k1 (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_kn (struct GMT_CTRL *GMT, unsigned int n, double x);
+EXTERN_MSC double GMT_dilog (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_sinc (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_erfinv (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC double GMT_rand (struct GMT_CTRL *GMT);
+EXTERN_MSC double GMT_nrand (struct GMT_CTRL *GMT);
+EXTERN_MSC double GMT_lrand (struct GMT_CTRL *GMT);
+EXTERN_MSC int GMT_chebyshev (struct GMT_CTRL *GMT, double x, int n, double *t);
+EXTERN_MSC double GMT_corrcoeff (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, unsigned int mode);
+EXTERN_MSC double GMT_corrcoeff_f (struct GMT_CTRL *GMT, float *x, float *y, uint64_t n, unsigned int mode);
+EXTERN_MSC double GMT_Fcrit (struct GMT_CTRL *GMT, double alpha, double nu1, double nu2);
+EXTERN_MSC double GMT_chi2crit (struct GMT_CTRL *GMT, double alpha, double nu);
+EXTERN_MSC double GMT_extreme (struct GMT_CTRL *GMT, double *x, uint64_t n, double x_default, int kind, int way);
+EXTERN_MSC double GMT_tcrit (struct GMT_CTRL *GMT, double alpha, double nu);
+EXTERN_MSC double GMT_zcrit (struct GMT_CTRL *GMT, double alpha);
+EXTERN_MSC double GMT_zdist (struct GMT_CTRL *GMT, double x);
+EXTERN_MSC int GMT_f_q (struct GMT_CTRL *GMT, double chisq1, uint64_t nu1, double chisq2, uint64_t nu2, double *prob);
+EXTERN_MSC int GMT_median (struct GMT_CTRL *GMT, double *x, uint64_t n, double xmin, double xmax, double m_initial, double *med);
+EXTERN_MSC int GMT_mode (struct GMT_CTRL *GMT, double *x, uint64_t n, uint64_t j, bool sort, unsigned int mode_selection, unsigned int *n_multiples, double *mode_est);
+EXTERN_MSC int GMT_mode_f (struct GMT_CTRL *GMT, float *x, uint64_t n, uint64_t j, bool sort, unsigned int mode_selection, unsigned int *n_multiples, double *mode_est);
+EXTERN_MSC double GMT_mean_and_std (struct GMT_CTRL *GMT, double *x, uint64_t n, double *std);
+
+EXTERN_MSC double GMT_median_weighted (struct GMT_CTRL *GMT, struct OBSERVATION *data, uint64_t n, double quantile);
+EXTERN_MSC double GMT_mode_weighted (struct GMT_CTRL *GMT, struct OBSERVATION *data, uint64_t n);
+
+EXTERN_MSC int GMT_sig_f (struct GMT_CTRL *GMT, double chi1, uint64_t n1, double chi2, uint64_t n2, double level, double *prob);
+EXTERN_MSC int GMT_student_t_a (struct GMT_CTRL *GMT, double t, uint64_t n, double *prob);
+EXTERN_MSC void GMT_chi2 (struct GMT_CTRL *GMT, double chi2, double nu, double *prob);
+EXTERN_MSC void GMT_cumpoisson (struct GMT_CTRL *GMT, double k, double mu, double *prob);
+EXTERN_MSC void GMT_getmad (struct GMT_CTRL *GMT, double *x, uint64_t n, double location, double *scale);
+EXTERN_MSC void GMT_getmad_f (struct GMT_CTRL *GMT, float *x, uint64_t n, double location, double *scale);
+EXTERN_MSC double GMT_psi (struct GMT_CTRL *GMT, double z[], double p[]);
+EXTERN_MSC void GMT_PvQv (struct GMT_CTRL *GMT, double x, double v_ri[], double pq[], unsigned int *iter);
+EXTERN_MSC double GMT_quantile (struct GMT_CTRL *GMT, double *x, double q, uint64_t n);
+EXTERN_MSC double GMT_quantile_f (struct GMT_CTRL *GMT, float *x, double q, uint64_t n);
+
+#endif /* _GMT_STAT_H */
diff --git a/src/gmt/gmt_supplements_module.h b/src/gmt/gmt_supplements_module.h
new file mode 100644
index 0000000..78fe8ea
--- /dev/null
+++ b/src/gmt/gmt_supplements_module.h
@@ -0,0 +1,73 @@
+/* $Id: gmt_supplements_module.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ * See LICENSE.TXT file for copying and redistribution conditions.
+ */
+
+/* gmt_supplements_module.h declares the prototypes for supplements module functions
+ * and the array that contains supplements GMT module parameters such as name
+ * and purpose strings.
+ * DO NOT edit this file directly! Instead edit 
+ * and regenerate this file with gmt_make_module_src.sh supplements. */
+
+#pragma once
+#ifndef _GMT_SUPPLEMENTS_MODULE_H
+#define _GMT_SUPPLEMENTS_MODULE_H
+
+#ifdef __cplusplus /* Basic C++ support */
+extern "C" {
+#endif
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#include "declspec.h"
+
+/* Prototypes of all modules in the GMT supplements library */
+EXTERN_MSC int GMT_gshhg (void *API, int mode, void *args);
+EXTERN_MSC int GMT_img2grd (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pscoupe (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psmeca (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pspolar (void *API, int mode, void *args);
+EXTERN_MSC int GMT_psvelo (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77convert (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77info (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77list (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77magref (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77manage (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77path (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77sniffer (void *API, int mode, void *args);
+EXTERN_MSC int GMT_mgd77track (void *API, int mode, void *args);
+EXTERN_MSC int GMT_dimfilter (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gmtgravmag3d (void *API, int mode, void *args);
+EXTERN_MSC int GMT_gravfft (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdgravmag3d (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdredpol (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdseamount (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pssegyz (void *API, int mode, void *args);
+EXTERN_MSC int GMT_pssegy (void *API, int mode, void *args);
+EXTERN_MSC int GMT_segy2grd (void *API, int mode, void *args);
+EXTERN_MSC int GMT_backtracker (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdpmodeler (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdrotater (void *API, int mode, void *args);
+EXTERN_MSC int GMT_grdspotter (void *API, int mode, void *args);
+EXTERN_MSC int GMT_hotspotter (void *API, int mode, void *args);
+EXTERN_MSC int GMT_originator (void *API, int mode, void *args);
+EXTERN_MSC int GMT_rotconverter (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_binlist (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_cross (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_datalist (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_get (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_init (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_list (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_merge (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_put (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_report (void *API, int mode, void *args);
+EXTERN_MSC int GMT_x2sys_solve (void *API, int mode, void *args);
+
+/* Pretty print all modules in the GMT supplements library and their purposes */
+EXTERN_MSC void gmt_supplements_module_show_all (void *API);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_GMT_SUPPLEMENTS_MODULE_H */
diff --git a/src/gmt/gmt_support.h b/src/gmt/gmt_support.h
new file mode 100644
index 0000000..74ea1a2
--- /dev/null
+++ b/src/gmt/gmt_support.h
@@ -0,0 +1,61 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_support.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+
+#ifndef _GMT_SUPPORT_H
+#define _GMT_SUPPORT_H
+
+/* Return codes from GMT_inonout */
+enum GMT_enum_inside {
+	GMT_OUTSIDE = 0,
+	GMT_ONEDGE,
+	GMT_INSIDE};
+
+/* Here are definition of MATH_MACRO and some functions used by grdmath and gmtmath */
+struct MATH_MACRO {
+	unsigned int n_arg;	/* How many commands this macro represents */
+	char *name;	/* The macro name */
+	char **arg;	/* List of those commands */
+};
+
+/* Definition of structure use for finding optimal nx.ny for surface */
+struct GMT_SURFACE_SUGGESTION {	/* Used to find top ten list of faster grid dimensions  */
+	unsigned int nx;
+	unsigned int ny;
+	double factor;	/* Speed up by a factor of factor  */
+};
+
+/* Definition of structure used for holding information of integer items to be selected */
+struct GMT_INT_SELECTION {	/* Used to hold array with items (0-n) that have been selected */
+	uint64_t *item;		/* Array with item numbers given (0 is first), sorted into ascending order */
+	uint64_t n;		/* Number of items */
+	uint64_t current;	/* Current item in item array */
+	bool invert;		/* Instead select the items NOT listed in item[] */
+};
+
+/* Definition of structure used for holding information of text items to be selected */
+struct GMT_TEXT_SELECTION {	/* Used to hold array with items (0-n) that have been selected */
+	char **pattern;		/* Array with text items given, sorted into lexical order */
+	int ogr_item;		/* Used if ogr_match is true */
+	uint64_t n;		/* Number of items */
+	bool invert;		/* Instead select the items NOT listed in item[] */
+	bool *regexp;		/* Item is a regex expression */
+	bool *caseless;		/* Treat as caseless */
+	bool ogr_match;		/* Compare pattern to an OGR item */
+};
+
+#endif /* _GMT_SUPPORT_H */
diff --git a/src/gmt/gmt_symbol.h b/src/gmt/gmt_symbol.h
new file mode 100644
index 0000000..972421f
--- /dev/null
+++ b/src/gmt/gmt_symbol.h
@@ -0,0 +1,113 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_symbol.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+ 
+/*
+ * Miscellaneous definitions and structures related to:
+ * 1. Compass symbols used by pscbasemap and pscoast
+ * 2. Custom symbols used by psxy and psxyz.
+ * 3. Definitions for vector attributes
+ *
+ * Author: Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ */
+
+#ifndef _GMT_SYMBOLS_H
+#define _GMT_SYMBOLS_H
+
+/* VECTOR attributes are used by psxy, psxyz, psrose, grdvector */
+#define VECTOR_LINE_WIDTH	2.0	/* Default vector attributes in points */
+#define VECTOR_HEAD_WIDTH	7.0
+#define VECTOR_HEAD_LENGTH	9.0
+
+struct GMT_CUSTOM_SYMBOL_ITEM {
+	double x, y, p[3], const_val[2];
+	int action, operator, var;
+	unsigned int conditional;
+	unsigned int justify;	/* For macro code l text justification [PSL_MC] */
+	bool negate;
+	struct GMT_FILL *fill;
+	struct GMT_PEN *pen;
+	struct GMT_CUSTOM_SYMBOL_ITEM *next;
+	struct GMT_FONT font;	/* Font to use for the l macro */
+	char *string;
+};
+
+struct GMT_CUSTOM_SYMBOL {
+	char name[GMT_LEN64];	/* Name of this symbol (i.e., just the <name> in [<dir>/]<name>.def) */
+	char *PS_macro;		/* Contains all the PS commands if PS is true */
+	unsigned int n_required;	/* Number of additional columns necessary to decode chosen symbol */
+	unsigned int start;	/* Column number of first additional column [2-4 depending on -C and psxy vs psxyz] */
+	bool PS;		/* true if a PSL symbol */
+	bool text;		/* true if symbol places text and hence need fonts to be set properly */
+	unsigned int *type;	/* Array with type of each parameter [0 = dimensionless, 1 = dimension, 2 = geographic angle (convert via projection)] */
+	struct GMT_CUSTOM_SYMBOL_ITEM *first;
+};
+
+struct GMT_MAP_INSERT {	/* Used to plot a map insert box in psbasemap */
+	/* -D[unit]xmin/xmax/ymin/ymax|width[/height][+c<clon>/<clat>][+p<pen>][+g<fill>] */
+	bool center;		/* Gave center of insert */
+	bool plot;		/* true if we want to draw the insert */
+	bool boxdraw;		/* true if we want to plot a rectangle to indicate the insert */
+	bool boxfill;		/* true if we want to paint/fill the insert */
+	bool oblique;		/* true if we want got <w/s/e/n>r instead of <w/e/s/n> */
+	char unit;		/* Unit of projected coordinates or 0 for geographic */
+	double x0, y0;		/* Center of insert, if given */
+	double wesn[4];		/* Geographic or projected boundaries */
+	double dim[2];		/* Width & height of box */
+	struct GMT_FILL fill;	/* Fill for insert */
+	struct GMT_PEN pen;	/* Pen for insert */
+};
+
+struct GMT_MAP_SCALE {	/* Used to plot a map scale in psbasemap and pscoast */
+	double lon, lat;	/* Location of top/mid point of scale on the map in lon/lat space */
+	double x0, y0;		/* Location of top/mid point of scale on the map in inches x/y */
+	double scale_lon;	/* Point where scale should apply */
+	double scale_lat;	/* Point where scale should apply */
+	double length;		/* How long the scale is in measure units */
+	bool boxdraw;	/* true if we want to plot a rectangle behind the scale */
+	bool boxfill;	/* true if we want to paint/fill a rectangle behind the scale */
+	bool plot;		/* true if we want to draw the scale */
+	bool fancy;		/* true for a fancy map scale */
+	bool gave_xy;	/* true if x0, y0 was given in cartesian map coordinates and not lon/lat */
+	bool unit;		/* true if we should append distance unit to all annotations along the scale */
+	bool do_label;	/* true if we should plot a label for the scale */
+	char measure;		/* The unit, i.e., m (miles), n (nautical miles), or k (kilometers) */
+	char justify;		/* Placement of label: t(op), b(ottom), l(eft), r(ight) */
+	char label[GMT_LEN64];	/* Alternative user-specified label */
+	struct GMT_FILL fill;	/* Fill to use for background rectangle */
+	struct GMT_PEN pen;	/* Pen to use for background rectangle */
+};
+
+struct GMT_MAP_ROSE {	/* Used to plot a map direction "rose" in psbasemap and pscoast */
+	double lon, lat;	/* Location of center point of rose on the map in lon/lat space */
+	double x0, y0;		/* Location of center point of scale on the map in inches x/y */
+	double size;		/* Diameter of the rose in measure units */
+	double declination;	/* Magnetic declination if needed */
+	double a_int[2];	/* Annotation interval for geographic and magnetic directions */
+	double f_int[2];	/* Tick (large) interval for geographic and magnetic directions */
+	double g_int[2];	/* Tick (small) interval for geographic and magnetic directions */
+	bool plot;		/* true if we want to draw the rose */
+	bool gave_xy;	/* true if x0, y0 was given in cartesian map coordinates and not lon/lat */
+	unsigned int type;	/* 0 for plain directional rose, 1 for a fancy directional map rose, 2 for magnetic rose */
+	unsigned int kind;	/* 0 : 90 degrees, 1 : 45 degrees, 2 : 22.5 degrees between points */
+	char label[4][GMT_LEN64];	/* User-changable labels for W, E, S, N point */
+	char dlabel[GMT_LEN256];	/* Magnetic declination label */
+};
+
+#endif	/* _GMT_SYMBOLS_H */
diff --git a/src/gmt/gmt_synopsis.h b/src/gmt/gmt_synopsis.h
new file mode 100644
index 0000000..7afb99c
--- /dev/null
+++ b/src/gmt/gmt_synopsis.h
@@ -0,0 +1,75 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_synopsis.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * Contains macros for presenting variations of GMT common options in program
+ * synopsis - yielding consistent presentation from all programs.
+ * See gmt_option.h for the GMT common options part of the API.
+ *
+ * Author:	Paul Wessel
+ * Date:	1-JAN-2010
+ * Version:	5 API
+ *
+ */
+
+#ifndef GMT_SYNOPSIS_H
+#define GMT_SYNOPSIS_H
+
+#define GMT_inc_OPT	"<xinc>[<unit>][=|+][/<yinc>[<unit>][=|+]]"
+#define GMT_Id_OPT	"-I<xinc>[m|s][/<yinc>[m|s]]"
+#define GMT_Jx_OPT	"-Jx|X<args>"
+#define GMT_Jz_OPT	"-Jz|Z<args>"
+#define GMT_Rgeo_OPT	"-R<west>/<east>/<south>/<north>[r]"
+#define GMT_Rgeoz_OPT	"-R<west>/<east>/<south>/<north>[/<zmin>/<zmax>][r]"
+#define GMT_Rx_OPT	"-R[<unit>]<xmin>/<xmax>/<ymin>/<ymax>[r]"
+
+/* Use b, f, h, when applies to both i and o, else use only the bi, bo, fi, fo variants */
+
+#define GMT_bi_OPT	"-bi[<ncol>][t][w][+L|B]"
+#define GMT_bo_OPT	"-bo[<ncol>][t][w][+L|B]"
+#define GMT_fi_OPT	"-f<info>"
+#define GMT_fo_OPT	"-f<info>"
+#define GMT_ho_OPT	"-ho[<nrecs>][+c][+d][+r<remark>][+t<title>]"
+
+/* For options needing a length or radius */
+
+#define GMT_DIST_OPT	"[-|+]<dist>[<unit>]"
+#define GMT_RADIUS_OPT	"[-|+]<radius>[<unit>]"
+
+/* Options for map rose, scale and insert, used in pscoast and psbasemap */
+
+#define GMT_TROSE	"[f|m][x]<lon0>/<lat0>/<diameter>[/<info>][:w,e,s,n:][+<gint>[/<mint>]]"
+#define GMT_SCALE	"[f][x]<lon0>/<lat0>[/<slon>]/<slat>/<length>[e|f|M|n|k|u][+l<label>][+j<just>][+p<pen>][+g<fill>][+u]"
+#define GMT_INSERT	"[<u>]<xmin>/<xmax>/<ymin>/<ymax>[r]|<width>[/<height>][+c<lon>/<lat>][+p<pen>][+g<fill>]"
+
+/* Argument to *contour programs */
+
+#define GMT_CONTG	"-G[d|f|n|l|L|x|X]<args>"
+#define GMT_CONTT	"-T[+|-][<gap>[c|i|p]/<length>[c|i|p]][:[<labels>]]"
+
+/* Options for coastline extraction  */
+#ifdef NEW_GSHHG
+#define GMT_A_OPT       "-A<min_area>[/<min_level>/<max_level>][+ag|i|s][+r|l][+p<percent>]"
+#else
+#define GMT_A_OPT       "-A<min_area>[/<min_level>/<max_level>][+as][+r|l][+p<percent>]"
+#endif
+
+/* Used in tools that sets grdheader information via a -D option */
+
+#define GMT_GRDEDIT	"-D<xname>/<yname>/<zname>/<scale>/<offset>/<invalid>/<title>/<remark>"
+
+#endif /* GMT_SYNOPSIS_H */
diff --git a/src/gmt/gmt_texture.h b/src/gmt/gmt_texture.h
new file mode 100644
index 0000000..505a83d
--- /dev/null
+++ b/src/gmt/gmt_texture.h
@@ -0,0 +1,67 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_texture.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_texture.h contains definitions of structures for pens, fills, and fonts.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_TEXTURE_H
+#define _GMT_TEXTURE_H
+
+/*--------------------------------------------------------------------
+ *			GMT TEXTURE STRUCTURE DEFINITIONS
+ *--------------------------------------------------------------------*/
+
+struct GMT_PEN {	/* Holds pen attributes */
+	double width;			/* In points */
+	double offset;			/* In points */
+	double rgb[4];			/* RGB color of pen + Transparency 0-1 [0 = opaque] */
+	char style[GMT_PEN_LEN];	/* Uses points as unit internally */
+};
+
+struct GMT_FILL {	/* Holds fill attributes */
+	double rgb[4];			/* Chosen color if no pattern + Transparency 0-1 [0 = opaque] */
+	double f_rgb[4], b_rgb[4];	/* Colors applied to unset and set bits in 1-bit image */
+	bool use_pattern;		/* true if pattern rather than rgb is set */
+	int pattern_no;		/* Number of predefined pattern, or -1 if not set */
+	unsigned int dpi;		/* Desired dpi of image building-block */
+	char pattern[GMT_BUFSIZ];		/* Full filename of user-define raster */
+};
+
+struct GMT_FONT {	/* Holds font attributes */
+	double size;			/* Font size in points */
+	unsigned int id;		/* Font ID number from predefined list */
+	unsigned int form;		/* Combination of binary 1 = fill, 2 = outline, 4 = pattern fill [1] */
+	struct GMT_FILL fill;		/* Font fill [black] */
+	struct GMT_PEN pen;		/* Font outline pen [none] */
+};
+
+struct GMT_FONTSPEC {	/* Holds information for each predefined font */
+	double height;			/* Height of letter "A" for unit fontsize */
+	char *name;			/* Name of the font */
+};
+
+struct GMT_MEDIA {	/* Holds information about paper sizes in points */
+	double width;		/* Width in points */
+	double height;		/* Height in points */
+};
+
+#endif  /* _GMT_TEXTURE_H */
diff --git a/src/gmt/gmt_time.h b/src/gmt/gmt_time.h
new file mode 100644
index 0000000..d004c62
--- /dev/null
+++ b/src/gmt/gmt_time.h
@@ -0,0 +1,48 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_time.h 13846 2014-12-28 21:46:54Z pwessel $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_time.h contains definitions of structures dealing with time.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_TIME_H
+#define _GMT_TIME_H
+
+/*--------------------------------------------------------------------
+ *			GMT TIME STRUCTURES
+ *--------------------------------------------------------------------*/
+
+struct GMT_TIME_SYSTEM {
+	double epoch_t0;		/* Rata_die fraction (in days since epoch, 0 <= t0 < 1) */
+	double scale;			/* Converts user units to seconds */
+	double i_scale;			/* Converts seconds to user units (= 1.0/scale) */
+	int64_t rata_die;		/* Rata die number of epoch */
+	char epoch[GMT_LEN64];	/* User-defined epoch for time */
+	char unit;			/* User-defined time unit */
+};
+
+struct GMT_TIME_LANGUAGE {		/* Language-specific text strings for calendars */
+	char month_name[4][12][GMT_LEN16];	/* Full, short, 1-char, and short (upper case) month names */
+	char day_name[3][7][GMT_LEN16];	/* Full, short, and 1-char weekday names */
+	char week_name[3][GMT_LEN16];	/* Full, short, and 1-char versions of the word Week */
+};
+
+#endif  /* _GMT_TIME_H */
diff --git a/src/gmt/gmt_types.h b/src/gmt/gmt_types.h
new file mode 100644
index 0000000..55ee509
--- /dev/null
+++ b/src/gmt/gmt_types.h
@@ -0,0 +1,216 @@
+/*--------------------------------------------------------------------
+ *	$Id: gmt_types.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
+ *	See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *	Contact info: gmt.soest.hawaii.edu
+ *--------------------------------------------------------------------*/
+/*
+ * gmt_types.h contains definitions of special types used by GMT.
+ *
+ * Author:	Paul Wessel
+ * Date:	01-OCT-2009
+ * Version:	5 API
+ */
+
+#ifndef _GMT_TYPES_H
+#define _GMT_TYPES_H
+//#ifdef HAVE_STDBOOL_H_
+#	include <stdbool.h>
+//#else
+//#	include "compat/stdbool.h"
+//#endif
+#include <stdint.h>
+
+/*--------------------------------------------------------------------
+ * GMT TYPE DEFINITIONS
+ *--------------------------------------------------------------------*/
+
+struct GMT_MAP {		/* Holds all map-related parameters */
+	struct GMT_PLOT_FRAME frame;		/* Everything about the frame parameters */
+	int this_x_status;			/* Tells us what quadrant old and new points are in (-4/4) */
+	int this_y_status;
+	int prev_x_status;
+	int prev_y_status;
+	int corner;			/* Tells us which corner 1-4 or -1 if not a corner */
+	bool coastline;			/* true if we are currently plotting the coastline data in pscoast */
+	bool on_border_is_outside;		/* true if a point exactly on the map border shoud be considered outside the map */
+	bool is_world;			/* true if map has 360 degrees of longitude range */
+	bool is_world_tm;			/* true if GMT_TM map is global? */
+	bool lon_wrap;			/* true when longitude wrapping over 360 degrees is allowed */
+	bool z_periodic;			/* true if grid values are 0-360 degrees (phases etc) */
+	bool loxodrome;				/* true if we are computing loxodrome distances */
+	unsigned int meridian_straight;		/* 1 if meridians plot as straight lines, 2 for special case */
+	unsigned int parallel_straight;		/* 1 if parallels plot as straight lines, 2 for special case */
+	unsigned int n_lon_nodes;		/* Somewhat arbitrary # of nodes for lines in longitude (may be reset in gmt_map.c) */
+	unsigned int n_lat_nodes;		/* Somewhat arbitrary # of nodes for lines in latitude (may be reset in gmt_map.c) */
+	unsigned int path_mode;		/* 0 if we should call GMT_fix_up_path to resample across gaps > path_step, 1 to leave alone */
+	double width;				/* Full width in inches of this world map */
+	double height;				/* Full height in inches of this world map */
+	double half_width;			/* Half width in inches of this world map */
+	double half_height;			/* Half height of this world map */
+	double dlon;				/* Steps taken in longitude along gridlines (gets reset in gmt_init.c) */
+	double dlat;				/* Steps taken in latitude along gridlines (gets reset in gmt_init.c) */
+	double path_step;			/* Sampling interval if resampling of paths should be done */
+	bool (*outside) (struct GMT_CTRL *, double, double);	/* Pointer to function checking if a lon/lat point is outside map */
+	bool (*overlap) (struct GMT_CTRL *, double, double, double, double);	/* Pointer to function checking for overlap between 2 regions */
+	bool (*will_it_wrap) (struct GMT_CTRL *, double *, double *, uint64_t, uint64_t *);	/* true if consecutive points indicate wrap */
+	int (*jump) (struct GMT_CTRL *, double, double, double, double);	/* true if we jump in x or y */
+	unsigned int (*crossing) (struct GMT_CTRL *, double, double, double, double, double *, double *, double *, double *, unsigned int *);	/* Pointer to functions returning crossover point at boundary */
+	uint64_t (*clip) (struct GMT_CTRL *, double *, double *, uint64_t, double **, double **, uint64_t *);	/* Pointer to functions that clip a polygon to fit inside map */
+	double (*left_edge) (struct GMT_CTRL *, double);	/* Pointers to functions that return left edge of map */
+	double (*right_edge) (struct GMT_CTRL *, double);	/* Pointers to functions that return right edge of map */
+	struct GMT_DIST dist[3];		/* struct with pointers to functions/scales returning distance between two points points */
+	bool (*near_lines_func) (struct GMT_CTRL *, double, double, struct GMT_DATATABLE *, unsigned int, double *, double *, double *);	/* Pointer to function returning distance to nearest line among a set of lines */
+	bool (*near_a_line_func) (struct GMT_CTRL *, double, double, uint64_t, struct GMT_DATASEGMENT *, unsigned int, double *, double *, double *);	/* Pointer to function returning distance to line */
+	bool (*near_point_func) (struct GMT_CTRL *, double, double, struct GMT_DATATABLE *, double);	/* Pointer to function returning distance to nearest point */	
+	unsigned int (*wrap_around_check) (struct GMT_CTRL *, double *, double, double, double, double, double *, double *, unsigned int *);	/* Does x or y wrap checks */
+	double (*azimuth_func) (struct GMT_CTRL *, double, double, double, double, bool);	/* Pointer to function returning azimuth between two points points */
+	void (*get_crossings) (struct GMT_CTRL *, double *, double *, double, double, double, double);	/* Returns map crossings in x or y */
+};
+
+struct GMT_TIME_CONV {		/* Holds all time-related parameters */
+	struct GMT_TRUNCATE_TIME truncate;
+	struct GMT_Y2K_FIX Y2K_fix;		/* Used to convert 2-digit years to 4-digit years */
+	struct GMT_TIME_LANGUAGE language;	/* For time axis */
+	time_t tic;				/* Last system time marker */
+	int64_t today_rata_die;			/* The rata die of current day at start of program */
+};
+
+struct GMT_INIT { /* Holds misc run-time parameters */
+	unsigned int n_custom_symbols;
+	const char *module_name;      /* Name of current module or NULL if not set */
+	const char *module_lib;       /* Name of current shared library or NULL if not set */
+	/* The rest of the struct contains pointers that may point to memory not included by this struct */
+	char *runtime_bindir;         /* Directory that contains the main exe at run-time */
+	char *runtime_libdir;         /* Directory that contains the main shared lib at run-time */
+	char *history[GMT_N_UNIQUE];  /* The internal gmt.history information */
+	struct GMT_CUSTOM_SYMBOL **custom_symbol; /* For custom symbol plotting in psxy[z]. */
+};
+
+struct GMT_PLOT {		/* Holds all plotting-related parameters */
+	uint64_t n;			/* Number of such points */
+	size_t n_alloc;			/* Size of allocated plot arrays */
+	bool r_theta_annot;		/* true for special r-theta map annotation (see GMT_get_annot_label) */
+	unsigned int mode_3D;		/* Determines if we draw fore and/or back 3-D box lines [Default is both] */
+	unsigned int *pen;		/* Pen (PSL_MOVE = up, PSL_DRAW = down) for these points */
+	struct GMT_PLOT_CALCLOCK calclock;
+	/* The rest of the struct contains pointers that may point to memory not included by this struct */
+	double *x;			/* Holds the x/y (inches) of a line to be plotted */
+	double *y;
+	char format[3][2][GMT_LEN256];	/* Keeps the 6 formats for dd:mm:ss plot output */
+};
+
+struct GMT_CURRENT {
+	/* These are internal parameters that need to be passed around between
+	 * many GMT functions.  These values may change by user interaction. */
+	struct GMT_DEFAULTS setting;	/* Holds all GMT defaults parameters */
+	struct GMT_IO io;		/* Holds all i/o-related parameters */
+	struct GMT_PROJ proj;		/* Holds all projection-related parameters */
+	struct GMT_MAP map;		/* Holds all projection-related parameters */
+	struct GMT_PLOT plot;		/* Holds all plotting-related parameters */
+	struct GMT_TIME_CONV time;	/* Holds all time-related parameters */
+	struct GMT_PS ps;		/* Hold parameters related to PS setup */
+	struct GMT_OPTION *options;	/* Pointer to current program's options */
+	struct GMT_FFT_HIDDEN fft;	/* Structure with info that must survive between FFT calls */
+};
+
+struct GMT_INTERNAL {
+	/* These are internal parameters that need to be passed around between
+	 * many GMT functions.  These may change during execution but are not
+	 * modified directly by user interaction. */
+	unsigned int func_level;	/* Keeps track of what level in a nested GMT_func calling GMT_func etc we are.  0 is top function */
+	size_t mem_cols;		/* Current number of allocated columns for temp memory */
+	size_t mem_rows;		/* Current number of allocated rows for temp memory */
+	double **mem_coord;		/* Columns of temp memory */
+#ifdef MEMDEBUG
+	struct MEMORY_TRACKER *mem_keeper;
+#endif
+};
+
+struct GMT_SHORTHAND {	/* Holds information for each grid extension shorthand read from the user's .gmtio file */
+	char *suffix; /* suffix of file */
+	char *format; /* format: ff/scale/offset/invalid */
+};
+
+struct GMT_SESSION {
+	/* These are parameters that is set once at the start of a GMT session and
+	 * are essentially read-only constants for the duration of the session */
+	FILE *std[3];			/* Pointers for standard input, output, and error */
+	void * (*input_ascii) (struct GMT_CTRL *, FILE *, uint64_t *, int *);	/* Pointer to function reading ascii tables only */
+	int (*output_ascii) (struct GMT_CTRL *, FILE *, uint64_t, double *);	/* Pointer to function writing ascii tables only */
+	unsigned int n_fonts;		/* Total number of fonts returned by GMT_init_fonts */
+	unsigned int n_user_media;	/* Total number of user media returned by gmt_load_user_media */
+	size_t min_meminc;		/* with -DMEMDEBUG, sets min/max memory increments */
+	size_t max_meminc;
+	float f_NaN;			/* Holds the IEEE NaN for floats */
+	double d_NaN;			/* Holds the IEEE NaN for doubles */
+	double no_rgb[4];		/* To hold {-1, -1, -1, 0} when needed */
+	double u2u[4][4];		/* u2u is the 4x4 conversion matrix for cm, inch, m, pt */
+	char unit_name[4][8];		/* Full name of the 4 units cm, inch, m, pt */
+	struct GMT_HASH rgb_hashnode[GMT_N_COLOR_NAMES];/* Used to translate colornames to r/g/b */
+	bool rgb_hashnode_init;		/* true once the rgb_hashnode array has been loaded; false otherwise */
+	unsigned int n_shorthands;			/* Length of arrray with shorthand information */
+	char *grdformat[GMT_N_GRD_FORMATS];	/* Type and description of grid format */
+	int (*readinfo[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *);	/* Pointers to grid read header functions */
+	int (*updateinfo[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *);	/* Pointers to grid update header functions */
+	int (*writeinfo[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *);	/* Pointers to grid write header functions */
+	int (*readgrd[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *, float *, double *, unsigned int *, unsigned int);	/* Pointers to grid read functions */
+	int (*writegrd[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *, float *, double *, unsigned int *, unsigned int);	/* Pointers to grid read functions */
+	int (*fft1d[k_n_fft_algorithms]) (struct GMT_CTRL *, float *, unsigned int, int, unsigned int);	/* Pointers to available 1-D FFT functions (or NULL if not configured) */
+	int (*fft2d[k_n_fft_algorithms]) (struct GMT_CTRL *, float *, unsigned int, unsigned int, int, unsigned int);	/* Pointers to available 2-D FFT functions (or NULL if not configured) */
+	/* This part contains pointers that may point to additional memory outside this struct */
+	char *DCWDIR;			/* Path to the DCW directory */
+	char *GSHHGDIR;			/* Path to the GSHHG directory */
+	char *SHAREDIR;			/* Path to the GMT share directory */
+	char *HOMEDIR;			/* Path to the user's home directory */
+	char *USERDIR;			/* Path to the user's GMT settings directory */
+	char *DATADIR;			/* Path to one or more directories with data sets */
+	char *TMPDIR;			/* Path to the directory directory for isolation mode */
+	char *CUSTOM_LIBS;		/* Names of one or more comma-separated GMT-compatible shared libraries */
+	char **user_media_name;		/* Length of array with custom media dimensions */
+	struct GMT_FONTSPEC *font;		/* Array with font names and height specification */
+	struct GMT_MEDIA *user_media;		/* Array with custom media dimensions */
+	struct GMT_SHORTHAND *shorthand;	/* Array with info about shorthand file extension magic */
+};
+
+struct GMT_CTRL {
+	/* Master structure for a GMT invokation.  All internal settings for GMT is accessed here */
+	struct GMT_SESSION session;	/* Structure with all values that do not change throughout a session */
+	struct GMT_INIT init;		/* Structure with all values that do not change in a GMT_func call */
+	struct GMT_COMMON common;	/* Structure with all the common GMT command settings (-R -J ..) */
+	struct GMT_CURRENT current;	/* Structure with all the GMT items that can change during execution, such as defaults settings (pens, colors, fonts.. ) */
+	struct GMT_INTERNAL hidden;	/* Internal global variables that are not to be changed directly by users */
+	struct PSL_CTRL *PSL;		/* Pointer to the PSL structure [or NULL] */
+	struct GMTAPI_CTRL *parent;	/* Owner of this structure [or NULL]; gives access to the API from functions being passed *GMT only */
+};
+
+/* p_to_io_func is used as a pointer to functions such as GMT_read_d in assignments
+ * and is used to declare GMT_get_io_ptr in gmt_io.c and gmt_prototypes.h */
+typedef int (*p_to_io_func) (struct GMT_CTRL *, FILE *, uint64_t, double *);
+
+/* Exit or return:  For some environments (e.g., Matlab) we do not
+   wish to call the system "Exit" as it brings down Matlab as well.  In those cases
+   we instead call return and let Matlab client deal with any follow-up.  This
+   decision is set in GMT_Create_Session via its flags.  While exit always returns
+   an integer code, the return functions may have to return other types, hence we
+   let GMT_exit possibly call exit, else it does nothing.  Thus, calls to GMT_exit
+   must be followed by return <type> so that we return where we said we would. */
+
+/* If GMT is not set or no_not_exit is false then we call system exit, else we move along */
+static inline void GMT_exit (struct GMT_CTRL *GMT, int code) {
+	if (GMT == NULL || GMT->parent == NULL || GMT->parent->do_not_exit == false)
+		exit (code);
+}
+
+#endif  /* _GMT_TYPES_H */
diff --git a/src/gmt/gmt_unique.h b/src/gmt/gmt_unique.h
new file mode 100644
index 0000000..b1aa0b3
--- /dev/null
+++ b/src/gmt/gmt_unique.h
@@ -0,0 +1,69 @@
+"B",
+"J",
+"JA",
+"Ja",
+"JB",
+"Jb",
+"JC",
+"Jc",
+"JD",
+"Jd",
+"JE",
+"Je",
+"JF",
+"Jf",
+"JG",
+"Jg",
+"JH",
+"Jh",
+"JI",
+"Ji",
+"JJ",
+"Jj",
+"JK",
+"Jk",
+"JL",
+"Jl",
+"JM",
+"Jm",
+"JN",
+"Jn",
+"JO",
+"Jo",
+"JP",
+"Jp",
+"JQ",
+"Jq",
+"JR",
+"Jr",
+"JS",
+"Js",
+"JT",
+"Jt",
+"JU",
+"Ju",
+"JV",
+"Jv",
+"JW",
+"Jw",
+"JX",
+"Jx",
+"JY",
+"Jy",
+"JZ",
+"Jz",
+"R",
+"X",
+"Y",
+"a",
+"b",
+"c",
+"f",
+"g",
+"h",
+"i",
+"n",
+"o",
+"p",
+"s",
+"t"
diff --git a/src/gmt/gmt_version.h b/src/gmt/gmt_version.h
new file mode 100644
index 0000000..35e33da
--- /dev/null
+++ b/src/gmt/gmt_version.h
@@ -0,0 +1,63 @@
+/*
+ * $Id: gmt_version.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *  Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo,
+ *  F. Wobbe, and J. Luis
+ *
+ * See LICENSE.TXT file for copying and redistribution conditions.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3 or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * Contact info: gmt.soest.hawaii.edu
+ */
+
+#pragma once
+#ifndef GMT_VERSION_H_
+#define GMT_VERSION_H_
+
+/* for manpages only */
+#define MANDATE "15 May 2015"
+
+#define GMT_MAJOR_VERSION 5
+#define GMT_MINOR_VERSION 1
+#define GMT_RELEASE_VERSION 2
+#define GMT_VERSION_YEAR 2015
+
+#define GMT_SOURCE_CODE_CONTROL_VERSION_STRING "14256"
+#ifdef GMT_SOURCE_CODE_CONTROL_VERSION_STRING
+#	define GMT_STRING "5.1.2 (r14256)"
+#else /* if HAVE_SVN_VERSION or if unversioned */
+#	define GMT_STRING "5.1.2"
+#endif
+
+#ifdef __x86_64__
+#	define GMT_VER_64 " [64-bit]"
+#else
+#	define GMT_VER_64 ""
+#endif
+
+#ifdef _OPENMP /* Open MP Parallelization is on */
+#	define GMT_MP " [MP]"
+#else
+#	define GMT_MP ""
+#endif
+
+#ifndef GMT_MANPAGE
+#	define GMT_VERSION GMT_version()
+	static inline char *GMT_version () {
+		/* final string returned by GMT_version() */
+		static char version[] = GMT_STRING GMT_VER_64 GMT_MP;
+		return version;
+	}
+#endif /* !GMT_MANPAGE */
+
+#endif /* !GMT_VERSION_H_ */
+
+/* vim: set ft=c: */
diff --git a/src/gmt/mbcontour.c b/src/gmt/mbcontour.c
index 0848ece..4800f54 100644
--- a/src/gmt/mbcontour.c
+++ b/src/gmt/mbcontour.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
- *    The MB-system:	mbcontour.c	6/4/93
- *    $Id: mbcontour.c 2175 2014-03-18 23:03:39Z caress $
+ *    The MB-system:	mbcontour.c	5/30/93
+ *    $Id: mbcontour.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -14,193 +14,35 @@
  *--------------------------------------------------------------------*/
 /*
  * MBCONTOUR is a GMT compatible utility which creates a color postscript
- * contour map of multibeam swath bathymetry.
- * Complete maps are made by using MBCONTOUR in conjunction with the
- * usual GMT programs.  The contour levels and colors can be controlled
- * directly or set implicitly using contour and color change intervals.
- * Contours can also be set to have ticks pointing downhill.
+ * image of swath bathymetry or backscatter data.  The image
+ * may be shaded relief as well.  Complete maps are made by using
+ * MBCONTOUR in conjunction with the usual GMT programs.  The modes
+ * of operation are:
+ *   Mode 1:  Bathymetry
+ *   Mode 2:  Bathymetry shaded by illumination
+ *   Mode 3:  Bathymetry shaded by amplitude
+ *   Mode 4:  amplitude
+ *   Mode 5:  sidescan
+ *   Mode 6:  Bathymetry shaded by amplitude using cpt gray data
  *
  * Author:	D. W. Caress
- * Date:	June 4, 1993
- *
- * $Log: mbcontour.c,v $
- * Revision 5.15  2009/03/02 18:59:05  caress
- * Moving towards 5.1.2beta1.
- *
- * Revision 5.14  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.13  2007/03/02 18:17:38  caress
- * Fixed problems plotting ping/shot number annotation.
- *
- * Revision 5.12  2006/11/10 22:05:37  caress
- * Added ping number/shot number navigation track annotation.
- *
- * Revision 5.11  2006/01/18 07:27:01  caress
- * Fixed to work with GMT4.1
- *
- * Revision 5.10  2005/11/04 20:50:19  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2005/03/25 04:03:10  caress
- * Added control on filename annotation direction.
- *
- * Revision 5.8  2004/12/18 01:26:43  caress
- * Added filename annotation.
- *
- * Revision 5.7  2003/04/17 20:43:37  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/10/02 23:52:37  caress
- * Release 5.0.beta24
- *
- * Revision 5.5  2002/04/06 02:45:59  caress
- * Release 5.0.beta16
- *
- * Revision 5.4  2001/08/10 22:40:02  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.3  2001-07-19 17:29:41-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22 21:03:31  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.1  2001/01/22  05:03:25  caress
- * Release 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:52:16  caress
- * First cut at Version 5.0.
- *
- * Revision 4.24  2000/10/11  00:53:45  caress
- * Converted to ANSI C
- *
- * Revision 4.23  2000/09/30  06:52:17  caress
- * Snapshot for Dale.
- *
- * Revision 4.22  2000/09/11  20:09:14  caress
- * Linked to new datalist parsing functions. Now supports recursive datalists
- * and comments in datalists.
- *
- * Revision 4.21  1998/10/28  21:32:29  caress
- * Fixed handling of data with variable numbers of beams.
- *
- * Revision 4.20  1998/10/04  04:18:07  caress
- * MB-System version 4.6beta
- *
- * Revision 4.19  1997/10/07  20:10:51  caress
- * Fixed tick flag for contours read from file.
- *
- * Revision 4.18  1997/04/21  16:53:56  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.18  1997/04/17  15:05:49  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.17  1996/09/05  13:58:27  caress
- * Added feature to check data bounds in ".inf" files.
- *
- * Revision 4.16  1996/04/22  13:18:44  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.15  1995/11/28  21:06:16  caress
- * Fixed scaling for meters to feet.
- *
- * Revision 4.14  1995/11/22  22:13:02  caress
- * Now handles bathymetry in feet with -W option.
- *
- * Revision 4.13  1995/11/02  19:24:45  caress
- * Fixed mb_error calls.
- *
- * Revision 4.12  1995/09/29  18:09:17  caress
- * Enabled mbio using larger bounds than plot bounds.
- *
- * Revision 4.11  1995/08/07  17:31:39  caress
- * Moved to GMT V3.
- *
- * Revision 4.10  1995/06/05  12:41:03  caress
- * Now checks navlon != navlon_old || navlat != navlat_old instead
- * of doing &
- *
- * Revision 4.9  1995/05/12  17:19:02  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.8  1995/03/06  19:39:52  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.7  1995/01/05  23:59:20  caress
- * Made it possible to read data from a single file or
- * from datalists.
- *
- * Revision 4.6  1994/12/21  20:23:30  caress
- * Allows plotting in triangle mode when ship's lon and lat
- * doesn't change.
- *
- * Revision 4.5  1994/10/21  11:34:20  caress
- * Release V4.0
- *
- * Revision 4.5  1994/10/21  11:34:20  caress
- * Release V4.0
- *
- * Revision 4.4  1994/07/29  19:04:31  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * >> using unix second time base.
- *
- * Revision 4.3  1994/06/13  19:01:13  caress
- * Fixed typos in info messages.
- *
- * Revision 4.2  1994/06/13  18:39:15  caress
- * Made it possible to read data from stdin.
- *
- * Revision 4.1  1994/05/16  22:15:16  caress
- * First cut at new contouring scheme.  Additional major changes
- * include adding annotated ship track plot and isolation
- * of plot initialization.
- *
- * Revision 4.1  1994/05/16  22:15:16  caress
- * First cut at new contouring scheme.  Additional major changes
- * include adding annotated ship track plot and isolation
- * of plot initialization.
- *
- * Revision 4.0  1994/03/05  23:46:48  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  23:46:48  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:48:58  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/26  23:07:51  caress
- * First cut at new version.
- *
- * Revision 3.3  1993/11/03  21:09:10  caress
- * Changed ps_plotinit call to agree with current version
- * of GMT (v2.1.4).
- *
- * Revision 3.2  1993/08/16  22:57:49  caress
- * Changed ad hoc string justification.  Used to assume letter width
- * is 0.5 letter height, but now assumes letter width is 0.37 letter
- * height.
- *
- * Revision 3.1  1993/06/21  00:04:52  caress
- * Fixed help message.
- *
- * Revision 3.0  1993/06/19  01:17:26  caress
- * Initial version
- * ls
- *
+ * Date:	May 30, 1993 (original standalone program for GMT3 and GMT4)
+ *                           (also originally served to drive Calcomp style pen 
+ *                              plotters in real time)
+ * Date:	January 27, 2015 (recast as GMT5 module, code supporting pen
+ *                                  plotters removed)
  *
  */
 
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
+#define THIS_MODULE_NAME	"mbcontour"
+#define THIS_MODULE_LIB		"mbgmt"
+#define THIS_MODULE_PURPOSE	"Plot swath bathymetry, amplitude, or backscatter"
+#define THIS_MODULE_KEYS	""
+
+/* GMT5 header file */
+#include "gmt_dev.h"
+
+#define GMT_PROG_OPTIONS "->BJKOPRUVXY" GMT_OPT("S")
 
 /* MBIO include files */
 #include "mb_status.h"
@@ -208,37 +50,463 @@
 #include "mb_define.h"
 #include "mb_aux.h"
 
-/* GMT argument handling define */
-#define MBCONTOUR_GMT_ARG_MAX 128
+EXTERN_MSC int GMT_mbcontour(void *API, int mode, void *args);
+
+/* Control structure for mbcontour */
+struct MBCONTOUR_CTRL {
+
+	struct mbcontour_A {	/* -A<cont_int>/<col_int>/<tick_int>/<label_int>/<tick_len>/<label_hgt>/<label_spacing> */
+		bool active;
+		double cont_int;
+		double col_int;
+		double tick_int;
+		double label_int;
+		double tick_len;
+		double label_hgt;
+		double label_spacing;
+ 	} A;
+	struct mbcontour_b {	/* -b<year>/<month>/<day>/<hour>/<minute>/<second> */
+		bool active;
+		int time_i[7];
+	} b;
+	struct mbcontour_C {	/* -C<contourfile> */
+		bool active;
+		char *contourfile;
+	} C;
+	struct mbcontour_D {	/* -D<time_tick_int>/<time_annot_int>/<date_annot_int>/<time_tick_len> */
+		bool active;
+		double time_tick_int;
+		double time_annot_int;
+		double date_annot_int;
+		double time_tick_len;
+	} D;
+	struct mbcontour_e {	/* -e<year>/<month>/<day>/<hour>/<minute>/<second> */
+		bool active;
+		int time_i[7];
+	} e;
+	struct mbcontour_F {	/* -F<format> */
+		bool active;
+		int format;
+	} F;
+	struct mbcontour_G {	/* -G<name_hgt>/<name_perp> */
+		bool active;
+		double name_hgt;
+		int name_perp;
+	} G;
+	struct mbcontour_I {	/* -I<inputfile> */
+		bool active;
+		char *inputfile;
+	} I;
+	struct mbcontour_L {	/* -L<lonflip> */
+		bool active;
+		int lonflip;
+	} L;
+	struct mbcontour_M {	/* -M<pingnumber_tick_int>/<pingnumber_annot_int>/<pingnumber_tick_len> */
+		bool active;
+		double pingnumber_tick_int;
+		double pingnumber_annot_int;
+		double pingnumber_tick_len;
+	} M;
+	struct mbcontour_N {	/* -N<nplot> */
+		bool active;
+		int nplot;
+	} N;
+	struct mbcontour_p {	/* -p<pings> */
+		bool active;
+		int pings;
+	} p;
+	struct mbcontour_Q {	/* -Q */
+		bool active;
+	} Q;
+	struct mbcontour_S {	/* -S<speedmin> */
+		bool active;
+		double speedmin;
+	} S;
+	struct mbcontour_T {	/* -T<timegap> */
+		bool active;
+		double timegap;
+	} T;
+	struct mbcontour_W {	/* -W */
+		bool active;
+	} W;
+	struct mbcontour_Z {	/* -Z<algorithm> */
+		bool active;
+		int contour_algorithm;
+	} Z;
+};
+
+/*--------------------------------------------------------------------*/
+/* Global variables */
+        
+/* GMT and PSlib control */
+struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
+struct GMT_CTRL *GMT = NULL;	/* General GMT interal parameters */
+
+/* pen variables */
+int	ncolor;
+int	nlevel;
+double	*level = NULL;
+int	*red = NULL;
+int	*green = NULL;
+int	*blue = NULL;
+int	*label = NULL;
+int	*tick = NULL;
+
+/* inch to map scale */
+double	inchtolon;
+
+/* line plotting variables */
+#define MBCONTOUR_PLOT_ALLOC_INC        1024
+#define MBCONTOUR_PLOT_MOVE 	3
+#define MBCONTOUR_PLOT_DRAW 	2
+#define MBCONTOUR_PLOT_STROKE   -2
+#define MBCONTOUR_PLOT_OR 	-3
+int     ncontour_plot = 0;
+int     ncontour_plot_alloc = 0;
+double  *contour_x = NULL;
+double  *contour_y = NULL;
+
+void *New_mbcontour_Ctrl (struct GMT_CTRL *GMT);
+void Free_mbcontour_Ctrl (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl);
+int GMT_mbcontour_usage (struct GMTAPI_CTRL *API, int level);
+int GMT_mbcontour_parse (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl, struct GMT_OPTION *options);
+
+int mbcontour_ping_copy(int verbose, int one, int two, struct swath *swath, int *error);
+void mbcontour_plot(double x, double y, int ipen);
+void mbcontour_setline(int linewidth);
+void mbcontour_newpen(int ipen);
+void mbcontour_justify_string(double height, char *string, double *s);
+void mbcontour_plot_string(double x, double y, double hgt, double angle, char *label);
+
+static char svn_id[] = "$Id: mbcontour.c 2247 2015-05-29 21:28:28Z caress $";
 
-/* label and contour line length */
-#define MBCONTOUR_LABEL_LEN 128
+/*--------------------------------------------------------------------*/
 
-int ping_copy(int verbose, int one, int two, struct swath *swath, int *error);
+void *New_mbcontour_Ctrl (struct GMT_CTRL *GMT) {	/* Allocate and initialize a new control structure */
+	struct MBCONTOUR_CTRL *Ctrl;
+        int     status;
+        int     verbose = 0;
+        double  dummybounds[4];
+        int     dummyformat;
+        int     dummypings;
 
-static char rcs_id[] = "$Id: mbcontour.c 2175 2014-03-18 23:03:39Z caress $";
+	Ctrl = GMT_memory (GMT, NULL, 1, struct MBCONTOUR_CTRL);
 
-/*--------------------------------------------------------------------*/
+	/* Initialize values whose defaults are not 0/false/NULL */
 
-int main (int argc, char **argv)
+	/* get current mb default values */
+	status = mb_defaults(verbose, &dummyformat, &dummypings, &Ctrl->L.lonflip, dummybounds,
+	                     Ctrl->b.time_i, Ctrl->e.time_i, &Ctrl->S.speedmin, &Ctrl->T.timegap);
+
+	Ctrl->A.active = MB_NO;
+	Ctrl->A.cont_int = 25.;
+	Ctrl->A.col_int = 100.;
+	Ctrl->A.tick_int = 100.;
+	Ctrl->A.label_int = 100.;
+	Ctrl->A.tick_len = 0.05;
+	Ctrl->A.label_hgt = 0.1;
+	Ctrl->A.label_spacing = 0.0;
+	Ctrl->b.active = MB_NO;
+	Ctrl->C.active = MB_NO;
+	Ctrl->C.contourfile = NULL;
+	Ctrl->D.active = MB_NO;
+	Ctrl->D.time_tick_int = 0.25;
+	Ctrl->D.time_annot_int = 1.0;
+	Ctrl->D.date_annot_int = 4.0;
+	Ctrl->D.time_tick_len = 0.1;
+	Ctrl->e.active = MB_NO;
+	Ctrl->F.active = MB_NO;
+	Ctrl->F.format = 0;
+	Ctrl->G.active = MB_NO;
+	Ctrl->G.name_hgt = 0.1;
+	Ctrl->G.name_perp = MB_NO;
+	Ctrl->I.active = MB_NO;
+	Ctrl->I.inputfile = NULL;
+	Ctrl->L.active = MB_NO;
+	Ctrl->M.active = MB_NO;
+	Ctrl->M.pingnumber_tick_int = 50;
+	Ctrl->M.pingnumber_annot_int = 100;
+	Ctrl->M.pingnumber_tick_len = 0.1;
+	Ctrl->N.active = MB_NO;
+	Ctrl->N.nplot = 0;
+	Ctrl->Q.active = MB_NO;
+	Ctrl->S.active = MB_NO;
+	Ctrl->T.active = MB_NO;
+	Ctrl->W.active = MB_NO;
+	Ctrl->Z.active = MB_NO;
+	Ctrl->Z.contour_algorithm = MB_CONTOUR_OLD;
+
+	return (Ctrl);
+}
+
+void Free_mbcontour_Ctrl (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl) {	/* Deallocate control structure */
+	if (!Ctrl) return;
+	if (Ctrl->C.contourfile) free (Ctrl->C.contourfile);
+	if (Ctrl->I.inputfile) free (Ctrl->I.inputfile);
+	GMT_free (GMT, Ctrl);
+}
+
+int GMT_mbcontour_usage (struct GMTAPI_CTRL *API, int level)
 {
-#ifdef MBCONTOURFILTER
-	char program_name[] = "MBCONTOURFILTER";
-	char help_message[] =  "MBCONTOURFILTER is a utility which creates a pen plot \ncontour map of multibeam swath bathymetry.  \nThe primary purpose of this program is to serve as \npart of a real-time plotting system.  The contour \nlevels and colors can be controlled \ndirectly or set implicitly using contour and color change intervals. \nContours can also be set to have ticks pointing downhill.";
-	char usage_message[] = "mbcontourfilter -Jparameters -Rwest/east/south/north \n\t[-Acontour_int/color_int/tick_int/label_int/tick_len/label_hgt/label_spacing \n\t-Btickinfo -byr/mon/day/hour/min/sec -Ccontourfile \n\t-Dtime_tick/time_annot/date_annot/time_tick_len -Eyr/mon/day/hour/min/sec \n\t-fformat -Fred/green/blue -Idatalist -K -Llonflip -M -O -Nnplot \n\t-P -ppings -Q -Ttimegap -U -Xx-shift -Yy-shift -Zalgorithm -#copies -V -H]";
+//	char help_message[] =  "mbcontour is a GMT compatible utility which creates a color postscript \nimage of swath bathymetry or backscatter data.  The image \nmay be shaded relief as well.  Complete maps are made by using \nMBCONTOUR in conjunction with the usual GMT programs.";
+//	char usage_message[] = "mbcontour -Ccptfile -Jparameters -Rwest/east/south/north \n\t[-Afactor -Btickinfo -byr/mon/day/hour/min/sec \n\t-ccopies -Dmode/ampscale/ampmin/ampmax \n\t-Eyr/mon/day/hour/min/sec -fformat \n\t-Fred/green/blue -Gmagnitude/azimuth -Idatalist \n\t-K -Ncptfile -O -P -ppings -Qdpi -Ttimegap -U -W -Xx-shift -Yy-shift \n\t-Zmode[F] -V -H]";
+
+	GMT_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_NAME, THIS_MODULE_PURPOSE);
+	if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
+	GMT_Message (API, GMT_TIME_NONE, "usage: mbcontour -I<inputfile> %s [%s]\n", GMT_J_OPT, GMT_B_OPT);
+	GMT_Message (API, GMT_TIME_NONE, "\t[-A<factor>/<mode>/<depth>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-b<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-C<cptfile>] [-D<mode>/<ampscale>/<ampmin>/<ampmax>] [-Ei|<dpi>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-e<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-F<format>] [-G<magnitude>/<azimuth | median>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-I<inputfile>] [-L<lonflip>] [-N<cptfile>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-S<speed>] [-T<timegap>] [-W] [-Z<mode>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-T] [%s] [%s]\n", GMT_Rgeo_OPT, GMT_U_OPT, GMT_V_OPT);
+	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s] [%s] [%s]\n\t[%s]\n\t[%s] [%s]\n\n", 
+	                                  GMT_X_OPT, GMT_Y_OPT, GMT_c_OPT, GMT_f_OPT, GMT_n_OPT, GMT_p_OPT, GMT_t_OPT);
+
+	if (level == GMT_SYNOPSIS) return (EXIT_FAILURE);
+
+	GMT_Message (API, GMT_TIME_NONE, "\t<inputfile> is an MB-System datalist referencing the swath data to be plotted.\n");
+	GMT_Option (API, "J-");
+	GMT_Message (API, GMT_TIME_NONE, "\n\tOPTIONS:\n");
+	GMT_Option (API, "B-");
+	GMT_Message (API, GMT_TIME_NONE, "\t-C Contour file. Defines contour levels, style, and colors.\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   to automatically assign 16 continuous colors over the data range [rainbow].\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t-E Set dpi for the projected output Postscript image\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   if -Jx or -Jm is not selected.\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   Give i to do the interpolation in PostScript at device resolution.\n");
+	GMT_rgb_syntax (API->GMT, 'G', "Set transparency color for images that otherwise would result in 1-bit images.\n\t  ");
+	GMT_Option (API, "K");
+	GMT_Option (API, "O,P");
+	GMT_Message (API, GMT_TIME_NONE, "\t-p<pings> Sets the ping averaging of the input data [Default = 1, i.e. no ping average].\n");
+	GMT_Option (API, "R");
+	GMT_Option (API, "U,V,X,c,.");
+
+	return (EXIT_FAILURE);
+}
+
+int GMT_mbcontour_parse (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl, struct GMT_OPTION *options)
+{
+	/* This parses the options provided to mbcontour and sets parameters in Ctrl.
+	 * Note Ctrl has already been initialized and non-zero default values set.
+	 * Any GMT common options will override values set previously by other commands.
+	 * It also replaces any file names specified as input or output with the data ID
+	 * returned when registering these sources/destinations with the API.
+	 */
+
+	unsigned int n_errors = 0, n_files = 0;
+	int    n;
+	struct GMT_OPTION *opt = NULL;
+	struct GMTAPI_CTRL *API = GMT->parent;
+
+	for (opt = options; opt; opt = opt->next) {	/* Process all the options given */
+
+		switch (opt->option) {
+			case '<':	/* Input file (only one or three is accepted) */
+				Ctrl->I.active = true;
+#if GMT_MINOR_VERSION == 1 && GMT_RELEASE_VERSION < 2
+				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN)) {
 #else
-	char program_name[] = "MBCONTOUR";
-	char help_message[] =  "MBCONTOUR is a GMT compatible utility which creates a color postscript \ncontour map of multibeam swath bathymetry.  \nComplete maps are made by using MBCONTOUR in conjunction with the  \nusual GMT programs.  The contour levels and colors can be controlled \ndirectly or set implicitly using contour and color change intervals. \nContours can also be set to have ticks pointing downhill.";
-	char usage_message[] = "mbcontour -Jparameters -Rwest/east/south/north \n\t[-Acontour_int/color_int/tick_int/label_int/tick_len/label_hgt/label_spacing \n\t-Btickinfo -byr/mon/day/hour/min/sec -Ccontourfile -ccopies \n\t-Dtime_tick/time_annot/date_annot/time_tick_len \n\t-Eyr/mon/day/hour/min/sec \n\t-fformat -Fred/green/blue -Idatalist -K -Llonflip -Nnplot -O \n\t-P -ppings -U -Xx-shift -Yy-shift -Zalgorithm -V -H]";
+				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN, GMT_IS_DATASET)) {
 #endif
+					Ctrl->I.inputfile = strdup (opt->arg);
+					n_files = 1;
+				}
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error: only one input file is allowed.\n");
+					n_errors++;
+				}
+				break;
+
+			/* Processes program-specific parameters */
+
+			case 'A':	/* contour controls */
+				n = sscanf(opt->arg, "%lf/%lf/%lf/%lf/%lf/%lf/%lf",
+				           &(Ctrl->A.cont_int), &(Ctrl->A.col_int), &(Ctrl->A.tick_int),
+				           &(Ctrl->A.label_int), &(Ctrl->A.tick_len), &(Ctrl->A.label_hgt),
+				           &(Ctrl->A.label_spacing));
+				if (n > 0)
+					Ctrl->A.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -A option: \n");
+					n_errors++;
+				}
+ 				break;
+			case 'b':	/* btime_i */
+				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
+				           &(Ctrl->b.time_i[0]), &(Ctrl->b.time_i[1]), &(Ctrl->b.time_i[2]),
+				           &(Ctrl->b.time_i[3]), &(Ctrl->b.time_i[4]), &(Ctrl->b.time_i[5]));
+				Ctrl->b.time_i[6] = 0;
+				if (n == 6)
+					Ctrl->b.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -b option: \n");
+					n_errors++;
+				}
+				break;
+			case 'C':	/* contour file */
+				Ctrl->C.active = true;
+				if (Ctrl->C.contourfile) free (Ctrl->C.contourfile);
+				Ctrl->C.contourfile = strdup (opt->arg);
+				break;
+			case 'D':	/* track annotation */
+				n = sscanf(opt->arg, "%lf/%lf/%lf/%lf",
+				           &(Ctrl->D.time_tick_int), &(Ctrl->D.time_annot_int),
+				           &(Ctrl->D.date_annot_int), &(Ctrl->D.time_tick_len));
+				if (n > 0)
+					Ctrl->D.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -D option: \n");
+					n_errors++;
+				}
+ 				break;
+			case 'e':	/* etime_i */
+				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
+				           &(Ctrl->e.time_i[0]), &(Ctrl->e.time_i[1]), &(Ctrl->e.time_i[2]),
+				           &(Ctrl->e.time_i[3]), &(Ctrl->e.time_i[4]), &(Ctrl->e.time_i[5]));
+				Ctrl->e.time_i[6] = 0;
+				if (n == 6)
+					Ctrl->e.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -e option: \n");
+					n_errors++;
+				}
+				break;
+			case 'f':	/* format */
+			case 'F':	/* format */
+				n = sscanf(opt->arg, "%d", &(Ctrl->F.format));
+				if (n == 1)
+					Ctrl->F.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -F option: \n");
+					n_errors++;
+				}
+				break;
+			case 'G':	/* file annotation */
+				n = sscanf(opt->arg, "%lf/%d", &(Ctrl->G.name_hgt), &(Ctrl->G.name_perp));
+				if (n == 2)
+					Ctrl->G.active = true;
+				else if (n == 1) {
+					Ctrl->G.active = true;
+					Ctrl->G.name_perp = false;
+				}
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -G option: \n");
+					n_errors++;
+				}
+				break;
+
+			case 'I':	/* -I<inputfile> */
+				Ctrl->I.active = true;
+				if (!GMT_access (GMT, opt->arg, R_OK)) {	/* Got a file */
+					Ctrl->I.inputfile = strdup (opt->arg);
+					n_files = 1;
+				}
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -I: Requires a valid file\n");
+					n_errors++;
+				}
+				break;
+			case 'L':	/* -L<lonflip> */
+				n = sscanf(opt->arg, "%d", &(Ctrl->L.lonflip));
+				if (n == 1)
+					Ctrl->L.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -L option: \n");
+					n_errors++;
+				}
+				break;
+			case 'M':	/* ping number annotation */
+				n = sscanf(opt->arg, "%lf/%lf/%lf",
+				           &(Ctrl->M.pingnumber_tick_int), &(Ctrl->M.pingnumber_annot_int),
+				           &(Ctrl->M.pingnumber_tick_len));
+				if (n > 0)
+					Ctrl->M.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -M option: \n");
+					n_errors++;
+				}
+ 				break;
+			case 'N':	/* nplot */
+				n = sscanf(opt->arg, "%d", &(Ctrl->N.nplot));
+				if (n > 0)
+					Ctrl->N.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -N option: \n");
+					n_errors++;
+				}
+ 				break;
+			case 'p':	/* Sets the ping averaging */
+				Ctrl->p.active = true;
+				Ctrl->p.pings = atoi(opt->arg);
+				if (Ctrl->p.pings < 0) {
+					GMT_Report (API, GMT_MSG_NORMAL, "Error -p option: Don't invent, number of pings must be >= 0\n");
+					Ctrl->p.pings = 1;
+				}
+ 				break;
+			case 'Q':	/* plot triangles */
+				Ctrl->Q.active = true;
+ 				break;
+			case 'S':	/* -S<speed> */
+				n = sscanf(opt->arg, "%lf", &(Ctrl->S.speedmin));
+				if (n == 1)
+					Ctrl->S.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -S option: \n");
+					n_errors++;
+				}
+				break;
+			case 'T':	/* -T<timegap> */
+				n = sscanf(opt->arg, "%lf", &(Ctrl->T.timegap));
+				if (n == 1)
+					Ctrl->T.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -T option: \n");
+					n_errors++;
+				}
+				break;
+			case 'W':	/* -W */
+				Ctrl->W.active = true;
+				break;
+			case 'Z':	/* contour algorithm */
+				n = sscanf(opt->arg, "%d", &(Ctrl->Z.contour_algorithm));
+				if (n == 1)
+					Ctrl->Z.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -Z option: \n");
+					n_errors++;
+				}
+				break;
+			default:	/* Report bad options */
+				n_errors += GMT_default_error (GMT, opt->option);
+				break;
+		}
+	}
 
-	extern char *optarg;
-	int     argc_gmt = 0;
-	char    *argv_gmt[MBCONTOUR_GMT_ARG_MAX];
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
+	n_errors += GMT_check_condition (GMT, !GMT->common.R.active, "Syntax error: Must specify -R option\n");
+	n_errors += GMT_check_condition (GMT, !GMT->common.J.active,
+	                                 "Syntax error: Must specify a map projection with the -J option\n");
+	n_errors += GMT_check_condition (GMT, n_files != 1, "Syntax error: Must specify one input file(s)\n");
+	n_errors += GMT_check_condition (GMT, Ctrl->I.active && !Ctrl->I.inputfile, 
+	                                 "Syntax error -I option: Must specify input file\n");
+
+	return (n_errors ? GMT_PARSE_ERROR : GMT_OK);
+}
+
+#define bailout(code) {GMT_Free_Options (mode); return (code);}
+#define Return(code) {Free_mbcontour_Ctrl (GMT, Ctrl); GMT_end_module (GMT, GMT_cpy); bailout (code);}
+
+int GMT_mbcontour (void *V_API, int mode, void *args)
+{
+
+	char program_name[] = "mbcontour";
+
+	struct GMT_PALETTE *CPTcolor = NULL;
+	struct GMT_CTRL *GMT_cpy = NULL;	/* General GMT interal parameters */
+	struct GMT_OPTION *options = NULL;
+	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
+	struct MBCONTOUR_CTRL *Ctrl = NULL;
 
 	/* MBIO status variables */
 	int	status = MB_SUCCESS;
@@ -247,9 +515,9 @@ int main (int argc, char **argv)
 	char	*message = NULL;
 
 	/* MBIO read control parameters */
-	char	read_file[MBCONTOUR_LABEL_LEN];
-        int     read_datalist;
-	int	read_data;
+	mb_path	read_file;
+	int     read_datalist = MB_NO;
+	int	read_data = MB_NO;
 	void	*datalist;
 	int	look_processed = MB_DATALIST_LOOK_UNSET;
 	double	file_weight;
@@ -259,15 +527,14 @@ int main (int argc, char **argv)
 	int	lonflip;
 	int	lonflip_set = MB_NO;
 	double	bounds[4];
-	double	mb_bounds[4];
 	int	btime_i[7];
 	int	etime_i[7];
 	double	btime_d;
 	double	etime_d;
 	double	speedmin;
 	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	file_in_bounds;
+	mb_path	file;
+	int	file_in_bounds = MB_NO;
 	int	beams_bath;
 	int	beams_amp;
 	int	pixels_ss;
@@ -295,11 +562,11 @@ int main (int argc, char **argv)
 	double	*ss = NULL;
 	double	*sslon = NULL;
 	double	*sslat = NULL;
-	char	comment[256];
+	mb_path	comment;
 	int	pingnumber;
 
 	/* plot control variables */
-	int	contour_algorithm;
+	int	contour_algorithm = MB_CONTOUR_OLD;
 	char	contourfile[MB_PATH_MAXLINE];
 	int	plot;
 	int	done;
@@ -307,10 +574,10 @@ int main (int argc, char **argv)
 	int	save_new;
 	int	*npings = NULL;
 	int	nping_read;
-	int	nplot;
-	int	plot_contours;
-	int	plot_triangles;
-	int	set_contours;
+	int	nplot = 0;
+	int	plot_contours = MB_NO;
+	int	plot_triangles = MB_NO;
+	int	set_contours = MB_NO;
 	double	cont_int;
 	double	col_int;
 	double	tick_int;
@@ -321,9 +588,9 @@ int main (int argc, char **argv)
 	double	tick_len_map;
 	double	label_hgt_map;
 	double	label_spacing_map;
-	int 	plot_name;
-	int	plotted_name;
-	int	plot_track;
+	int 	plot_name = MB_NO;
+	int	plotted_name = MB_NO;
+	int	plot_track = MB_NO;
 	double	time_tick_int;
 	double	time_annot_int;
 	double	date_annot_int;
@@ -331,284 +598,133 @@ int main (int argc, char **argv)
 	double	time_tick_len_map;
 	double	name_hgt;
 	double	name_hgt_map;
-	int	name_perp;
-	double	scale;
-	int	bathy_in_feet;
-	int	plot_pingnumber;
-	int	pingnumber_tick_int;
-	int	pingnumber_annot_int;
-	double	pingnumber_tick_len;
+	int	name_perp = MB_NO;
+	int	bathy_in_feet = MB_NO;
+	int	plot_pingnumber = MB_NO;
+	int	pingnumber_tick_int = 50;
+	int	pingnumber_annot_int = 100;
+	double	pingnumber_tick_len = 0.1;
 	double	pingnumber_tick_len_map;
 
-	/* pen variables */
-	int	ncolor;
-	int	nlevel;
-	double	*level = NULL;
-	int	*red = NULL;
-	int	*green = NULL;
-	int	*blue = NULL;
-	int	*label = NULL;
-	int	*tick = NULL;
-
-	/* inch to map scale */
-	double	inchtolon;
-
 	/* other variables */
-	char	line[MBCONTOUR_LABEL_LEN];
-	char	labelstr[MBCONTOUR_LABEL_LEN], tickstr[MBCONTOUR_LABEL_LEN];
+	mb_path	line;
+	mb_path	labelstr, tickstr;
 	int	count;
 	int	setcolors;
 	double	navlon_old;
 	double	navlat_old;
-	int	i1, i2;
-	double	d1, d2, d3, d4, d5, d6, d7;
-	int	nscan;
+	double  clipx[4], clipy[4];
 	int	i;
 
+	/*----------------------- Standard module initialization and parsing ----------------------*/
+
+	if (API == NULL) return (GMT_NOT_A_SESSION);
+	if (mode == GMT_MODULE_PURPOSE) return (GMT_mbcontour_usage (API, GMT_MODULE_PURPOSE));	/* Return the purpose of program */
+	options = GMT_Create_Options (API, mode, args);	if (API->error) return (API->error);	/* Set or get option list */
+
+	if (!options || options->option == GMT_OPT_USAGE) bailout (GMT_mbcontour_usage (API, GMT_USAGE));	/* Return the usage message */
+	if (options->option == GMT_OPT_SYNOPSIS) bailout (GMT_mbcontour_usage (API, GMT_SYNOPSIS));	/* Return the synopsis */
+
+	/* Parse the command-line arguments */
+
+	GMT = GMT_begin_module (API, THIS_MODULE_LIB, THIS_MODULE_NAME, &GMT_cpy); /* Save current state */
+	if (GMT_Parse_Common (API, GMT_PROG_OPTIONS, options)) {
+		fprintf(stderr,"Error from GMT_Parse_common():%d\n",API->error);
+		Return (API->error);
+	}
+               
+	Ctrl = (struct MBCONTOUR_CTRL *) New_mbcontour_Ctrl (GMT);	/* Allocate and initialize a new control structure */
+	if ((error = GMT_mbcontour_parse (GMT, Ctrl, options))) {
+		fprintf(stderr,"Error from GMT_mbcontour_parse():%d\n",error);
+		Return (error);
+	}
+
+	/*-------------------------------- Variable initialization --------------------------------*/
+
 	/* get current mb default values */
 	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
 		btime_i,etime_i,&speedmin,&timegap);
 
-	/* set default input to stdin */
-	strcpy (read_file, "stdin");
-
-	/* initialize some values */
-	format = -1;
-        read_datalist = MB_NO;
-	contour_algorithm = MB_CONTOUR_OLD;
-	strcpy (contourfile,"\0");
-	set_contours = MB_NO;
-	bounds[0] = 0.0;
-	bounds[1] = 0.0;
-	bounds[2] = 0.0;
-	bounds[3] = 0.0;
-	scale = 0.0;
-	nplot = 0;
-	cont_int = 25.;
-	col_int = 100.;
-	tick_int = 100.;
-	label_int = 100.;
-	label_hgt = 0.1;
-	label_spacing = 0.0;
-	tick_len = 0.05;
-	plot_name = MB_NO;
-	plot_track = MB_NO;
-	time_tick_int = 0.25;
-	time_annot_int = 1.0;
-	date_annot_int = 4.0;
-	time_tick_len = 0.1;
-	name_hgt = 0.1;
-	name_perp = MB_NO;
-	ncolor = 4;
-	nlevel = 0;
-	plot_contours = MB_NO;
-	plot_triangles = MB_NO;
-	bathy_in_feet = MB_NO;
-	plot_pingnumber = MB_NO;
-	pingnumber_tick_int = 50;
-	pingnumber_annot_int = 100;
-	pingnumber_tick_len = 0.1;
-
-	/* get GMT options into separate argv */
-	argv_gmt[0] = argv[0];
-	argc_gmt = 1;
-	for (i=1;i<argc;i++)
-	  {
-	  if (argv[i][0] == '-')
-	    {
-	    switch (argv[i][1])
-	        {
-		case 'B':
-		case 'F':
-		case 'J':
-		case 'j':
-		case 'K':
-		case 'k':
-		case 'O':
-		case 'o':
-		case 'P':
-		case 'R':
-		case 'r':
-		case 'U':
-		case 'u':
-		case 'V':
-		case 'v':
-		case 'X':
-		case 'x':
-		case 'Y':
-		case 'y':
-		case '#':
-		        if (argc_gmt < MBCONTOUR_GMT_ARG_MAX)
-			  {
-			  argv_gmt[argc_gmt] = argv[i];
-			  argc_gmt++;
-			  break;
-			  }
-		}
-	    }
-	  }
-
-	/* deal with mb options */
-	while ((c = getopt(argc, argv, "VvHhA:a:B:b:C:c:D:d:E:e:F:f:G:g:I:i:J:j:KkL:l:M:m:N:n:OoPp:QqR:r:S:s:T:t:UuWwX:x:Y:y:Z:z:")) != -1)
-	  switch (c)
-		{
-		case 'A':
-		case 'a':
-			nscan = sscanf (optarg, "%lf/%lf/%lf/%lf/%lf/%lf/%lf",
-					&d1,&d2,&d3,&d4,&d5,&d6,&d7);
-			if (nscan >= 1)
-			    cont_int = d1;
-			if (nscan >= 2)
-			    col_int = d2;
-			if (nscan >= 3)
-			    tick_int = d3;
-			if (nscan >= 4)
-			    label_int = d4;
-			if (nscan >= 5)
-			    tick_len = d5;
-			if (nscan >= 6)
-			    label_hgt = d6;
-			if (nscan >= 7)
-			    label_spacing = d7;
-			if (nscan >= 1)
-			    plot_contours = MB_YES;
-			break;
-		case 'b':
-			sscanf (optarg, "%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			break;
-		case 'C':
-			sscanf (optarg,"%s", contourfile);
-			plot_contours = MB_YES;
-			set_contours = MB_YES;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg, "%lf/%lf/%lf/%lf",
-				&time_tick_int,&time_annot_int,
-				&date_annot_int,&time_tick_len);
-			plot_track = MB_YES;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg, "%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			break;
-                case 'f':
-                        sscanf (optarg, "%d",&format);
-                        break;
-		case 'G':
-		case 'g':
-			nscan = sscanf (optarg, "%lf/%d", &name_hgt, &name_perp);
-			plot_name = MB_YES;
-			if (nscan < 1)
-			    name_hgt = 0.1;
-			if (nscan < 2)
-			    name_perp = MB_NO;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'J':
-			if (optarg[0] == 'm')
-				sscanf (&optarg[1],"%lf", &scale);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			lonflip_set = MB_YES;
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			nscan = sscanf (optarg, "%d/%d/%lf",
-					&i1,&i2,&d3);
-			if (nscan >= 1)
-			    pingnumber_tick_int = i1;
-			if (nscan >= 2)
-			    pingnumber_annot_int = i2;
-			if (nscan >= 3)
-			    pingnumber_tick_len = d3;
-			if (nscan >= 1)
-			    plot_pingnumber = MB_YES;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%d", &nplot);
-			if (nplot < 3) nplot = 3;
-			break;
-		case 'p':
-			sscanf (optarg,"%d", &pings);
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			plot_triangles = MB_YES;
-			break;
-		case 'R':
-		case 'r':
-			sscanf(optarg,"%lf/%lf/%lf/%lf",
-				&bounds[0],&bounds[1],
-				&bounds[2],&bounds[3]);
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg, "%lf", &speedmin);
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'W':
-		case 'w':
-			bathy_in_feet = MB_YES;
-			break;
-		case 'Z':
-		case 'z':
-			sscanf (optarg,"%d", &contour_algorithm);
-			flag++;
-			break;
-		case 'B':
-		case 'F':
-		case 'K':
-		case 'O':
-		case 'P':
-		case 'U':
-		case 'X':
-		case 'x':
-		case 'Y':
-		case 'y':
-		case '#':
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
+	if (Ctrl->p.active) pings = Ctrl->p.pings;		/* If pings were set by user, prefer it */
+
+	/* set default input to datalist.mb-1 */
+	strcpy (read_file, "datalist.mb-1");
+                        
+        /* set modes */
+        if (Ctrl->A.active)
+            {
+            plot_contours = MB_YES;
+            cont_int = Ctrl->A.cont_int;
+            col_int = Ctrl->A.col_int;
+            tick_int = Ctrl->A.tick_int;
+            label_int = Ctrl->A.label_int;
+            tick_len = Ctrl->A.tick_len;
+            label_hgt = Ctrl->A.label_hgt;
+            label_spacing = Ctrl->A.label_spacing;
+            }
+        if (Ctrl->b.active)
+            {
+            for (i=0;i<7;i++)
+                btime_i[i] = Ctrl->b.time_i[i];
+            }
+        if (Ctrl->C.active)
+            {
+            plot_contours = MB_YES;
+            set_contours = MB_YES;
+            strcpy(contourfile, Ctrl->C.contourfile);
+            }
+        if (Ctrl->D.active)
+            {
+            plot_track = MB_YES;
+            time_tick_int = Ctrl->D.time_tick_int;
+            time_annot_int = Ctrl->D.time_annot_int;
+            date_annot_int = Ctrl->D.date_annot_int;
+            time_tick_len = Ctrl->D.time_tick_len;
+            }
+        if (Ctrl->e.active)
+            {
+            for (i=0;i<7;i++)
+                etime_i[i] = Ctrl->e.time_i[i];
+            }
+        if (Ctrl->F.active)
+            format = Ctrl->F.format;
+        if (Ctrl->G.active)
+            {
+            plot_name = MB_YES;
+            name_hgt = Ctrl->G.name_hgt;
+            name_perp = Ctrl->G.name_perp;
+            }
+        if (Ctrl->I.active)
+            {
+            strcpy(read_file, Ctrl->I.inputfile);
+            }
+        if (Ctrl->L.active)
+            {
+            lonflip_set = MB_YES;
+            lonflip = Ctrl->L.lonflip;
+            }
+        if (Ctrl->M.active)
+            {
+            plot_pingnumber = MB_YES;
+            pingnumber_tick_int  = (int)Ctrl->M.pingnumber_tick_int;
+            pingnumber_annot_int = (int)Ctrl->M.pingnumber_annot_int;
+            pingnumber_tick_len  = Ctrl->M.pingnumber_tick_len;
+            }
+        if (Ctrl->N.active)
+                nplot = Ctrl->N.nplot;
+        if (Ctrl->Q.active)
+                plot_triangles = MB_YES;
+        if (Ctrl->S.active)
+                speedmin = Ctrl->S.speedmin;
+        if (Ctrl->T.active)
+                timegap = Ctrl->T.timegap;
+        if (Ctrl->W.active)
+                bathy_in_feet = MB_YES;
+        if (Ctrl->Z.active)
+                contour_algorithm = Ctrl->Z.contour_algorithm;
+        
+        /* set verbosity */
+        verbose = GMT->common.V.active;
 
 	/* set number of pings to be plotted if not set */
 	if (nplot == 0 && contour_algorithm == MB_CONTOUR_TRIANGLES)
@@ -638,111 +754,14 @@ int main (int argc, char **argv)
 		}
 
 	/* print starting message */
-	if (verbose == 1 || help)
+	if (verbose == 1)
 		{
 		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
+		fprintf(stderr,"Version %s\n",svn_id);
 		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
 		}
 
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* initialize plotting */
-	status = mb_plot_init(verbose,argc_gmt,argv_gmt,bounds,&scale,&inchtolon,&error);
-
-	/* if error flagged then print it and exit */
-	if (status == MB_FAILURE)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"GMT option error\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                 %d\n",help);
-		fprintf(stderr,"dbg2       format:               %d\n",format);
-		fprintf(stderr,"dbg2       pings:                %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:              %d\n",lonflip);
-		fprintf(stderr,"dbg2       btime_i[0]:           %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:           %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:           %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:           %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:           %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:           %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:           %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:           %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:           %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:           %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:           %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:           %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:           %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:           %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:             %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:              %f\n",timegap);
-		fprintf(stderr,"dbg2       read file:            %s\n",read_file);
-		fprintf(stderr,"dbg2       bounds[0]:            %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:            %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:            %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:            %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       contour algorithm:    %d\n",contour_algorithm);
-		fprintf(stderr,"dbg2       plot contours:        %d\n",plot_contours);
-		fprintf(stderr,"dbg2       plot triangles:       %d\n",plot_triangles);
-		fprintf(stderr,"dbg2       plot track:           %d\n",plot_track);
-		fprintf(stderr,"dbg2       plot_pingnumber:      %d\n",plot_pingnumber);
-		fprintf(stderr,"dbg2       plot name:            %d\n",plot_name);
-		fprintf(stderr,"dbg2       contour interval:     %f\n",cont_int);
-		fprintf(stderr,"dbg2       color interval:       %f\n",col_int);
-		fprintf(stderr,"dbg2       tick interval:        %f\n",tick_int);
-		fprintf(stderr,"dbg2       label interval:       %f\n",label_int);
-		fprintf(stderr,"dbg2       tick length:          %f\n",tick_len);
-		fprintf(stderr,"dbg2       label height:         %f\n",label_hgt);
-		fprintf(stderr,"dbg2       label spacing:        %f\n",label_spacing);
-		fprintf(stderr,"dbg2       number contoured:     %d\n",nplot);
-		fprintf(stderr,"dbg2       time tick int:        %f\n",time_tick_int);
-		fprintf(stderr,"dbg2       time interval:        %f\n",time_annot_int);
-		fprintf(stderr,"dbg2       date interval:        %f\n",date_annot_int);
-		fprintf(stderr,"dbg2       time tick length:     %f\n",time_tick_len);
-		fprintf(stderr,"dbg2       name height:          %f\n",name_hgt);
-		fprintf(stderr,"dbg2       pingnumber tick int:  %d\n",pingnumber_tick_int);
-		fprintf(stderr,"dbg2       pingnumber annot int: %d\n",pingnumber_annot_int);
-		fprintf(stderr,"dbg2       pingnumber tick len:  %f\n",pingnumber_tick_len);
-		fprintf(stderr,"dbg2       bathy_in_feet:        %d\n\n",bathy_in_feet);
-		}
-
-	/* if bounds not specified then quit */
-	if (bounds[0] >= bounds[1] || bounds[2] >= bounds[3]
-		|| bounds[2] <= -90.0 || bounds[3] >= 90.0)
-		{
-		fprintf(stderr,"\nRegion bounds not properly specified:\n\t%f %f %f %f\n",bounds[0],bounds[1],bounds[2],bounds[3]);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_PARAMETER;
-		exit(error);
-		}
-
-	/* scale label and tick sizes */
-	label_hgt_map = inchtolon * label_hgt;
-	label_spacing_map = inchtolon * label_spacing;
-	tick_len_map = inchtolon * tick_len;
-	time_tick_len_map = inchtolon * time_tick_len;
-	name_hgt_map = inchtolon * name_hgt;
-	pingnumber_tick_len_map = inchtolon * pingnumber_tick_len;
+	/*---------------------------- This is the mbcontour main code ----------------------------*/
 
 	/* read contours from file */
 	if (set_contours == MB_YES)
@@ -760,7 +779,7 @@ int main (int argc, char **argv)
 
 		/* count lines in file */
 		nlevel = 0;
-		while (fgets(line,MBCONTOUR_LABEL_LEN,fp) != NULL)
+		while (fgets(line,MB_PATH_MAXLINE,fp) != NULL)
 			nlevel++;
 		fclose(fp);
 
@@ -788,7 +807,7 @@ int main (int argc, char **argv)
 
 		/* read contour levels from file */
 		nlevel = 0;
-		while (fgets(line,MBCONTOUR_LABEL_LEN,fp) != NULL)
+		while (fgets(line,MB_PATH_MAXLINE,fp) != NULL)
 			{
 			count = sscanf(line,"%lf %s %s %d %d %d",
 				&level[nlevel],labelstr,tickstr,
@@ -845,26 +864,62 @@ int main (int argc, char **argv)
 	/* set colors */
 	mb_set_colors(ncolor,red,green,blue);
 
-	/* set bounds for multibeam reading larger than
-		map borders */
-	mb_bounds[0] = bounds[0] - 0.25*(bounds[1] - bounds[0]);
-	mb_bounds[1] = bounds[1] + 0.25*(bounds[1] - bounds[0]);
-	mb_bounds[2] = bounds[2] - 0.25*(bounds[3] - bounds[2]);
-	mb_bounds[3] = bounds[3] + 0.25*(bounds[3] - bounds[2]);
+        /* set bounds for data reading larger than map borders */
+	bounds[0] = GMT->common.R.wesn[0]
+		- 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
+	bounds[1] = GMT->common.R.wesn[1]
+		+ 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
+	bounds[2] = GMT->common.R.wesn[2]
+		- 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
+	bounds[3] = GMT->common.R.wesn[3]
+		+ 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
+
+//	/* get scaling from degrees to km */
+//	mb_coor_scale(verbose, 0.5*(bounds[2] + bounds[3]), &mtodeglon, &mtodeglat);
 
 	/* set lonflip if possible */
 	if (lonflip_set == MB_NO)
 		{
-		if (mb_bounds[0] < -180.0)
+		if (bounds[0] < -180.0)
 			lonflip = -1;
-		else if (mb_bounds[1] > 180.0)
+		else if (bounds[1] > 180.0)
 			lonflip = 1;
-		else if (lonflip == -1 && mb_bounds[1] > 0.0)
+		else if (lonflip == -1 && bounds[1] > 0.0)
 			lonflip = 0;
-		else if (lonflip == 1 && mb_bounds[0] < 0.0)
+		else if (lonflip == 1 && bounds[0] < 0.0)
 			lonflip = 0;
 		}
 
+	/* Start the postscript plot */
+	GMT_err_fail (GMT, GMT_map_setup (GMT, GMT->common.R.wesn), "");
+	PSL = GMT_plotinit (GMT, options);
+	GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
+	GMT_plotcanvas (GMT);	/* Fill canvas if requested */
+	GMT_map_clip_on (GMT, GMT->session.no_rgb, 3);
+                
+        /* Set particulars of output image for the postscript plot */
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[2], &clipx[0], &clipy[0]);
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[2], &clipx[1], &clipy[1]);
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[3], &clipx[2], &clipy[2]);
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[3], &clipx[3], &clipy[3]);
+//	x_inch = clipx[1] - clipx[0];
+//	y_inch = clipy[2] - clipy[1];
+//	x0 = GMT->common.R.wesn[0];
+//	y0 = GMT->common.R.wesn[2];
+        inchtolon = (GMT->common.R.wesn[1] - GMT->common.R.wesn[0]) / (clipx[1] - clipx[0]);
+        
+	/* scale label and tick sizes */
+	label_hgt_map = inchtolon * label_hgt;
+	label_spacing_map = inchtolon * label_spacing;
+	tick_len_map = inchtolon * tick_len;
+	time_tick_len_map = inchtolon * time_tick_len;
+	name_hgt_map = inchtolon * name_hgt;
+	pingnumber_tick_len_map = inchtolon * pingnumber_tick_len;
+
+	/* get format if required */
+	if (format == 0)
+		mb_get_format(verbose, read_file, NULL, &format, &error);
+
 	/* determine whether to read one file or a list of files */
 	if (format < 0)
 		read_datalist = MB_YES;
@@ -928,7 +983,7 @@ int main (int argc, char **argv)
 
 		/* call mb_read_init() */
 		if ((status = mb_read_init(
-		    verbose,file,format,pings,lonflip,mb_bounds,
+		    verbose,file,format,pings,lonflip,bounds,
 		    btime_i,etime_i,speedmin,timegap,
 		    &mbio_ptr,&btime_d,&etime_d,
 		    &beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
@@ -989,11 +1044,11 @@ int main (int argc, char **argv)
 				    date_annot_int,time_tick_len_map,name_hgt_map,
 				    pingnumber_tick_int,pingnumber_annot_int,
 				    pingnumber_tick_len_map,
-                                    &mb_plot,
-                                    &mb_newpen,
-                                    &mb_setline,
-                                    &mb_justify_string,
-                                    &mb_plot_string,
+                                    &mbcontour_plot,
+                                    &mbcontour_newpen,
+                                    &mbcontour_setline,
+                                    &mbcontour_justify_string,
+                                    &mbcontour_plot_string,
 				    &error);
 		swath_plot->beams_bath = beams_bath;
 
@@ -1124,18 +1179,10 @@ int main (int argc, char **argv)
 		    /* update bookkeeping */
 		    if (error == MB_ERROR_NO_ERROR)
 			    {
-			    /*if (*npings == 0 ||
-				    (*npings > 0
-				    && contour_algorithm == MB_CONTOUR_TRIANGLES)
-				    || (*npings > 0
-				    && (navlon != navlon_old
-				    || navlat != navlat_old)))*/
-				    {
-				    nping_read += pings_read;
-				    (*npings)++;
-				    navlon_old = navlon;
-				    navlat_old = navlat;
-				    }
+                            nping_read += pings_read;
+                            (*npings)++;
+                            navlon_old = navlon;
+                            navlat_old = navlat;
 			    }
 
 		    /* decide whether to plot, whether to
@@ -1207,7 +1254,7 @@ int main (int argc, char **argv)
 			    /* reorganize data */
 			    if (flush == MB_YES && save_new == MB_YES)
 				    {
-				    status = ping_copy(verbose,0,*npings,
+				    status = mbcontour_ping_copy(verbose,0,*npings,
 					    swath_plot,&error);
 				    *npings = 1;
 				    }
@@ -1217,11 +1264,10 @@ int main (int argc, char **argv)
 				    }
 			    else if (*npings > 1)
 				    {
-				    status = ping_copy(verbose,0,*npings-1,
+				    status = mbcontour_ping_copy(verbose,0,*npings-1,
 						    swath_plot,&error);
 				    *npings = 1;
 				    }
-
 			    }
 		    }
 		status = mb_close(verbose,&mbio_ptr,&error);
@@ -1250,8 +1296,11 @@ int main (int argc, char **argv)
 	if (read_datalist == MB_YES)
 		mb_datalist_close(verbose,&datalist,&error);
 
-	/* end plot */
-	mb_plot_end(verbose,&error);
+	GMT_map_clip_off (GMT);
+
+	GMT_map_basemap (GMT);
+	GMT_plane_perspective (GMT, -1, 0.0);
+	GMT_plotend (GMT);
 
 	/* deallocate memory for data arrays */
 	mb_freed(verbose,__FILE__, __LINE__, (void **)&level,&error);
@@ -1279,14 +1328,17 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       status:  %d\n",status);
 		}
 
-	/* end it all */
-	mb_plot_exit(argc,argv);
-	exit(status);
+	if (!Ctrl->C.active && GMT_Destroy_Data (API, &CPTcolor) != GMT_OK)
+                {
+		Return (API->error);
+                }
+	Return (EXIT_SUCCESS);
 }
-/*--------------------------------------------------------------------*/
-int ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
+
+/*--------------------------------------------------------------------------*/
+int mbcontour_ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
 {
-	char	*function_name = "ping_copy";
+	char	*function_name = "mbcontour_ping_copy";
 	int	status = MB_SUCCESS;
 
 	struct ping	*ping1;
@@ -1296,7 +1348,7 @@ int ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
 	/* print input debug statements */
 	if (verbose >= 2)
 		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
+		fprintf(stderr,"\ndbg2  MBCONTOUR function <%s> called\n",
 			function_name);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
@@ -1361,7 +1413,7 @@ int ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
 	/* print output debug statements */
 	if (verbose >= 2)
 		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
+		fprintf(stderr,"\ndbg2  MBCONTOUR function <%s> completed\n",
 			function_name);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -1372,4 +1424,109 @@ int ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
 	/* return status */
 	return(status);
 }
-/*--------------------------------------------------------------------*/
+
+/*--------------------------------------------------------------------------*/
+void mb_set_colors(int ncolor, int *red, int *green, int *blue)
+{
+	return;
+}
+/*--------------------------------------------------------------------------*/
+void mbcontour_plot(double x, double y, int ipen)
+{
+	double	xx, yy;
+
+        /* make sure contour arrays are large enough */
+	if (ncontour_plot >= ncontour_plot_alloc)
+	    {
+	    ncontour_plot_alloc += MBCONTOUR_PLOT_ALLOC_INC;
+	    contour_x = (double *) realloc(contour_x,
+			sizeof(double) * (ncontour_plot_alloc));
+	    contour_y = (double *) realloc(contour_y,
+			sizeof(double) * (ncontour_plot_alloc));
+	    if (contour_x == NULL)
+		ncontour_plot_alloc = 0;
+	    }
+            
+        /* convert to map units */
+        GMT_geo_to_xy(GMT, x, y, &xx, &yy);
+        
+        /* if command is move then start new contour */
+        if (ipen == MBCONTOUR_PLOT_MOVE)
+            {
+            ncontour_plot = 0;
+            contour_x[ncontour_plot] = xx;
+            contour_y[ncontour_plot] = yy;
+            ncontour_plot++;
+            }
+            
+        /* else if command is to draw then add the point to the list */
+        else if (ipen == MBCONTOUR_PLOT_DRAW)
+            {
+            contour_x[ncontour_plot] = xx;
+            contour_y[ncontour_plot] = yy;
+            ncontour_plot++;
+            }
+            
+        /* else if command is to areokw then add the point to the list
+            and call PSL_plotline() */
+        else if (ipen == MBCONTOUR_PLOT_STROKE)
+            {
+            contour_x[ncontour_plot] = xx;
+            contour_y[ncontour_plot] = yy;
+            ncontour_plot++;
+
+            PSL_plotline(PSL, contour_x, contour_y, ncontour_plot, PSL_MOVE + PSL_STROKE);
+            
+            ncontour_plot = 0;
+            }
+
+	return;
+}
+/*--------------------------------------------------------------------------*/
+void mbcontour_setline(int linewidth)
+{
+        //PSL_setlinewidth(PSL, (double)linewidth);
+        return;
+}
+/*--------------------------------------------------------------------------*/
+void mbcontour_newpen(int ipen)
+{
+	double rgb[4];
+	rgb[3] = 0;		/* To not fall into the transparency case of pslib.c/psl_putcolor()  */
+        
+	if (ipen > -1 && ipen < ncolor)
+		{
+		rgb[0] = ((double)red[ipen]) / 255.0;
+		rgb[1] = ((double)green[ipen]) / 255.0;
+		rgb[2] = ((double)blue[ipen]) / 255.0;
+                PSL_setcolor(PSL, rgb, PSL_IS_STROKE);
+		}
+	return;
+}
+/*--------------------------------------------------------------------------*/
+void mbcontour_justify_string(double height, char *string, double *s)
+{
+	int	len;
+
+	len = strlen(string);
+	s[0] = 0.0;
+	s[1] = 0.185*height*len;
+	s[2] = 0.37*len*height;
+	s[3] = 0.37*len*height;
+
+	return;
+}
+/*--------------------------------------------------------------------------*/
+void mbcontour_plot_string(double x, double y, double hgt, double angle, char *label)
+{
+	double	fontsize;
+	double	xx, yy;
+        int     justify = 5;
+        int     mode = 0;
+
+	fontsize = 72.0 * hgt / inchtolon;
+	GMT_geo_to_xy(GMT, x, y, &xx, &yy);
+        PSL_plottext (PSL, xx, yy, fontsize, label, angle, justify, mode);
+	return;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/src/gmt/mbgrdtiff.c b/src/gmt/mbgrdtiff.c
index f5d055b..6085419 100644
--- a/src/gmt/mbgrdtiff.c
+++ b/src/gmt/mbgrdtiff.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbgrdtiff.c	5/30/93
- *    $Id: mbgrdtiff.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbgrdtiff.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -22,8 +22,9 @@
  *    as a geographically located coverage. The image is 8 bits
  *    per pixel if the color map is a grayscale, and 24 bits
  *    per pixel otherwise.
- *
- *
+ */
+/*--------------------------------------------------------------------*/
+/*
  * The geotiff file variant produced by mbgrdtiff
  * has the structure given below. The image width in
  * pixels is denoted as nx and the image height as ny.
@@ -213,82 +214,8 @@
  *    512    3*nx*ny         Image in RGB bytes
  *
  *
- *
- * $Log: mbgrdtiff.c,v $
- * Revision 5.16  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.15  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.14  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.13  2006/07/27 18:42:51  caress
- * Working towards 5.1.0
- *
- * Revision 5.12  2006/06/22 04:45:42  caress
- * Working towards 5.1.0
- *
- * Revision 5.11  2006/01/11 07:25:53  caress
- * Working towards 5.0.8
- *
- * Revision 5.10  2005/11/04 20:18:04  caress
- * Altered the GeoTiff header so that images are compatible with more GIS packages.
- *
- * Revision 5.9  2004/05/21 23:13:35  caress
- * Changes to support GMT 4.0
- *
- * Revision 5.8  2003/04/17 20:43:37  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/11/12 06:47:19  caress
- * Proper GeoTIFF now created with projected coordinate systems.
- *
- * Revision 5.6  2001/11/08 02:22:17  caress
- * Fixed program so bounds can be taken from grd file if not
- * specified on the command line.
- *
- * Revision 5.5  2001/09/19  21:57:10  caress
- * Really really removed inadvertant debug messages.
- *
- * Revision 5.4  2001/09/19  21:53:26  caress
- * Really removed inadvertant debug messages.
- *
- * Revision 5.3  2001/09/19  21:51:56  caress
- * Removed inadvertant debug messages.
- *
- * Revision 5.2  2001/06/03  06:58:45  caress
- * Release 5.0.beta01.
- *
- * Revision 5.1  2001/01/22 05:03:25  caress
- * Release 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:52:16  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/10/11  00:53:45  caress
- * Converted to ANSI C
- *
- * Revision 4.1  2000/09/30  06:52:17  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  2000/03/06  21:59:34  caress
- * Initial version.
- *
- *
- *
  */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* GMT include files */
-#include "gmt.h"
+/*--------------------------------------------------------------------*/
 
 /* MBIO include files */
 #include "mb_status.h"
@@ -390,260 +317,782 @@ int              tiff_offset[] =
 			400,      /* GeoDoubleParamsTag */
 			448       /* GeoAsciiParamsTag */
 		      };
+                      
+/*--------------------------------------------------------------------*/
+
+#define THIS_MODULE_NAME	"mbgrdtiff"
+#define THIS_MODULE_LIB		"mbgmt"
+#define THIS_MODULE_PURPOSE	"Project grids or images and plot them on maps"
+#define THIS_MODULE_KEYS	""
+
+#include "gmt_dev.h"
+
+EXTERN_MSC int GMT_mbgrdtiff(void *API, int mode, void *args);
+
+#define GMT_PROG_OPTIONS "->JRVn" GMT_OPT("S")
+
+/* Control structure for mbgrdtiff */
+struct MBGRDTIFF_CTRL {
+	struct A {	/* -A to write a GDAL file */
+		bool active;
+		char *file;
+		char *driver;
+	} A;
+	struct C {	/* -C<cptfile> */
+		bool active;
+		char *file;
+	} C;
+	struct D {	/* -D to read GDAL file */
+		bool active;
+		bool mode;	/* Use info of -R option to reference image */
+	} D;
+	struct E {	/* -Ei|<dpi> */
+		bool active;
+		bool device_dpi;
+		unsigned int dpi;
+	} E;
+	struct G {	/* -G[f|b]<rgb> */
+		bool active;
+		double f_rgb[4];
+		double b_rgb[4];
+	} G;
+	struct I {	/* -I<inputfile>> */
+		bool active;
+		bool do_rgb;
+		char *file[3];
+	} I;
+	struct Intensity {	/* -I<intensfile>|<value> */
+		bool active;
+		bool constant;
+		double value;
+		char *file;
+	} Intensity;
+	struct M {	/* -M */
+		bool active;
+	} M;
+	struct N {	/* -N */
+		bool active;
+	} N;
+	struct mbO {	/* -O */
+		bool active;
+		char *file;
+	} O;
+	struct Q {	/* -Q */
+		bool active;
+	} Q;
+};
+
+
+void *New_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT);
+void Free_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl);
+int GMT_mbgrdtiff_usage (struct GMTAPI_CTRL *API, int level);
+int GMT_mbgrdtiff_parse (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl, struct GMT_OPTION *options);
+void GMT_mbgrdtiff_set_proj_limits (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *r, struct GMT_GRID_HEADER *g, bool projected);
+
+/*--------------------------------------------------------------------*/
+
+void *New_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT) {	/* Allocate and initialize a new control structure */
+	struct MBGRDTIFF_CTRL *Ctrl;
+
+	Ctrl = GMT_memory (GMT, NULL, 1, struct MBGRDTIFF_CTRL);
+
+	/* Initialize values whose defaults are not 0/false/NULL */
+
+	Ctrl->G.b_rgb[0] = Ctrl->G.b_rgb[1] = Ctrl->G.b_rgb[2] = 1.0;
+
+	return (Ctrl);
+}
+/*--------------------------------------------------------------------*/
 
-static char rcs_id[] = "$Id: mbgrdtiff.c 2175 2014-03-18 23:03:39Z caress $";
+void Free_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl) {	/* Deallocate control structure */
+	int k;
+	if (!Ctrl) return;
+	for (k = 0; k < 3; k++) if (Ctrl->I.file[k]) free (Ctrl->I.file[k]);	
+	if (Ctrl->C.file) free (Ctrl->C.file);
+	if (Ctrl->Intensity.file) free (Ctrl->Intensity.file);
+	GMT_free (GMT, Ctrl);
+}
+/*--------------------------------------------------------------------*/
 
+int GMT_mbgrdtiff_usage (struct GMTAPI_CTRL *API, int level)
+{
+	GMT_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_NAME, THIS_MODULE_PURPOSE);
+	if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
+	GMT_Message (API, GMT_TIME_NONE, "usage: mbgrdtiff <grd_z>|<grd_r> <grd_g> <grd_b> %s [%s] [-C<cpt>] [-Ei[|<dpi>]]\n", GMT_J_OPT, GMT_B_OPT);
+	GMT_Message (API, GMT_TIME_NONE, "\t[-G[f|b]<rgb>] [-I<intensgrid>|<value>] [-K] [-M] [-N] [-O] [-P] [-Q]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-T] [%s] [%s]\n", GMT_Rgeo_OPT, GMT_U_OPT, GMT_V_OPT);
+	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s] [%s] [%s]\n\t[%s]\n\t[%s] [%s]\n\n", 
+			GMT_X_OPT, GMT_Y_OPT, GMT_c_OPT, GMT_f_OPT, GMT_n_OPT, GMT_p_OPT, GMT_t_OPT);
+
+	if (level == GMT_SYNOPSIS) return (EXIT_FAILURE);
+
+	GMT_Message (API, GMT_TIME_NONE, "\t<grd_z> is data set to be plotted.  Its z-values are in user units and will be\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t  converted to rgb colors via the cpt file.  Alternatively, give three separate\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t  grid files that contain the red, green, and blue components in the 0-255 range.\n");
+	GMT_Option (API, "J-");
+	GMT_Message (API, GMT_TIME_NONE, "\n\tOPTIONS:\n");
+	GMT_Option (API, "B-");
+	GMT_Message (API, GMT_TIME_NONE, "\t-C Color palette file to convert z to rgb.  Optionally, instead give name of a master cpt\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   to automatically assign 16 continuous colors over the data range [rainbow].\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t-E Set dpi for the projected grid which must be constructed [100]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   if -Jx or -Jm is not selected [Default gives same size as input grid].\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   Give i to do the interpolation in PostScript at device resolution.\n");
+	GMT_rgb_syntax (API->GMT, 'G', "Set transparency color for images that otherwise would result in 1-bit images.\n\t  ");
+	GMT_Message (API, GMT_TIME_NONE, "\t-I Use illumination. Append name of intensity grid file.\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   For a constant intensity, just give the value instead.\n");
+	GMT_Option (API, "K");
+	GMT_Message (API, GMT_TIME_NONE, "\t-M Force monochrome image.\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t-N Do not clip image at the map boundary.\n");
+	GMT_Option (API, "O,P");
+	GMT_Message (API, GMT_TIME_NONE, "\t-Q Use PS Level 3 colormasking to make nodes with z = NaN transparent.\n");
+	GMT_Option (API, "R");
+	GMT_Option (API, "U,V,X,c,n,t,.");
+
+	return (EXIT_FAILURE);
+}
 /*--------------------------------------------------------------------*/
 
-int main (int argc, char **argv)
+int GMT_mbgrdtiff_parse (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl, struct GMT_OPTION *options)
 {
-	char program_name[] = "mbgrdtiff";
-	char help_message[] = "mbgrdtiff generates a tiff image from a GMT grid. The \nimage generation is similar to that of the GMT program \ngrdimage. In particular, the color map is applied from \na GMT CPT file, and shading overlay grids may be applied. \nThe output TIFF file contains information allowing\nthe ArcView and ArcInfo GIS packages to import the image\nas a geographically located coverage.";
-	char usage_message[] = "mbgrdtiff -Ccptfile -Igrdfile -Otiff_file [-H -Kintensfile -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	lonflip = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* control parameters */
-	char    grdfile[MB_PATH_MAXLINE];
-	char    cptfile[MB_PATH_MAXLINE];
-        char    intensfile[MB_PATH_MAXLINE];
-        char    tiff_file[MB_PATH_MAXLINE];
-        char    world_file[MB_PATH_MAXLINE];
-	int	intensity;
-        double  bounds[4];
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
+	/* This parses the options provided to mbgrdtiff and sets parameters in Ctrl.
+	 * Note Ctrl has already been initialized and non-zero default values set.
+	 * Any GMT common options will override values set previously by other commands.
+	 * It also replaces any file names specified as input or output with the data ID
+	 * returned when registering these sources/destinations with the API.
+	 */
+
+	unsigned int n_errors = 0, n_files = 0;
+	struct GMT_OPTION *opt = NULL;
+	struct GMTAPI_CTRL *API = GMT->parent;
+
+	for (opt = options; opt; opt = opt->next) {	/* Process all the options given */
+
+		switch (opt->option) {
+			case '<':	/* Input file (only one or three is accepted) */
+				Ctrl->I.active = true;
+				if (n_files >= 3) break;
+#if GMT_MINOR_VERSION == 1 && GMT_RELEASE_VERSION < 2
+				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN))
 #else
-	int	pad[4];
+				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN, GMT_IS_DATASET))
 #endif
-        int     nx,ny,nxy;
-        float   *grid = NULL;
-        float   *igrid = NULL;
-	struct GRD_HEADER header;
-	struct GRD_HEADER iheader;
+					Ctrl->I.file[n_files++] = strdup (opt->arg);
+				else
+					n_errors++;
+				break;
+
+			/* Processes program-specific parameters */
+
+			case 'C':	/* CPT file */
+				Ctrl->C.active = true;
+				if (Ctrl->C.file) free (Ctrl->C.file);
+				Ctrl->C.file = strdup (opt->arg);
+				break;
+			case 'E':	/* Sets dpi */
+				Ctrl->E.active = true;
+				if (opt->arg[0] == 'i')	/* Interpolate image to device resolution */
+					Ctrl->E.device_dpi = true;
+				else if (opt->arg[0] == '\0')	
+					Ctrl->E.dpi = 100;	/* Default grid dpi */
+				else
+					Ctrl->E.dpi = atoi (opt->arg);
+				break;
+			case 'G':	/* 1-bit fore or background color for transparent masks */
+				Ctrl->G.active = true;
+				switch (opt->arg[0]) {
+					case 'F':
+					case 'f':
+						if (GMT_getrgb (GMT, &opt->arg[1], Ctrl->G.f_rgb)) {
+							GMT_rgb_syntax (GMT, 'G', " ");
+							n_errors++;
+						}
+						else
+							Ctrl->G.b_rgb[0] = -1;
+						break;
+					case 'B':
+					case 'b':
+						if (GMT_getrgb (GMT, &opt->arg[1], Ctrl->G.b_rgb)) {
+							GMT_rgb_syntax (GMT, 'G', " ");
+							n_errors++;
+						}
+						else
+							Ctrl->G.f_rgb[0] = -1;
+						break;
+					default:	/* Same as -Gf */
+						if (GMT_getrgb (GMT, opt->arg, Ctrl->G.f_rgb)) {
+							GMT_rgb_syntax (GMT, 'G', " ");
+							n_errors++;
+						}
+						else
+							Ctrl->G.b_rgb[0] = -1;
+						break;
+				}
+				break;
+			case 'I':	/* Input file (only one or three is accepted) */
+				/* if no grid file specified yet then first -Ifile sets
+				 * the primary grid file, and second -Ifile will be the
+				 * intensity file */
+				if (n_files == 0) {
+					Ctrl->I.active = true;
+					Ctrl->I.file[n_files++] = strdup (opt->arg);
+				}
+				else {
+					Ctrl->Intensity.active = true;
+					if (!GMT_access (GMT, opt->arg, R_OK))	/* Got a file */
+						Ctrl->Intensity.file = strdup (opt->arg);
+					else if (opt->arg[0] && !GMT_not_numeric (GMT, opt->arg)) {	/* Looks like a constant value */
+						Ctrl->Intensity.value = atof (opt->arg);
+						Ctrl->Intensity.constant = true;
+					}
+					else {
+						GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -I: Requires a valid grid file or a constant\n");
+						n_errors++;
+					}
+				}
+				break;
+			case 'M':	/* Monochrome image */
+				Ctrl->M.active = true;
+				break;
+			case 'N':	/* Do not clip at map boundary */
+				Ctrl->N.active = true;
+				break;
+			case 'O':	/* Output file */
+				Ctrl->O.active = true;
+				Ctrl->O.file = strdup (opt->arg);
+				break;
+			case 'Q':	/* PS3 colormasking */
+				Ctrl->Q.active = true;
+				break;
+
+			default:	/* Report bad options */
+				n_errors += GMT_default_error (GMT, opt->option);
+				break;
+		}
+	}
+
+	if (n_files == 3) Ctrl->I.do_rgb = true;
+//	n_errors += GMT_check_condition (GMT, !GMT->common.J.active, 
+//					"Syntax error: Must specify a map projection with the -J option\n");
+	n_errors += GMT_check_condition (GMT, !Ctrl->C.file && !Ctrl->I.do_rgb, 
+					"Syntax error: Must specify color palette table\n");
+	n_errors += GMT_check_condition (GMT, !(n_files == 1 || n_files == 3), 
+					"Syntax error: Must specify one (or three) input file(s)\n");
+	n_errors += GMT_check_condition (GMT, Ctrl->Intensity.active && !Ctrl->Intensity.constant && !Ctrl->Intensity.file, 
+					"Syntax error -I option: Must specify intensity file or value\n");
+	n_errors += GMT_check_condition (GMT, Ctrl->E.active && !Ctrl->E.device_dpi && Ctrl->E.dpi <= 0, 
+					"Syntax error -E option: dpi must be positive\n");
+	n_errors += GMT_check_condition (GMT, Ctrl->G.f_rgb[0] < 0 && Ctrl->G.b_rgb[0] < 0, 
+					"Syntax error -G option: Only one of fore/back-ground can be transparent for 1-bit images\n");
+	n_errors += GMT_check_condition (GMT, Ctrl->M.active && Ctrl->Q.active,
+					"Syntax error -Q option:  Cannot use -M when doing colormasking\n");
+	n_errors += GMT_check_condition (GMT, !Ctrl->O.active || !Ctrl->O.file,
+					"Syntax error -O option: Must specify the output file name.\n");
+
+	return (n_errors ? GMT_PARSE_ERROR : GMT_OK);
+}
+/*--------------------------------------------------------------------*/
+
+void GMT_mbgrdtiff_set_proj_limits (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *r, struct GMT_GRID_HEADER *g, bool projected)
+{
+	/* Sets the projected extent of the grid given the map projection
+	 * The extreme x/y coordinates are returned in r, and dx/dy, and
+	 * nx/ny are set accordingly.  Not that some of these may change
+	 * if GMT_project_init is called at a later stage */
+
+	unsigned int i, k;
+	bool all_lats = false, all_lons = false;
+	double x, y;
+
+	r->nx = g->nx;	r->ny = g->ny;
+	r->registration = g->registration;
+	r->n_bands = g->n_bands;
+
+	/* By default, use entire plot region */
+
+	GMT_memcpy (r->wesn, GMT->current.proj.rect, 4, double);
+	
+	if (GMT->current.proj.projection == GMT_GENPER && GMT->current.proj.g_width != 0.0) return;
+
+	if (GMT_is_geographic (GMT, GMT_IN)) {
+		all_lats = GMT_180_RANGE (g->wesn[YHI], g->wesn[YLO]);
+		all_lons = GMT_grd_is_global (GMT, g);
+		if (all_lons && all_lats) return;	/* Whole globe */
+	}
+	
+	/* Must search for extent along perimeter */
+
+	r->wesn[XLO] = r->wesn[YLO] = +DBL_MAX;
+	r->wesn[XHI] = r->wesn[YHI] = -DBL_MAX;
+	k = (g->registration == GMT_GRID_NODE_REG) ? 1 : 0;
+	
+	for (i = 0; i < g->nx - k; i++) {	/* South and north sides */
+		GMT_geo_to_xy (GMT, g->wesn[XLO] + i * g->inc[GMT_X], g->wesn[YLO], &x, &y);
+		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
+		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
+		GMT_geo_to_xy (GMT, g->wesn[XHI] - i * g->inc[GMT_X], g->wesn[YHI], &x, &y);
+		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
+		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
+	}
+	for (i = 0; i < g->ny - k; i++) {	/* East and west sides */
+		GMT_geo_to_xy (GMT, g->wesn[XLO], g->wesn[YHI] - i * g->inc[GMT_Y], &x, &y);
+		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
+		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
+		GMT_geo_to_xy (GMT, g->wesn[XHI], g->wesn[YLO] + i * g->inc[GMT_Y], &x, &y);
+		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
+		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
+	}
+	if (projected) {
+		if (all_lons) {	/* Full 360, use min/max for x */
+			r->wesn[XLO] = GMT->current.proj.rect[XLO];	r->wesn[XHI] = GMT->current.proj.rect[XHI];
+		}
+		if (all_lats) {	/* Full -90/+90, use min/max for y */
+			r->wesn[YLO] = GMT->current.proj.rect[YLO];	r->wesn[YHI] = GMT->current.proj.rect[YHI];
+		}
+	}
+}
+/*--------------------------------------------------------------------*/
+
+#define bailout(code) {GMT_Free_Options (mode); return (code);}
+#define Return(code) {Free_mbgrdtiff_Ctrl (GMT, Ctrl); GMT_end_module (GMT, GMT_cpy); bailout (code);}
+
+int GMT_mbgrdtiff (void *V_API, int mode, void *args)
+{
+	char program_name[] = "mbgrdtiff";
 
 	/* TIFF arrays */
-	int     image_size = 0;
+        mb_path world_file;
+	size_t image_size = 0;
 	int	modeltype;
 	int	projectionid;
-        char    projectionname[MB_PATH_MAXLINE];
+        mb_path projectionname;
 	char    tiff_header[TIFF_HEADER_SIZE];
-	char    *tiff_image = NULL;
+	void    *tiff_image = NULL;
 	char	tiff_comment[TIFF_COMMENT_MAXLINE];
 	char	NorS;
-
-	/* other variables */
-	FILE    *tfp;
-	int     rgb[3];
-	int	i, j, k, kk;
-        int     index, keyindex;
+        FILE    *tfp;
 	int	nscan;
 	int	utmzone;
-	int	off;
+        int     keyindex;
+        
         short   value_short;
         int     value_int;
 	double  value_double;
-	char	*projection = "-Jx1.0";
-        int     make_worldfile = MB_NO;
-
-	/* get current mb default values */
-	status = mb_lonflip(verbose,&lonflip);
-
-	/* initialize some values */
-	strcpy (grdfile,"\0");
-	strcpy (intensfile,"\0");
-	strcpy (cptfile,"\0");
-	strcpy (tiff_file,"\0");
-	bounds[0] = 0.0;
-	bounds[1] = 0.0;
-	bounds[2] = 0.0;
-	bounds[3] = 0.0;
-	intensity = MB_NO;
-
-	/* deal with gmt options */
-	GMT_begin (1, argv);
-	errflg += GMT_get_common_args (projection,
-				&bounds[0], &bounds[1],
-				&bounds[2], &bounds[3]);
-	for (i = 1; i < argc; i++)
-		{
-		if (argv[i][0] == '-')
-			{
-			switch (argv[i][1])
-				{
-				/* Common parameters */
-
-				case 'r':
-					argv[i][1] = 'R';
-				case 'R':
-					errflg += GMT_get_common_args (argv[i],
-						&bounds[0], &bounds[1],
-						&bounds[2], &bounds[3]);
-					break;
+        size_t  write_size;
+        int     i;
+        
+	bool done, need_to_project, normal_x, normal_y, resampled = false, gray_only = false;
+	bool nothing_inside = false, use_intensity_grid;
+	unsigned int k, nx = 0, ny = 0, grid_registration = GMT_GRID_NODE_REG, n_grids;
+	unsigned int colormask_offset = 0, try, row, actual_row, col;
+	uint64_t node_RGBA = 0;		/* uint64_t for the RGB(A) image array. */
+	uint64_t node, kk, nm, byte;
+	int index = 0, ks, error = 0;
+	int nx8, shift, b_or_w, nx_pixels, k8;
+	
+	unsigned char *bitimage_1 = NULL, *bitimage_8 = NULL, *bitimage_24 = NULL, *rgb_used = NULL, i_rgb[3];
+
+	double dx, dy, x_side, y_side, x0 = 0.0, y0 = 0.0, rgb[4] = {0.0, 0.0, 0.0, 0.0};
+	double *NaN_rgb = NULL, red[4] = {1.0, 0.0, 0.0, 0.0}, wesn[4];
+
+	struct GMT_GRID *Grid_orig[3] = {NULL, NULL, NULL}, *Grid_proj[3] = {NULL, NULL, NULL};
+	struct GMT_GRID *Intens_orig = NULL, *Intens_proj = NULL;
+	struct GMT_PALETTE *P = NULL;
+	struct MBGRDTIFF_CTRL *Ctrl = NULL;
+	struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;	/* General GMT interal parameters */
+	struct GMT_OPTION *options = NULL;
+	struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
+	struct GMT_GRID_HEADER *header_work = NULL;	/* Pointer to a GMT header for the image or grid */
+	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
+
+
+	/*----------------------- Standard module initialization and parsing ----------------------*/
+
+	if (API == NULL) return (GMT_NOT_A_SESSION);
+	if (mode == GMT_MODULE_PURPOSE) return (GMT_mbgrdtiff_usage (API, GMT_MODULE_PURPOSE));	/* Return the purpose of program */
+	options = GMT_Create_Options (API, mode, args);
+        if (API->error) return (API->error);	/* Set or get option list */
+
+	if (!options || options->option == GMT_OPT_USAGE) bailout (GMT_mbgrdtiff_usage (API, GMT_USAGE));	/* Return the usage message */
+	if (options->option == GMT_OPT_SYNOPSIS) bailout (GMT_mbgrdtiff_usage (API, GMT_SYNOPSIS));	/* Return the synopsis */
+
+	/* Parse the command-line arguments */
+
+	GMT = GMT_begin_module (API, THIS_MODULE_LIB, THIS_MODULE_NAME, &GMT_cpy); /* Save current state */
+	if (GMT_Parse_Common (API, GMT_PROG_OPTIONS, options)) Return (API->error);
+	Ctrl = New_mbgrdtiff_Ctrl (GMT);	/* Allocate and initialize a new control structure */
+	if ((error = GMT_mbgrdtiff_parse (GMT, Ctrl, options))) Return (error);
+
+	/*---------------------------- This is the mbgrdtiff main code ----------------------------*/
+
+	n_grids = (Ctrl->I.do_rgb) ? 3 : 1;
+	use_intensity_grid = (Ctrl->Intensity.active && !Ctrl->Intensity.constant);	/* We want to use the intensity grid */
+
+	/* Read the illumination grid header right away so we can use its region to set that of an image (if requested) */
+	if (use_intensity_grid) {	/* Illumination grid wanted */
+
+		GMT_Report (API, GMT_MSG_VERBOSE, "Allocates memory and read intensity file\n");
+
+		if ((Intens_orig = GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_HEADER_ONLY, NULL, Ctrl->Intensity.file, NULL)) == NULL) {	/* Get header only */
+			Return (API->error);
+		}
+	}
 
-				/* Supplemental parameters */
+	GMT_Report (API, GMT_MSG_VERBOSE, "Allocates memory and read data file\n");
 
- 			}
+	if (!Ctrl->D.active) {
+		for (k = 0; k < n_grids; k++) {
+			if ((Grid_orig[k] = GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_HEADER_ONLY, NULL, Ctrl->I.file[k], NULL)) == NULL) {	/* Get header only */
+				Return (API->error);
 			}
 		}
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhC:c:I:i:K:k:L:l:O:o:R:r:Ww")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'C':
-		case 'c':
-			sscanf (optarg,"%s", cptfile);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", grdfile);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			intensity = MB_YES;
-			sscanf (optarg,"%s", intensfile);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", tiff_file);
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-                case 'W':
-                case 'w':
-                        make_worldfile = MB_YES;
-                        flag++;
-                        break;
-		case '?':
-			errflg++;
+		if (!Ctrl->C.active) Ctrl->C.active = true;	/* Use default CPT stuff */
+	}
+
+	if (n_grids) header_work = Grid_orig[0]->header;	/* OK, we are in GRID mode and this was not set further above. Do it now */
+
+	if (n_grids && Ctrl->I.do_rgb) {	/* Must ensure all three grids are coregistered */
+		if (!GMT_grd_same_region (GMT, Grid_orig[0], Grid_orig[1])) error++;
+		if (!GMT_grd_same_region (GMT, Grid_orig[0], Grid_orig[2])) error++;
+		if (!(Grid_orig[0]->header->inc[GMT_X] == Grid_orig[1]->header->inc[GMT_X] && Grid_orig[0]->header->inc[GMT_X] == 
+			Grid_orig[2]->header->inc[GMT_X])) error++;
+		if (!(Grid_orig[0]->header->nx == Grid_orig[1]->header->nx && Grid_orig[0]->header->nx == Grid_orig[2]->header->nx)) error++;
+		if (!(Grid_orig[0]->header->ny == Grid_orig[1]->header->ny && Grid_orig[0]->header->ny == Grid_orig[2]->header->ny)) error++;
+		if (!(Grid_orig[0]->header->registration == Grid_orig[1]->header->registration && Grid_orig[0]->header->registration == 
+			Grid_orig[2]->header->registration)) error++;
+		if (error) {
+			GMT_Report (API, GMT_MSG_NORMAL, "The r, g, and b grids are not congruent\n");
+			Return (EXIT_FAILURE);
+		}
+	}
+
+	/* Determine what wesn to pass to map_setup */
+
+	if (!GMT->common.R.active && n_grids) GMT_memcpy (GMT->common.R.wesn, Grid_orig[0]->header->wesn, 4, double);
+
+	GMT_err_fail (GMT, GMT_map_setup (GMT, GMT->common.R.wesn), "");
+	
+	/* Determine if grid is to be projected */
+
+	need_to_project = (GMT_IS_NONLINEAR_GRATICULE (GMT) || Ctrl->E.dpi > 0);
+	if (need_to_project) GMT_Report (API, GMT_MSG_DEBUG, "Projected grid is non-orthogonal, nonlinear, or dpi was changed\n");
+	
+	/* Determine the wesn to be used to read the grid file; or bail if file is outside -R */
+
+	if (!GMT_grd_setregion (GMT, header_work, wesn, need_to_project * GMT->common.n.interpolant))
+		nothing_inside = true;
+	else if (use_intensity_grid && !GMT_grd_setregion (GMT, Intens_orig->header, wesn, need_to_project * GMT->common.n.interpolant))
+		nothing_inside = true;
+
+	if (nothing_inside) {
+		/* No grid to plot; just do empty map and bail */
+		PSL = GMT_plotinit (GMT, options);
+		GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
+		GMT_plotcanvas (GMT);	/* Fill canvas if requested */
+		GMT_map_basemap (GMT);
+		GMT_plane_perspective (GMT, -1, 0.0);
+		GMT_plotend (GMT);
+		Return (EXIT_SUCCESS);
+	}
+
+	if (n_grids) {
+		nx = GMT_get_n (GMT, wesn[XLO], wesn[XHI], Grid_orig[0]->header->inc[GMT_X], Grid_orig[0]->header->registration);
+		ny = GMT_get_n (GMT, wesn[YLO], wesn[YHI], Grid_orig[0]->header->inc[GMT_Y], Grid_orig[0]->header->registration);
+	}
+
+//	if (!Ctrl->A.active) {	/* Otherwise we are not writting any postscript */
+//		PSL = GMT_plotinit (GMT, options);
+//		GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
+//		GMT_plotcanvas (GMT);	/* Fill canvas if requested */
+//		if (!Ctrl->N.active) GMT_map_clip_on (GMT, GMT->session.no_rgb, 3);
+//	}
+
+	/* Read data */
+
+	for (k = 0; k < n_grids; k++) {
+		if (GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, wesn, Ctrl->I.file[k], Grid_orig[k]) == NULL) {	/* Get grid data */
+			Return (API->error);
 		}
+	}
+	
+	/* If given, get intensity file or compute intensities */
 
-	/* if error flagged then print it and exit */
+	if (use_intensity_grid) {	/* Illumination wanted */
 
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
+		GMT_Report (API, GMT_MSG_VERBOSE, "Allocates memory and read intensity file\n");
+
+		/* Remember, the illumination header was already read at the top */
+		if (GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, wesn, Ctrl->Intensity.file, Intens_orig) == NULL) {
+			Return (API->error);	/* Get grid data */
+		}
+		if (n_grids && (Intens_orig->header->nx != Grid_orig[0]->header->nx || Intens_orig->header->ny != Grid_orig[0]->header->ny)) {
+			GMT_Report (API, GMT_MSG_NORMAL, "Intensity file has improper dimensions!\n");
+			Return (EXIT_FAILURE);
 		}
 
-	GMT_grd_init (&header, argc, argv, FALSE);
-	GMT_grd_init (&iheader, argc, argv, FALSE);
 
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
+	}
 
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       cptfile:         %s\n",cptfile);
-		fprintf(stderr,"dbg2       grdfile:         %s\n",grdfile);
-		fprintf(stderr,"dbg2       intensfile:      %s\n",intensfile);
-		fprintf(stderr,"dbg2       tiff_file:       %s\n",tiff_file);
-		fprintf(stderr,"dbg2       make_worldfile:  %d\n",make_worldfile);
+	if (need_to_project) {	/* Need to resample the grd file */
+		int nx_proj = 0, ny_proj = 0;
+		double inc[2] = {0.0, 0.0};
+		GMT_Report (API, GMT_MSG_VERBOSE, "project grid files\n");
+
+		if (Ctrl->E.dpi == 0) {	/* Use input # of nodes as # of projected nodes */
+			nx_proj = nx;
+			ny_proj = ny;
 		}
+		for (k = 0; k < n_grids; k++) {
+			if (!Grid_proj[k] && (Grid_proj[k] = GMT_Duplicate_Data (API, GMT_IS_GRID, GMT_DUPLICATE_NONE, Grid_orig[k])) == NULL) Return (API->error);	/* Just to get a header we can change */
+					
+			GMT_mbgrdtiff_set_proj_limits (GMT, Grid_proj[k]->header, Grid_orig[k]->header, need_to_project);
+			if (grid_registration == GMT_GRID_NODE_REG)		/* Force pixel if dpi is set */
+				grid_registration = (Ctrl->E.dpi > 0) ? GMT_GRID_PIXEL_REG : Grid_orig[k]->header->registration;
+			GMT_err_fail (GMT, GMT_project_init (GMT, Grid_proj[k]->header, inc, nx_proj, ny_proj, Ctrl->E.dpi, grid_registration), Ctrl->I.file[k]);
+			GMT_set_grddim (GMT, Grid_proj[k]->header);
+			if (GMT_Create_Data (API, GMT_IS_GRID, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, NULL, NULL, NULL, 0, 0, Grid_proj[k]) == NULL) Return (API->error);
+			GMT_grd_project (GMT, Grid_orig[k], Grid_proj[k], false);
+			if (GMT_Destroy_Data (API, &Grid_orig[k]) != GMT_OK) {
+				Return (API->error);
+			}
+		}
+		if (use_intensity_grid) {
+			if ((Intens_proj = GMT_Duplicate_Data (API, GMT_IS_GRID, GMT_DUPLICATE_NONE, Intens_orig)) == NULL) Return (API->error);	/* Just to get a header we can change */
+			if (n_grids)
+				GMT_memcpy (Intens_proj->header->wesn, Grid_proj[0]->header->wesn, 4, double);
+			if (Ctrl->E.dpi == 0) {	/* Use input # of nodes as # of projected nodes */
+				nx_proj = Intens_orig->header->nx;
+				ny_proj = Intens_orig->header->ny;
+			}
+			GMT_err_fail (GMT, GMT_project_init (GMT, Intens_proj->header, inc, nx_proj, ny_proj, Ctrl->E.dpi, grid_registration), Ctrl->Intensity.file);
+			GMT_set_grddim (GMT, Intens_proj->header);
+			if (GMT_Create_Data (API, GMT_IS_GRID, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, NULL, NULL, NULL, 0, 0, Intens_proj) == NULL) Return (API->error);
+			GMT_grd_project (GMT, Intens_orig, Intens_proj, false);
+			if (GMT_Destroy_Data (API, &Intens_orig) != GMT_OK) {
+				Return (API->error);
+			}
+		}
+		resampled = true;
+	}
+	else {	/* Simply set Grid_proj[i]/Intens_proj to point to Grid_orig[i]/Intens_orig */
+		struct GMT_GRID_HEADER tmp_header;
+		for (k = 0; k < n_grids; k++) {	/* Must get a copy so we can change one without affecting the other */
+			GMT_memcpy (&tmp_header, Grid_orig[k]->header, 1, struct GMT_GRID_HEADER);
+			Grid_proj[k] = Grid_orig[k];
+			//GMT_mbgrdtiff_set_proj_limits (GMT, Grid_proj[k]->header, &tmp_header, need_to_project);
+		}
+		if (use_intensity_grid) Intens_proj = Intens_orig;
+		if (n_grids)
+			grid_registration = Grid_orig[0]->header->registration;
+	}
+
+	if (n_grids) {
+		Grid_proj[0]->header->n_bands = 1;
+		header_work = Grid_proj[0]->header;	/* Later when need to refer to the header, use this copy */
+	}
+
+	nm = header_work->nm;
+	nx = header_work->nx;
+	ny = header_work->ny;
+
+	/* Get/calculate a color palette file */
+	if (!Ctrl->I.do_rgb) {
+		if (Ctrl->C.active) {		/* Read palette file */
+			if ((P = GMT_Get_CPT (GMT, Ctrl->C.file, GMT_CPT_OPTIONAL, header_work->z_min, header_work->z_max)) == NULL) {
+				Return (API->error);
+			}
+			gray_only = (P && P->is_gray);
+		}
+	}
 
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
+
+	if (P && P->has_pattern) GMT_Report (API, GMT_MSG_VERBOSE, "Warning: Patterns in cpt file only apply to -T\n");
+	GMT_Report (API, GMT_MSG_VERBOSE, "Evaluate pixel colors\n");
+
+	NaN_rgb = (P) ? P->patch[GMT_NAN].rgb : GMT->current.setting.color_patch[GMT_NAN];
+	if (Ctrl->Q.active) {
+		if (gray_only) {
+			GMT_Report (API, GMT_MSG_VERBOSE, "Your image is grayscale only but -Q requires 24-bit; image will be converted to 24-bit.\n");
+			gray_only = false;
+			NaN_rgb = red;	/* Arbitrarily pick red as the NaN color since image is gray only */
+			GMT_memcpy (P->patch[GMT_NAN].rgb, red, 4, double);
+		}
+		rgb_used = GMT_memory (GMT, NULL, 256*256*256, unsigned char);
+	}
+	if (Ctrl->M.active || gray_only) {
+                image_size = nm;
+		bitimage_8 = GMT_memory (GMT, NULL, image_size, unsigned char);
+                tiff_image = bitimage_8;
+	}
+	else {
+		if (Ctrl->Q.active) colormask_offset = 3;
+                image_size = 3 * nm + colormask_offset;
+		bitimage_24 = GMT_memory (GMT, NULL, image_size, unsigned char);
+		if (P && Ctrl->Q.active) {
+			for (k = 0; k < 3; k++) bitimage_24[k] = GMT_u255 (P->patch[GMT_NAN].rgb[k]);
 		}
+                tiff_image = bitimage_24;
+	}
+	normal_x = !(GMT->current.proj.projection == GMT_LINEAR && !GMT->current.proj.xyz_pos[0] && !resampled);
+	normal_y = !(GMT->current.proj.projection == GMT_LINEAR && !GMT->current.proj.xyz_pos[1] && !resampled);
+        normal_x = true;
+        normal_y = true;
+	for (try = 0, done = false; !done && try < 2; try++) {	/* Evaluate colors at least once, or twice if -Q and we need to select another NaN color */
+		for (row = 0, byte = colormask_offset; row < ny; row++) {
+			actual_row = (normal_y) ? row : ny - row - 1;
+			kk = GMT_IJPGI (header_work, actual_row, 0);
+			if (Ctrl->D.active && row == 0) node_RGBA = kk;		/* First time per row equals 'node', after grows alone */
+			for (col = 0; col < nx; col++) {	/* Compute rgb for each pixel */
+				node = kk + (normal_x ? col : nx - col - 1);
+				if (Ctrl->I.do_rgb) {
+					for (k = 0; k < 3; k++) {
+						if (GMT_is_fnan (Grid_proj[k]->data[node])) {	/* If one is NaN they are all assumed to be NaN */
+							k = 3;	/* To exit the k-loop */
+							GMT_rgb_copy (rgb, NaN_rgb);
+							index = GMT_NAN - 3;	/* Ensures no illumination done later */
+						}
+						else {				/* Set color, let index = 0 so illuminate test will work */
+							rgb[k] = GMT_is255 (Grid_proj[k]->data[node]);
+							if (rgb[k] < 0.0) rgb[k] = 0.0; else if (rgb[k] > 1.0) rgb[k] = 1.0;	/* Clip */
+							index = 0;
+						}
+					}
+				}
+				else
+					index = GMT_get_rgb_from_z (GMT, P, Grid_proj[0]->data[node], rgb);
+
+				if (Ctrl->I.active && index != GMT_NAN - 3) {
+					if (!n_grids) {		/* Here we are illuminating an image. Must recompute "node" with the GMT_IJP macro */
+						node = GMT_IJP (Intens_proj->header, actual_row, 0) + (normal_x ? col : nx - col - 1);
+					}
+					if (use_intensity_grid)
+						GMT_illuminate (GMT, Intens_proj->data[node], rgb);
+					else
+						GMT_illuminate (GMT, Ctrl->Intensity.value, rgb);
+				}
+				
+				if (P && gray_only)		/* Color table only has grays, pick r */
+					bitimage_8[byte++] = GMT_u255 (rgb[0]);
+				else if (Ctrl->M.active)	/* Convert rgb to gray using the GMT_YIQ transformation */
+					bitimage_8[byte++] = GMT_u255 (GMT_YIQ (rgb));
+				else {
+					for (k = 0; k < 3; k++) bitimage_24[byte++] = i_rgb[k] = GMT_u255 (rgb[k]);
+					if (Ctrl->Q.active && index != GMT_NAN - 3) /* Keep track of all r/g/b combinations used except for NaN */
+						rgb_used[(i_rgb[0]*256 + i_rgb[1])*256+i_rgb[2]] = true;
+				}
+			}
 
-	/* get color palette file */
-	GMT_read_cpt(cptfile);
-	if (GMT_n_colors <= 0)
-	  {
-	    fprintf(stderr,"\nColor palette table not properly specified:\n");
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		    program_name);
-	    error = MB_ERROR_BAD_PARAMETER;
-	    exit(error);
-	  }
+			if (!n_grids) node_RGBA += header_work->n_bands * (header_work->pad[XLO] + header_work->pad[XHI]);
+		}
 
-	/* read input grd file header */
-	if (GMT_read_grd_info (grdfile, &header))
-	    {
-	    error = MB_ERROR_OPEN_FAIL;
-	    fprintf(stderr,"\nUnable to open grd file: %s\n",
-		    grdfile);
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		    program_name);
-	    exit(error);
-	    }
-	if (intensity == MB_YES)
-	    {
-	    if (GMT_read_grd_info (intensfile, &iheader))
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open intensity grd file: %s\n",
-			intensfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
+		if (P && Ctrl->Q.active) {	/* Check that we found an unused r/g/b value so colormasking will work OK */
+			index = (GMT_u255(P->patch[GMT_NAN].rgb[0])*256 + GMT_u255(P->patch[GMT_NAN].rgb[1]))*256 + GMT_u255(P->patch[GMT_NAN].rgb[2]);
+			if (rgb_used[index]) {	/* This r/g/b already appears in the image as a non-NaN color; we must find a replacement NaN color */
+				for (index = 0, ks = -1; ks == -1 && index < 256*256*256; index++) if (!rgb_used[index]) ks = index;
+				if (ks == -1) {
+					GMT_Report (API, GMT_MSG_NORMAL, "Warning: Colormasking will fail as there is no unused color that can represent transparency\n");
+					done = true;
+				}
+				else {	/* Pick the first unused color (i.e., k) and let it play the role of the NaN color for transparency */
+					bitimage_24[0] = (unsigned char)(ks >> 16);
+					bitimage_24[1] = (unsigned char)((ks >> 8) & 255);
+					bitimage_24[2] = (unsigned char)(ks & 255);
+					GMT_Report (API, GMT_MSG_VERBOSE, "Warning: transparency color reset from %s to color %d/%d/%d\n", 
+						GMT_putrgb (GMT, P->patch[GMT_NAN].rgb), (int)bitimage_24[0], (int)bitimage_24[1], (int)bitimage_24[2]);
+					for (k = 0; k < 3; k++) P->patch[GMT_NAN].rgb[k] = GMT_is255 (bitimage_24[k]);	/* Set new NaN color */
+				}	
+			}
 		}
-	    if (header.x_min != iheader.x_min
-		|| header.x_max != iheader.x_max
-		|| header.y_min != iheader.y_min
-		|| header.y_max != iheader.y_max
-		|| header.x_inc != iheader.x_inc
-		|| header.y_inc != iheader.y_inc
-		|| header.nx != iheader.nx
-		|| header.ny != iheader.ny)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nIntensity grd file %s header does not match grd file %s header\n",
-			grdfile, intensfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
+		else
+			done = true;
+	}
+	if (Ctrl->Q.active) GMT_free (GMT, rgb_used);
+	
+	for (k = 1; k < n_grids; k++) {	/* Not done with Grid_proj[0] yet, hence we start loop at k = 1 */
+		if (need_to_project && GMT_Destroy_Data (API, &Grid_proj[k]) != GMT_OK) {
+			GMT_Report (API, GMT_MSG_NORMAL, "Failed to free Grid_proj[k]\n");
+		}
+	}
+	if (use_intensity_grid) {
+		if (need_to_project || !n_grids) {
+			if (GMT_Destroy_Data (API, &Intens_proj) != GMT_OK) {
+				GMT_Report (API, GMT_MSG_NORMAL, "Failed to free Intens_proj\n");
+			}
+		}
+	}
+	
+	/* Get actual size of each pixel */
+	dx = GMT_get_inc (GMT, header_work->wesn[XLO], header_work->wesn[XHI], header_work->nx, header_work->registration);
+	dy = GMT_get_inc (GMT, header_work->wesn[YLO], header_work->wesn[YHI], header_work->ny, header_work->registration);
+
+	/* Set lower left position of image on map */
+
+	x0 = header_work->wesn[XLO];	y0 = header_work->wesn[YLO];
+	if (grid_registration == GMT_GRID_NODE_REG) {	/* Grid registration, move 1/2 pixel down/left */
+		x0 -= 0.5 * dx;
+		y0 -= 0.5 * dy;
+	}
+
+	x_side = dx * header_work->nx;
+	y_side = dy * header_work->ny;
+
+	if (P && gray_only) 
+		for (kk = 0, P->is_bw = true; P->is_bw && kk < nm; kk++) 
+			if (!(bitimage_8[kk] == 0 || bitimage_8[kk] == 255)) P->is_bw = false;
+
+	if (P && P->is_bw) {	/* Can get away with 1 bit image */
+
+		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 1-bit B/W image\n");
+
+		nx8 = irint (ceil (nx / 8.0));	/* Image width must equal a multiple of 8 bits */
+		nx_pixels = nx8 * 8;
+                image_size = nx8 * ny;
+		bitimage_1 = GMT_memory (GMT, NULL, image_size, unsigned char);
+                tiff_image = bitimage_1;
+
+		for (row = k = k8 = 0; row < ny; row++) {
+			shift = 0; byte = 0;
+			for (col = 0; col < nx; col++, k++) {
+				b_or_w = (bitimage_8[k] == 255);
+				byte |= b_or_w;
+				shift++;
+				if (shift == 8) {	/* Time to dump out byte */
+					bitimage_1[k8++] = (unsigned char) byte;
+					byte = shift = 0;
+				}
+				else
+					byte <<= 1;	/* Move the bits we have so far 1 step to the left */
+			}
+			if (shift) {	/* Set the remaining bits in this bit to white */
+				byte |= 1;
+				shift++;
+				while (shift < 8) {
+					byte <<= 1;
+					byte |= 1;
+					shift++;
+				}
+				bitimage_1[k8++] = (unsigned char) byte;
+			}
 		}
-	    }
 
+		x_side = nx_pixels * dx;
+		//PSL_plotbitimage (PSL, x0, y0, x_side, y_side, PSL_BL, bit, nx_pixels, ny, Ctrl->G.f_rgb, Ctrl->G.b_rgb);
+	}
+	else if ((P && gray_only) || Ctrl->M.active) {
+			GMT_Report (API, GMT_MSG_VERBOSE, "Creating 8-bit grayshade image\n");
+			//PSL_plotcolorimage (PSL, x0, y0, x_side, y_side, PSL_BL, bitimage_8, nx, ny, (Ctrl->E.device_dpi ? -8 : 8));
+	}
+	else {
+		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 24-bit color image\n");
+		//PSL_plotcolorimage (PSL, x0, y0, x_side, y_side, PSL_BL, bitimage_24, (Ctrl->Q.active ? -1 : 1) * 
+		//    nx, ny, (Ctrl->E.device_dpi ? -24 : 24));
+	}
+
+	/*------------------------- Write out the GeoTiff and world files -------------------------*/
+        
 	/* try to get projection from the grd file remark */
-	if (strncmp(&(header.remark[2]), "Projection: ", 12) == 0)
+	if (strncmp(&(header_work->remark[2]), "Projection: ", 12) == 0)
 		{
-		if ((nscan = sscanf(&(header.remark[2]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
+		if ((nscan = sscanf(&(header_work->remark[2]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
 			{
 			if (NorS == 'N')
 				{
@@ -655,30 +1104,22 @@ int main (int argc, char **argv)
 				}
 				modeltype = ModelTypeProjected;
 			sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
-
-			project_info.degree[0] = FALSE;
 			}
-		else if ((nscan = sscanf(&(header.remark[2]), "Projection: epsg%d", &projectionid)) == 1)
+		else if ((nscan = sscanf(&(header_work->remark[2]), "Projection: epsg%d", &projectionid)) == 1)
 			{
 			sprintf(projectionname, "epsg%d", projectionid);
 			modeltype = ModelTypeProjected;
-
-			project_info.degree[0] = FALSE;
 			}
-		else if (strncmp(&(header.remark[2]), "Projection: SeismicProfile", 26) == 0)
+		else if (strncmp(&(header_work->remark[2]), "Projection: SeismicProfile", 26) == 0)
 			{
 			sprintf(projectionname, "SeismicProfile");
 			modeltype = ModelTypeProjected;
-
-			project_info.degree[0] = FALSE;
 			}
 		else
 			{
 			strcpy(projectionname, "Geographic WGS84");
 			modeltype = ModelTypeGeographic;
 			projectionid = GCS_WGS_84;
-
-			project_info.degree[0] = TRUE;
 			}
 		}
 	else
@@ -686,133 +1127,21 @@ int main (int argc, char **argv)
 		strcpy(projectionname, "Geographic WGS84");
 		modeltype = ModelTypeGeographic;
 		projectionid = GCS_WGS_84;
-
-		project_info.degree[0] = TRUE;
-		}
-
-	/* set bounds from grd file if not set on command line */
-	if (bounds[1] <= bounds[0] || bounds[3] <= bounds[2])
-	    {
-	    bounds[0] = header.x_min;
-	    bounds[1] = header.x_max;
-	    bounds[2] = header.y_min;
-	    bounds[3] = header.y_max;
-	    }
-
-	/* Determine the wesn to be used to read the grdfile */
-	off = (header.node_offset) ? 0 : 1;
-	GMT_map_setup (bounds[0], bounds[1], bounds[2], bounds[3]);
-#ifdef GMT_MINOR_VERSION
-	GMT_grd_setregion (&header, &bounds[0], &bounds[1], &bounds[2], &bounds[3], BCR_BILINEAR);
-#else
-	GMT_grd_setregion (&header, &bounds[0], &bounds[1], &bounds[2], &bounds[3]);
-#endif
-
-	/* allocate memory */
-	nx = irint ( (bounds[1] - bounds[0]) / header.x_inc) + off;
-	ny = irint ( (bounds[3] - bounds[2]) / header.y_inc) + off;
-	nxy = nx * ny;
-	if (GMT_gray)
-	  image_size = nx * ny;
-	else
-	  image_size = 3 * nx * ny;
-	status = mb_mallocd(verbose, __FILE__, __LINE__, nxy * sizeof(float), (void **)&grid, &error);
-	if (intensity == MB_YES)
-	    status = mb_mallocd(verbose, __FILE__, __LINE__, nxy * sizeof(float), (void **)&igrid, &error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, image_size, (void **)&tiff_image, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
 		}
-
-	/* read the grid */
-	pad[0] = 0;
-	pad[1] = 0;
-	pad[2] = 0;
-	pad[3] = 0;
-	if (GMT_read_grd (grdfile, &header, grid,
-			    bounds[0],  bounds[1],  bounds[2],  bounds[3],
-			    pad, FALSE))
-	    {
-	    error = MB_ERROR_OPEN_FAIL;
-	    fprintf(stderr,"\nUnable to read grd file: %s\n",
-		    grdfile);
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		    program_name);
-	    exit(error);
-	    }
-	if (intensity == MB_YES)
-	    {
-	    if (GMT_read_grd (intensfile, &iheader, igrid,
-				bounds[0],  bounds[1],  bounds[2],  bounds[3],
-				pad, FALSE))
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to read intensity grd file: %s\n",
-			intensfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    }
-
-	/* apply lonflip */
-	if (modeltype != ModelTypeProjected)
-		{
-		mb_apply_lonflip(verbose, lonflip, &header.x_min);
-		mb_apply_lonflip(verbose, lonflip, &header.x_max);
-		if (intensity == MB_YES)
-	    		{
-			mb_apply_lonflip(verbose, lonflip, &iheader.x_min);
-			mb_apply_lonflip(verbose, lonflip, &iheader.x_max);
-			}
-		}
-
-	/* print debug info */
-	if (verbose >= 0)
-	    {
-	    fprintf(stderr,"Grid read:\n");
-	    fprintf(stderr,"  Dimensions: %d %d\n", header.nx, header.ny);
-	    if (modeltype == ModelTypeProjected)
-	    	{
-		fprintf(stderr,"  Projected Coordinate System Name: %s\n", projectionname);
-		fprintf(stderr,"  Projected Coordinate System ID:   %d\n", projectionid);
-	    	fprintf(stderr,"  Easting:    %f %f  %f\n",
-		  	header.x_min, header.x_max, header.x_inc);
-	    	fprintf(stderr,"  Northing:   %f %f  %f\n",
-		  	header.y_min, header.y_max, header.y_inc);
-		}
-	    else
-		{
-		fprintf(stderr,"  Geographic Coordinate System Name: %s\n", projectionname);
-		fprintf(stderr,"  Geographic Coordinate System ID:   %d\n", projectionid);
-	    	fprintf(stderr,"  Longitude:  %f %f  %f\n",
-		  	header.x_min, header.x_max, header.x_inc);
-	    	fprintf(stderr,"  Latitude:   %f %f  %f\n",
-		  	header.y_min, header.y_max, header.y_inc);
-		}
-	    if (GMT_gray)
-		fprintf(stderr,"Writing 8 bit grayscale TIFF image\n");
-	    else
-		fprintf(stderr,"Writing 24 bit color TIFF image\n");
-	    }
-
-	/* open TIFF file */
-	if ((tfp = fopen(tiff_file,"w")) == NULL)
-	    {
-	    error = MB_ERROR_OPEN_FAIL;
-	    fprintf(stderr,"\nUnable to open output tiff file: %s\n",
-		  tiff_file);
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		  program_name);
-	    exit(error);
-	    }
+                
+        /* Google Earth Pro requires GeoTiffs longitude to be in -180 to +180 domain
+         * make sure geographic images have the origin in the right domain unless
+         * that does not make sense so that most images will work with Google Earth Pro */
+        if (modeltype == ModelTypeGeographic && header_work->wesn[XLO] > 180.0 && header_work->wesn[XHI] > 180.0)
+            {
+            header_work->wesn[XLO] -= 360.0;
+            header_work->wesn[XHI] -= 360.0;
+            }
+        if (modeltype == ModelTypeGeographic && header_work->wesn[XLO] < -180.0 && header_work->wesn[XHI] < -180.0)
+            {
+            header_work->wesn[XLO] += 360.0;
+            header_work->wesn[XHI] += 360.0;
+            }
 
 	/* set the TIFF comment */
 	sprintf(tiff_comment, "Image generated by %s|", program_name);
@@ -870,7 +1199,7 @@ int main (int argc, char **argv)
 		index += 4;
 		break;
 	      case BitsPerSample:
-		if (GMT_gray)
+		if ((P && gray_only))
 		  {
 		    value_int = 1;
 		    mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
@@ -905,7 +1234,7 @@ int main (int argc, char **argv)
 		value_int = 1;
 		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
 		index += 4;
-		if (GMT_gray)
+		if ((P && gray_only))
 		  {
 		  value_short = 1;
 		  }
@@ -928,7 +1257,7 @@ int main (int argc, char **argv)
 		value_int = 1;
 		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
 		index += 4;
-		if (GMT_gray)
+		if ((P && gray_only))
 		  value_short = 1;
 		else
 		  value_short = 3;
@@ -947,7 +1276,7 @@ int main (int argc, char **argv)
 		value_int = 1;
 		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
 		index += 4;
-		if (GMT_gray)
+		if ((P && gray_only))
 		  value_int = nx * ny;
 		else
 		  value_int = 3 * nx * ny;
@@ -993,9 +1322,9 @@ int main (int argc, char **argv)
 		value_int = tiff_offset[i];
 	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
 		index += 4;
-		value_double = header.x_inc;
+		value_double = header_work->inc[0];
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i]]);
-		value_double = header.y_inc;
+		value_double = header_work->inc[1];
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i]+8]);
 		value_double = 0.0;
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i]+16]);
@@ -1013,10 +1342,11 @@ int main (int argc, char **argv)
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 1 * 8]);
 		value_double = 0;
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 2 * 8]);
-		value_double = header.x_min - 0.5 * header.x_inc;
+                value_double = header_work->wesn[XLO] - 0.5 * header_work->inc[0];
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 3 * 8]);
-		value_double = header.y_max + 0.5 * header.y_inc;
+		value_double = header_work->wesn[YHI] + 0.5 * header_work->inc[1];
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 4 * 8]);
+                
 		value_double = 0.0;
 		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 5 * 8]);
 		break;
@@ -1144,100 +1474,75 @@ int main (int argc, char **argv)
 	      }
 	  }
 
-	/* generate image */
-	for (j=0;j<ny;j++)
-	  for (i=0;i<nx;i++)
-	    {
-	      k = j * nx + i;
-	      GMT_get_rgb24(grid[k], rgb);
-	      if (intensity == MB_YES)
-		GMT_illuminate(igrid[k], rgb);
-	      if (GMT_gray)
-		{
-		  tiff_image[k] = (mb_u_char)rgb[0];
-		}
-	      else
-		{
-	          kk = 3 * k;
-		  tiff_image[kk] = (mb_u_char)rgb[0];
-		  tiff_image[kk+1] = (mb_u_char)rgb[1];
-		  tiff_image[kk+2] = (mb_u_char)rgb[2];
-		}
-	    }
+	/* open TIFF file */
+	if ((tfp = fopen(Ctrl->O.file,"w")) == NULL) {
+                API->error++;
+                return(API->error);
+	}
+
+	/* set the TIFF comment */
+	sprintf(tiff_comment, "Image generated by %s|", program_name);
 
 	/* write the header */
-	if ((status = fwrite(tiff_header,1,TIFF_HEADER_SIZE,tfp))
-			!= TIFF_HEADER_SIZE)
-	  {
-	    status = MB_FAILURE;
-	    error = MB_ERROR_WRITE_FAIL;
-	  }
+	if ((write_size = fwrite(tiff_header,1,TIFF_HEADER_SIZE,tfp)) != TIFF_HEADER_SIZE) {
+                API->error++;
+                return(API->error);
+	}
 
 	/* write the image */
-	if ((status = fwrite(tiff_image,1,image_size,tfp))
-			!= image_size)
-	  {
-	    status = MB_FAILURE;
-	    error = MB_ERROR_WRITE_FAIL;
-	  }
+	if ((write_size = fwrite(tiff_image,1,image_size,tfp)) != image_size) {
+                API->error++;
+                return(API->error);
+	}
 
 	/* close the tiff file */
 	fclose(tfp);
 
 	/* open world file */
-        if (make_worldfile == MB_YES)
-            {
-            strcpy(world_file, tiff_file);
-            world_file[strlen(tiff_file)-4] = '\0';
-            strcat(world_file,".tfw");
-            if ((tfp = fopen(world_file,"w")) == NULL)
-                {
-                error = MB_ERROR_OPEN_FAIL;
-                fprintf(stderr,"\nUnable to open output world file: %s\n",
-                      world_file);
-                fprintf(stderr,"\nProgram <%s> Terminated\n",
-                      program_name);
-                exit(error);
-                }
-
-            /* write out world file contents */
-            fprintf(tfp, "%f\r\n0.0\r\n0.0\r\n%f\r\n%f\r\n%f\r\n",
-                    header.x_inc, -header.y_inc,
-                    header.x_min - 0.5 * header.x_inc,
-                    header.y_max + 0.5 * header.y_inc);
-
-            /* close the world file */
-            fclose(tfp);
-            }
-
-	/* deallocate arrays */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&grid, &error);
-	if (intensity == MB_YES)
-	  status = mb_freed(verbose,__FILE__, __LINE__, (void **)&igrid, &error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&tiff_image, &error);
-
-	/* set the status */
-	status = MB_SUCCESS;
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* clean up GMT memory usage and file locking */
-	fprintf(stderr,"\n");
-	GMT_end(1, argv);
-
-	/* end it all */
-	exit(status);
+        strcpy(world_file, Ctrl->O.file);
+        world_file[strlen(Ctrl->O.file)-4] = '\0';
+        strcat(world_file,".tfw");
+        if ((tfp = fopen(world_file,"w")) == NULL) {
+                API->error++;
+                return(API->error);
+        }
+
+        /* write out world file contents */
+        fprintf(tfp, "%f\r\n0.0\r\n0.0\r\n%f\r\n%f\r\n%f\r\n",
+                dx, -dy,
+                header_work->wesn[XLO] - 0.5 * dx,
+                header_work->wesn[YHI] + 0.5 * dy);
+
+        /* close the world file */
+        fclose(tfp);
+fprintf(stderr,"3 Grid header:\n\tnx:%d ny:%d registration:%d\n\tWESN: %f %f %f %f\n\tinc: %f %f\n",
+Grid_orig[0]->header->nx,Grid_orig[0]->header->ny,Grid_orig[0]->header->registration,
+Grid_orig[0]->header->wesn[XLO],Grid_orig[0]->header->wesn[XHI],Grid_orig[0]->header->wesn[YLO],Grid_orig[0]->header->wesn[YHI],
+Grid_orig[0]->header->inc[0],Grid_orig[0]->header->inc[1]);
+fprintf(stderr,"3 Work header:\n\tnx:%d ny:%d registration:%d\n\tWESN: %f %f %f %f\n\tinc: %f %f\n",
+header_work->nx,header_work->ny,header_work->registration,
+header_work->wesn[XLO],header_work->wesn[XHI],header_work->wesn[YLO],header_work->wesn[YHI],
+header_work->inc[0],header_work->inc[1]);
+
+//	if (!Ctrl->A.active) {
+//		if (!Ctrl->N.active) GMT_map_clip_off (GMT);
+//
+//		GMT_map_basemap (GMT);
+//		GMT_plane_perspective (GMT, -1, 0.0);
+//		GMT_plotend (GMT);
+//	}
+
+	/* Free bitimage arrays. GMT_free will not complain if they have not been used (NULL) */
+        if (P && P->is_bw) GMT_free (GMT, bitimage_1);
+        if (bitimage_8) GMT_free (GMT, bitimage_8);
+	if (bitimage_24) GMT_free (GMT, bitimage_24);
+
+	if (need_to_project && n_grids && GMT_Destroy_Data (API, &Grid_proj[0]) != GMT_OK) {
+		GMT_Report (API, GMT_MSG_NORMAL, "Failed to free Grid_proj[0]\n");
+	}
+
+	if (!Ctrl->C.active && GMT_Destroy_Data (API, &P) != GMT_OK) {
+		Return (API->error);
+	}
+	Return (EXIT_SUCCESS);
 }
-
-/*--------------------------------------------------------------------*/
diff --git a/src/gmt/mbswath.c b/src/gmt/mbswath.c
index 0903013..59a337d 100644
--- a/src/gmt/mbswath.c
+++ b/src/gmt/mbswath.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbswath.c	5/30/93
- *    $Id: mbswath.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbswath.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -26,248 +26,28 @@
  *   Mode 6:  Bathymetry shaded by amplitude using cpt gray data
  *
  * Author:	D. W. Caress
- * Date:	May 30, 1993
- *
- * $Log: mbswath.c,v $
- * Revision 5.23  2009/03/02 18:59:05  caress
- * Moving towards 5.1.2beta1.
- *
- * Revision 5.22  2008/09/27 03:27:10  caress
- * Working towards release 5.1.1beta24
- *
- * Revision 5.21  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.20  2007/11/02 22:38:52  caress
- * Fixed handling of time gap errors in mbswath.
- *
- * Revision 5.19  2007/10/17 20:35:53  caress
- * Release 5.1.1beta11
- *
- * Revision 5.18  2007/07/04 03:00:19  caress
- * Now works with xyz data.
- *
- * Revision 5.17  2006/12/15 21:42:49  caress
- * Incremental CVS update.
- *
- * Revision 5.16  2006/11/26 09:42:01  caress
- * Making distribution 5.1.0.
- *
- * Revision 5.15  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.14  2006/11/07 20:19:29  dale
- * Changed line 646 from: 	GMT_pen_syntax ('F');
- *
- * to: GMT_pen_syntax ('F'," ");
- *
- * to accomodate GMT4.1.4
- * -Dale
- *
- * Revision 5.13  2006/06/22 04:45:42  caress
- * Working towards 5.1.0
- *
- * Revision 5.12  2006/06/02 03:00:31  caress
- * Put in ifdefs to handle new GMT version.
- *
- * Revision 5.11  2006/01/11 07:25:53  caress
- * Working towards 5.0.8
- *
- * Revision 5.10  2005/11/04 20:50:19  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2004/05/21 23:13:35  caress
- * Changes to support GMT 4.0
- *
- * Revision 5.8  2003/04/17 20:43:37  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/10/02 23:52:37  caress
- * Release 5.0.beta24
- *
- * Revision 5.6  2002/04/06 02:45:59  caress
- * Release 5.0.beta16
- *
- * Revision 5.5  2001/08/10 22:40:02  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.4  2001-07-19 17:29:41-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08 21:42:53  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22 21:03:31  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.1  2001/01/22  05:03:25  caress
- * Release 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:52:16  caress
- * First cut at Version 5.0.
- *
- * Revision 4.33  2000/10/11  00:53:45  caress
- * Converted to ANSI C
- *
- * Revision 4.32  2000/09/30  06:52:17  caress
- * Snapshot for Dale.
- *
- * Revision 4.31  2000/09/11  20:09:14  caress
- * Linked to new datalist parsing functions. Now supports recursive datalists
- * and comments in datalists.
- *
- * Revision 4.30  1999/04/16  01:24:27  caress
- * Final version 4.6 release?
- *
- * Revision 4.29  1999/02/04  23:41:29  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.28  1998/12/17  22:53:13  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.27  1998/10/28  21:32:29  caress
- * Fixed handling of data with variable numbers of beams.
- *
- * Revision 4.26  1998/10/04  04:18:07  caress
- * MB-System version 4.6beta
- *
- * Revision 4.25  1997/09/15  19:03:27  caress
- * Real Version 4.5
- *
- * Revision 4.24  1997/04/21  16:53:56  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.24  1997/04/17  15:05:49  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.23  1996/09/05  13:58:27  caress
- * Added feature to check data bounds in ".inf" files.
- *
- * Revision 4.22  1996/08/26  17:31:55  caress
- * Release 4.4 revision.
- *
- * Revision 4.21  1996/08/13  18:32:53  caress
- * Fixed bug in getting footprints of outer beams.
- *
- * Revision 4.20  1996/08/13  16:10:07  caress
- * Fixed bug in plotting the first sidescan pixel.
- *
- * Revision 4.19  1996/07/26  21:03:26  caress
- * Fixed code to handle variable numbers of beams and pixels properly.
- *
- * Revision 4.18  1996/04/22  13:20:25  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.17  1995/11/28  21:06:16  caress
- * Fixed scaling for meters to feet.
- *
- * Revision 4.16  1995/11/22  22:13:02  caress
- * Now handles bathymetry in feet with -W option.
- *
- * Revision 4.15  1995/11/15  22:32:55  caress
- * Now handles non-region bounds (lower left point
- * + upper right point) properly.
- *
- * Revision 4.14  1995/08/17  14:49:26  caress
- * Revision for release 4.3.
- *
- * Revision 4.13  1995/08/07  17:31:39  caress
- * Moved to GMT V3.
- *
- * Revision 4.12  1995/07/13  19:15:53  caress
- * Fixed problems with footprints for sidescan.
- *
- * Revision 4.11  1995/05/12  17:19:02  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.10  1995/03/06  19:40:17  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.9  1995/01/18  22:14:49  caress
- * Fixed bug regarding the calculation of footprints for
- * sidescan data.
- *
- * Revision 4.8  1995/01/10  15:46:08  caress
- * Made plotting using the fore-aft beam width the default.
- *
- * Revision 4.7  1995/01/05  23:59:20  caress
- * Made it possible to read data from a single file or
- * from datalists.
- *
- * Revision 4.6  1994/12/21  20:23:30  caress
- * Allows the alongtrack beam footprint to be determined
- * by alongtrack beam width in degrees. The alongtrack
- * beam width is set using a negative argument in the
- * -A option. This will be made the standard mode soon,
- * but is an undocumented feature for now.
- *
- * Revision 4.5  1994/10/25  12:32:41  caress
- * Fixed memory overwrite that causing early exits.
- *
- * Revision 4.4  1994/10/21  16:08:22  caress
- * Release V4.0
- *
- * Revision 4.3  1994/10/21  11:34:20  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  19:04:31  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * >> using unix second time base.
- *
- * Revision 4.1  1994/06/13  18:39:15  caress
- * Made it possible to read data from stdin.
- *
- * Revision 4.0  1994/03/05  23:46:48  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:48:58  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/03/02  22:21:45  caress
- * Added capability of plotting bathymetry shaded by amplitude,
- * amplitude, or sidescan data.
- *
- * Revision 4.0  1994/02/26  23:07:51  caress
- * First cut at new version.
- *
- * Revision 3.3  1993/11/27  03:03:37  caress
- * Fixed major bug in shaded relief plotting.  Before, only the
- * along track derivative was being used because the drvx and drvy
- * x and y derivative components were set to zero after the
- * across-track derivative was calculated.
- * ..
- *
- * Revision 3.2  1993/11/03  21:09:10  caress
- * Changed ps_plotinit call to agree with current version
- * of GMT (v2.1.4).
- *
- * Revision 3.1  1993/06/20  23:08:30  caress
- * Fixed help message.
- *
- * Revision 3.0  1993/06/19  01:16:43  caress
- * Initial version.
- *
+ * Date:	May 30, 1993 (original standalone program for GMT3 and GMT4)
+ * Date:	January 27, 2015 (recast as GMT5 module)
  *
  */
 
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
+#define THIS_MODULE_NAME	"mbswath"
+#define THIS_MODULE_LIB		"mbgmt"
+#define THIS_MODULE_PURPOSE	"Plot swath bathymetry, amplitude, or backscatter"
+#define THIS_MODULE_KEYS	""
 
-/* GMT include files */
-#include "gmt.h"
-#include "pslib.h"
+/* GMT5 header file */
+#include "gmt_dev.h"
+
+EXTERN_MSC int GMT_mbswath(void *API, int mode, void *args);
+
+#define GMT_PROG_OPTIONS "->BJKOPRUVXY" GMT_OPT("S")
 
 /* MBIO include files */
 #include "mb_status.h"
 #include "mb_format.h"
 #include "mb_define.h"
-
-/* GMT argument handling define */
-#define MBSWATH_GMT_ARG_MAX     128
+#include "mb_io.h"
 
 /* MBSWATH MODE DEFINES */
 #define	MBSWATH_BATH		1
@@ -285,14 +65,22 @@
 #define MBSWATH_FILTER_AMP	1
 #define MBSWATH_FILTER_SIDESCAN	2
 
+/* image type defines */
+#define	MBSWATH_IMAGE_VECTOR	1
+#define	MBSWATH_IMAGE_8		2
+#define	MBSWATH_IMAGE_24	3
+
+/* How B/W TV's convert RGB to Gray */
+#define YIQ(rgb) (0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2])
+
 /* global structure definitions */
 #define MAXPINGS 50
-struct	footprint
+struct footprint
 	{
 	double	x[4];
 	double	y[4];
 	};
-struct	ping
+struct ping
 	{
 	int	pings;
 	int	kind;
@@ -336,704 +124,671 @@ struct swath
 	struct ping data[MAXPINGS];
 	};
 
-/* image type defines */
-#define	MBSWATH_IMAGE_VECTOR	1
-#define	MBSWATH_IMAGE_8		2
-#define	MBSWATH_IMAGE_24	3
-
-/* global image variables and defines */
-#ifndef YIQ
-#define YIQ(rgb) irint (0.299 * (rgb[0]) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]))
-#endif
-int	image = MBSWATH_IMAGE_24;
-unsigned char *bitimage;
-int	dpi = 100;
-double	x_inch, y_inch;
-double	xo, yo;
-int	nx, ny, nm, nm2;
-unsigned char r, g, b, gray;
-
-int get_footprints(int verbose, int mode, int fp_mode,
-		double factor, double depth_def,
-		struct swath *swath,
-		double mtodeglon, double mtodeglat, int *error);
-int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
-		double mtodeglon, double mtodeglat,
-		double magnitude, double azimuth,
-		int nshadelevel, double *shadelevel,
-		int *shadelevelgray, int *error);
-int plot_data_footprint(int verbose, int mode,
-		struct swath *swath, int first, int nplot, int *error);
-int plot_data_point(int verbose, int mode,
-		struct swath *swath, int first, int nplot, int *error);
-int plot_box(int verbose, double *x, double *y, int *rgb, int *error);
-int plot_point(int verbose, double x, double y, int *rgb, int *error);
-int ping_copy(int verbose, int one, int two, struct swath *swath, int *error);
-
-static char rcs_id[] = "$Id: mbswath.c 2175 2014-03-18 23:03:39Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBSWATH";
-	char help_message[] =  "MBSWATH is a GMT compatible utility which creates a color postscript \nimage of swath bathymetry or backscatter data.  The image \nmay be shaded relief as well.  Complete maps are made by using \nMBSWATH in conjunction with the usual GMT programs.";
-	char usage_message[] = "mbswath -Ccptfile -Jparameters -Rwest/east/south/north \n\t[-Afactor -Btickinfo -byr/mon/day/hour/min/sec \n\t-ccopies -Dmode/ampscale/ampmin/ampmax \n\t-Eyr/mon/day/hour/min/sec -fformat \n\t-Fred/green/blue -Gmagnitude/azimuth -Idatalist \n\t-K -Ncptfile -O -P -ppings -Qdpi -Ttimegap -U -W -Xx-shift -Yy-shift \n\t-Zmode[F] -V -H]";
-
-	extern char *optarg;
-	int     argc_gmt = 0;
-	char    *argv_gmt[MBSWATH_GMT_ARG_MAX];
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	char	read_file[MB_PATH_MAXLINE];
-        int     read_datalist = MB_NO;
-	int	read_data;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	FILE	*fp;
-	int	format;
+/* Control structure for mbswath */
+struct MBSWATH_CTRL {
+
+        /* mbswath variables */
+	double  bounds[4];
+	int     image_type;
+	double  mtodeglon;
+	double  mtodeglat;
+	double  clipx[4];
+	double  clipy[4];
+	double  x_inc;
+	double  y_inc;
+	double  x_side;
+	double  y_side;
+	double  x0;
+	double  y0;
+	double  x_inch;
+	double  y_inch;
+	int     nx;
+	int     ny;
+	int     nm;
+	int     nm2;
+	unsigned char *bitimage;
+	int     format;
 	double	beamwidth_xtrack;
 	double	beamwidth_ltrack;
-	int	pings;
-	int	lonflip;
-	int	lonflip_set = MB_NO;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
+	double  footprint_factor;
 	double	btime_d;
 	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	file_in_bounds;
+	int     read_datalist;
+	int	read_data;
+	void	*datalist;
+	double	file_weight;
+        mb_path file;
+	int	filtermode;
 	int	beams_bath_max;
 	int	beams_amp_max;
 	int	pixels_ss_max;
-	void	*mbio_ptr = NULL;
-
-	/* mbio read values */
-	struct swath *swath_plot = NULL;
-	struct ping *pingcur = NULL;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathlon = NULL;
-	double	*bathlat = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*sslon = NULL;
-	double	*sslat = NULL;
-
-	/* gmt control variables */
-	double	borders[4];
-	double	borders_use[4];
-	char	cptfile[MB_PATH_MAXLINE];
-	char	cptshadefile[MB_PATH_MAXLINE];
-	int	ampshademode = 0;
-	int	nshadelevel = 0;
-	double	*shadelevel;
-	int	*shadelevelgray;
-	double	magnitude = 1.0;
-	double	azimuth = 90.0;
-	int	ampscale_mode = 0;
-	double	ampscale = 1.0;
-	double	ampmin = 0.0;
-	double	ampmax = 1.0;
-	int	footprint_mode = MBSWATH_FOOTPRINT_REAL;
-	double	rawfactor = 1.0;
-	double	factor;
-	double	default_depth = 0.0;
-	double	default_depth_use;
-	int	mode = MBSWATH_BATH;
-	int	usefiltered = MB_NO;
-	int	filtermode = MBSWATH_FILTER_NONE;
-	int	bathy_in_feet = MB_NO;
-	int	start;
-	int	plot;
-	int	done;
-	int	flush;
-	int	save_new;
-	int	first;
-	int	*npings;
-	int	nping_read = 0;
-	int	nplot;
-	double	amplog;
-	double	mtodeglon, mtodeglat;
-	double	clipx[4], clipy[4];
-
-	/* other variables */
-	int	rgb[3];
-	int	r1, g1, b1, r2, g2, b2;
-	int	count;
-	int	i, j;
-	char	line[MB_PATH_MAXLINE];
+	void	*mbio_ptr;
+	struct swath *swath_plot;
+
+	struct mbswath_A {	/* -A<factor>/<mode>/<depth> */
+		bool active;
+		double factor;
+		int mode;
+		double depth;
+	} A;
+	struct mbswath_b {	/* -b<year>/<month>/<day>/<hour>/<minute>/<second> */
+		bool active;
+		int time_i[7];
+	} b;
+	struct mbswath_C {	/* -C<cptfile> */
+		bool active;
+		char *cptfile;
+	} C;
+	struct mbswath_D {	/* -D<mode>/<ampscale>/<ampmin>/<ampmax> */
+		bool active;
+		unsigned int mode;
+		double ampscale;
+		double ampmin;
+		double ampmax;
+	} D;
+	struct mbswath_E {	/* -Ei|<dpi> */
+		bool active;
+		bool device_dpi;
+		unsigned int dpi;
+	} E;
+	struct mbswath_e {	/* -e<year>/<month>/<day>/<hour>/<minute>/<second> */
+		bool active;
+		int time_i[7];
+	} e;
+	struct mbswath_F {	/* -F<format> */
+		bool active;
+		int format;
+	} F;
+	struct mbswath_G {	/* -G<magnitude>/<azimuth | median> */
+		bool active;
+		double magnitude;
+		double azimuth;
+	} G;
+	struct mbswath_I {	/* -I<inputfile> */
+		bool active;
+		char *inputfile;
+	} I;
+	struct mbswath_L {	/* -L<lonflip> */
+		bool active;
+		int lonflip;
+	} L;
+	struct mbswath_N {	/* -N<cptfile> */
+		bool active;
+		char *cptfile;
+	} N;
+	struct mswath_p {	/* -p<pings> */
+		bool active;
+		int pings;
+	} p;
+	struct mbswath_S {	/* -S<speed> */
+		bool active;
+		double speed;
+	} S;
+	struct mbswath_T {	/* -T<timegap> */
+		bool active;
+		double timegap;
+	} T;
+	struct mbswath_W {	/* -W */
+		bool active;
+	} W;
+	struct mbswath_Z {	/* -Z<mode> */
+		bool active;
+		int mode;
+		int filter;
+		int usefiltered;
+	} Z;
+};
+
+void *New_mbswath_Ctrl (struct GMT_CTRL *GMT);
+void Free_mbswath_Ctrl (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl);
+int GMT_mbswath_usage (struct GMTAPI_CTRL *API, int level);
+int GMT_mbswath_parse (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl, struct GMT_OPTION *options);
+
+int mbswath_get_footprints(int verbose, struct MBSWATH_CTRL *Ctrl, int *error);
+int mbswath_get_shading(int verbose, struct MBSWATH_CTRL *Ctrl,
+                        struct GMT_CTRL *GMT, struct GMT_PALETTE *CPT, int *error);
+int mbswath_plot_data_footprint(int verbose, struct MBSWATH_CTRL *Ctrl,
+                        struct GMT_CTRL *GMT, struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL,
+                        int first, int nplot, int *error);
+int mbswath_plot_data_point(int verbose, struct MBSWATH_CTRL *Ctrl,
+                        struct GMT_CTRL *GMT, struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL,
+                        int first, int nplot, int *error);
+int mbswath_plot_box(int verbose, struct MBSWATH_CTRL *Ctrl,
+                        struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
+                        double *x, double *y, double *rgb, int *error);
+int mbswath_plot_point(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
+                        double x, double y, double *rgb, int *error);
+int mbswath_ping_copy(int verbose, int one, int two, struct swath *swath, int *error);
+
+void *New_mbswath_Ctrl (struct GMT_CTRL *GMT) {	/* Allocate and initialize a new control structure */
+	struct MBSWATH_CTRL *Ctrl;
+	int     status;
+	int     verbose = 0;
+	double  dummybounds[4];
+	int     dummyformat;
+	int     dummypings;
+	int     i;
+
+	Ctrl = GMT_memory (GMT, NULL, 1, struct MBSWATH_CTRL);
+
+	/* Initialize values whose defaults are not 0/false/NULL */
 
 	/* get current mb default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to stdin */
-	strcpy (read_file, "stdin");
-
-	/* initialize some values */
-	format = -1;
-        read_datalist = MB_NO;
-	strcpy (cptfile,"cpt");
-	strcpy (cptshadefile,"\0");
-	borders[0] = 0.0;
-	borders[1] = 0.0;
-	borders[2] = 0.0;
-	borders[3] = 0.0;
-
-	/* get GMT options into separate argv */
-	argv_gmt[0] = argv[0];
-	argc_gmt = 1;
-	for (i=1;i<argc;i++)
-	  {
-	  if (argv[i][0] == '-')
-	    {
-	    switch (argv[i][1])
-	        {
-		case 'B':
-       		case 'C':
-		case 'c':
-		case 'F':
-		case 'J':
-		case 'j':
-		case 'K':
-		case 'k':
-		case 'O':
-		case 'o':
-		case 'P':
-		case 'R':
-		case 'r':
-		case 'U':
-		case 'u':
-		case 'V':
-		case 'v':
-		case 'X':
-		case 'x':
-		case 'Y':
-		case 'y':
-		case '0':
-		case '1':
-		case '2':
-		case '#':
-		case '\0':
-		        if (argc_gmt < MBSWATH_GMT_ARG_MAX)
-			  {
-			  argv_gmt[argc_gmt] = argv[i];
-			  argc_gmt++;
-			  break;
-			  }
-		}
-	    }
-	  }
+	status = mb_defaults(verbose, &dummyformat, &dummypings, &Ctrl->L.lonflip, dummybounds,
+		Ctrl->b.time_i, Ctrl->e.time_i, &Ctrl->S.speed, &Ctrl->T.timegap);
+
+	Ctrl->A.factor = 1.0;
+	Ctrl->A.mode = MBSWATH_FOOTPRINT_REAL;
+	Ctrl->A.depth = 0.0;
+	Ctrl->C.cptfile = NULL;
+	Ctrl->D.mode = 1;
+	Ctrl->D.ampscale = 1.0;
+	Ctrl->D.ampmin = 0.0;
+	Ctrl->D.ampmax = 1.0;
+	Ctrl->E.device_dpi = 0;
+	Ctrl->E.dpi = 100;
+	Ctrl->F.format = 0;
+	Ctrl->G.magnitude = 1.0;
+	Ctrl->G.azimuth = 270.0;
+	Ctrl->I.inputfile = NULL;
+	Ctrl->N.cptfile = NULL;
+	Ctrl->p.pings = 1;
+	Ctrl->S.speed = 0.0;
+	Ctrl->T.timegap = 1.0;
+	Ctrl->Z.mode = MBSWATH_BATH;
+	Ctrl->Z.filter = 0;
+	Ctrl->Z.usefiltered = MB_NO;
+        
+        /* mbswath variables */
+        for (i=0;i<4;i++)
+                {
+                Ctrl->bounds[i] = 0.0;
+                Ctrl->clipx[i] = 0.0;
+                Ctrl->clipy[i] = 0.0;
+                }
+	Ctrl->image_type = MBSWATH_IMAGE_24;
+	Ctrl->mtodeglon = 0.0;
+	Ctrl->mtodeglat = 0.0;
+	Ctrl->x_inch = 0.0;
+	Ctrl->y_inch = 0.0;
+	Ctrl->x_inc = 0.0;
+	Ctrl->y_inc = 0.0;
+	Ctrl->x_side = 0.0;
+	Ctrl->y_side = 0.0;
+	Ctrl->x0 = 0.0;
+	Ctrl->y0 = 0.0;
+	Ctrl->nx = 0;
+	Ctrl->ny = 0;
+	Ctrl->nm = 0;
+	Ctrl->bitimage = NULL;
+	Ctrl->format = 0;
+	Ctrl->beamwidth_xtrack = 0.0;
+	Ctrl->beamwidth_ltrack = 0.0;
+	Ctrl->btime_d = 0.0;
+	Ctrl->etime_d = 0.0;
+	Ctrl->read_datalist = MB_NO;
+	Ctrl->read_data = 0;
+	Ctrl->datalist = NULL;
+	Ctrl->file_weight = 0.0;
+	Ctrl->file[0] = '\0';
+	Ctrl->filtermode = MBSWATH_FILTER_NONE;
+	Ctrl->beams_bath_max = 0;
+	Ctrl->beams_amp_max = 0;
+	Ctrl->pixels_ss_max = 0;
+	Ctrl->mbio_ptr = NULL;
+	Ctrl->swath_plot = NULL;
+
+	return (Ctrl);
+}
 
-	/* deal with mb options */
-	while ((c = getopt(argc, argv, "A:a:B:b:C:c:D:d:E:e:F:f:G:g:HhI:i:J:j:KkL:l:MN:n:OPp:Q:R:r:S:s:T:t:UuVvWwX:x:Y:y:Z:z:012")) != -1)
-	  switch (c)
-		{
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%lf/%d/%lf", &rawfactor,
-				&footprint_mode, &default_depth);
-			flag++;
-			break;
-		case 'b':
-			sscanf (optarg, "%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg, "%d/%lf/%lf/%lf",
-				&ampscale_mode,&ampscale,&ampmin,&ampmax);
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg, "%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			break;
-                case 'f':
-			sscanf (optarg, "%d",&format);
-                        break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%lf/%lf", &magnitude,&azimuth);
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			lonflip_set = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%s", cptshadefile);
-			ampshademode = 1;
-			flag++;
-			break;
-		case 'p':
-			sscanf (optarg,"%d", &pings);
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			sscanf (optarg,"%d", &dpi);
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg, "%lf", &speedmin);
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'W':
-		case 'w':
-			bathy_in_feet = MB_YES;
-			break;
-		case 'Z':
-		case 'z':
-			sscanf (optarg,"%d", &mode);
-                        if (optarg[1] == 'f' || optarg[1] == 'F')
-				usefiltered = MB_YES;
-			flag++;
-			break;
-		case 'B':
-		case 'C':
-		case 'c':
-		case 'F':
-		case 'J':
-		case 'j':
-		case 'K':
-		case 'k':
-		case 'O':
-		case 'o':
-		case 'P':
-		case 'R':
-		case 'r':
-		case 'U':
-		case 'u':
-		case 'X':
-		case 'x':
-		case 'Y':
-		case 'y':
-		case '#':
-		case '0':
-		case '1':
-		case '2':
-			break;
-		case '?':
-			errflg++;
-		}
+void Free_mbswath_Ctrl (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl) {	/* Deallocate control structure */
+	if (!Ctrl) return;
+	if (Ctrl->C.cptfile) free (Ctrl->C.cptfile);
+	if (Ctrl->I.inputfile) free (Ctrl->I.inputfile);
+	if (Ctrl->N.cptfile) free (Ctrl->N.cptfile);
+	GMT_free (GMT, Ctrl);
+}
 
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
+int GMT_mbswath_usage (struct GMTAPI_CTRL *API, int level)
+{
+	GMT_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_NAME, THIS_MODULE_PURPOSE);
+	if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
+	GMT_Message (API, GMT_TIME_NONE, "usage: mbswath -I<inputfile> %s [%s]\n", GMT_J_OPT, GMT_B_OPT);
+	GMT_Message (API, GMT_TIME_NONE, "\t[-A<factor>/<mode>/<depth>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-b<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-C<cptfile>] [-D<mode>/<ampscale>/<ampmin>/<ampmax>] [-Ei|<dpi>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-e<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-F<format>] [-G<magnitude>/<azimuth | median>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-I<inputfile>] [-L<lonflip>] [-N<cptfile>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[-S<speed>] [-T<timegap>] [-W] [-Z<mode>]\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-T] [%s] [%s]\n", GMT_Rgeo_OPT, GMT_U_OPT, GMT_V_OPT);
+	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s] [%s] [%s]\n\t[%s]\n\t[%s] [%s]\n\n", 
+	                                  GMT_X_OPT, GMT_Y_OPT, GMT_c_OPT, GMT_f_OPT, GMT_n_OPT, GMT_p_OPT, GMT_t_OPT);
+
+	if (level == GMT_SYNOPSIS) return (EXIT_FAILURE);
+
+	GMT_Message (API, GMT_TIME_NONE, "\t<inputfile> is an MB-System datalist referencing the swath data to be plotted.\n");
+	GMT_Option (API, "J-");
+	GMT_Message (API, GMT_TIME_NONE, "\n\tOPTIONS:\n");
+	GMT_Option (API, "B-");
+	GMT_Message (API, GMT_TIME_NONE, "\t-C Color palette file to convert z to rgb.  Optionally, instead give name of a master cpt\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   to automatically assign 16 continuous colors over the data range [rainbow].\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t-E Set dpi for the projected output Postscript image\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   if -Jx or -Jm is not selected.\n");
+	GMT_Message (API, GMT_TIME_NONE, "\t   Give i to do the interpolation in PostScript at device resolution.\n");
+	GMT_rgb_syntax (API->GMT, 'G', "Set transparency color for images that otherwise would result in 1-bit images.\n\t  ");
+	GMT_Option (API, "K");
+	GMT_Option (API, "O,P");
+	GMT_Message (API, GMT_TIME_NONE, "\t-p<pings> Sets the ping averaging of the input data [Default = 1, i.e. no ping average].\n");
+	GMT_Option (API, "R");
+	GMT_Option (API, "U,V,X,c,.");
+
+	return (EXIT_FAILURE);
+}
 
-	/* deal with gmt options */
-	argc = GMT_begin (argc_gmt, argv_gmt);
-	for (i = 1; i < argc_gmt; i++)
-		{
-		if (argv_gmt[i][0] == '-')
-			{
-			switch (argv_gmt[i][1])
-				{
-				/* Common parameters */
-
-				case 'B':
-				case 'J':
-				case 'K':
-				case 'O':
-				case 'P':
-				case 'R':
-				case 'U':
-				case 'V':
-				case 'X':
-				case 'x':
-				case 'Y':
-				case 'y':
-				case 'c':
-				case '\0':
-					errflg += GMT_get_common_args (argv_gmt[i],
-						&borders[0], &borders[1],
-						&borders[2], &borders[3]);
-					break;
-
-				/* Supplemental parameters */
-
-				case 'C':
-					strcpy(cptfile,&argv_gmt[i][2]);
-					break;
-				case 'F':
-					if (GMT_getrgb (&argv_gmt[i][2],
-						gmtdefs.basemap_frame_rgb))
-						{
-#ifdef GMT_4_1_2
-						GMT_pen_syntax ('F');
+int GMT_mbswath_parse (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl, struct GMT_OPTION *options)
+{
+	/* This parses the options provided to mbswath and sets parameters in Ctrl.
+	 * Note Ctrl has already been initialized and non-zero default values set.
+	 * Any GMT common options will override values set previously by other commands.
+	 * It also replaces any file names specified as input or output with the data ID
+	 * returned when registering these sources/destinations with the API.
+	 */
+
+	unsigned int n_errors = 0, n_files = 0;
+	struct GMT_OPTION *opt = NULL;
+	struct GMTAPI_CTRL *API = GMT->parent;
+        int     n;
+
+	for (opt = options; opt; opt = opt->next) {	/* Process all the options given */
+
+		switch (opt->option) {
+			case '<':	/* Input file (only one or three is accepted) */
+				Ctrl->I.active = true;
+#if GMT_MINOR_VERSION == 1 && GMT_RELEASE_VERSION < 2
+ 				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN)) {
 #else
-						GMT_pen_syntax ('F'," ");
+				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN, GMT_IS_DATASET)) {
 #endif
-						}
-				case '0':
-					gmtdefs.color_image = 0;
-					image = MBSWATH_IMAGE_24;
-					break;
-				case '1':
-					gmtdefs.color_image = 1;
-					image = MBSWATH_IMAGE_VECTOR;
-					break;
-				case '2':
-					gmtdefs.color_image = 2;
-					image = MBSWATH_IMAGE_24;
-					break;
-			}
-			}
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"GMT option error\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       help:             %d\n",help);
-		fprintf(stderr,"dbg2       format:           %d\n",format);
-		fprintf(stderr,"dbg2       pings:            %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:          %d\n",lonflip);
-		fprintf(stderr,"dbg2       btime_i[0]:       %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:       %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:       %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:       %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:       %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:       %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:       %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:       %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:       %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:       %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:       %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:       %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:       %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:       %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:         %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:          %f\n",timegap);
-		fprintf(stderr,"dbg2       input file:       %s\n",read_file);
-		fprintf(stderr,"dbg2       borders[0]:       %f\n",borders[0]);
-		fprintf(stderr,"dbg2       borders[1]:       %f\n",borders[1]);
-		fprintf(stderr,"dbg2       borders[2]:       %f\n",borders[2]);
-		fprintf(stderr,"dbg2       borders[3]:       %f\n",borders[3]);
-		fprintf(stderr,"dbg2       cptfile:          %s\n",cptfile);
-		fprintf(stderr,"dbg2       cptshadefile:     %s\n",cptshadefile);
-		fprintf(stderr,"dbg2       shade magnitude:  %f\n",magnitude);
-		fprintf(stderr,"dbg2       shade azimuth:    %f\n",azimuth);
-		fprintf(stderr,"dbg2       amp scale mode:   %d\n",ampscale_mode);
-		fprintf(stderr,"dbg2       amplitude scale:  %f\n",ampscale);
-		fprintf(stderr,"dbg2       amplitude minimum:%f\n",ampmin);
-		fprintf(stderr,"dbg2       amplitude maximum:%f\n",ampmax);
-		fprintf(stderr,"dbg2       footprint mode:   %d\n",footprint_mode);
-		fprintf(stderr,"dbg2       footprint factor: %f\n",rawfactor);
-		fprintf(stderr,"dbg2       default depth:    %f\n",default_depth);
-		fprintf(stderr,"dbg2       mode:             %d\n",mode);
-		fprintf(stderr,"dbg2       usefiltered:      %d\n",usefiltered);
-		fprintf(stderr,"dbg2       bathy_in_feet:    %d\n",bathy_in_feet);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
+					Ctrl->I.inputfile = strdup (opt->arg);
+					n_files = 1;
+				}
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error: only one input file is allowed.\n");
+					n_errors++;
+				}
+				break;
 
-	/* turn on looking for filtered amp or sidescan if needed */
-	if (usefiltered == MB_YES)
-		{
-		if (mode == MBSWATH_BATH_AMP)
-			filtermode = MBSWATH_FILTER_AMP;
-		else if (mode == MBSWATH_AMP)
-			filtermode = MBSWATH_FILTER_AMP;
-		else if (mode == MBSWATH_SS)
-			filtermode = MBSWATH_FILTER_SIDESCAN;
-		}
+			/* Processes program-specific parameters */
 
-	/* copy borders in correct order for use by this program */
-	if (project_info.region == MB_YES)
-		{
-		borders_use[0] = borders[0];
-		borders_use[1] = borders[1];
-		borders_use[2] = borders[2];
-		borders_use[3] = borders[3];
-		}
-	else
-		{
-		borders_use[0] = borders[0];
-		borders_use[1] = borders[2];
-		borders_use[2] = borders[1];
-		borders_use[3] = borders[3];
+			case 'A':	/* footprint controls */
+				n = sscanf(opt->arg, "%lf/%d/%lf", &(Ctrl->A.factor), &(Ctrl->A.mode), &(Ctrl->A.depth));
+				if (n > 0)
+					Ctrl->A.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -A option: \n");
+					n_errors++;
+				}
+ 				break;
+			case 'b':	/* btime_i */
+				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
+				           &(Ctrl->b.time_i[0]), &(Ctrl->b.time_i[1]), &(Ctrl->b.time_i[2]),
+				           &(Ctrl->b.time_i[3]), &(Ctrl->b.time_i[4]), &(Ctrl->b.time_i[5]));
+				Ctrl->b.time_i[6] = 0;
+				if (n == 6)
+					Ctrl->b.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -b option: \n");
+					n_errors++;
+				}
+				break;
+			case 'C':	/* CPT file */
+				Ctrl->C.active = true;
+				if (Ctrl->C.cptfile) free (Ctrl->C.cptfile);
+				Ctrl->C.cptfile = strdup (opt->arg);
+				break;
+			case 'D':	/* amplitude scaling */
+				n = sscanf(opt->arg, "%d/%lf/%lf/%lf",
+				           &(Ctrl->D.mode), &(Ctrl->D.ampscale),
+				           &(Ctrl->D.ampmin), &(Ctrl->D.ampmax));
+				if (n > 0)
+					Ctrl->D.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -D option: \n");
+					n_errors++;
+				}
+ 				break;
+			case 'E':	/* dpi */
+				if (strcmp(opt->arg, "i") == 0) {
+					Ctrl->E.device_dpi = true;
+					Ctrl->E.active = true;
+				}
+				else {
+					n = sscanf(opt->arg, "%d", &(Ctrl->E.dpi));
+					if (n == 1)
+						Ctrl->E.active = true;
+					else {
+						GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -E option: \n");
+						n_errors++;
+					}
+				}
+				break;
+			case 'e':	/* etime_i */
+				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
+				           &(Ctrl->e.time_i[0]), &(Ctrl->e.time_i[1]), &(Ctrl->e.time_i[2]),
+				           &(Ctrl->e.time_i[3]), &(Ctrl->e.time_i[4]), &(Ctrl->e.time_i[5]));
+				Ctrl->e.time_i[6] = 0;
+				if (n == 6)
+					Ctrl->e.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -e option: \n");
+					n_errors++;
+				}
+				break;
+			case 'f':	/* format */
+			case 'F':	/* format */
+				n = sscanf(opt->arg, "%d", &(Ctrl->F.format));
+				if (n == 1)
+					Ctrl->F.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -F option: \n");
+					n_errors++;
+				}
+				break;
+			case 'G':	/* -G<magnitude>/<azimuth | median> */
+				n = sscanf(opt->arg, "%lf/%lf", &(Ctrl->G.magnitude), &(Ctrl->G.azimuth));
+				if (n >= 1)
+					Ctrl->G.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -G option: \n");
+					n_errors++;
+				}
+				break;
+			case 'I':	/* -I<inputfile> */
+				Ctrl->I.active = true;
+				if (!GMT_access (GMT, opt->arg, R_OK)) {	/* Got a file */
+					Ctrl->I.inputfile = strdup (opt->arg);
+					n_files = 1;
+				}
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -I: Requires a valid file\n");
+					n_errors++;
+				}
+				break;
+			case 'L':	/* -L<lonflip> */
+				n = sscanf(opt->arg, "%d", &(Ctrl->L.lonflip));
+				if (n == 1)
+					Ctrl->L.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -L option: \n");
+					n_errors++;
+				}
+				break;
+			case 'N':	/* -N<cptfile> */
+				Ctrl->N.active = true;
+				if (Ctrl->N.cptfile) free (Ctrl->N.cptfile);
+				Ctrl->N.cptfile = strdup (opt->arg);
+				break;
+			case 'p':	/* Sets the ping averaging */
+				Ctrl->p.active = true;
+				Ctrl->p.pings = atoi(opt->arg);
+				if (Ctrl->p.pings < 0) {
+					GMT_Report (API, GMT_MSG_NORMAL, "Error -p option: Don't invent, number of pings must be >= 0\n");
+					Ctrl->p.pings = 1;
+				}
+ 				break;
+			case 'S':	/* -S<speed> */
+				n = sscanf(opt->arg, "%lf", &(Ctrl->S.speed));
+				if (n == 1)
+					Ctrl->S.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -S option: \n");
+					n_errors++;
+				}
+				break;
+			case 'T':	/* -T<timegap> */
+				n = sscanf(opt->arg, "%lf", &(Ctrl->T.timegap));
+				if (n == 1)
+					Ctrl->T.active = true;
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -T option: \n");
+					n_errors++;
+				}
+				break;
+			case 'W':	/* -W */
+				Ctrl->W.active = true;
+				break;
+			case 'Z':	/* -Z<mode> */
+				n = sscanf(opt->arg, "%d", &(Ctrl->Z.mode));
+				if (n == 1) {
+					Ctrl->Z.active = true;
+					if (opt->arg[1] == 'f' || opt->arg[1] == 'F')
+							Ctrl->Z.usefiltered = MB_YES;
+					else
+						Ctrl->Z.usefiltered = MB_NO;
+				}
+				else {
+					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -Z option: \n");
+					n_errors++;
+				}
+				break;
+			default:	/* Report bad options */
+				n_errors += GMT_default_error (GMT, opt->option);
+				break;
 		}
+	}
+
+	n_errors += GMT_check_condition (GMT, !GMT->common.J.active, 
+					"Syntax error: Must specify a map projection with the -J option\n");
+	n_errors += GMT_check_condition (GMT, n_files != 1, 
+					"Syntax error: Must specify one input file(s)\n");
+	n_errors += GMT_check_condition (GMT, Ctrl->I.active && !Ctrl->I.inputfile, 
+					"Syntax error -I option: Must specify input file\n");
+	n_errors += GMT_check_condition (GMT, Ctrl->E.active && !Ctrl->E.device_dpi && Ctrl->E.dpi <= 0, 
+					"Syntax error -E option: dpi must be positive\n");
+
+	return (n_errors ? GMT_PARSE_ERROR : GMT_OK);
+}
 
-	/* if borders not specified then quit */
-	if (borders_use[0] >= borders_use[1]
-		|| borders_use[2] >= borders_use[3]
-		|| borders_use[2] <= -90.0
-		|| borders_use[3] >= 90.0)
-		{
-		fprintf(stderr,"\nRegion borders not properly specified:\n\t%f %f %f %f\n",borders[0],borders[1],borders[2],borders[3]);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_PARAMETER;
-		exit(error);
-		}
+#define bailout(code) {GMT_Free_Options (mode); return (code);}
+#define Return(code) {Free_mbswath_Ctrl (GMT, Ctrl); GMT_end_module (GMT, GMT_cpy); bailout (code);}
 
-	/* set lonflip if possible */
-	if (lonflip_set == MB_NO)
-		{
-		if (borders_use[0] < -180.0)
-			lonflip = -1;
-		else if (borders_use[1] > 180.0)
-			lonflip = 1;
-		else if (lonflip == -1 && borders_use[1] > 0.0)
-			lonflip = 0;
-		else if (lonflip == 1 && borders_use[0] < 0.0)
-			lonflip = 0;
-		}
+int GMT_mbswath (void *V_API, int mode, void *args)
+{
+//	bool done, need_to_project, normal_x, normal_y, resampled = false, gray_only = false;
+//	bool nothing_inside = false, use_intensity_grid;
+//	unsigned int k, nx = 0, ny = 0, grid_registration = GMT_GRID_NODE_REG, n_grids;
+//	unsigned int colormask_offset = 0, try, row, actual_row, col;
+//	uint64_t node_RGBA = 0;		/* uint64_t for the RGB(A) image array. */
+//	uint64_t node, kk, nm, byte;
+//	int index = 0, ks, error = 0;
+	
+//	unsigned char *bitimage_8 = NULL, *bitimage_24 = NULL, *rgb_used = NULL, i_rgb[3];
+
+//	double dx, dy, x_side, y_side, x0 = 0.0, y0 = 0.0, rgb[4] = {0.0, 0.0, 0.0, 0.0};
+//	double *NaN_rgb = NULL, red[4] = {1.0, 0.0, 0.0, 0.0}, wesn[4];
+
+//	struct GMT_GRID *Grid_orig[3] = {NULL, NULL, NULL}, *Grid_proj[3] = {NULL, NULL, NULL};
+//	struct GMT_GRID *Intens_orig = NULL, *Intens_proj = NULL;
+//	struct GMT_PALETTE *P = NULL;
+//	struct MBSWATH_CTRL *Ctrl = NULL;
+//	struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;	/* General GMT interal parameters */
+//	struct GMT_OPTION *options = NULL;
+//	struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
+//	struct GMT_GRID_HEADER *header_work = NULL;	/* Pointer to a GMT header for the image or grid */
+//	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
+
+	char program_name[] = "mbswath";
+//	char help_message[] =  "mbswath is a GMT compatible utility which creates a color postscript \nimage of swath bathymetry or backscatter data.  The image \nmay be shaded relief as well.  Complete maps are made by using \nMBSWATH in conjunction with the usual GMT programs.";
+//	char usage_message[] = "mbswath -Ccptfile -Jparameters -Rwest/east/south/north \n\t[-Afactor -Btickinfo -byr/mon/day/hour/min/sec \n\t-ccopies -Dmode/ampscale/ampmin/ampmax \n\t-Eyr/mon/day/hour/min/sec -fformat \n\t-Fred/green/blue -Gmagnitude/azimuth -Idatalist \n\t-K -Ncptfile -O -P -ppings -Qdpi -Ttimegap -U -W -Xx-shift -Yy-shift \n\t-Zmode[F] -V -H]";
+
+	struct GMT_PALETTE *CPTcolor = NULL;
+	struct GMT_PALETTE *CPTshade = NULL;
+	struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;	/* General GMT interal parameters */
+	struct GMT_OPTION *options = NULL;
+	struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
+	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
+	struct MBSWATH_CTRL *Ctrl = NULL;
 
-	/* set bounds for data reading larger than
-		map borders */
-	bounds[0] = borders_use[0]
-		- 0.25*(borders_use[1] - borders_use[0]);
-	bounds[1] = borders_use[1]
-		+ 0.25*(borders_use[1] - borders_use[0]);
-	bounds[2] = borders_use[2]
-		- 0.25*(borders_use[3] - borders_use[2]);
-	bounds[3] = borders_use[3]
-		+ 0.25*(borders_use[3] - borders_use[2]);
+	/* MBIO status variables */
+	int	status = MB_SUCCESS;
+	int	verbose = 0;
+	int	error = MB_ERROR_NO_ERROR;
+	char	*message = NULL;
 
-	/* set up map */
-	GMT_map_setup(borders[0],borders[1],borders[2],borders[3]);
+	mb_path file;
+	int     format;
+	int     file_in_bounds;
+	int     read_data;
+	struct ping *pingcur;
+	double  amplog;
+	int     *npings;
+	int     nping_read = 0;
+	int     start, done, first, nplot;
+	int     plot;
+	int     flush;
+	int     save_new;
+	int     i;
+	int     pings;
+
+	/*----------------------- Standard module initialization and parsing ----------------------*/
+
+	if (API == NULL) return (GMT_NOT_A_SESSION);
+	if (mode == GMT_MODULE_PURPOSE) return (GMT_mbswath_usage (API, GMT_MODULE_PURPOSE));	/* Return the purpose of program */
+	options = GMT_Create_Options (API, mode, args);	if (API->error) return (API->error);	/* Set or get option list */
+
+	if (!options || options->option == GMT_OPT_USAGE) bailout (GMT_mbswath_usage (API, GMT_USAGE));	/* Return the usage message */
+	if (options->option == GMT_OPT_SYNOPSIS) bailout (GMT_mbswath_usage (API, GMT_SYNOPSIS));	/* Return the synopsis */
+
+	/* Parse the command-line arguments */
+
+	GMT = GMT_begin_module (API, THIS_MODULE_LIB, THIS_MODULE_NAME, &GMT_cpy); /* Save current state */
+	if (GMT_Parse_Common (API, GMT_PROG_OPTIONS, options))
+                Return (API->error);
+	Ctrl = (struct MBSWATH_CTRL *) New_mbswath_Ctrl (GMT);	/* Allocate and initialize a new control structure */
+	if ((error = GMT_mbswath_parse (GMT, Ctrl, options)))
+                Return (error);
+
+	/*---------------------------- This is the mbswath main code ----------------------------*/
+
+	pings = Ctrl->p.pings;		/* If pings were set by user, prefer it */
+	/* set verbosity */
+
+	verbose = GMT->common.V.active;
+
+        /* set bounds for data reading larger than map borders */
+	Ctrl->bounds[0] = GMT->common.R.wesn[0]
+		- 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
+	Ctrl->bounds[1] = GMT->common.R.wesn[1]
+		+ 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
+	Ctrl->bounds[2] = GMT->common.R.wesn[2]
+		- 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
+	Ctrl->bounds[3] = GMT->common.R.wesn[3]
+		+ 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
 
 	/* get scaling from degrees to km */
-	mb_coor_scale(verbose,0.5*(borders_use[2] + borders_use[3]),
-			&mtodeglon,&mtodeglat);
-
-	/* get color palette file */
-	GMT_read_cpt(cptfile);
-	if (GMT_gray || GMT_b_and_w)
-		image = MBSWATH_IMAGE_8;
-	if (GMT_n_colors <= 0)
-		{
-		fprintf(stderr,"\nColor palette table not properly specified:\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_PARAMETER;
-		exit(error);
-		}
+	mb_coor_scale(verbose, 0.5*(Ctrl->bounds[2] + Ctrl->bounds[3]), &Ctrl->mtodeglon, &Ctrl->mtodeglat);
 
-	/* if overlaying amplitude on bathymetry and cptshadefile specified
-		read in grayscale cpt to modulate shading */
-	if (ampshademode == 1 && mode == MBSWATH_BATH_AMP)
+	/* set lonflip if needed */
+	if (!Ctrl->L.active)
 		{
-		/* open shade control cpt file */
-		if ((fp = fopen(cptshadefile,"r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open shading control cpt file: %s\n",
-				cptshadefile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count lines in file */
-		nshadelevel = 0;
-		while (fgets(line,MB_PATH_MAXLINE,fp) != NULL)
-			nshadelevel++;
-		nshadelevel++;
-		fclose(fp);
-
-		/* allocate memory */
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nshadelevel*sizeof(double), (void **)&shadelevel, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nshadelevel*sizeof(int), (void **)&shadelevelgray, &error);
-
-		/* reopen shade control cpt file */
-		if ((fp = fopen(cptshadefile,"r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open shading control cpt file: %s\n",
-				cptshadefile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
+		if (Ctrl->bounds[0] < -180.0)
+			Ctrl->L.lonflip = -1;
+		else if (Ctrl->bounds[1] > 180.0)
+			Ctrl->L.lonflip = 1;
+		else if (Ctrl->L.lonflip == -1 && Ctrl->bounds[1] > 0.0)
+			Ctrl->L.lonflip = 0;
+		else if (Ctrl->L.lonflip == 1 && Ctrl->bounds[0] < 0.0)
+			Ctrl->L.lonflip = 0;
+		}
 
-		/* read shading levels from file */
-		nshadelevel = 0;
-		while (fgets(line,MB_PATH_MAXLINE,fp) != NULL)
-			{
-			count = sscanf(line,"%lf %d %d %d %lf %d %d %d",
-				&shadelevel[nshadelevel], &r1, &g1, &b1,
-				&shadelevel[nshadelevel+1], &r2, &g2, &b2);
-			shadelevelgray[nshadelevel] = (int)(r1 + g1 + b1)/3;
-			shadelevelgray[nshadelevel] =
-				MIN(255, shadelevelgray[nshadelevel]);
-			shadelevelgray[nshadelevel] =
-				MAX(0, shadelevelgray[nshadelevel]);
-			shadelevelgray[nshadelevel+1] = (int)(r2 + g2 + b2)/3;
-			shadelevelgray[nshadelevel+1] =
-				MIN(255, shadelevelgray[nshadelevel+1]);
-			shadelevelgray[nshadelevel+1] =
-				MAX(0, shadelevelgray[nshadelevel+1]);
-			if (count == 8)
-				nshadelevel++;
+	/* Start the postscript plot */
+	GMT_err_fail (GMT, GMT_map_setup (GMT, GMT->common.R.wesn), "");
+	PSL = GMT_plotinit (GMT, options);
+	GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
+	GMT_plotcanvas (GMT);	/* Fill canvas if requested */
+	GMT_map_clip_on (GMT, GMT->session.no_rgb, 3);
+
+	/* Read the color palette file */
+	if (Ctrl->C.active)
+                {   /* Read palette file */
+		if ((CPTcolor = GMT_Get_CPT (GMT, Ctrl->C.cptfile, GMT_CPT_REQUIRED, 0.0, 0.0)) == NULL)
+                        {
+			Return (API->error);
 			}
-		if (nshadelevel > 0)
-			nshadelevel++;
-		fclose(fp);
-
-		/* check if cpt data was read */
-		if (nshadelevel < 2)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to read proper shading control cpt data from file: %s\n",
-				cptshadefile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
+                if (CPTcolor && CPTcolor->is_gray && Ctrl->image_type == MBSWATH_IMAGE_24)
+                        Ctrl->image_type = MBSWATH_IMAGE_8;
+        	}
+
+	/* Read the color palette file for amplitude shading if requested */
+	if (Ctrl->N.active)
+                {   /* Read palette file */
+		if ((CPTshade = GMT_Get_CPT (GMT, Ctrl->N.cptfile, GMT_CPT_REQUIRED, 0.0, 0.0)) == NULL)
+                        {
+			Return (API->error);
 			}
-		}
-
-	/* initialize plotting */
-	GMT_plotinit (argc, argv);
-
-	/* set clip path */
-	GMT_geo_to_xy(borders_use[0],borders_use[2],&clipx[0],&clipy[0]);
-	GMT_geo_to_xy(borders_use[1],borders_use[2],&clipx[1],&clipy[1]);
-	GMT_geo_to_xy(borders_use[1],borders_use[3],&clipx[2],&clipy[2]);
-	GMT_geo_to_xy(borders_use[0],borders_use[3],&clipx[3],&clipy[3]);
-	GMT_map_clip_on (GMT_no_rgb, 3);
+        	}
+                
+        /* Set particulars of output image for the postscript plot */
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[2], &Ctrl->clipx[0], &Ctrl->clipy[0]);
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[2], &Ctrl->clipx[1], &Ctrl->clipy[1]);
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[3], &Ctrl->clipx[2], &Ctrl->clipy[2]);
+	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[3], &Ctrl->clipx[3], &Ctrl->clipy[3]);
+	Ctrl->x_inch = Ctrl->clipx[1] - Ctrl->clipx[0];
+	Ctrl->y_inch = Ctrl->clipy[2] - Ctrl->clipy[1];
+	Ctrl->x0 = Ctrl->clipx[0];
+	Ctrl->y0 = Ctrl->clipy[0];
+	Ctrl->nx = (int)(Ctrl->x_inch * Ctrl->E.dpi);
+	Ctrl->ny = (int)(Ctrl->y_inch * Ctrl->E.dpi);
+	Ctrl->x_inc = (GMT->common.R.wesn[1] - GMT->common.R.wesn[0]) / (Ctrl->nx - 1);
+	Ctrl->y_inc = (GMT->common.R.wesn[3] - GMT->common.R.wesn[2]) / (Ctrl->ny - 1);
+	Ctrl->x_side = Ctrl->x_inc * Ctrl->nx;
+	Ctrl->y_side = Ctrl->y_inc * Ctrl->ny;
+	Ctrl->nm = Ctrl->nx * Ctrl->ny;
+	Ctrl->nm2 = 2 * Ctrl->nm;
+
+        /* allocate and initialize the output image */
+	if (Ctrl->image_type == MBSWATH_IMAGE_8) {
+                Ctrl->bitimage = GMT_memory (GMT, NULL, Ctrl->nm, unsigned char);
+                memset(Ctrl->bitimage, 255, Ctrl->nm);
+	}
+	else if (Ctrl->image_type == MBSWATH_IMAGE_24) {
+                Ctrl->bitimage = GMT_memory (GMT, NULL, 3 * Ctrl->nm, unsigned char);
+                memset(Ctrl->bitimage, 255, 3 * Ctrl->nm);
+	}
+                
+	/* get format if required */
+	if (Ctrl->F.format == 0)
+		mb_get_format(verbose, Ctrl->I.inputfile, NULL, &Ctrl->F.format, &error);
 
-	/* if plot is made using an image operator
-		set up the image */
-	if (image == MBSWATH_IMAGE_8 || image == MBSWATH_IMAGE_24)
+	/* turn on looking for filtered amp or sidescan if needed */
+	if (Ctrl->Z.usefiltered == MB_YES)
 		{
-		x_inch = clipx[1] - clipx[0];
-		y_inch = clipy[2] - clipy[1];
-		xo = 0.0;
-		yo = 0.0;
-		nx = x_inch*dpi;
-		ny = y_inch*dpi;
-		nm = nx*ny;
-		nm2 = 2*nm;
-
-		if (image == MBSWATH_IMAGE_8)
-			{
-			/* allocate image */
-			status = mb_mallocd(verbose, __FILE__, __LINE__, nm*sizeof(char),
-					(void **)&bitimage, &error);
-
-			/* set image to background color */
-			gray = YIQ (gmtdefs.page_rgb);
-			for (j=0;j<nm;j++)
-				bitimage[j] = gray;
-			}
-		else
-			{
-			/* allocate image */
-			status = mb_mallocd(verbose, __FILE__, __LINE__, 3*nm*sizeof(char),
-					(void **)&bitimage, &error);
-
-			/* set image to background color */
-			j = 0;
-			while (j < 3*nm)
-				{
-				bitimage[j++] = gmtdefs.page_rgb[0];
-				bitimage[j++] = gmtdefs.page_rgb[1];
-				bitimage[j++] = gmtdefs.page_rgb[2];
-				}
-			}
+		if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
+			Ctrl->filtermode = MBSWATH_FILTER_AMP;
+		else if (Ctrl->Z.mode == MBSWATH_AMP)
+			Ctrl->filtermode = MBSWATH_FILTER_AMP;
+		else if (Ctrl->Z.mode == MBSWATH_SS)
+			Ctrl->filtermode = MBSWATH_FILTER_SIDESCAN;
 		}
 
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
 	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
+	if (Ctrl->F.format < 0)
+		Ctrl->read_datalist = MB_YES;
 
 	/* open file list */
-	if (read_datalist == MB_YES)
+	if (Ctrl->read_datalist == MB_YES)
 	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
+	    if ((status = mb_datalist_open(verbose, &Ctrl->datalist,
+					    Ctrl->I.inputfile, MB_DATALIST_LOOK_UNSET, &error)) != MB_SUCCESS)
 		{
 		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
+		fprintf(stderr,"\nUnable to open data list file: %s\n", Ctrl->I.inputfile);
+		fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
 		exit(error);
 		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
+	    if ((status = mb_datalist_read(verbose, Ctrl->datalist,
+			     file, &format, &Ctrl->file_weight, &error))
 			    == MB_SUCCESS)
 		read_data = MB_YES;
 	    else
@@ -1041,7 +796,7 @@ int main (int argc, char **argv)
 	    }
 	else
 	    {
-	    strcpy(file,read_file);
+	    strcpy(file, Ctrl->I.inputfile);
 	    read_data = MB_YES;
 	    }
 
@@ -1051,7 +806,7 @@ int main (int argc, char **argv)
 	while (read_data == MB_YES)
 	    {
 	    /* check for mbinfo file - get file bounds if possible */
-	    status = mb_check_info(verbose, file, lonflip, borders_use,
+	    status = mb_check_info(verbose, file, Ctrl->L.lonflip, Ctrl->bounds,
 			    &file_in_bounds, &error);
 	    if (status == MB_FAILURE)
 		    {
@@ -1064,14 +819,14 @@ int main (int argc, char **argv)
 	    if (file_in_bounds == MB_YES)
 		{
 		/* check for "fast bathymetry" or "fbt" file */
-		if (mode == MBSWATH_BATH
-		    || mode == MBSWATH_BATH_RELIEF)
+		if (Ctrl->Z.mode == MBSWATH_BATH
+		    || Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
 		    {
 		    mb_get_fbt(verbose, file, &format, &error);
 		    }
 
 		/* check for filtered amplitude or sidescan file */
-		if (filtermode == MBSWATH_FILTER_AMP)
+		if (Ctrl->filtermode == MBSWATH_FILTER_AMP)
 		    {
 		    if ((status = mb_get_ffa(verbose, file, &format, &error)) != MB_SUCCESS)
 			{
@@ -1084,7 +839,7 @@ int main (int argc, char **argv)
 			exit(error);
 			}
 		    }
-		else if (filtermode == MBSWATH_FILTER_SIDESCAN)
+		else if (Ctrl->filtermode == MBSWATH_FILTER_SIDESCAN)
 		    {
 		    if ((status = mb_get_ffs(verbose, file, &format, &error)) != MB_SUCCESS)
 			{
@@ -1099,11 +854,10 @@ int main (int argc, char **argv)
 		    }
 
 		/* call mb_read_init() */
-		if ((status = mb_read_init(
-		    verbose,file,format,pings,lonflip,bounds,
-		    btime_i,etime_i,speedmin,timegap,
-		    &mbio_ptr,&btime_d,&etime_d,
-		    &beams_bath_max,&beams_amp_max,&pixels_ss_max,&error)) != MB_SUCCESS)
+		if ((status = mb_read_init(verbose, file, format, pings, Ctrl->L.lonflip, Ctrl->bounds,
+                                            Ctrl->b.time_i, Ctrl->e.time_i, Ctrl->S.speed, Ctrl->T.timegap,
+                                            &Ctrl->mbio_ptr, &Ctrl->btime_d, &Ctrl->etime_d,
+                                            &Ctrl->beams_bath_max, &Ctrl->beams_amp_max, &Ctrl->pixels_ss_max, &error)) != MB_SUCCESS)
 		    {
 		    mb_error(verbose,error,&message);
 		    fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
@@ -1115,32 +869,25 @@ int main (int argc, char **argv)
 
 		/* get fore-aft beam_width */
 		status = mb_format_beamwidth(verbose, &format,
-				&beamwidth_xtrack, &beamwidth_ltrack,
+				&Ctrl->beamwidth_xtrack, &Ctrl->beamwidth_ltrack,
 				&error);
-		if (beamwidth_ltrack <= 0.0)
-			beamwidth_ltrack = 2.0;
-		if (footprint_mode == MBSWATH_FOOTPRINT_REAL)
-		    factor = rawfactor*pings*beamwidth_ltrack;
-		else
-		    factor = rawfactor;
-
-		/* set default depth, checking for deep-tow data */
-		if ((format == 111 || format == 112)
-		    && default_depth <= 0.0)
-		    default_depth_use = 100.0;
+		if (Ctrl->beamwidth_ltrack <= 0.0)
+			Ctrl->beamwidth_ltrack = 2.0;
+		if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
+                        Ctrl->footprint_factor = Ctrl->A.factor * Ctrl->beamwidth_ltrack;
 		else
-		    default_depth_use = default_depth;
+                        Ctrl->footprint_factor = Ctrl->A.factor;
 
 		/* allocate memory for data arrays */
 		status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct swath),
-				(void **)&swath_plot, &error);
-		npings = &swath_plot->npings;
-		swath_plot->beams_bath = beams_bath_max;
-		swath_plot->beams_amp = beams_amp_max;
-		swath_plot->pixels_ss = pixels_ss_max;
+				(void **)&Ctrl->swath_plot, &error);
+		npings = &Ctrl->swath_plot->npings;
+		Ctrl->swath_plot->beams_bath = Ctrl->beams_bath_max;
+		Ctrl->swath_plot->beams_amp = Ctrl->beams_amp_max;
+		Ctrl->swath_plot->pixels_ss = Ctrl->pixels_ss_max;
 		for (i=0;i<MAXPINGS;i++)
 		    {
-		    pingcur = &(swath_plot->data[i]);
+		    pingcur = &(Ctrl->swath_plot->data[i]);
 		    pingcur->beamflag = NULL;
 		    pingcur->bath = NULL;
 		    pingcur->amp = NULL;
@@ -1155,43 +902,43 @@ int main (int argc, char **argv)
 		    pingcur->ssfoot = NULL;
 		    pingcur->bathshade = NULL;
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
 							    sizeof(char), (void **)&(pingcur->beamflag), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
 							    sizeof(double), (void **)&(pingcur->bath), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
 							    sizeof(double), (void **)&(pingcur->amp), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
 							    sizeof(double), (void **)&(pingcur->bathlon), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
 							    sizeof(double), (void **)&(pingcur->bathlat), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
 							    sizeof(double), (void **)&(pingcur->ss), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
 							    sizeof(double), (void **)&(pingcur->sslon), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
 							    sizeof(double), (void **)&(pingcur->sslat), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
 							    sizeof(int), (void **)&(pingcur->bathflag), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
 							    sizeof(struct footprint), (void **)&(pingcur->bathfoot), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
 							    sizeof(int), (void **)&(pingcur->ssflag), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
 							    sizeof(struct footprint), (void **)&(pingcur->ssfoot), &error);
 		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
+			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
 							    sizeof(double), (void **)&(pingcur->bathshade), &error);
 		    }
 
@@ -1217,8 +964,8 @@ int main (int argc, char **argv)
 		done = MB_NO;
 		while (done == MB_NO)
 		    {
-		    pingcur = &swath_plot->data[*npings];
-		    status = mb_read(verbose,mbio_ptr,&(pingcur->kind),
+		    pingcur = &Ctrl->swath_plot->data[*npings];
+		    status = mb_read(verbose,Ctrl->mbio_ptr,&(pingcur->kind),
 			    &(pingcur->pings),pingcur->time_i,&(pingcur->time_d),
 			    &(pingcur->navlon),&(pingcur->navlat),
 			    &(pingcur->speed),&(pingcur->heading),
@@ -1231,46 +978,31 @@ int main (int argc, char **argv)
 			    pingcur->bathlon,pingcur->bathlat,
 			    pingcur->ss,pingcur->sslon,pingcur->sslat,
 			    pingcur->comment,&error);
-		    beamflag = pingcur->beamflag;
-		    bath = pingcur->bath;
-		    amp = pingcur->amp;
-		    bathlon = pingcur->bathlon;
-		    bathlat = pingcur->bathlat;
-		    ss = pingcur->ss;
-		    sslon = pingcur->sslon;
-		    sslat = pingcur->sslat;
 
 		    /* print debug statements */
 		    if (verbose >= 2)
 			    {
-			    fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				    program_name);
-			    fprintf(stderr,"dbg2       kind:           %d\n",
-				    pingcur->kind);
-			    fprintf(stderr,"dbg2       beams_bath:     %d\n",
-				    pingcur->beams_bath);
-			    fprintf(stderr,"dbg2       beams_amp:      %d\n",
-				    pingcur->beams_amp);
-			    fprintf(stderr,"dbg2       pixels_ss:      %d\n",
-				    pingcur->pixels_ss);
-			    fprintf(stderr,"dbg2       error:          %d\n",
-				    error);
-			    fprintf(stderr,"dbg2       status:         %d\n",
-				    status);
+			    fprintf(stderr,"\ndbg2  Ping read in program <%s>\n", program_name);
+			    fprintf(stderr,"dbg2       kind:           %d\n", pingcur->kind);
+			    fprintf(stderr,"dbg2       beams_bath:     %d\n", pingcur->beams_bath);
+			    fprintf(stderr,"dbg2       beams_amp:      %d\n", pingcur->beams_amp);
+			    fprintf(stderr,"dbg2       pixels_ss:      %d\n", pingcur->pixels_ss);
+			    fprintf(stderr,"dbg2       error:          %d\n", error);
+			    fprintf(stderr,"dbg2       status:         %d\n", status);
 			    for (i=0;i<pingcur->beams_bath;i++)
 				    {
 				    fprintf(stderr, "bath[%4d]:  %3d  %f  %f  %f\n",
-					    i, beamflag[i], bath[i], bathlon[i], bathlat[i]);
+					    i, pingcur->beamflag[i], pingcur->bath[i], pingcur->bathlon[i], pingcur->bathlat[i]);
 				    }
 			    for (i=0;i<pingcur->beams_amp;i++)
 				    {
 				    fprintf(stderr, "amp[%4d]:  %f  %f  %f\n",
-					    i, amp[i], bathlon[i], bathlat[i]);
+					    i, pingcur->amp[i], pingcur->bathlon[i], pingcur->bathlat[i]);
 				    }
 			    for (i=0;i<pingcur->pixels_ss;i++)
 				    {
 				    fprintf(stderr, "ss[%4d]:  %f  %f  %f\n",
-					    i, ss[i], sslon[i], sslat[i]);
+					    i, pingcur->ss[i], pingcur->sslon[i], pingcur->sslat[i]);
 				    }
 			    }
 
@@ -1292,81 +1024,81 @@ int main (int argc, char **argv)
 		    if (error == MB_ERROR_NO_ERROR
 			    && (mode == MBSWATH_BATH_AMP
 			    || mode == MBSWATH_AMP)
-			    && ampscale_mode > 0)
+			    && Ctrl->D.mode > 0)
 			    {
 			    for (i=0;i<pingcur->beams_amp;i++)
 				    {
-				    if (mb_beam_ok(beamflag[i]) && ampscale_mode == 1)
+				    if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 1)
 					{
-					amp[i] = ampscale*(amp[i] - ampmin)
-					    /(ampmax - ampmin);
+					pingcur->amp[i] = Ctrl->D.ampscale * (pingcur->amp[i] - Ctrl->D.ampmin)
+					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
-				    else if (mb_beam_ok(beamflag[i]) && ampscale_mode == 2)
+				    else if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 2)
 					{
-					amp[i] = MIN(amp[i],ampmax);
-					amp[i] = MAX(amp[i],ampmin);
-					amp[i] = ampscale*(amp[i] - ampmin)
-					    /(ampmax - ampmin);
+					pingcur->amp[i] = MIN(pingcur->amp[i],Ctrl->D.ampmax);
+					pingcur->amp[i] = MAX(pingcur->amp[i],Ctrl->D.ampmin);
+					pingcur->amp[i] = Ctrl->D.ampscale * (pingcur->amp[i] - Ctrl->D.ampmin)
+                                                            / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
-				    else if (mb_beam_ok(beamflag[i]) && ampscale_mode == 3)
+				    else if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 3)
 					{
-					amplog = 20.0*log10(amp[i]);
-					amp[i] = ampscale*(amplog - ampmin)
-					    /(ampmax - ampmin);
+					amplog = 20.0 * log10(pingcur->amp[i]);
+					pingcur->amp[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
+					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
-				    else if (mb_beam_ok(beamflag[i]) && ampscale_mode == 4)
+				    else if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 4)
 					{
-					amplog = 20.0*log10(amp[i]);
-					amplog = MIN(amplog,ampmax);
-					amplog = MAX(amplog,ampmin);
-					amp[i] = ampscale*(amplog - ampmin)
-					       /(ampmax - ampmin);
+					amplog = 20.0 * log10(pingcur->amp[i]);
+					amplog = MIN(amplog,Ctrl->D.ampmax);
+					amplog = MAX(amplog,Ctrl->D.ampmin);
+					pingcur->amp[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
+					        / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
 				    }
 			    }
 
-		    /* scale bathymetry if necessary */
+		    /* scale bathymetry from meters to feet if necessary */
 		    if (error == MB_ERROR_NO_ERROR
-			    && bathy_in_feet == MB_YES)
+			    && Ctrl->W.active == true)
 			    {
 			    for (i=0;i<pingcur->beams_bath;i++)
 				    {
-				    bath[i] = 3.2808399 * bath[i];
+				    pingcur->bath[i] = 3.2808399 * pingcur->bath[i];
 				    }
 			    }
 
 		    /* scale sidescan if necessary */
 		    if (error == MB_ERROR_NO_ERROR
 			    && mode == MBSWATH_SS
-			    && ampscale_mode > 0)
+			    && Ctrl->D.mode > 0)
 			    {
 			    for (i=0;i<pingcur->pixels_ss;i++)
 				    {
-				    if (ss[i] > MB_SIDESCAN_NULL && ampscale_mode == 1)
+				    if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 1)
 					{
-					ss[i] = ampscale*(ss[i] - ampmin)
-					    /(ampmax - ampmin);
+					pingcur->ss[i] = Ctrl->D.ampscale * (pingcur->ss[i] - Ctrl->D.ampmin)
+					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
-				    else if (ss[i] > MB_SIDESCAN_NULL && ampscale_mode == 2)
+				    else if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 2)
 					{
-					ss[i] = MIN(ss[i],ampmax);
-					ss[i] = MAX(ss[i],ampmin);
-					ss[i] = ampscale*(ss[i] - ampmin)
-					    /(ampmax - ampmin);
+					pingcur->ss[i] = MIN(pingcur->ss[i],Ctrl->D.ampmax);
+					pingcur->ss[i] = MAX(pingcur->ss[i],Ctrl->D.ampmin);
+					pingcur->ss[i] = Ctrl->D.ampscale * (pingcur->ss[i] - Ctrl->D.ampmin)
+					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
-				    else if (ss[i] > MB_SIDESCAN_NULL && ampscale_mode == 3)
+				    else if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 3)
 					{
-					amplog = 20.0*log10(ss[i]);
-					ss[i] = ampscale*(amplog - ampmin)
-					    /(ampmax - ampmin);
+					amplog = 20.0 * log10(pingcur->ss[i]);
+					pingcur->ss[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
+					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
-				    else if (ss[i] > MB_SIDESCAN_NULL && ampscale_mode == 4)
+				    else if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 4)
 					{
-					amplog = 20.0*log10(ss[i]);
-					amplog = MIN(amplog,ampmax);
-					amplog = MAX(amplog,ampmin);
-					ss[i] = ampscale*(amplog - ampmin)
-					       /(ampmax - ampmin);
+					amplog = 20.0 * log10(pingcur->ss[i]);
+					amplog = MIN(amplog,Ctrl->D.ampmax);
+					amplog = MAX(amplog,Ctrl->D.ampmin);
+					pingcur->ss[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
+					        / (Ctrl->D.ampmax - Ctrl->D.ampmin);
 					}
 				    }
 			    }
@@ -1397,22 +1129,13 @@ int main (int argc, char **argv)
 		    if (plot == MB_YES)
 			    {
 			    /* get footprint locations */
-			    if (footprint_mode != MBSWATH_FOOTPRINT_POINT)
-			    status = get_footprints(verbose,mode,
-				    footprint_mode,factor,default_depth_use,
-				    swath_plot,mtodeglon,mtodeglat,&error);
-
+			    if (Ctrl->A.mode != MBSWATH_FOOTPRINT_POINT)
+			    status = mbswath_get_footprints(verbose, Ctrl, &error);
 
 			    /* get shading */
-			    if (mode == MBSWATH_BATH_RELIEF
-				    || mode == MBSWATH_BATH_AMP)
-				    status = get_shading(verbose,
-				    	    mode,ampshademode,swath_plot,
-					    mtodeglon,mtodeglat,
-					    magnitude,azimuth,
-					    nshadelevel, shadelevel,
-					    shadelevelgray,
-					    &error);
+			    if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF
+				    || Ctrl->Z.mode == MBSWATH_BATH_AMP)
+				    status = mbswath_get_shading(verbose, Ctrl, GMT, CPTshade, &error);
 
 			    /* plot data */
 			    if (start == MB_YES)
@@ -1427,21 +1150,18 @@ int main (int argc, char **argv)
 			    else
 				    nplot = *npings - first - 1;
 
-			    if (footprint_mode == MBSWATH_FOOTPRINT_POINT)
-				    status = plot_data_point(verbose,
-					    mode,swath_plot,
-					    first,nplot,&error);
+			    if (Ctrl->A.mode == MBSWATH_FOOTPRINT_POINT)
+				    status = mbswath_plot_data_point(verbose, Ctrl, GMT, CPTcolor, PSL,
+                                                                first, nplot, &error);
 			    else
-				    status = plot_data_footprint(verbose,
-					    mode,swath_plot,
-					    first,nplot,&error);
+				    status = mbswath_plot_data_footprint(verbose, Ctrl, GMT, CPTcolor, PSL,
+                                                                first, nplot, &error);
 
 
 			    /* reorganize data */
 			    if (flush == MB_YES && save_new == MB_YES)
 				    {
-				    status = ping_copy(verbose,0,*npings,
-					    swath_plot,&error);
+				    status = mbswath_ping_copy(verbose,0, *npings, Ctrl->swath_plot, &error);
 				    *npings = 1;
 				    start = MB_YES;
 				    }
@@ -1453,25 +1173,21 @@ int main (int argc, char **argv)
 			    else if (*npings > 1)
 				    {
 				    for (i=0;i<2;i++)
-					    status = ping_copy(verbose,i,
-						    *npings-2+i,
-						    swath_plot,&error);
+					    status = mbswath_ping_copy(verbose,i, *npings-2+i, Ctrl->swath_plot, &error);
 				    *npings = 2;
 				    }
-
 			    }
 		    }
-		status = mb_close(verbose,&mbio_ptr,&error);
+		status = mb_close(verbose,&Ctrl->mbio_ptr,&error);
 
 		/* deallocate memory for data arrays */
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&swath_plot, &error);
+		mb_freed(verbose,__FILE__, __LINE__, (void **)&Ctrl->swath_plot, &error);
 		} /* end if file in bounds */
 
 	    /* figure out whether and what to read next */
-	    if (read_datalist == MB_YES)
+	    if (Ctrl->read_datalist == MB_YES)
                 {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
+		if ((status = mb_datalist_read(verbose, Ctrl->datalist, file, &format, &Ctrl->file_weight, &error))
 			    == MB_SUCCESS)
                         read_data = MB_YES;
                 else
@@ -1484,80 +1200,62 @@ int main (int argc, char **argv)
 
 	    /* end loop over files in list */
 	    }
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* turn off clipping */
-	ps_clipoff();
-
-	/* plot image if one is used */
-	if (image == MBSWATH_IMAGE_8)
-		{
-		ps_image (0., 0., x_inch, y_inch, bitimage, nx, ny, 8);
-		}
-	else if (image == MBSWATH_IMAGE_24)
-		{
-		GMT_color_image (0., 0., x_inch, y_inch, bitimage, nx, ny, 24);
-		}
+	if (Ctrl->read_datalist == MB_YES)
+		mb_datalist_close(verbose, &Ctrl->datalist, &error);
 
-	/* plot basemap if required */
-	if (frame_info.plot)
-		{
-		ps_setpaint (gmtdefs.basemap_frame_rgb);
-		GMT_map_basemap ();
-		rgb[0] = 0;
-		rgb[1] = 0;
-		rgb[2] = 0;
-		ps_setpaint (rgb);
-		}
+	/* Generate grayscale 8-bit image */
+        if (Ctrl->image_type == MBSWATH_IMAGE_8)
+                {
+		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 8-bit grayshade image\n");
+		PSL_plotcolorimage (PSL, Ctrl->x0, Ctrl->y0, Ctrl->x_inch, Ctrl->y_inch, PSL_BL, Ctrl->bitimage, Ctrl->nx, Ctrl->ny, (Ctrl->E.device_dpi ? -8 : 8));
+                }
+                
+        /* Generate full color 24-bit image */
+	else if (Ctrl->image_type == MBSWATH_IMAGE_24)
+                {
+		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 24-bit color image\n");
+		PSL_plotcolorimage (PSL, Ctrl->x0, Ctrl->y0, Ctrl->x_inch, Ctrl->y_inch, PSL_BL, Ctrl->bitimage, Ctrl->nx, Ctrl->ny, (Ctrl->E.device_dpi ? -24 : 24));
+                }
 
-	/* end the plot */
-	GMT_plotend ();
+	GMT_map_clip_off (GMT);
 
-	/* deallocate image */
-	if (image == MBSWATH_IMAGE_8 || image == MBSWATH_IMAGE_24)
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&bitimage, &error);
-	if (ampshademode == 1 && mode == MBSWATH_BATH_AMP)
-		{
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&shadelevel, &error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&shadelevelgray, &error);
-		}
+	GMT_map_basemap (GMT);
+	GMT_plane_perspective (GMT, -1, 0.0);
+	GMT_plotend (GMT);
 
-	/* check memory */
-	if (verbose >= 2)
-		status = mb_memory_list(verbose,&error);
+	/* Free bitimage arrays. GMT_free will not complain if they have not been used (NULL) */
+	if (Ctrl->bitimage) GMT_free (GMT, Ctrl->bitimage);
 
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	GMT_end(argc, argv);
-	exit(status);
+	if (!Ctrl->C.active && GMT_Destroy_Data (API, &CPTcolor) != GMT_OK)
+                {
+		Return (API->error);
+                }
+	if (!Ctrl->N.active && GMT_Destroy_Data (API, &CPTshade) != GMT_OK)
+                {
+		Return (API->error);
+                }
+	Return (EXIT_SUCCESS);
 }
 /*--------------------------------------------------------------------*/
-int get_footprints(int verbose, int mode, int fp_mode,
-		double factor, double depth_def,
-		struct swath *swath,
-		double mtodeglon, double mtodeglat, int *error)
+int mbswath_get_footprints(int verbose, struct MBSWATH_CTRL *Ctrl, int *error)
 {
-	char	*function_name = "get_footprints";
+	char	*function_name = "mbswath_get_footprints";
 	int	status = MB_SUCCESS;
-
-	struct ping	*pingcur;
-	struct footprint	*print;
+        struct swath *swath;
+        struct ping *pingcur;
+	struct footprint *print;
 	int	dobath, doss;
 	double	headingx, headingy;
 	double	dx, dy, r, dlon1, dlon2, dlat1, dlat2, tt, x, y;
 	double	ddlonx, ddlaty, rfactor;
 	static double	dddepth = 0.0;
 	int	setprint;
+        struct mb_io_struct *mb_io_ptr;
 	int	i, j, k;
+                
+        /* get swath */
+        swath = Ctrl->swath_plot;
+        mb_io_ptr = (struct mb_io_struct *) Ctrl->mbio_ptr;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -1565,19 +1263,20 @@ int get_footprints(int verbose, int mode, int fp_mode,
 		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
 			function_name);
 		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:     %d\n",verbose);
-		fprintf(stderr,"dbg2       mode:        %d\n",mode);
-		fprintf(stderr,"dbg2       fp mode:     %d\n",fp_mode);
-		fprintf(stderr,"dbg2       factor:      %f\n",factor);
-		fprintf(stderr,"dbg2       depth_def:   %f\n",depth_def);
-		fprintf(stderr,"dbg2       swath:       %p\n",swath);
-		fprintf(stderr,"dbg2       mtodeglon:   %f\n",mtodeglon);
-		fprintf(stderr,"dbg2       mtodeglat:   %f\n",mtodeglat);
-		fprintf(stderr,"dbg2       pings:       %d\n",swath->npings);
+		fprintf(stderr,"dbg2       verbose:                  %d\n",verbose);
+		fprintf(stderr,"dbg2       Ctrl->A.mode:             %d\n", Ctrl->A.mode);
+		fprintf(stderr,"dbg2       Ctrl->A.factor:           %f\n", Ctrl->A.factor);
+		fprintf(stderr,"dbg2       Ctrl->A.depth:            %f\n",Ctrl->A.depth);
+		fprintf(stderr,"dbg2       Ctrl->footprint_factor:   %f\n",Ctrl->footprint_factor);
+		fprintf(stderr,"dbg2       Ctrl->swath_plot:         %p\n",Ctrl->swath_plot);
+		fprintf(stderr,"dbg2       Ctrl->mtodeglon:          %f\n",Ctrl->mtodeglon);
+		fprintf(stderr,"dbg2       Ctrl->mtodeglat:          %f\n",Ctrl->mtodeglat);
+		fprintf(stderr,"dbg2       pings:                    %d\n",swath->npings);
 		}
 
 	/* set mode of operation */
-	if (mode != MBSWATH_SS)
+	if (Ctrl->Z.mode != MBSWATH_SS
+                && Ctrl->Z.mode != MBSWATH_SS_FILTER)
 		{
 		dobath = MB_YES;
 		doss = MB_NO;
@@ -1599,7 +1298,7 @@ int get_footprints(int verbose, int mode, int fp_mode,
 		}
 
 	/* get fore-aft components of beam footprints */
-	if (swath->npings > 1 && fp_mode == MBSWATH_FOOTPRINT_FAKE)
+	if (swath->npings > 1 && Ctrl->A.mode == MBSWATH_FOOTPRINT_FAKE)
 	  {
 	  for (i=0;i<swath->npings;i++)
 		{
@@ -1616,12 +1315,12 @@ int get_footprints(int verbose, int mode, int fp_mode,
 			headingx = sin(pingcur->heading*DTR);
 			headingy = cos(pingcur->heading*DTR);
 			dx = (swath->data[i-1].navlon - pingcur->navlon)
-				/mtodeglon;
+				/Ctrl->mtodeglon;
 			dy = (swath->data[i-1].navlat - pingcur->navlat)
-				/mtodeglat;
+				/Ctrl->mtodeglat;
 			r = sqrt(dx*dx + dy*dy);
-			pingcur->lonaft = factor*r*headingx*mtodeglon;
-			pingcur->lataft = factor*r*headingy*mtodeglat;
+			pingcur->lonaft = Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
+			pingcur->lataft = Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
 			}
 
 		/* get forward looking */
@@ -1630,12 +1329,12 @@ int get_footprints(int verbose, int mode, int fp_mode,
 			headingx = sin(pingcur->heading*DTR);
 			headingy = cos(pingcur->heading*DTR);
 			dx = (swath->data[i+1].navlon - pingcur->navlon)
-				/mtodeglon;
+				/Ctrl->mtodeglon;
 			dy = (swath->data[i+1].navlat - pingcur->navlat)
-				/mtodeglat;
+				/Ctrl->mtodeglat;
 			r = sqrt(dx*dx + dy*dy);
-			pingcur->lonfor = factor*r*headingx*mtodeglon;
-			pingcur->latfor = factor*r*headingy*mtodeglat;
+			pingcur->lonfor = Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
+			pingcur->latfor = Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
 			}
 
 		/* take care of first ping */
@@ -1655,25 +1354,25 @@ int get_footprints(int verbose, int mode, int fp_mode,
 	  }
 
 	/* take care of just one ping with nonzero center beam */
-	else if (swath->npings == 1 && fp_mode == MBSWATH_FOOTPRINT_FAKE
+	else if (swath->npings == 1 && Ctrl->A.mode == MBSWATH_FOOTPRINT_FAKE
 		&& mb_beam_ok(swath->data[0].beamflag[pingcur->beams_bath/2])
-		&& depth_def <= 0.0)
+		&& Ctrl->A.depth <= 0.0)
 	  {
 	  pingcur = &swath->data[0];
 	  headingx = sin(pingcur->heading*DTR);
 	  headingy = cos(pingcur->heading*DTR);
 	  tt = pingcur->bath[pingcur->beams_bath/2]/750.0; /* in s */
 	  r = tt * pingcur->speed * 0.55555556; /* in m */
-	  pingcur->lonaft = -factor*r*headingx*mtodeglon;
-	  pingcur->lataft = -factor*r*headingy*mtodeglat;
-	  pingcur->lonfor = factor*r*headingx*mtodeglon;
-	  pingcur->latfor = factor*r*headingy*mtodeglat;
+	  pingcur->lonaft = -Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
+	  pingcur->lataft = -Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
+	  pingcur->lonfor = Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
+	  pingcur->latfor = Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
 	  }
 
 	/* else get rfactor if using fore-aft beam width */
-	else if (fp_mode == MBSWATH_FOOTPRINT_REAL)
+	else if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 	  {
-	  rfactor = 0.5*sin(DTR*factor);
+	  rfactor = 0.5*sin(DTR*Ctrl->footprint_factor);
 	  }
 
 	/* loop over the inner beams and get
@@ -1683,7 +1382,7 @@ int get_footprints(int verbose, int mode, int fp_mode,
 		pingcur = &swath->data[i];
 
 		/* get heading if using fore-aft beam width */
-		if (fp_mode == MBSWATH_FOOTPRINT_REAL)
+		if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 			{
 			headingx = sin(pingcur->heading*DTR);
 			headingy = cos(pingcur->heading*DTR);
@@ -1733,17 +1432,16 @@ int get_footprints(int verbose, int mode, int fp_mode,
 
 			/* do it using fore-aft beam width */
 			if (setprint == MB_YES
-				&& fp_mode == MBSWATH_FOOTPRINT_REAL
-				&& depth_def <= 0.0)
+				&& Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 				{
 				print = &pingcur->bathfoot[j];
 				pingcur->bathflag[j] = MB_YES;
 				ddlonx = (pingcur->bathlon[j]
-					- pingcur->navlon)/mtodeglon;
+					- pingcur->navlon)/Ctrl->mtodeglon;
 				ddlaty = (pingcur->bathlat[j]
-					- pingcur->navlat)/mtodeglat;
-				if (depth_def > 0.0)
-					dddepth = depth_def;
+					- pingcur->navlat)/Ctrl->mtodeglat;
+				if (Ctrl->A.depth > 0.0)
+					dddepth = Ctrl->A.depth;
 				else if (pingcur->altitude > 0.0)
 					dddepth = pingcur->altitude;
 				else
@@ -1751,10 +1449,10 @@ int get_footprints(int verbose, int mode, int fp_mode,
 				r = rfactor*sqrt(ddlonx*ddlonx
 					+ ddlaty*ddlaty
 					+ dddepth*dddepth);
-				pingcur->lonaft = -r*headingx*mtodeglon;
-				pingcur->lataft = -r*headingy*mtodeglat;
-				pingcur->lonfor = r*headingx*mtodeglon;
-				pingcur->latfor = r*headingy*mtodeglat;
+				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
+				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
+				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
+				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
 				print->x[0] = x + dlon1 + pingcur->lonaft;
 				print->y[0] = y + dlat1 + pingcur->lataft;
 				print->x[1] = x + dlon2 + pingcur->lonaft;
@@ -1825,16 +1523,16 @@ int get_footprints(int verbose, int mode, int fp_mode,
 
 			/* do it using fore-aft beam width */
 			if (setprint == MB_YES
-				&& fp_mode == MBSWATH_FOOTPRINT_REAL)
+				&& Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 				{
 				print = &pingcur->ssfoot[j];
 				pingcur->ssflag[j] = MB_YES;
 				ddlonx = (pingcur->sslon[j]
-					- pingcur->navlon)/mtodeglon;
+					- pingcur->navlon)/Ctrl->mtodeglon;
 				ddlaty = (pingcur->sslat[j]
-					- pingcur->navlat)/mtodeglat;
-				if (depth_def > 0.0)
-					dddepth = depth_def;
+					- pingcur->navlat)/Ctrl->mtodeglat;
+				if (Ctrl->A.depth > 0.0)
+					dddepth = Ctrl->A.depth;
 				else if (pingcur->altitude > 0.0)
 					dddepth = pingcur->altitude;
 				else if (pingcur->beams_bath > 0
@@ -1842,10 +1540,10 @@ int get_footprints(int verbose, int mode, int fp_mode,
 					dddepth = pingcur->bath[pingcur->beams_bath/2];
 				r = rfactor*sqrt(ddlonx*ddlonx
 					+ ddlaty*ddlaty + dddepth*dddepth);
-				pingcur->lonaft = -r*headingx*mtodeglon;
-				pingcur->lataft = -r*headingy*mtodeglat;
-				pingcur->lonfor = r*headingx*mtodeglon;
-				pingcur->latfor = r*headingy*mtodeglat;
+				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
+				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
+				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
+				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
 				print->x[0] = x + dlon1 + pingcur->lonaft;
 				print->y[0] = y + dlat1 + pingcur->lataft;
 				print->x[1] = x + dlon2 + pingcur->lonaft;
@@ -1880,7 +1578,7 @@ int get_footprints(int verbose, int mode, int fp_mode,
 		pingcur = &swath->data[i];
 
 		/* get heading if using fore-aft beam width */
-		if (fp_mode == MBSWATH_FOOTPRINT_REAL)
+		if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 			{
 			headingx = sin(pingcur->heading*DTR);
 			headingy = cos(pingcur->heading*DTR);
@@ -1905,14 +1603,14 @@ int get_footprints(int verbose, int mode, int fp_mode,
 			pingcur->bathflag[j] = MB_YES;
 
 			/* using fore-aft beam width */
-			if (fp_mode == MBSWATH_FOOTPRINT_REAL)
+			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 				{
 				ddlonx = (pingcur->bathlon[j]
-					- pingcur->navlon)/mtodeglon;
+					- pingcur->navlon)/Ctrl->mtodeglon;
 				ddlaty = (pingcur->bathlat[j]
-					- pingcur->navlat)/mtodeglat;
-				if (depth_def > 0.0)
-					dddepth = depth_def;
+					- pingcur->navlat)/Ctrl->mtodeglat;
+				if (Ctrl->A.depth > 0.0)
+					dddepth = Ctrl->A.depth;
 				else if (pingcur->altitude > 0.0)
 					dddepth = pingcur->altitude;
 				else
@@ -1920,10 +1618,10 @@ int get_footprints(int verbose, int mode, int fp_mode,
 				r = rfactor*sqrt(ddlonx*ddlonx
 					+ ddlaty*ddlaty
 					+ dddepth*dddepth);
-				pingcur->lonaft = -r*headingx*mtodeglon;
-				pingcur->lataft = -r*headingy*mtodeglat;
-				pingcur->lonfor = r*headingx*mtodeglon;
-				pingcur->latfor = r*headingy*mtodeglat;
+				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
+				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
+				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
+				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
 				}
 
 			print->x[0] = x + dlon1 + pingcur->lonaft;
@@ -1951,14 +1649,14 @@ int get_footprints(int verbose, int mode, int fp_mode,
 			pingcur->bathflag[j] = MB_YES;
 
 			/* using fore-aft beam width */
-			if (fp_mode == MBSWATH_FOOTPRINT_REAL)
+			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 				{
 				ddlonx = (pingcur->bathlon[j]
-					- pingcur->navlon)/mtodeglon;
+					- pingcur->navlon)/Ctrl->mtodeglon;
 				ddlaty = (pingcur->bathlat[j]
-					- pingcur->navlat)/mtodeglat;
-				if (depth_def > 0.0)
-					dddepth = depth_def;
+					- pingcur->navlat)/Ctrl->mtodeglat;
+				if (Ctrl->A.depth > 0.0)
+					dddepth = Ctrl->A.depth;
 				else if (pingcur->altitude > 0.0)
 					dddepth = pingcur->altitude;
 				else
@@ -1966,10 +1664,10 @@ int get_footprints(int verbose, int mode, int fp_mode,
 				r = rfactor*sqrt(ddlonx*ddlonx
 					+ ddlaty*ddlaty
 					+ dddepth*dddepth);
-				pingcur->lonaft = -r*headingx*mtodeglon;
-				pingcur->lataft = -r*headingy*mtodeglat;
-				pingcur->lonfor = r*headingx*mtodeglon;
-				pingcur->latfor = r*headingy*mtodeglat;
+				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
+				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
+				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
+				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
 				}
 
 			print->x[0] = x + dlon1 + pingcur->lonaft;
@@ -1984,18 +1682,18 @@ int get_footprints(int verbose, int mode, int fp_mode,
 		  }
 
 		/* do bathymetry with 1 sounding */
-		if (dobath == MB_YES && fp_mode == MBSWATH_FOOTPRINT_REAL && pingcur->beams_bath == 1)
+		if (dobath == MB_YES && Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL && pingcur->beams_bath == 1)
 		  {
 		  if (mb_beam_ok(pingcur->beamflag[0]))
 			{
 			print = &pingcur->bathfoot[0];
 			pingcur->bathflag[0] = MB_YES;
 			ddlonx = (pingcur->bathlon[0]
-				- pingcur->navlon)/mtodeglon;
+				- pingcur->navlon)/Ctrl->mtodeglon;
 			ddlaty = (pingcur->bathlat[0]
-				- pingcur->navlat)/mtodeglat;
-			if (depth_def > 0.0)
-				dddepth = depth_def;
+				- pingcur->navlat)/Ctrl->mtodeglat;
+			if (Ctrl->A.depth > 0.0)
+				dddepth = Ctrl->A.depth;
 			else if (pingcur->altitude > 0.0)
 				dddepth = pingcur->altitude;
 			else
@@ -2004,14 +1702,14 @@ int get_footprints(int verbose, int mode, int fp_mode,
 				+ ddlaty*ddlaty
 				+ dddepth*dddepth);
 
-			dlon2 = -r*headingy*mtodeglon;
-			dlat2 = -r*headingx*mtodeglat;
-			dlon1 = r*headingy*mtodeglon;
-			dlat1 = r*headingx*mtodeglat;
-			pingcur->lonaft = -r*headingx*mtodeglon;
-			pingcur->lataft = -r*headingy*mtodeglat;
-			pingcur->lonfor = r*headingx*mtodeglon;
-			pingcur->latfor = r*headingy*mtodeglat;
+			dlon2 = -r * headingy * Ctrl->mtodeglon;
+			dlat2 = -r * headingx * Ctrl->mtodeglat;
+			dlon1 = r * headingy * Ctrl->mtodeglon;
+			dlat1 = r * headingx * Ctrl->mtodeglat;
+			pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
+			pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
+			pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
+			pingcur->latfor = r * headingy * Ctrl->mtodeglat;
 			print->x[0] = pingcur->bathlon[0] + dlon1 + pingcur->lonaft;
 			print->y[0] = pingcur->bathlat[0] + dlat1 + pingcur->lataft;
 			print->x[1] = pingcur->bathlon[0] + dlon2 + pingcur->lonaft;
@@ -2041,14 +1739,14 @@ int get_footprints(int verbose, int mode, int fp_mode,
 			pingcur->ssflag[j] = MB_YES;
 
 			/* using fore-aft beam width */
-			if (fp_mode == MBSWATH_FOOTPRINT_REAL)
+			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 				{
 				ddlonx = (pingcur->sslon[j]
-					- pingcur->navlon)/mtodeglon;
+					- pingcur->navlon)/Ctrl->mtodeglon;
 				ddlaty = (pingcur->sslat[j]
-					- pingcur->navlat)/mtodeglat;
-				if (depth_def > 0.0)
-					dddepth = depth_def;
+					- pingcur->navlat)/Ctrl->mtodeglat;
+				if (Ctrl->A.depth > 0.0)
+					dddepth = Ctrl->A.depth;
 				else if (pingcur->altitude > 0.0)
 					dddepth = pingcur->altitude;
 				else if (pingcur->beams_bath > 0
@@ -2056,10 +1754,10 @@ int get_footprints(int verbose, int mode, int fp_mode,
 					dddepth = pingcur->bath[pingcur->beams_bath/2];
 				r = rfactor*sqrt(ddlonx*ddlonx
 					+ ddlaty*ddlaty + dddepth*dddepth);
-				pingcur->lonaft = -r*headingx*mtodeglon;
-				pingcur->lataft = -r*headingy*mtodeglat;
-				pingcur->lonfor = r*headingx*mtodeglon;
-				pingcur->latfor = r*headingy*mtodeglat;
+				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
+				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
+				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
+				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
 				}
 
 			print->x[0] = x + dlon1 + pingcur->lonaft;
@@ -2087,14 +1785,14 @@ int get_footprints(int verbose, int mode, int fp_mode,
 			pingcur->ssflag[j] = MB_YES;
 
 			/* using fore-aft beam width */
-			if (fp_mode == MBSWATH_FOOTPRINT_REAL)
+			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
 				{
 				ddlonx = (pingcur->sslon[j]
-					- pingcur->navlon)/mtodeglon;
+					- pingcur->navlon)/Ctrl->mtodeglon;
 				ddlaty = (pingcur->sslat[j]
-					- pingcur->navlat)/mtodeglat;
-				if (depth_def > 0.0)
-					dddepth = depth_def;
+					- pingcur->navlat)/Ctrl->mtodeglat;
+				if (Ctrl->A.depth > 0.0)
+					dddepth = Ctrl->A.depth;
 				else if (pingcur->altitude > 0.0)
 					dddepth = pingcur->altitude;
 				else if (pingcur->beams_bath > 0
@@ -2102,10 +1800,10 @@ int get_footprints(int verbose, int mode, int fp_mode,
 					dddepth = pingcur->bath[pingcur->beams_bath/2];
 				r = rfactor*sqrt(ddlonx*ddlonx
 					+ ddlaty*ddlaty + dddepth*dddepth);
-				pingcur->lonaft = -r*headingx*mtodeglon;
-				pingcur->lataft = -r*headingy*mtodeglat;
-				pingcur->lonfor = r*headingx*mtodeglon;
-				pingcur->latfor = r*headingy*mtodeglat;
+				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
+				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
+				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
+				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
 				}
 
 			print->x[0] = x + dlon1 + pingcur->lonaft;
@@ -2125,12 +1823,9 @@ int get_footprints(int verbose, int mode, int fp_mode,
 		{
 		fprintf(stderr,"\ndbg2  Beam footprints found in function <%s>\n",
 			function_name);
-		fprintf(stderr,"dbg2       npings:         %d\n",
-			swath->npings);
-		fprintf(stderr,"dbg2       error:          %d\n",
-			*error);
-		fprintf(stderr,"dbg2       status:         %d\n",
-			status);
+		fprintf(stderr,"dbg2       npings:         %d\n", swath->npings);
+		fprintf(stderr,"dbg2       error:          %d\n", *error);
+		fprintf(stderr,"dbg2       status:         %d\n", status);
 		for (i=0;i<swath->npings;i++)
 			{
 			fprintf(stderr,"dbg2\ndbg2       ping:           %d\n",i);
@@ -2185,17 +1880,15 @@ int get_footprints(int verbose, int mode, int fp_mode,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
-		double mtodeglon, double mtodeglat,
-		double magnitude, double azimuth,
-		int nshadelevel, double *shadelevel,
-		int *shadelevelgray, int *error)
+int mbswath_get_shading(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT,
+                struct GMT_PALETTE *CPT, int *error)
 {
-	char	*function_name = "get_shading";
+	char	*function_name = "mbswath_get_shading";
 	int	status = MB_SUCCESS;
-	struct ping	*ping0;
-	struct ping	*ping1;
-	struct ping	*ping2;
+        struct swath *swath;
+	struct ping *ping0;
+	struct ping *ping1;
+	struct ping *ping2;
 	int	drvcount;
 	double	dx, dy, dd;
 	double	dst2;
@@ -2203,7 +1896,12 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 	double	sinx,cosy;
 	double	median;
 	double	graylevel;
-	int	i, j, k;
+        double  rgb[4];
+        int     cpt_index;
+	int	i, j;
+                
+        /* get swath */
+        swath = Ctrl->swath_plot;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -2211,22 +1909,36 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
 			function_name);
 		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mode:       %d\n",mode);
-		fprintf(stderr,"dbg2       swath:      %p\n",swath);
-		fprintf(stderr,"dbg2       pings:      %d\n",swath->npings);
-		fprintf(stderr,"dbg2       mtodeglon:  %f\n",mtodeglon);
-		fprintf(stderr,"dbg2       mtodeglat:  %f\n",mtodeglat);
-		fprintf(stderr,"dbg2       magnitude:  %f\n",magnitude);
-		fprintf(stderr,"dbg2       azimuth:    %f\n",azimuth);
+		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
+		fprintf(stderr,"dbg2       Ctrl:               %p\n",Ctrl);
+		fprintf(stderr,"dbg2       Ctrl->Z.mode:       %d\n",Ctrl->Z.mode);
+              if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
+                        {
+                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f shaded relief magnitude\n",Ctrl->G.magnitude);
+                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f shaded relief azimuth\n",Ctrl->G.azimuth);
+                        }
+                else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
+                        {
+                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f amplitude shading magnitude\n",Ctrl->G.magnitude);
+                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f amplitude shading center\n",Ctrl->G.azimuth);
+                        fprintf(stderr,"dbg2       Ctrl->N.active:     %d\n",Ctrl->N.active);
+                        if (Ctrl->N.active)
+                                fprintf(stderr,"dbg2       Ctrl->N.cptfile:    %s\n",Ctrl->N.cptfile);
+                        }
+		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
+		fprintf(stderr,"dbg2       CPT:                %p\n",CPT);
+		fprintf(stderr,"dbg2       swath:              %p\n",swath);
+		fprintf(stderr,"dbg2       pings:              %d\n",swath->npings);
+		fprintf(stderr,"dbg2       Ctrl->mtodeglon:          %f\n",Ctrl->mtodeglon);
+		fprintf(stderr,"dbg2       Ctrl->mtodeglat:          %f\n",Ctrl->mtodeglat);
 		}
 
 	/* get shading from directional bathymetric gradient */
-	if (mode == MBSWATH_BATH_RELIEF)
+	if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
 	  {
 	  /* get directional factors */
-	  sinx = sin(DTR*azimuth);
-	  cosy = cos(DTR*azimuth);
+	  sinx = sin(DTR * Ctrl->G.azimuth);
+	  cosy = cos(DTR * Ctrl->G.azimuth);
 
 	  /* loop over the pings and beams */
 	  for (i=0;i<swath->npings;i++)
@@ -2249,9 +1961,9 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 			&& mb_beam_ok(ping1->beamflag[j+1]))
 			{
 			dx = (ping1->bathlon[j+1] - ping1->bathlon[j-1])
-				/mtodeglon;
+				 / Ctrl->mtodeglon;
 			dy = (ping1->bathlat[j+1] - ping1->bathlat[j-1])
-				/mtodeglat;
+				 / Ctrl->mtodeglat;
 			dd = ping1->bath[j+1] - ping1->bath[j-1];
 			}
 		else if (j < ping1->beams_bath - 1
@@ -2259,9 +1971,9 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 			&& mb_beam_ok(ping1->beamflag[j+1]))
 			{
 			dx = (ping1->bathlon[j+1] - ping1->bathlon[j])
-				/mtodeglon;
+				 / Ctrl->mtodeglon;
 			dy = (ping1->bathlat[j+1] - ping1->bathlat[j])
-				/mtodeglat;
+				 / Ctrl->mtodeglat;
 			dd = ping1->bath[j+1] - ping1->bath[j];
 			}
 		else if (j > 0
@@ -2269,16 +1981,16 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 			&& mb_beam_ok(ping1->beamflag[j]))
 			{
 			dx = (ping1->bathlon[j] - ping1->bathlon[j-1])
-				/mtodeglon;
+				 / Ctrl->mtodeglon;
 			dy = (ping1->bathlat[j] - ping1->bathlat[j-1])
-				/mtodeglat;
+				 / Ctrl->mtodeglat;
 			dd = ping1->bath[j] - ping1->bath[j-1];
 			}
-		dst2 = dx*dx + dy*dy;
+		dst2 = dx * dx + dy * dy;
 		if (dst2 > 0.0)
 			{
-			drvx = dd*dx/dst2;
-			drvy = dd*dy/dst2;
+			drvx = dd * dx / dst2;
+			drvy = dd * dy / dst2;
 			drvcount++;
 			}
 
@@ -2291,9 +2003,9 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 			&& mb_beam_ok(ping2->beamflag[j]))
 			{
 			dx = (ping2->bathlon[j] - ping0->bathlon[j])
-				/mtodeglon;
+				 / Ctrl->mtodeglon;
 			dy = (ping2->bathlat[j] - ping0->bathlat[j])
-				/mtodeglat;
+				 / Ctrl->mtodeglat;
 			dd = ping2->bath[j] - ping0->bath[j];
 			}
 		else if (i < swath->npings - 1
@@ -2301,9 +2013,9 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 			&& mb_beam_ok(ping2->beamflag[j]))
 			{
 			dx = (ping2->bathlon[j] - ping1->bathlon[j])
-				/mtodeglon;
+				 / Ctrl->mtodeglon;
 			dy = (ping2->bathlat[j] - ping1->bathlat[j])
-				/mtodeglat;
+				 / Ctrl->mtodeglat;
 			dd = ping2->bath[j] - ping1->bath[j];
 			}
 		else if (i > 0
@@ -2311,35 +2023,31 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 			&& mb_beam_ok(ping1->beamflag[j]))
 			{
 			dx = (ping1->bathlon[j] - ping0->bathlon[j])
-				/mtodeglon;
+				 / Ctrl->mtodeglon;
 			dy = (ping1->bathlat[j] - ping0->bathlat[j])
-				/mtodeglat;
+				 / Ctrl->mtodeglat;
 			dd = ping1->bath[j] - ping0->bath[j];
 			}
-		dst2 = dx*dx + dy*dy;
+		dst2 = dx * dx + dy * dy;
 		if (dst2 > 0.0)
 			{
-			drvx = drvx + dd*dx/dst2;
-			drvy = drvy + dd*dy/dst2;
+			drvx = drvx + dd * dx / dst2;
+			drvy = drvy + dd * dy / dst2;
 			drvcount++;
 			}
 
 		/* calculate directional derivative */
 		if (drvcount == 2)
-			ping1->bathshade[j] = magnitude*(drvx*sinx + drvy*cosy);
+			ping1->bathshade[j] = Ctrl->G.magnitude * (drvx*sinx + drvy*cosy);
 		else
 			ping1->bathshade[j] = 0.0;
-
 		}
 	    }
 	  }
 
-	/* get shading from amplitude data */
-	if (ampshademode == 1 && mode == MBSWATH_BATH_AMP)
+	/* get shading from amplitude data using cpt file */
+	else if (Ctrl->Z.mode == MBSWATH_BATH_AMP && Ctrl->N.active)
 	  {
-	  /* get median value from value entered as azimuth */
-	  median = azimuth;
-
 	  /* loop over the pings and beams */
 	  for (i=0;i<swath->npings;i++)
 	    {
@@ -2349,43 +2057,25 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 	    for (j=0;j<ping1->beams_bath;j++)
 	      if (mb_beam_ok(ping1->beamflag[j]))
 		{
-
 		/* calculate shading */
 		if (mb_beam_ok(ping1->beamflag[j]))
 			{
-			/* get shading value from cpt grayscale */
-			if (ping1->amp[j] < shadelevel[0])
-			    graylevel = (double) shadelevelgray[0];
-			else if (ping1->amp[j] > shadelevel[nshadelevel-1])
-			    graylevel = (double) shadelevelgray[nshadelevel-1];
-			else
-			    {
-			    for (k=0;k<nshadelevel-1;k++)
-				{
-				if (ping1->amp[j] > shadelevel[k]
-				    && ping1->amp[j] <= shadelevel[k+1])
-				    {
-				    graylevel = (double) shadelevelgray[k]
-					+ (ping1->amp[j] - shadelevel[k])
-					*((double)shadelevelgray[k+1] - (double)shadelevelgray[k])
-					/(shadelevel[k+1] - shadelevel[k]);
-				    }
-				}
-			    }
-			ping1->bathshade[j] = magnitude*(graylevel - median)/128.;
+                        /* get shading value from cpt */
+                        cpt_index = GMT_get_rgb_from_z(GMT, CPT, ping1->amp[j], rgb);
+                        graylevel = (rgb[0] + rgb[1] + rgb[2]) / 3.0;
+			ping1->bathshade[j] = Ctrl->G.magnitude * (graylevel - Ctrl->G.azimuth) / 128.;
 			}
 		else
 			ping1->bathshade[j] = 0.0;
-
 		}
 	    }
 	  }
 
 	/* get shading from amplitude data */
-	else if (mode == MBSWATH_BATH_AMP)
+	else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
 	  {
 	  /* get median value from value entered as azimuth */
-	  median = azimuth;
+	  median = Ctrl->G.azimuth;
 
 	  /* loop over the pings and beams */
 	  for (i=0;i<swath->npings;i++)
@@ -2396,13 +2086,11 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 	    for (j=0;j<ping1->beams_bath;j++)
 	      if (mb_beam_ok(ping1->beamflag[j]))
 		{
-
 		/* calculate shading */
 		if (mb_beam_ok(ping1->beamflag[j]))
-			ping1->bathshade[j] = magnitude*(ping1->amp[j] - median);
+			ping1->bathshade[j] = Ctrl->G.magnitude * (ping1->amp[j] - Ctrl->G.azimuth);
 		else
 			ping1->bathshade[j] = 0.0;
-
 		}
 	    }
 	  }
@@ -2451,17 +2139,23 @@ int get_shading(int verbose, int mode, int ampshademode, struct swath *swath,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-int plot_data_footprint(int verbose, int mode,
-		struct swath *swath, int first, int nplot, int *error)
+int mbswath_plot_data_footprint(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT,
+                        struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL, 
+                        int first, int nplot, int *error)
 {
-	char	*function_name = "plot_data_footprint";
+	char	*function_name = "mbswath_plot_data_footprint";
 	int	status = MB_SUCCESS;
-	struct ping	*pingcur;
-	struct footprint	*print;
+        struct swath *swath;
+	struct ping *pingcur;
+	struct footprint *print;
 	double	*x, *y;
 	double	xx[4], yy[4];
-	int	rgb[3];
+	double 	rgb[4];
+        int     cpt_index;
 	int	i, j, k;
+                
+        /* get swath */
+        swath = Ctrl->swath_plot;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -2470,16 +2164,34 @@ int plot_data_footprint(int verbose, int mode,
 			function_name);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mode:       %d\n",mode);
+		fprintf(stderr,"dbg2       Ctrl:               %p\n",Ctrl);
+		fprintf(stderr,"dbg2       Ctrl->Z.mode:       %d\n",Ctrl->Z.mode);
+		fprintf(stderr,"dbg2       Ctrl->C.cptfile:    %s\n",Ctrl->C.cptfile);
+              if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
+                        {
+                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f shaded relief magnitude\n",Ctrl->G.magnitude);
+                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f shaded relief azimuth\n",Ctrl->G.azimuth);
+                        }
+                else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
+                        {
+                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f amplitude shading magnitude\n",Ctrl->G.magnitude);
+                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f amplitude shading center\n",Ctrl->G.azimuth);
+                        fprintf(stderr,"dbg2       Ctrl->N.active:     %d\n",Ctrl->N.active);
+                        if (Ctrl->N.active)
+                                fprintf(stderr,"dbg2       Ctrl->N.cptfile:    %s\n",Ctrl->N.cptfile);
+                        }
+		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
+		fprintf(stderr,"dbg2       CPT:                %p\n",CPT);
+		fprintf(stderr,"dbg2       PSL:                %p\n",PSL);
 		fprintf(stderr,"dbg2       swath:      %p\n",swath);
 		fprintf(stderr,"dbg2       pings:      %d\n",swath->npings);
 		fprintf(stderr,"dbg2       first:      %d\n",first);
 		fprintf(stderr,"dbg2       nplot:      %d\n",nplot);
 		}
 
-	if (mode == MBSWATH_BATH
-		|| mode == MBSWATH_BATH_RELIEF
-		|| mode == MBSWATH_BATH_AMP)
+	if (Ctrl->Z.mode == MBSWATH_BATH
+		|| Ctrl->Z.mode == MBSWATH_BATH_RELIEF
+		|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
 		{
 		/* loop over all pings and beams and plot the good ones */
 		for (i=first;i<first+nplot;i++)
@@ -2492,18 +2204,22 @@ int plot_data_footprint(int verbose, int mode,
 				x = &(print->x[0]);
 				y = &(print->y[0]);
 				for (k=0;k<4;k++)
-					GMT_geo_to_xy(x[k],y[k],&xx[k],&yy[k]);
-				GMT_get_rgb24(pingcur->bath[j],rgb);
-				if (mode == MBSWATH_BATH_RELIEF
-					|| mode == MBSWATH_BATH_AMP)
-					GMT_illuminate(pingcur->bathshade[j],rgb);
-/*fprintf(stderr,"Calling plot_box ping:%d of %d   beam:%d of %d\n",
+					GMT_geo_to_xy(GMT, x[k], y[k], &xx[k], &yy[k]);
+                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->bath[j], rgb);
+				if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF
+					|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
+                                        {
+//fprintf(stderr,"Illuminate: shade:%f rgb: %f %f %f ",pingcur->bathshade[j], rgb[0],rgb[1],rgb[2]);
+					GMT_illuminate(GMT, pingcur->bathshade[j], rgb);
+//fprintf(stderr,"    %f %f %f\n",rgb[0],rgb[1],rgb[2]);
+                                        }
+/*fprintf(stderr,"Calling mbswath_plot_box ping:%d of %d   beam:%d of %d\n",
 i,nplot,j,pingcur->beams_bath);*/
-				status = plot_box(verbose,xx,yy,rgb,error);
+				status = mbswath_plot_box(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
 				}
 			}
 		}
-	else if (mode == MBSWATH_AMP)
+	else if (Ctrl->Z.mode == MBSWATH_AMP)
 		{
 		/* loop over all pings and beams and plot the good ones */
 		for (i=first;i<first+nplot;i++)
@@ -2516,13 +2232,13 @@ i,nplot,j,pingcur->beams_bath);*/
 				x = &(print->x[0]);
 				y = &(print->y[0]);
 				for (k=0;k<4;k++)
-					GMT_geo_to_xy(x[k],y[k],&xx[k],&yy[k]);
-				GMT_get_rgb24(pingcur->amp[j],rgb);
-				status = plot_box(verbose,xx,yy,rgb,error);
+					GMT_geo_to_xy(GMT, x[k], y[k], &xx[k], &yy[k]);
+                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->amp[j], rgb);
+				status = mbswath_plot_box(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
 				}
 			}
 		}
-	else if (mode == MBSWATH_SS)
+	else if (Ctrl->Z.mode == MBSWATH_SS)
 		{
 		/* loop over all pings and beams and plot the good ones */
 		for (i=first;i<first+nplot;i++)
@@ -2535,9 +2251,9 @@ i,nplot,j,pingcur->beams_bath);*/
 				x = &(print->x[0]);
 				y = &(print->y[0]);
 				for (k=0;k<4;k++)
-					GMT_geo_to_xy(x[k],y[k],&xx[k],&yy[k]);
-				GMT_get_rgb24(pingcur->ss[j],rgb);
-				status = plot_box(verbose,xx,yy,rgb,error);
+					GMT_geo_to_xy(GMT, x[k], y[k], &xx[k], &yy[k]);
+                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->ss[j], rgb);
+				status = mbswath_plot_box(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
 				}
 			}
 		}
@@ -2561,15 +2277,21 @@ i,nplot,j,pingcur->beams_bath);*/
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-int plot_data_point(int verbose, int mode,
-		struct swath *swath, int first, int nplot, int *error)
+int mbswath_plot_data_point(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT,
+		struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL,
+                int first, int nplot, int *error)
 {
-	char	*function_name = "plot_data_point";
+	char	*function_name = "mbswath_plot_data_point";
 	int	status = MB_SUCCESS;
+        struct swath *swath;
 	struct ping	*pingcur;
 	double	xx, yy;
-	int	rgb[3];
+	double	rgb[4];
+        int     cpt_index;
 	int	i, j;
+                
+        /* get swath */
+        swath = Ctrl->swath_plot;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -2578,16 +2300,33 @@ int plot_data_point(int verbose, int mode,
 			function_name);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mode:       %d\n",mode);
+		fprintf(stderr,"dbg2       Ctrl:               %p\n",Ctrl);
+		fprintf(stderr,"dbg2       Ctrl->Z.mode:       %d\n",Ctrl->Z.mode);
+              if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
+                        {
+                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f shaded relief magnitude\n",Ctrl->G.magnitude);
+                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f shaded relief azimuth\n",Ctrl->G.azimuth);
+                        }
+                else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
+                        {
+                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f amplitude shading magnitude\n",Ctrl->G.magnitude);
+                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f amplitude shading center\n",Ctrl->G.azimuth);
+                        fprintf(stderr,"dbg2       Ctrl->N.active:     %d\n",Ctrl->N.active);
+                        if (Ctrl->N.active)
+                                fprintf(stderr,"dbg2       Ctrl->N.cptfile:    %s\n",Ctrl->N.cptfile);
+                        }
+		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
+		fprintf(stderr,"dbg2       CPT:                %p\n",CPT);
+		fprintf(stderr,"dbg2       PSL:                %p\n",PSL);
 		fprintf(stderr,"dbg2       swath:      %p\n",swath);
 		fprintf(stderr,"dbg2       pings:      %d\n",swath->npings);
 		fprintf(stderr,"dbg2       first:      %d\n",first);
 		fprintf(stderr,"dbg2       nplot:      %d\n",nplot);
 		}
 
-	if (mode == MBSWATH_BATH
-		|| mode == MBSWATH_BATH_RELIEF
-		|| mode == MBSWATH_BATH_AMP)
+	if (Ctrl->Z.mode == MBSWATH_BATH
+		|| Ctrl->Z.mode == MBSWATH_BATH_RELIEF
+		|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
 		{
 		/* loop over all pings and beams and plot the good ones */
 		for (i=first;i<first+nplot;i++)
@@ -2596,19 +2335,17 @@ int plot_data_point(int verbose, int mode,
 			for (j=0;j<pingcur->beams_bath;j++)
 			  if (mb_beam_ok(pingcur->beamflag[j]))
 				{
-				GMT_geo_to_xy(pingcur->bathlon[j],
-					pingcur->bathlat[j],
+				GMT_geo_to_xy(GMT, pingcur->bathlon[j], pingcur->bathlat[j],
 					&xx, &yy);
-				GMT_get_rgb24(pingcur->bath[j],rgb);
-				if (mode == MBSWATH_BATH_RELIEF
-					|| mode == MBSWATH_BATH_AMP)
-					GMT_illuminate(pingcur->bathshade[j],
-						rgb);
-				status = plot_point(verbose,xx,yy,rgb,error);
+                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->bath[j], rgb);
+				if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF
+					|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
+					GMT_illuminate(GMT, pingcur->bathshade[j], rgb);
+				status = mbswath_plot_point(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
 				}
 			}
 		}
-	else if (mode == MBSWATH_AMP)
+	else if (Ctrl->Z.mode == MBSWATH_AMP)
 		{
 		/* loop over all pings and beams and plot the good ones */
 		for (i=first;i<first+nplot;i++)
@@ -2617,15 +2354,14 @@ int plot_data_point(int verbose, int mode,
 			for (j=0;j<pingcur->beams_amp;j++)
 			  if (mb_beam_ok(pingcur->beamflag[j]))
 				{
-				GMT_geo_to_xy(pingcur->bathlon[j],
-					pingcur->bathlat[j],
+				GMT_geo_to_xy(GMT, pingcur->bathlon[j], pingcur->bathlat[j],
 					&xx, &yy);
-				GMT_get_rgb24(pingcur->amp[j],rgb);
-				status = plot_point(verbose,xx,yy,rgb,error);
+				cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->amp[j], rgb);
+				status = mbswath_plot_point(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
 				}
 			}
 		}
-	else if (mode == MBSWATH_SS)
+	else if (Ctrl->Z.mode == MBSWATH_SS)
 		{
 		/* loop over all pings and beams and plot the good ones */
 		for (i=first;i<first+nplot;i++)
@@ -2634,11 +2370,10 @@ int plot_data_point(int verbose, int mode,
 			for (j=0;j<pingcur->pixels_ss;j++)
 			  if (pingcur->ss[j] > MB_SIDESCAN_NULL)
 				{
-				GMT_geo_to_xy(pingcur->sslon[j],
-					pingcur->sslat[j],
+				GMT_geo_to_xy(GMT, pingcur->sslon[j], pingcur->sslat[j],
 					&xx, &yy);
-				GMT_get_rgb24(pingcur->ss[j],rgb);
-				status = plot_point(verbose,xx,yy,rgb,error);
+				cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->ss[j], rgb);
+				status = mbswath_plot_point(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
 				}
 			}
 		}
@@ -2662,9 +2397,11 @@ int plot_data_point(int verbose, int mode,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-int plot_box(int verbose, double *x, double *y, int *rgb, int *error)
+int mbswath_plot_box(int verbose, struct MBSWATH_CTRL *Ctrl,
+                        struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
+                        double *x, double *y, double *rgb, int *error)
 {
-	char	*function_name = "plot_box";
+	char	*function_name = "mbswath_plot_box";
 	int	status = MB_SUCCESS;
 	int	ix[5], iy[5];
 	int	ixmin, ixmax, iymin, iymax;
@@ -2680,34 +2417,37 @@ int plot_box(int verbose, double *x, double *y, int *rgb, int *error)
 		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
 			function_name);
 		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       x[0]:       %f\n",x[0]);
-		fprintf(stderr,"dbg2       y[0]:       %f\n",y[0]);
-		fprintf(stderr,"dbg2       x[1]:       %f\n",x[1]);
-		fprintf(stderr,"dbg2       y[1]:       %f\n",y[1]);
-		fprintf(stderr,"dbg2       x[2]:       %f\n",x[2]);
-		fprintf(stderr,"dbg2       y[2]:       %f\n",y[2]);
-		fprintf(stderr,"dbg2       x[3]:       %f\n",x[3]);
-		fprintf(stderr,"dbg2       y[3]:       %f\n",y[3]);
-		fprintf(stderr,"dbg2       rgb[0]:     %d\n",rgb[0]);
-		fprintf(stderr,"dbg2       rgb[1]:     %d\n",rgb[1]);
-		fprintf(stderr,"dbg2       rgb[2]:     %d\n",rgb[2]);
+		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
+		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
+		fprintf(stderr,"dbg2       x[0]:               %f\n",x[0]);
+		fprintf(stderr,"dbg2       y[0]:               %f\n",y[0]);
+		fprintf(stderr,"dbg2       x[1]:               %f\n",x[1]);
+		fprintf(stderr,"dbg2       y[1]:               %f\n",y[1]);
+		fprintf(stderr,"dbg2       x[2]:               %f\n",x[2]);
+		fprintf(stderr,"dbg2       y[2]:               %f\n",y[2]);
+		fprintf(stderr,"dbg2       x[3]:               %f\n",x[3]);
+		fprintf(stderr,"dbg2       y[3]:               %f\n",y[3]);
+		fprintf(stderr,"dbg2       rgb[0]:             %f\n",rgb[0]);
+		fprintf(stderr,"dbg2       rgb[1]:             %f\n",rgb[1]);
+		fprintf(stderr,"dbg2       rgb[2]:             %f\n",rgb[2]);
+		fprintf(stderr,"dbg2       rgb[3]:             %f\n",rgb[3]);
 		}
 
 	/* if simple case just plot polygon */
-	if (image == MBSWATH_IMAGE_VECTOR)
+	if (Ctrl->image_type == MBSWATH_IMAGE_VECTOR)
 		{
-		ps_polygon(x,y,4,rgb,0);
+                PSL_setcolor(PSL, rgb, PSL_IS_FILL);
+		PSL_plotpolygon(PSL, x, y, 4);
 		}
 
 	/* if image plot then rasterize the box */
-	else if (image == MBSWATH_IMAGE_8 || image == MBSWATH_IMAGE_24)
+	else if (Ctrl->image_type == MBSWATH_IMAGE_8 || Ctrl->image_type == MBSWATH_IMAGE_24)
 		{
 		/* get bounds of box in pixels */
 		for (i=0;i<4;i++)
 			{
-			ix[i] = nx*x[i]/x_inch;
-			iy[i] = ny*y[i]/y_inch;
+			ix[i] = (int)(Ctrl->nx * x[i] / Ctrl->x_inch);
+			iy[i] = (int)(Ctrl->ny * y[i] / Ctrl->y_inch);
 			}
 		ix[4] = ix[0];
 		iy[4] = iy[0];
@@ -2729,9 +2469,9 @@ int plot_box(int verbose, double *x, double *y, int *rgb, int *error)
 				iymax = iy[i];
 			}
 		if (ixmin < 0) ixmin = 0;
-		if (ixmax > nx-1) ixmax = nx - 1;
+		if (ixmax > Ctrl->nx-1) ixmax = Ctrl->nx - 1;
 		if (iymin < 1) iymin = 1;
-		if (iymax > ny-1) iymax = ny - 1;
+		if (iymax > Ctrl->ny-1) iymax = Ctrl->ny - 1;
 
 		/* loop over all y values */
 		for (iyy=iymin;iyy<=iymax;iyy++)
@@ -2754,7 +2494,7 @@ int plot_box(int verbose, double *x, double *y, int *rgb, int *error)
 		        {
 		        dy = iy[i+1] - iy[i];
 		        dx = ix[i+1] - ix[i];
-		        xcross[ncross] = (int) ((iyy - iy[i])*dx/dy + ix[i]);
+		        xcross[ncross] = (int) ((iyy - iy[i]) * dx / dy + ix[i]);
 		        ncross++;
 		        }
 		      }
@@ -2784,53 +2524,25 @@ int plot_box(int verbose, double *x, double *y, int *rgb, int *error)
 		    for (ixx=ixx1;ixx<=ixx2;ixx++)
 		      {
 /*			fprintf(stderr,"plot %d %d\n",ixx,iyy);*/
-		      if (image == MBSWATH_IMAGE_8)
-			{
-			k = nx*(ny - iyy) + ixx;
-			bitimage[k] = (unsigned char) YIQ (rgb);
-			}
-		      else if (gmtdefs.color_image == 2)
+		      if (Ctrl->image_type == MBSWATH_IMAGE_8)
 			{
-			k = nx*(ny - iyy) + ixx;
-			bitimage[k] = rgb[0];
-			bitimage[k+nm] = rgb[1];
-			bitimage[k+nm2] = rgb[2];
+			k = Ctrl->nx * (Ctrl->ny - iyy) + ixx;
+			Ctrl->bitimage[k] = (unsigned char) (255 * YIQ(rgb));
+//fprintf(stderr,"k:%d rgb: %f %f %f   bitimage: %u\n",
+//k,rgb[0],rgb[1],rgb[2],Ctrl->bitimage[k]);                        
 			}
 		      else
 			{
-			k = 3*(nx*(ny - iyy) + ixx);
-			bitimage[k] = rgb[0];
-			bitimage[k+1] = rgb[1];
-			bitimage[k+2] = rgb[2];
+			k = 3 * (Ctrl->nx * (Ctrl->ny - iyy) + ixx);
+			Ctrl->bitimage[k] = (unsigned char) (255 * rgb[0]);
+			Ctrl->bitimage[k+1] = (unsigned char) (255 * rgb[1]);
+			Ctrl->bitimage[k+2] = (unsigned char) (255 * rgb[2]);
+//fprintf(stderr,"k:%d rgb: %f %f %f   bitimage: %u %u %u\n",
+//k,rgb[0],rgb[1],rgb[2],Ctrl->bitimage[k],Ctrl->bitimage[k+1],Ctrl->bitimage[k+2]);
 			}
 		      }
 		    }
 		  }
-
-		/* plot simple minded wrong box */
-/*		for (iyy=iymin;iyy<=iymax;iyy++)
-		  for (ixx=ixmin;ixx<=ixmax;ixx++)
-		    {
-		    if (image == MBSWATH_IMAGE_8)
-			{
-			k = nx*(ny - iyy) + ixx;
-			bitimage[k] = (unsigned char) YIQ (rgb);
-			}
-		    else if (gmtdefs.color_image == 2)
-			{
-			k = nx*(ny - iyy) + ixx;
-			bitimage[k] = rgb[0];
-			bitimage[k+nm] = rgb[1];
-			bitimage[k+nm2] = rgb[2];
-			}
-		    else
-			{
-			k = 3*(nx*(ny - iyy) + ixx);
-			bitimage[k] = rgb[0];
-			bitimage[k+1] = rgb[1];
-			bitimage[k+2] = rgb[2];
-			}
-		    }*/
 		}
 
 	/* assume success */
@@ -2852,10 +2564,12 @@ int plot_box(int verbose, double *x, double *y, int *rgb, int *error)
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-int plot_point(int verbose, double x, double y, int *rgb, int *error)
+int mbswath_plot_point(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
+                        double x, double y, double *rgb, int *error)
 {
-	char	*function_name = "plot_point";
+	char	*function_name = "mbswath_plot_point";
 	int	status = MB_SUCCESS;
+        double  size = 0.005;
 	int	ix, iy;
 	int	k;
 
@@ -2865,47 +2579,42 @@ int plot_point(int verbose, double x, double y, int *rgb, int *error)
 		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
 			function_name);
 		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       x:          %f\n",x);
-		fprintf(stderr,"dbg2       y:          %f\n",y);
-		fprintf(stderr,"dbg2       rgb[0]:     %d\n",rgb[0]);
-		fprintf(stderr,"dbg2       rgb[1]:     %d\n",rgb[1]);
-		fprintf(stderr,"dbg2       rgb[2]:     %d\n",rgb[1]);
+		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
+		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
+		fprintf(stderr,"dbg2       x:                  %f\n",x);
+		fprintf(stderr,"dbg2       y:                  %f\n",y);
+		fprintf(stderr,"dbg2       rgb[0]:             %f\n",rgb[0]);
+		fprintf(stderr,"dbg2       rgb[1]:             %f\n",rgb[1]);
+		fprintf(stderr,"dbg2       rgb[2]:             %f\n",rgb[2]);
+		fprintf(stderr,"dbg2       rgb[3]:             %f\n",rgb[3]);
 		}
 
-	/* if simple case just plot point */
-	if (image == MBSWATH_IMAGE_VECTOR)
+	/* if simple case just plot point (well, a very small cross actually) */
+	if (Ctrl->image_type == MBSWATH_IMAGE_VECTOR)
 		{
-		ps_setpaint (rgb);
-		ps_cross (x, y, 0.005);
+                PSL_setcolor(PSL, rgb, PSL_IS_STROKE);
+                PSL_plotsymbol(PSL, x, y, &size, PSL_CROSS);
 		}
 
 	/* if image plot then plot pixel */
-	else if (image == MBSWATH_IMAGE_8 || image == MBSWATH_IMAGE_24)
+	else
 		{
 		/* get pixel */
-		ix = nx*x/x_inch;
-		iy = ny*y/y_inch;
+		ix = (int)(Ctrl->nx * x / Ctrl->x_inch);
+		iy = (int)(Ctrl->ny * y / Ctrl->y_inch);
 
 		/* plot pixel */
-		if (image == MBSWATH_IMAGE_8)
-			{
-			k = nx*(ny - iy) + ix;
-			bitimage[k] = (unsigned char ) YIQ(rgb);
-			}
-		else if (gmtdefs.color_image == 2)
+		if (Ctrl->image_type == MBSWATH_IMAGE_8)
 			{
-			k = nx*(ny - iy) + ix;
-			bitimage[k] = rgb[0];
-			bitimage[k+nm] = rgb[1];
-			bitimage[k+nm2] = rgb[2];
+			k = Ctrl->nx * (Ctrl->ny - iy) + ix;
+			Ctrl->bitimage[k] = (unsigned char ) YIQ(rgb);
 			}
 		else
 			{
-			k = 3*(nx*(ny - iy) + ix);
-			bitimage[k] = rgb[0];
-			bitimage[k+1] = rgb[1];
-			bitimage[k+2] = rgb[2];
+			k = 3 * (Ctrl->nx * (Ctrl->ny - iy) + ix);
+			Ctrl->bitimage[k] = (unsigned char) (255 * rgb[0]);
+			Ctrl->bitimage[k+1] = (unsigned char) (255 * rgb[1]);
+			Ctrl->bitimage[k+2] = (unsigned char) (255 * rgb[2]);
 			}
 		  }
 
@@ -2928,9 +2637,9 @@ int plot_point(int verbose, double x, double y, int *rgb, int *error)
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-int ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
+int mbswath_ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
 {
-	char	*function_name = "ping_copy";
+	char	*function_name = "mbswath_ping_copy";
 	int	status = MB_SUCCESS;
 
 	struct ping	*ping1;
diff --git a/src/gmt/pslib.h b/src/gmt/pslib.h
new file mode 100644
index 0000000..0eea732
--- /dev/null
+++ b/src/gmt/pslib.h
@@ -0,0 +1,405 @@
+/*--------------------------------------------------------------------
+ *	$Id: pslib.h 2242 2015-05-16 05:21:28Z caress $
+ *
+ *	Copyright (c) 2009-2015 by P. Wessel and R. Scharroo
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU Lesser General Public License as published by
+ *	the Free Software Foundation; version 3 or any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU Lesser General Public License for more details.
+ *
+ *--------------------------------------------------------------------*/
+/*
+ * This include file must be included by all programs using pslib.a
+ *
+ * Authors:	Paul Wessel, Dept. of Geology and Geophysics, SOEST, U Hawaii
+ *			   pwessel at hawaii.edu
+ *		Remko Scharroo, Altimetrics
+ *			   remko at altimetrics.com
+ * Version:	5.0 [64-bit enabled API edition]
+ * Date:	15-OCT-2009
+ */
+
+#ifndef _PSLIB_H
+#define _PSLIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* CMake definitions: This must be first! */
+//#include "gmt_config.h"
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#include "declspec.h"
+
+#include <stdio.h>
+
+/* Number of PostScript points in one inch */
+
+#define PSL_POINTS_PER_INCH	72.0
+#define PSL_DOTS_PER_INCH	1200.0	/* Effective dots per inch resolution */
+#define PSL_ALL_CLIP		INT_MAX	/* Terminates all clipping */
+
+/* PSL codes for geometric symbols as expected by PSL_plotsymbol */
+
+#define PSL_STAR		((int)'a')
+#define PSL_CIRCLE		((int)'c')
+#define PSL_DIAMOND		((int)'d')
+#define PSL_ELLIPSE		((int)'e')
+#define PSL_HEXAGON		((int)'h')
+#define PSL_OCTAGON		((int)'g')
+#define PSL_INVTRIANGLE		((int)'i')
+#define PSL_ROTRECT		((int)'j')
+#define PSL_MARC		((int)'m')
+#define PSL_PENTAGON		((int)'n')
+#define PSL_DOT			((int)'p')
+#define PSL_RECT		((int)'r')
+#define PSL_RNDRECT		((int)'R')
+#define PSL_SQUARE		((int)'s')
+#define PSL_TRIANGLE		((int)'t')
+#define PSL_VECTOR		((int)'v')
+#define PSL_WEDGE		((int)'w')
+#define PSL_CROSS		((int)'x')
+#define PSL_YDASH		((int)'y')
+#define PSL_PLUS		((int)'+')
+#define PSL_XDASH		((int)'-')
+
+/* PSL codes for vector attributes - mirroring similar codes and macros in GMT */
+
+/* Note: If changes are made to PSL_enum_vecattr you must also change gmt_plot.h: GMT_enum_vecattr */
+
+enum PSL_enum_vecattr {PSL_VEC_BEGIN = 1,	/* Place vector head at beginning of vector. Add PSL_VEC_BEGIN_L for left only, PSL_VEC_BEGIN_R for right only */
+	PSL_VEC_END		= 2,		/* Place vector head at end of vector.  Add PSL_VEC_END_L for left only, and PSL_VEC_END_R for right only */
+	PSL_VEC_HEADS		= 3,		/* Mask for either head end */
+	PSL_VEC_BEGIN_L		= 4,		/* Left-half head at beginning */
+	PSL_VEC_BEGIN_R		= 8,		/* Right-half head at beginning */
+	PSL_VEC_END_L		= 16,		/* Left-half head at end */
+	PSL_VEC_END_R		= 32,		/* Right-half head at end */
+	PSL_VEC_JUST_B		= 0,		/* Align vector beginning at (x,y) */
+	PSL_VEC_JUST_C		= 64,		/* Align vector center at (x,y) */
+	PSL_VEC_JUST_E		= 128,		/* Align vector end at (x,y) */
+	PSL_VEC_JUST_S		= 256,		/* Align vector center at (x,y) */
+	PSL_VEC_ANGLES		= 512,		/* Got start/stop angles instead of az, length */
+	PSL_VEC_POLE		= 1024,		/* Got pole of small/great circle */
+	PSL_VEC_OUTLINE		= 2048,		/* Draw vector head outline using default pen */
+	PSL_VEC_OUTLINE2	= 4096,		/* Draw vector head outline using supplied v_pen */
+	PSL_VEC_FILL		= 8192,		/* Fill vector head using default fill */
+	PSL_VEC_FILL2		= 16384,	/* Fill vector head using supplied v_fill) */
+	PSL_VEC_MARC90		= 32768};	/* Matharc only: if angles subtend 90, draw straight angle symbol */
+	
+#define PSL_vec_justify(status) ((status>>6)&3)			/* Return justification as 0-3 */
+#define PSL_vec_head(status) ((status)&3)			/* Return head selection as 0-3 */
+#define PSL_vec_side(status,head) (((status>>(2+2*head))&3) ? 2*((status>>(2+2*head))&3)-3 : 0)	/* Return side selection for this head as 0,-1,+1 */
+
+/* PSL codes for arguments of PSL_beginplot and other routines */
+
+enum PSL_enum_const {PSL_CM	= 0,
+	PSL_INCH		= 1,
+	PSL_METER		= 2,
+	PSL_PT			= 3,
+	PSL_FINALIZE		= 1,
+	PSL_OVERLAY		= 1,
+	PSL_INIT		= 0,
+	PSL_LANDSCAPE		= 0,
+	PSL_PORTRAIT		= 1,
+	PSL_ASCII85		= 0,
+	PSL_HEX			= 1,
+	PSL_NONE		= 0,
+	PSL_RLE			= 1,
+	PSL_LZW			= 2,
+	PSL_DEFLATE		= 3,
+	PSL_NO			= 0,
+	PSL_YES			= 1,
+	PSL_FWD			= 0,
+	PSL_INV			= 1,
+	PSL_OUTLINE		= 1,
+	PSL_MAX_EPS_FONTS	= 6,
+	PSL_MAX_DIMS		= 8,		/* Max number of dim arguments to PSL_plot_symbol */
+	PSL_N_PATTERNS		= 91,		/* Current number of predefined patterns + 1, # 91 is user-supplied */
+	PSL_BUFSIZ		= 4096U};	/* To match GMT_BUFSIZ and be consistent across all platforms */
+
+/* PSL codes for pen movements (used by PSL_plotpoint, PSL_plotline, PSL_plotarc) */
+
+enum PSL_enum_move {PSL_DRAW	= 0,
+	PSL_MOVE		= 1,
+	PSL_STROKE		= 2,
+	PSL_REL			= 4,
+	PSL_CLOSE		= 8};
+
+/* PSL codes for text and paragraph justification */
+
+enum PSL_enum_just {PSL_BL	= 1,
+	PSL_BC			= 2,
+	PSL_BR			= 3,
+	PSL_ML			= 5,
+	PSL_MC			= 6,
+	PSL_MR			= 7,
+	PSL_TL			= 9,
+	PSL_TC			= 10,
+	PSL_TR			= 11,
+	PSL_JUST		= 4};
+
+/* PSL code for rectangle shapes */
+
+enum PSL_enum_rect {PSL_RECT_STRAIGHT	= 0,
+	PSL_RECT_ROUNDED,
+	PSL_RECT_CONVEX,
+	PSL_RECT_CONCAVE};
+
+/* PSL codes for line settings */
+
+enum PSL_enum_line {PSL_BUTT_CAP	= 0,
+	PSL_ROUND_CAP			= 1,
+	PSL_SQUARE_CAP			= 2,
+	PSL_MITER_JOIN			= 0,
+	PSL_ROUND_JOIN			= 1,
+	PSL_BEVEL_JOIN			= 2,
+	PSL_MITER_DEFAULT		= 35};
+
+/* PSL codes for text clipping (PSL_plottextline) */
+
+enum PSL_enum_txt {PSL_TXT_INIT	= 1,
+	PSL_TXT_SHOW		= 2,
+	PSL_TXT_CLIP_ON		= 4,
+	PSL_TXT_DRAW		= 8,
+	PSL_TXT_CLIP_OFF	= 16,
+	PSL_TXT_ROUND		= 32,
+	PSL_TXT_CURVED		= 64,
+	PSL_TXT_FILLBOX		= 128,
+	PSL_TXT_DRAWBOX		= 256};
+
+/* Verbosity levels */
+
+enum PSL_enum_verbose {PSL_MSG_QUIET = 0,	/* No messages whatsoever */
+	PSL_MSG_FATAL,		/* Fatal errors */
+	PSL_MSG_TICTOC,		/* To print a tic-toc elapsed time message */
+	PSL_MSG_COMPAT,		/* Compatibility warnings */
+	PSL_MSG_NORMAL,		/* Warnings level -V */
+	PSL_MSG_VERBOSE,	/* Longer verbose, -Vl in some programs */
+	PSL_MSG_DEBUG};		/* Debug messages for developers mostly */
+
+/* Color spaces */
+
+enum PSL_enum_color {PSL_RGB = 0,
+	PSL_CMYK,
+	PSL_HSV,
+	PSL_GRAY};
+
+/* Color types */
+
+enum PSL_enum_fill {PSL_IS_STROKE = 0,
+	PSL_IS_FILL,
+	PSL_IS_FONT};
+
+/* PSL error codes */
+
+enum PSL_enum_err {PSL_BAD_VALUE = -99,	/* Bad value */
+	PSL_BAD_JUST,		/* Bad text or paragraph justification */
+	PSL_READ_FAILURE,	/* Less than 3 points */
+	PSL_NO_POLYGON,		/* Less than 3 points */
+	PSL_BAD_TEXT,		/* Text is too long */
+	PSL_BAD_WIDTH,		/* Negative line width */
+	PSL_NO_PATH,		/* Less than 2 points given as path */
+	PSL_BAD_SYMBOL,		/* Unknown symbol type */
+	PSL_BAD_SIZE,		/* Size is negative */
+	PSL_BAD_RANGE,		/* Range defined by min/max exceeds limit */
+	PSL_BAD_FLAG,		/* A flag is outside required range */
+	PSL_NO_SESSION,		/* No active session */
+	PSL_NO_ERROR = 0};	/* No errors, all is OK */
+
+/*--------------------------------------------------------------------
+ *			PSL PARAMETERS DEFINITIONS
+ *--------------------------------------------------------------------*/
+
+struct PSL_CTRL {
+	struct INIT {	/* Parameters set by user via PSL_beginplot() */
+		FILE *err;			/* Error stream (NULL means stderr)		*/
+		char *encoding;			/* The encoding name. e.g. ISO-8859-1		*/
+		char *session;			/* The session name (NULL)			*/
+		int unit;			/* 0 = cm, 1 = inch, 2 = meter			*/
+		int copies;		/* Number of copies for this plot		*/
+		double page_rgb[4];		/* RGB color for background paper [white]	*/
+		double page_size[2];		/* Width and height of paper used in points	*/
+		double magnify[2];		/* Global scale values [1/1]			*/
+	} init;
+	struct CURRENT {	/* Variables and settings that changes via PSL_* calls */
+		char string[PSL_BUFSIZ];	/* Last text string plotted			*/
+		char style[512];		/* Current setdash pattern			*/
+		char bw_format[8];		/* Format used for grayshade value		*/
+		char rgb_format[64];		/* Same, for RGB color triplets			*/
+		char hsv_format[64];		/* Same, for HSV color triplets	(HSB in PS)	*/
+		char cmyk_format[64];		/* Same, for CMYK color quadruples		*/
+		char transparency_mode[16];	/* PDF transparency mode			*/
+		double linewidth;		/* Current pen thickness			*/
+		double rgb[3][4];		/* Current stroke, fill, and fs fill rgb	*/
+		double offset;			/* Current setdash offset			*/
+		double fontsize;		/* Current font size				*/
+		double subsupsize;		/* Fractional size of super/sub-scripts		*/
+		double scapssize;		/* Fractional size of small caps		*/
+		double sub_down;		/* Fractional fontsize shift down for subscript */
+		double sup_up[2];		/* Fractional fontsize shift up for superscript */
+						/* [0] is for lower-case, [1] is for uppercase  */
+		int nclip;			/* Clip depth 					*/
+		int font_no;		/* Current font number				*/
+		int outline;		/* Current outline				*/
+	} current;
+	struct INTERNAL {	/* Variables used internally only */
+		char *SHAREDIR;			/* Pointer to path of directory with pslib subdirectory */
+		char *USERDIR;			/* Pointer to path of directory with user definitions (~/.gmt) */
+		char *user_image[PSL_N_PATTERNS];	/* Name of user patterns		*/
+		char origin[2];			/* 'r', 'a', 'f', 'c' depending on reference for new origin x and y coordinate */
+		double offset[2];		/* Origin offset [1/1]				*/
+		double p_width;			/* Paper width in points, set in PSL_beginplot();	*/
+		double p_height;		/* Paper height in points, set in PSL_beginplot();	*/
+		double dpu;			/* PS dots per unit.  Must be set through PSL_beginplot();		*/
+		double dpp;			/* PS dots per point.  Must be set through PSL_beginplot();		*/
+		double x2ix;			/* Scales user x to PS dots			*/
+		double y2iy;			/* Scales user y to PS dots			*/
+		double p2u;			/* Scales dimensions in points (e.g., fonts, linewidths) to user units (e.g. inch)		*/
+		double axis_limit[4];		/* The current xmin, xmax, ymin, ymax settings for axes */
+		double axis_pos[2];		/* Lower left placement for axes		*/
+		double axis_dim[2];		/* Lengths of axes 				*/
+		int verbose;		/* Verbosity level (0-4): see PSL_MSG_*	*/
+		int comments;		/* true for writing comments to output, false strips all comments */
+		int overlay;		/* true if overlay (-O)				*/
+		int landscape;		/* true = Landscape, false = Portrait		*/
+		int text_init;		/* true after PSL_text.ps has been loaded	*/
+		int image_format;		/* 0 writes images in ascii, 2 uses binary	*/
+		int N_FONTS;		/* Total no of fonts;  To add more, modify the file CUSTOM_font_info.d */
+		int compress;		/* Compresses images with (1) RLE or (2) LZW (3) DEFLATE or (0) None */
+		int deflate_level; /* Compression level for DEFLATE (1-9, default 0) */
+		int color_mode;		/* 0 = rgb, 1 = cmyk, 2 = hsv (only 1-2 for images)	*/
+		int line_cap;		/* 0, 1, or 2 for butt, round, or square [butt]	*/
+		int line_join;		/* 0, 1, or 2 for miter, arc, or bevel [miter]	*/
+		int miter_limit;		/* Acute angle threshold 0-180; 0 means PS default [0] */
+		int ix, iy;		/* Absolute coordinates of last point		*/
+		int n_userimages;		/* Number of specified custom patterns		*/
+		int x0, y0;		/* x,y PS offsets				*/
+		FILE *fp;			/* PS output file pointer. NULL = stdout	*/
+		struct PSL_FONT {
+			double height;		/* Height of A for unit fontsize */
+			char *name;		/* Name of this font */
+			int encoded;	/* true if we never should reencode this font (e.g. symbols) */
+						/* This is also changed to true after we do reencode a font */
+		} *font;	/* Pointer to array of font structures 		*/
+		struct PSL_PATTERN {
+			int nx, ny;
+			int status, depth, dpi;
+			double f_rgb[4], b_rgb[4];
+		} pattern[PSL_N_PATTERNS*2];
+	} internal;
+};
+
+struct imageinfo {
+	int magic;		/* magic number */
+	int width;		/* width (pixels) of image */
+	int height;		/* height (pixels) of image */
+	int depth;		/* depth (1, 8, or 24 bits) of pixel; 0 for EPS */
+	int length;		/* length (bytes) of image */
+	int type;		/* type of file; see RT_* below */
+	int maptype;	/* type of colormap; see RMT_* below */
+	int maplength;	/* length (bytes) of following map */
+	int xorigin;	/* x-coordinate of origin (EPS only) */
+	int yorigin;	/* y-coordinate of origin (EPS only) */
+	/* color map follows for maplength bytes, followed by image */
+};
+
+#define	RAS_MAGIC	0x59a66a95	/* Magic number for Sun rasterfile */
+#define EPS_MAGIC	0x25215053	/* Magic number for EPS file */
+#define RT_OLD		0		/* Old-style, unencoded Sun rasterfile */
+#define RT_STANDARD	1		/* Standard, unencoded Sun rasterfile */
+#define RT_BYTE_ENCODED	2		/* Run-length-encoded Sun rasterfile */
+#define RT_FORMAT_RGB	3		/* [X]RGB instead of [X]BGR Sun rasterfile */
+#define RT_EPS		4		/* Encapsulated PostScript format */
+#define RMT_NONE	0		/* maplength is expected to be 0 */
+#define RMT_EQUAL_RGB	1		/* red[maplength/3], green[], blue[] follow */
+
+/* Public functions */
+
+EXTERN_MSC struct PSL_CTRL *New_PSL_Ctrl (char *session);
+EXTERN_MSC int PSL_beginaxes (struct PSL_CTRL *PSL, double llx, double lly, double width, double height, double x0, double y0, double x1, double y1);
+EXTERN_MSC int PSL_beginclipping (struct PSL_CTRL *PSL, double *x, double *y, int n, double rgb[], int flag);
+EXTERN_MSC int PSL_beginlayer (struct PSL_CTRL *PSL, int layer);
+EXTERN_MSC int PSL_beginplot (struct PSL_CTRL *PSL, FILE *fp, int orientation, int overlay, int color_mode, char origin[], double offset[], double page_size[], char *title, int font_no[]);
+EXTERN_MSC int PSL_beginsession (struct PSL_CTRL *PSL, unsigned int search, char *sharedir, char *userdir);
+EXTERN_MSC int PSL_endaxes (struct PSL_CTRL *PSL);
+EXTERN_MSC int PSL_endclipping (struct PSL_CTRL *PSL, int mode);
+EXTERN_MSC int PSL_endlayer (struct PSL_CTRL *PSL);
+EXTERN_MSC int PSL_endplot (struct PSL_CTRL *PSL, int lastpage);
+EXTERN_MSC int PSL_endsession (struct PSL_CTRL *PSL);
+EXTERN_MSC int PSL_plotarc (struct PSL_CTRL *PSL, double x, double y, double radius, double az1, double az2, int type);
+EXTERN_MSC int PSL_plotaxis (struct PSL_CTRL *PSL, double annotation_int, char *label, double annotfontsize, int side);
+EXTERN_MSC int PSL_plotbitimage (struct PSL_CTRL *PSL, double x, double y, double xsize, double ysize, int justify, unsigned char *buffer, int nx, int ny, double f_rgb[], double b_rgb[]);
+EXTERN_MSC int PSL_plotcolorimage (struct PSL_CTRL *PSL, double x, double y, double xsize, double ysize, int justify, unsigned char *buffer, int nx, int ny, int nbits);
+EXTERN_MSC int PSL_plotepsimage (struct PSL_CTRL *PSL, double x, double y, double xsize, double ysize, int justify, unsigned char *buffer, int size, int nx, int ny, int ox, int oy);
+EXTERN_MSC int PSL_plotline (struct PSL_CTRL *PSL, double *x, double *y, int n, int type);
+EXTERN_MSC int PSL_plotparagraph (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *paragraph, double angle, int justify);
+EXTERN_MSC int PSL_plotparagraphbox (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *paragraph, double angle, int justify, double offset[], int mode);
+EXTERN_MSC int PSL_plotpoint (struct PSL_CTRL *PSL, double x, double y, int pen);
+EXTERN_MSC int PSL_plotbox (struct PSL_CTRL *PSL, double x0, double y0, double x1, double y1);
+EXTERN_MSC int PSL_plotpolygon (struct PSL_CTRL *PSL, double *x, double *y, int n);
+EXTERN_MSC int PSL_plotsegment (struct PSL_CTRL *PSL, double x0, double y0, double x1, double y1);
+EXTERN_MSC int PSL_plotsymbol (struct PSL_CTRL *PSL, double x, double y, double param[], int symbol);
+EXTERN_MSC int PSL_plottext (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *text, double angle, int justify, int mode);
+EXTERN_MSC int PSL_plottextbox (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *text, double angle, int justify, double offset[], int mode);
+EXTERN_MSC int PSL_plottextline (struct PSL_CTRL *PSL, double x[], double y[], int np[], int n_segments, void *arg1, void *arg2, char *label[], double angle[], int nlabel_per_seg[], double fontsize, int justify, double offset[], int mode);
+EXTERN_MSC int PSL_loadimage (struct PSL_CTRL *PSL, char *file, struct imageinfo *header, unsigned char **image);
+EXTERN_MSC int PSL_setcolor (struct PSL_CTRL *PSL, double rgb[], int mode);
+EXTERN_MSC int PSL_setdefaults (struct PSL_CTRL *PSL, double xyscales[], double page_rgb[], char *encoding);
+EXTERN_MSC int PSL_setdash (struct PSL_CTRL *PSL, char *pattern, double offset);
+EXTERN_MSC int PSL_setfill (struct PSL_CTRL *PSL, double rgb[], int outline);
+EXTERN_MSC int PSL_setfont (struct PSL_CTRL *PSL, int font_no);
+EXTERN_MSC int PSL_setfontdims (struct PSL_CTRL *PSL, double supsub, double scaps, double sup_lc, double sup_uc, double sdown);
+EXTERN_MSC int PSL_setformat (struct PSL_CTRL *PSL, int n_decimals);
+EXTERN_MSC int PSL_setlinecap (struct PSL_CTRL *PSL, int cap);
+EXTERN_MSC int PSL_setlinejoin (struct PSL_CTRL *PSL, int join);
+EXTERN_MSC int PSL_setlinewidth (struct PSL_CTRL *PSL, double linewidth);
+EXTERN_MSC int PSL_setmiterlimit (struct PSL_CTRL *PSL, int limit);
+EXTERN_MSC int PSL_setorigin (struct PSL_CTRL *PSL, double x, double y, double angle, int mode);
+EXTERN_MSC int PSL_setparagraph (struct PSL_CTRL *PSL, double line_space, double par_width, int par_just);
+EXTERN_MSC int PSL_setpattern (struct PSL_CTRL *PSL, int image_no, char *imagefile, int image_dpi, double f_rgb[], double b_rgb[]);
+EXTERN_MSC int PSL_settransparencymode (struct PSL_CTRL *PSL, const char *mode);
+EXTERN_MSC int PSL_definteger (struct PSL_CTRL *PSL, const char *param, int value);
+EXTERN_MSC int PSL_defpen (struct PSL_CTRL *PSL, const char *param, double width, char *style, double offset, double rgb[]);
+EXTERN_MSC int PSL_defpoints (struct PSL_CTRL *PSL, const char *param, double fontsize);
+EXTERN_MSC int PSL_defcolor (struct PSL_CTRL *PSL, const char *param, double rgb[]);
+EXTERN_MSC int PSL_deftextdim (struct PSL_CTRL *PSL, const char *dim, double fontsize, char *text);
+EXTERN_MSC int PSL_defunits (struct PSL_CTRL *PSL, const char *param, double value);
+EXTERN_MSC unsigned char *psl_gray_encode (struct PSL_CTRL *PSL, int *nbytes, unsigned char *input);
+EXTERN_MSC char * PSL_makepen (struct PSL_CTRL *PSL, double linewidth, double rgb[], char *pattern, double offset);
+
+/* Other deep level routines that are useful */
+EXTERN_MSC int psl_ix (struct PSL_CTRL *PSL, double value);
+EXTERN_MSC int psl_iy (struct PSL_CTRL *PSL, double value);
+EXTERN_MSC int psl_iz (struct PSL_CTRL *PSL, double value);
+EXTERN_MSC int psl_ip (struct PSL_CTRL *PSL, double value);
+EXTERN_MSC void psl_set_txt_array (struct PSL_CTRL *PSL, const char *param, char *array[], int n);
+EXTERN_MSC int psl_encodefont (struct PSL_CTRL *PSL, int font_no);
+EXTERN_MSC void psl_set_int_array (struct PSL_CTRL *PSL, const char *param, int *array, int n);
+EXTERN_MSC char *psl_putcolor (struct PSL_CTRL *PSL, double rgb[]);
+
+/* Used indirectly by macro PSL_free and FORTRAN wrapper PSL_free_ . */
+EXTERN_MSC int PSL_free_nonmacro (void *addr);
+
+/* Definition for printing a message. When DEBUG is on, also print source file and line number.
+ * Use this for various progress statements, debugging to see certain variables, and even fatal
+ * error messages. */
+/* For FORTRAN there is PSL_command_ that only accepts one text argument */
+EXTERN_MSC int PSL_command (struct PSL_CTRL *C, const char *format, ...);
+EXTERN_MSC int PSL_comment (struct PSL_CTRL *C, const char *format, ...);
+EXTERN_MSC int PSL_initerr (struct PSL_CTRL *C, const char *format, ...);
+EXTERN_MSC int PSL_message (struct PSL_CTRL *C, int level, const char *format, ...);
+EXTERN_MSC FILE *PSL_fopen (char *file, char *mode);
+
+#define PSL_free(ptr) (PSL_free_nonmacro(ptr),(ptr)=NULL) /* Cleanly set the freed pointer to NULL */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSLIB_H */
diff --git a/src/gsf/Makefile.in b/src/gsf/Makefile.in
index c1faadc..c326083 100644
--- a/src/gsf/Makefile.in
+++ b/src/gsf/Makefile.in
@@ -223,8 +223,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -241,6 +239,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -304,19 +303,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -329,8 +335,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/gsf/Makefile.template b/src/gsf/Makefile.template
deleted file mode 100644
index 1984ce7..0000000
--- a/src/gsf/Makefile.template
+++ /dev/null
@@ -1,106 +0,0 @@
-#     The MB-system:	Makefile.template  1/12/98
-#	$Id: Makefile.template 2197 2014-07-19 18:24:52Z caress $
-#
-#     Copyright (c) 1998-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/gsf directory level
-# Author:	D. W. Caress
-# Date:		January 12, 1998
-#
-# $Log: Makefile.template,v $
-# Revision 5.1  2006/03/06 21:35:24  caress
-# Changed libproj and libgsf to libmbproj and libmbgsf.
-#
-# Revision 5.0  2003/07/27 20:52:51  caress
-# Release 5.0.0
-#
-# Revision 4.4  2002/04/06 02:50:59  caress
-# Release 5.0.beta16
-#
-# Revision 4.3  2001/06/30 17:36:01  caress
-# Fixed problem with cc.
-#
-# Revision 4.2  2000/09/30  07:19:33  caress
-# Snapshot for Dale.
-#
-# Revision 4.1  1998/10/07  19:36:35  caress
-# Added ranlib.
-#
-# Revision 4.0  1998/10/04  04:30:25  caress
-# MB-System version 4.6beta
-#
-#
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -DIRIX
-ARCHIVE = ar rcv
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the gsf library, man page, and associated include files
-all:	$(LIBDIR)/libmbgsf.a \
-	$(INCDIR)/gsf.h $(INCDIR)/gsf_ft.h \
-	$(INCDIR)/gsf_enc.h $(INCDIR)/gsf_dec.h \
-	$(BINDIR)/dump_gsf
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### link the executables
-$(BINDIR)/dump_gsf:	dump_gsf.o $(LIBDIR)/libmbgsf.a
-	$(CC) $(CFLAGS) dump_gsf.o $(LIBDIR)/libmbgsf.a $(LFLAGS) \
-		-o $(BINDIR)/dump_gsf
-
-### put together the library
-$(LIBDIR)/libmbgsf.a:	gsf.o gsf_dec.o gsf_enc.o gsf_indx.o gsf_info.o
-	$(ARCHIVE) $(LIBDIR)/libmbgsf.a \
-		gsf.o gsf_dec.o gsf_enc.o gsf_indx.o gsf_info.o
-	ranlib $(LIBDIR)/libmbgsf.a
-
-### compile the source files
-gsf.o:      gsf.c $(INCDIR)/gsf.h gsf_dec.h gsf_enc.h gsf_ft.h gsf_indx.h
-	$(CC) -c $(CFLAGS) -DUSE_DEFAULT_FILE_FUNCTIONS gsf.c
-gsf_dec.o:  gsf_dec.c $(INCDIR)/gsf.h gsf_dec.h gsf_enc.h gsf_ft.h gsf_indx.h
-	$(CC) -c $(CFLAGS) gsf_dec.c
-gsf_enc.o:  gsf_enc.c $(INCDIR)/gsf.h gsf_dec.h gsf_enc.h gsf_ft.h gsf_indx.h
-	$(CC) -c $(CFLAGS) gsf_enc.c
-gsf_indx.o: gsf_indx.c $(INCDIR)/gsf.h gsf_dec.h gsf_enc.h gsf_ft.h gsf_indx.h
-	$(CC) -c $(CFLAGS) -DUSE_DEFAULT_FILE_FUNCTIONS gsf_indx.c
-gsf_info.o: gsf_info.c $(INCDIR)/gsf.h gsf_dec.h gsf_enc.h gsf_ft.h gsf_indx.h
-	$(CC) -c $(CFLAGS) gsf_info.c
-dump_gsf.o:	dump_gsf.c $(INCDIR)/gsf.h gsf_dec.h gsf_enc.h gsf_ft.h gsf_indx.h
-	$(CC) -c $(CFLAGS) dump_gsf.c
-
-### copy the include files to the include file directory
-$(INCDIR)/gsf.h:	gsf.h
-	cp gsf.h $(INCDIR)/gsf.h
-	chmod 664 $(INCDIR)/gsf.h
-$(INCDIR)/gsf_ft.h:	gsf_ft.h
-	cp gsf_ft.h $(INCDIR)/gsf_ft.h
-	chmod 664 $(INCDIR)/gsf_ft.h
-$(INCDIR)/gsf_enc.h:	gsf_enc.h
-	cp gsf_enc.h $(INCDIR)/gsf_enc.h
-	chmod 664 $(INCDIR)/gsf_enc.h
-$(INCDIR)/gsf_dec.h:	gsf_dec.h
-	cp gsf_dec.h $(INCDIR)/gsf_dec.h
-	chmod 664 $(INCDIR)/gsf_dec.h
diff --git a/src/gsf/gsf.c b/src/gsf/gsf.c
index 79c5df7..ca8ac99 100644
--- a/src/gsf/gsf.c
+++ b/src/gsf/gsf.c
@@ -256,7 +256,7 @@ gsfStat (const char *filename, long long *sz)
     struct stat stbuf;
     rc = stat(filename, &stbuf);
 #else
-#ifdef (defined __WINDOWS__) || (defined __MINGW32__)
+#if defined(__WINDOWS__) || defined(__MINGW32__)
     struct _stati64    stbuf;
     rc = _stati64(filename, &stbuf);
 #else
diff --git a/src/gsf/gsf.c b/src/gsf/gsf.c.orig
similarity index 100%
copy from src/gsf/gsf.c
copy to src/gsf/gsf.c.orig
diff --git a/src/gsf/gsf.c.rej b/src/gsf/gsf.c.rej
new file mode 100644
index 0000000..0296cee
--- /dev/null
+++ b/src/gsf/gsf.c.rej
@@ -0,0 +1,17 @@
+***************
+*** 256,262 ****
+      struct stat stbuf;
+      rc = stat(filename, &stbuf);
+  #else
+- #ifdef (defined __WINDOWS__) || (defined __MINGW32__)
+      struct _stati64    stbuf;
+      rc = _stati64(filename, &stbuf);
+  #else
+--- 256,262 ----
+      struct stat stbuf;
+      rc = stat(filename, &stbuf);
+  #else
++ #if defined(__WINDOWS__) || defined(__MINGW32__)
+      struct _stati64    stbuf;
+      rc = _stati64(filename, &stbuf);
+  #else
diff --git a/src/gsf/gsf.h b/src/gsf/gsf.h
index 0628ccf..6a5566f 100644
--- a/src/gsf/gsf.h
+++ b/src/gsf/gsf.h
@@ -169,6 +169,19 @@
 #define OPTLK
 #endif
 
+#ifdef WIN32
+#	define R_OK 04
+#	define W_OK 02
+#	define X_OK 01
+#	define F_OK 00
+#	ifndef __WINDOWS__              /* I, Joaquim Luis, understand nothing of this mess on the ways to detect if we are on Windows */
+#		define __WINDOWS__
+#	endif
+#	ifndef _WIN32
+#		define _WIN32
+#	endif
+#endif
+
 #ifdef __cplusplus
 extern          "C"
 {
@@ -2856,6 +2869,24 @@ int gsfStat (const char *filename, long long *sz);
  *
  ********************************************************************/
 
+int gsfSetDefaultScaleFactor(gsfSwathBathyPing *mb_ping);
+/********************************************************************
+ *
+ * Function Name : gsfSetDefaultScaleFactor
+ *
+ * Description : This function is used to estimate and set scale
+ *               factors for a ping record
+ *
+ * Inputs :
+ *    mb_ping - a pointer to a ping record.  The scale factors
+ *              will be set in this record.
+ *
+ * Returns : This function returns 0.
+ *
+ * Error Conditions : none
+ *
+ ********************************************************************/
+
 /********************************************************************
  *
  * Function Name : gsfGetPositionDestination
diff --git a/src/gsf/gsf.h b/src/gsf/gsf.h.orig
similarity index 100%
copy from src/gsf/gsf.h
copy to src/gsf/gsf.h.orig
diff --git a/src/gsf/gsf.h.rej b/src/gsf/gsf.h.rej
new file mode 100644
index 0000000..98bcc43
--- /dev/null
+++ b/src/gsf/gsf.h.rej
@@ -0,0 +1,65 @@
+***************
+*** 169,174 ****
+  #define OPTLK
+  #endif
+  
+  #ifdef __cplusplus
+  extern          "C"
+  {
+--- 169,187 ----
+  #define OPTLK
+  #endif
+  
++ #ifdef WIN32
++ #	define R_OK 04
++ #	define W_OK 02
++ #	define X_OK 01
++ #	define F_OK 00
++ #	ifndef __WINDOWS__			/* I, JL, understand nothing of this mess on the ways to detect if we are on Windows */
++ #		define __WINDOWS__
++ #	endif
++ #	ifndef _WIN32
++ #		define _WIN32
++ #	endif
++ #endif
++ 
+  #ifdef __cplusplus
+  extern          "C"
+  {
+***************
+*** 2856,2863 ****
+   *
+   ********************************************************************/
+  
+  /********************************************************************
+   *
+   * Function Name : gsfGetPositionDestination
+   *
+   * Description : compute a new position from an existing one.
+--- 2869,2894 ----
+   *
+   ********************************************************************/
+  
++ int gsfSetDefaultScaleFactor(gsfSwathBathyPing *mb_ping);
+  /********************************************************************
+   *
++  * Function Name : gsfSetDefaultScaleFactor
++  *
++  * Description : This function is used to estimate and set scale
++  *               factors for a ping record
++  *
++  * Inputs :
++  *    mb_ping - a pointer to a ping record.  The scale factors
++  *              will be set in this record.
++  *
++  * Returns : This function returns 0.
++  *
++  * Error Conditions : none
++  *
++  ********************************************************************/
++ 
++ /********************************************************************
++  *
+   * Function Name : gsfGetPositionDestination
+   *
+   * Description : compute a new position from an existing one.
diff --git a/src/html/ChangeLog.txt b/src/html/ChangeLog.txt
index 6ddc414..9cf06c8 100644
--- a/src/html/ChangeLog.txt
+++ b/src/html/ChangeLog.txt
@@ -1,7 +1,7 @@
 -------------------------------------------------------------------------------
 MB-SYSTEM CHANGELOG FILE:
 -------------------------------------------------------------------------------
-Version: $Id: ChangeLog.txt 2219 2014-12-11 21:22:25Z caress $
+Version: $Id: ChangeLog.txt 2252 2015-07-01 19:35:37Z caress $
 -------------------------------------------------------------------------------
 
 This file lists changes to the source code of the MB-System open
@@ -16,6 +16,28 @@ Here "*" denotes source distribution release made available for ftp download.
 Releases without an "*" are discrete revisions available from the source code
 archive at http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System.
 
+* Version 5.5.2252       July 1, 2015
+* Version 5.5.2251       June 30, 2015
+  Version 5.5.2250       June 29, 2015
+  Version 5.5.2249       June 26, 2015
+* Version 5.5.2248       May 31, 2015
+  Version 5.5.2247       May 29, 2015
+* Version 5.5.2246       May 27, 2015
+* Version 5.5.2243       May 22, 2015
+* Version 5.5.2242       May 16, 2015
+  Version 5.5.2241       May 12, 2015
+  Version 5.5.2240       May 8, 2015
+  Version 5.5.2239       May 6, 2015
+  Version 5.5.2238       April 14, 2015
+  Version 5.5.2237       March 23, 2015
+  Version 5.5.2234       March 5, 2015
+* Version 5.5.2233       February 23, 2015
+  Version 5.5.2232       February 21, 2015
+  Version 5.5.2231       February 20, 2015
+  Version 5.5.2230       February 18, 2015
+  Version 5.5.2229       February 14, 2015
+  Version 5.5.2228       February 6, 2015
+* Version 5.4.2220       January 22, 2015 (Last GMT4-compatible archive revision, released February 27, 2015)
   Version 5.4.2219       December 11, 2014
   Version 5.4.2218       December 4, 2014
   Version 5.4.2217       December 1, 2014
@@ -192,6 +214,281 @@ archive at http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System.
   Version 5.0.beta00     April 6, 2001
 
 -------------------------------------------------------------------------------
+MB-SYSTEM VERSION 5.5 RELEASE NOTES:
+-------------------------------------------------------------------------------
+
+-----> 5.5.2252 (July 1, 2015)
+
+Mbedit, mbnavedit, mbnavadjust, mbvelocitytool: Fix X11 font initialization
+problem created in the 2251 commit.
+
+-----> 5.5.2251 (June 30, 2015)
+
+Mblist, mbnavlist, mbctdlist: Changed time outputs so that decimal second
+values will be formatted according to the locale (e.g. decimal delineation by
+commas in Europe).
+
+Mbedit, mbnavedit, mbnavadjust, mbvelocitytool, mbgrdviz, mbeditviz: Set up
+preprocessor defines to allow fonts to be defined using the CFLAGS
+environment variable.
+
+-----> 5.5.2250 (June 29, 2015)
+
+Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Removed call to X11
+function XtSetLanguageProc() in all graphical tools. This call apparently
+causes the program locale to be reset according system defaults, even if the
+program implicitly begins in the standard C locale. If the system locale uses
+"," rather than "." as the decimal point marker (e.g. a normal European locale),
+then a GMT 5 initialization will probably fail on reading fonts, at least on
+many if not all Linux distributions. Thanks to Giancarlo Troni for figuring this
+one out.
+
+General: Added mbio/mb_platform.c to the archive. This source file includes the
+functions to read, write, and use platform, sensor, and sensor offset definitions.
+At this time the mb_platform_*() functions are only used in mb7kpreprocess, but
+they will soon be used in mbprocess and all the preprocess programs.
+
+Mbprocess: changed application of tide corrections so that these corrections are
+applied to the platform depth values rather than the bathymetry values. The result
+is the same, but now the navigation (or trajectory) of the processed files is
+corrected in addition to the bathymetry.
+
+-----> 5.5.2249 (June 26, 2015)
+
+Format 121 (MBF_GSFGENMB): Kluge added to the GSF format i/o module to handle
+beam angles incorrectly constructed so that angles from vertical are negative
+for port side beams when all aziumuthal angles are uniformaly zero (=starboard).
+
+General: Added platform, sensor, and sensor offset definitions to mb_io.h for
+use in flexibly defining a platform consisting of many sensors with relative
+positional and angular offsets. Also added functions to read and write
+platform files using these definitions. Have not completed the function to perform
+lever arm calculations using this platform definition. Initially these functions
+will be used in mb7kpreprocess, but ultimately these will be used generally
+in MB-System.
+
+Mb7kpreprocess: initial implementation using the new platform file and structure
+definitions.
+
+-----> 5.5.2248 (May 31, 2015)
+
+Mbgrdviz and mbview: Fixed casts between int and pointer that seem to be
+responsible for mbgrdviz crashes.
+
+-----> 5.5.2247 (May 29, 2015)
+
+General: Cleaned up missing function prototypes through much of the codebase
+(excepting externally written libraries gsf, sapi, bsio) in an effort to fix
+crashes of mbgrdviz and other programs.
+
+-----> 5.5.2246 (May 27, 2015)
+
+Mbswath, mbcontour, mbgrdtiff: Updated GMT5 header files in src/gmt to enable
+building on Ubuntu Linux, CentOs Linux, and CygWin while maintaining
+compatibility with GMT 5.1.2.
+
+Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Incomplete tweaks to
+font handling to enable use of fonts other than Helvetica, Times, and Courier.
+
+-----> 5.5.2243 (May 22, 2015)
+
+Rewrote the configure.ac file to fix logic flaws in the configure script.
+
+-----> 5.5.2242 (May 16, 2015)
+
+Mbswath, mbcontour, mbgrdtiff: Updated files in src/gmt for compatibility with
+GMT 5.1.2.
+
+-----> 5.5.2241 (May 12, 2015)
+
+Format 59 (MBF_EM710MBA): Fixed flag causing erroneous warning that beam flags
+are not supported for this format (beam flags are supported).
+
+Many source files: further changes to precompiler directives suggested by Joaquim Luis
+in order to enable building under Windows.
+
+-----> 5.5.2240 (May 8, 2015)
+
+Format 241 (MBF_WASSPENL): Fixed recognition of *.nwsf suffix.
+
+Mbclean: fixed bug in beam position calculation identified by Joaquim Luis.
+
+-----> 5.5.2239 (May 6, 2015)
+
+Format 241 (MBF_WASSPENL): Now supports WASSP multibeam data conforming to
+the WASSP ICD 2.4. MB-System is storing beam flags in unused bytes in the
+existing CORBATHY data records (specifically the "empty" field in the
+CORBATHY beam data specified in ICD 2.4).
+
+Many source files: changes to precompiler directives suggested by Joaquim Luis
+in order to enable building under Windows.
+
+Mbnavadjust: Modified the inversion to separate the vertical and lateral
+covariance so that lateral offsets do not bleed into the vertical offset
+model.
+
+Mb7kpreprocess: Fixed bug that treated null soundings as good for datasets
+without detection records.
+
+Mbdumpesf: Added capability to output in the edit save file format in addition
+to ASCII text, and to ignore specified types of edit events (e.g. copy an esf
+file while removing all beam null events).
+
+Build system: Fixed bug that caused configure to fail if netCDF has a pkg-config
+installation while GMT5 is in a specified but nonstandard location.
+
+-----> 5.5.2238 (April 15, 2015)
+
+Mbnavadjust: Recast and improved the inversion. Added a "perturbation" model
+display which does not include the average offsets between the individual surveys
+in projects involving multiple surveys.
+
+Mbcontour, mbswath, mbgrdtiff: Included fixes suggested by Joaquim Luis for
+compatibility with the next GMT5 release.
+
+Mbclean: Removed -M3 and -M4 options that previously caused the program to null
+(or zero) rather than flag bad soundings. This is an obsolete feature that only
+made sense prior to existence of mbprocess.
+
+Mbbackangle: Fixed mbm_grdplot call to no longer use an obsolete option.
+
+-----> 5.5.2237 (March 23, 2015)
+
+Mbnavadjust, mbnavedit: Removed references to GMT and netCDF in the Makefile.am
+file in both source directories.
+
+-----> 5.5.2236 (March 23, 2015)
+
+Mbnavadjust, mbnavadjustmerge: Added a new type of constraint referred to as a
+global tie. Each data section can have one of its navigation points tied to
+the fixed global frame of reference with a specified x, y, z offset (or just x
+and y, or just z) and x, y, and z uncertainties in the offset values. These
+global ties are set using mbnavadjustmerge. The relevant mbnavadjustmerge
+commands are:
+    --set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
+    --set-global-tie-xyz=file:section[:snav]
+    --set-global-tie-xyonly=file:section[:snav]
+    --set-global-tie-zonly=file:section[:snav]
+
+Mbnavadjustmerge: Added ability to unset (delete) global ties and crossing ties.
+The relevant mbnavadjustmerge commands are:
+    --unset-global-tie=file:section
+    --unset-tie=file1:section1/file2:section2
+
+Mbnavadjust, mbnavadjustmerge: Explicitly added references to libgmt and libpsl in
+the src/mbnavadjust/Makefile.am file so that the mbnavadjust and mbnavadjustmerge
+executables are linked to those libraries. This is to solve a mysterious dependency
+of mbnavadjust on libgmt on CentOs6 - the program was failing due inability to find
+libgmt.so.5 even though the code does not reference any GMT or GMT5 function or header
+file. Presumably this change will go away when the mystery is solved.
+
+Mbsslayout: fixed automatically generated plottin script.
+
+Mbm_route2mission: Added multibeam maximum range value.
+
+-----> 5.5.2234 (March 5, 2015)
+
+Plot macros (mbm_grdplot, mbm_grd3dplot, mbm_grdtiff, mbm_histplot, mbm_plot,
+mbm_xyplot): Now generate plotting scripts that will not attempt to display the
+plot on the screen if invoked with a "-N" command line argument.
+
+Format 64 (MBF_MR1PRVR2): Added include of <sys/time.h> in mbbs_defines.h to
+facilitate building under cygwin.
+
+Multi-macros (mbm_multiprocess, mbm_multicopy, mbm_multidatalist): Changed to
+use datalist.mb-1 as default input and to use 4 as the default number of CPUs.
+
+Mbedit: Added fast scroll through a file if the forward or back mouse buttons
+are held down more than 2 seconds.
+
+Mbextractsegy, mbsslayout: Changed output section/line plotting script so that
+it will not attempt to display the plot on the screen if invoked with a "-N"
+command line argument.
+
+Mbprocess: Reduced informational output when not in verbose mode to make the
+output from use of mbm_multiprocess cleaner.
+
+-----> 5.5.2233 (February 23, 2015)
+
+Release 5.5.2233
+
+Mbm_grdplot, mbm_grdtiff: Generated plot scripts now set foregound and background
+colors based on the -D option.
+
+Mbmroute2mission: Now allows the maximum planned climb rate of the AUV to be
+specified with the -U option
+
+-----> 5.5.2232 (February 21, 2015)
+
+Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbhistplot: Changed handling of gmt defaults
+so that any local gmt.conf file is deleted before any gmtset calls are made, and
+the resulting gmt.conf file is deleted before the plot script ends.
+
+Mbswath: fixed calculation of beam or pixel footprints in mode requesting real
+footprint plotting.
+
+-----> 5.5.2231 (February 20, 2015)
+
+Mb7kpreprocess: Switched beam angle calculation to the mb_beaudoin() function
+already used by mbkongsbergpreprocess (contributed by Jonathan Beaudoin).
+
+Mbm_bpr: Made compatible with GMT5.
+
+-----> 5.5.2230 (February 18, 2015)
+
+Mbgrdtiff: Fixed ordering of rows and columns in the output image.
+
+Mbm_route2mission: Added output of a mission alititude profile plot.
+
+Mbauvloglist: Added capability of binary output.
+
+Mb7kpreprocess: Fixed so that bathymetry calculation uses roll merged at
+the bottom detect time for all of the possible combinations of Reson 7k
+data record types.
+
+Mbpreprocess: Fixed to exclude zero longitude or lattitude values from the
+tables used for interpolation onto ping times.
+
+Mbrolltimelag: Fixed automatically generated roll-slope correlation plot.
+
+-----> 5.5.2229 (February 14, 2015)
+
+Format 121 (MBF_GSFGENMB): The i/o module will now allocate and initialize arrays
+of beamflags and alongtrack distance when those are not included in the input file.
+
+Mbfilter: removed failing check for existance of sidescan data.
+
+Mbsegygrid: flipped grid convention for compatibility with GMT5.
+
+Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_histplot: further changes for compatibility
+with GMT5.
+
+Mbm_route2mission: Compatibility with GMT5.
+
+Mbcontour, mbswath: More changes for compatibility with GMT5.
+
+-----> 5.5.2228 (February 6, 2015)
+
+Install_makefiles: the old install_makefiles build system no longer 
+functions and has been removed.
+
+Mbgrid: When using the two-step weighted footprint slope algorithm, mbgrid
+only reads files on the second pass through the input datalist that contained
+useful data in the first pass.
+
+Major changes made to integrate MB-System with GMT5:
+  The code will no longer compile or work with GMT4.5.
+  Changes include:
+    -updating functions in libmbaux  that read and write GMT grids
+    -deletion of src/mbaux/mb_pslibface.c
+    -changes to all programs that read or write GMT grids,
+    -the former programs mbcontour, mbswath, and mbgrdtiff are now GMT5
+      modules built as part of a shared library.
+    -changes to all of the plot macros (e.g. mbm_grdplot) that make use of GMT
+
+Format 88 (MBF_RESON7KR): Update Reson 7k i/o module to handle TVG records.
+
+-------------------------------------------------------------------------------
 MB-SYSTEM VERSION 5.4 RELEASE NOTES:
 -------------------------------------------------------------------------------
 
diff --git a/src/html/Makefile.in b/src/html/Makefile.in
index 799f1b0..2e46a8a 100644
--- a/src/html/Makefile.in
+++ b/src/html/Makefile.in
@@ -170,8 +170,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -188,6 +186,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -251,19 +250,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -276,8 +282,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/html/Makefile.template b/src/html/Makefile.template
deleted file mode 100644
index 81d16df..0000000
--- a/src/html/Makefile.template
+++ /dev/null
@@ -1,45 +0,0 @@
-#     The MB-system:	Makefile.template  5/21/2013
-#	$Id: Makefile.template 2183 2014-04-16 19:54:45Z caress $
-#
-#     Copyright (c) 2013-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/html directory level
-# Author:	D. W. Caress
-# Date:		May 21, 2013
-#
-# $Log: Makefile.template,v $
-#
-#
-
-### sets locations of vital objects
-HTMLDIR = ../../share/doc/mbsystem/html
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all copies the html files to the share/doc/mbsystem/html file directory
-all:    ../../share ../../share/doc ../../share/doc/mbsystem ../../share/doc/mbsystem/html
-	cp *.html *.txt *.gif *.jpg ChangeLog.txt $(HTMLDIR)
-	chmod 664 $(HTMLDIR)/*.html $(HTMLDIR)/*.txt $(HTMLDIR)/*.gif $(HTMLDIR)/*.jpg $(HTMLDIR)/ChangeLog.txt
-../../share:
-	mkdir ../../share
-../../share/doc:
-	mkdir ../../share/doc
-../../share/doc/mbsystem:
-	mkdir ../../share/doc/mbsystem
-../../share/doc/mbsystem/html:
-	mkdir ../../share/doc/mbsystem/html
-
-### make clean removes the object files
-clean:
-	rm -r -f $(HTMLDIR)
diff --git a/src/html/index.html b/src/html/index.html
index 3a7e5c0..e1c1169 100644
--- a/src/html/index.html
+++ b/src/html/index.html
@@ -300,7 +300,7 @@ University</a></dt>
   </dt>
 </dl>
 <center>
-<p>Last Updated: $Id: index.html 2180 2014-04-02 20:58:34Z caress $</p>
+<p>Last Updated: $Id: mbsystem_home.html 2180 2014-04-02 20:58:34Z caress $</p>
 </center>
 <p></p>
 <div align="center">
diff --git a/src/html/man2html b/src/html/man2html
new file mode 100755
index 0000000..39eba3a
Binary files /dev/null and b/src/html/man2html differ
diff --git a/src/html/mbauvloglist.html b/src/html/mbauvloglist.html
index e2c897e..ddb4cd7 100644
--- a/src/html/mbauvloglist.html
+++ b/src/html/mbauvloglist.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbauvloglist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  21 October 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  18 February 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -28,7 +28,7 @@ Version 5.0
 <H2>SYNOPSIS</H2>
 
 <B>mbauvloglist</B> <B>-I</B><I>file</I> [<B>-F</B><I>printformat</I> <B>-L</B><I>lonflip</I>
-<B>-O</B><I>list</I> <B>-P -S</B> <B>-V -H</B> ]
+<B>-M</B><I>mode</I> <B>-N</B><I>navfile</I> <B>-O</B><I>list</I> <B>-P -S</B> <B>-V -H</B> ]
 <P>
 <A NAME="lbAE"> </A>
 <H2>DESCRIPTION</H2>
@@ -85,6 +85,15 @@ to specify each of the desired values in the desired order of columns. The <B>-F
 can be used to set the printing format. Otherwise, the default format specified in the
 log header will be used.
 <P>
+The <B>-M</B><I>mode</I> option sets the output mode. By default, the output will be ASCII
+text with tab characters between fields, which is equivalent to <B>-M</B><I>0</I>. If
+fImode = 1, then the output will be ASCII text with comma delimiters. If <I>mode</I> = 1,
+then the output will binary values (8-btye double or 4-byte int values) with nothing between
+the desired fields.
+<P>
+For log files that do not include navigation, an external navigation file in the "fnv"
+format may be specified using the <B>-N</B> option. 
+<P>
 As of August 2009, the contents of the MBARI Mapping AUV missions logs are:
 <P>
 DropWeight.log Contents:
@@ -349,6 +358,38 @@ then the longitude values will be in
 the range from 0 to 360 degrees.
 Default: <B>mbauvloglist</B> uses the user default <I>lonflip</I> set using
 <B>mbdefaults</B>.
+<DT><B>-M</B>
+
+<DD>
+<I>mode</I>
+<BR>
+
+Specifies the output mode. If <I>mode</I> = 0, then the output is
+ASCII text with tab delimiters between fields. If <I>mode</I> = 1,
+then the output is ASCII text with comma delimiters between fields.
+If <I>mode</I> = 2, then the output is binary with no values or breaks
+between fields. Default: ASCII text with tab delimiters.
+<DT><B>-N</B>
+
+<DD>
+<I>navfile</I>
+<BR>
+
+Specifies a navigation file in the "fnv" format that contains position,
+heading, sensor depth, and attitude data. Values merged (interpolated)
+from these data can be specified for output using the
+<BR>     mergeLon
+<BR>     mergeLat
+<BR>     mergeHeading
+<BR>     mergeSpeed
+<BR>     mergeDraft
+<BR>     mergeSensordepth
+<BR>     mergeRoll
+<BR>     mergePitch
+<BR>     mergeHeave
+<BR>
+
+valuenames in the <B>-O</B> option.
 <DT><B>-O</B>
 
 <DD>
@@ -357,6 +398,24 @@ Default: <B>mbauvloglist</B> uses the user default <I>lonflip</I> set using
 
 Causes <B>mbauvloglist</B> to output the specified value. This option can be
 given multiple times, and the values will be output in the order specified.
+The valid valuename strings consist of those defined in the header of the
+log file being parsed, plus the following:
+<BR>     zero
+<BR>     timeTag
+<BR>     mergeLon
+<BR>     mergeLat
+<BR>     mergeHeading
+<BR>     mergeSpeed
+<BR>     mergeDraft
+<BR>     mergeSensordepth
+<BR>     mergeRoll
+<BR>     mergePitch
+<BR>     mergeHeave
+<BR>
+
+All of the special values are double values. Those beginning with "merge"
+derive from interpolation of data from an external navigation file
+specified using the <B>-N</B> option.
 <DT><B>-P</B>
 
 <DD>
@@ -422,7 +481,7 @@ Indubitably.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 21 October 2013</P></CENTER>
+Last Updated: 18 February 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbclean.html b/src/html/mbclean.html
index cfdba96..0d284e5 100644
--- a/src/html/mbclean.html
+++ b/src/html/mbclean.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbclean</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  1 December 2014 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  14 April 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -287,13 +287,7 @@ are handled.
 <BR> <TT>       </TT><TT>        </TT><TT>        </TT>The flagged beam is the one furthest from the local<BR>
 <BR> <TT>       </TT><TT>        </TT><TT>        </TT>median depth.<BR>
 <BR> <TT>       </TT><I>mode</I> = 2:<TT>       </TT>Flags both beams associated with each outlier slope.<BR>
-<BR> <TT>       </TT><I>mode</I> = 3:<TT>       </TT>Zeros one beam associated with each outlier slope.<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>The zeroed beam is the one furthest from the local<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>median depth.<BR>
-<BR> <TT>       </TT><I>mode</I> = 4:<TT>       </TT>Zeros both beams associated with each outlier slope.<BR>
-If the data format of the input file
-prohibits storage of negative depths, an error message will be output
-and the program will exit. Default: <I>mode</I> = 1.
+Default: <I>mode</I> = 1.
 <DT><B>-P</B>
 
 <DD>
@@ -465,7 +459,6 @@ is flagged. Here is an example of the nonverbose output:
 <TT>        </TT>0 excessive spikes identified<BR>
 <BR> <TT>       </TT>1665 beams flagged<BR>
 <BR> <TT>       </TT>0 beams unflagged<BR>
-<BR> <TT>       </TT>0 beams zeroed<BR>
 <P>
 <BR> <TT>       </TT>Processing 0002_20020425_011607.mb57<BR>
 <BR> <TT>       </TT>259 bathymetry data records processed<BR>
@@ -479,7 +472,6 @@ is flagged. Here is an example of the nonverbose output:
 <TT>        </TT>0 excessive spikes identified<BR>
 <BR> <TT>       </TT>242 beams flagged<BR>
 <BR> <TT>       </TT>0 beams unflagged<BR>
-<BR> <TT>       </TT>0 beams zeroed<BR>
 <P>
 <BR> <TT>       </TT>Processing 0003_20020425_022926.mb57<BR>
 <BR> <TT>       </TT>65 bathymetry data records processed<BR>
@@ -493,7 +485,6 @@ is flagged. Here is an example of the nonverbose output:
 <TT>        </TT>0 excessive spikes identified<BR>
 <BR> <TT>       </TT>506 beams flagged<BR>
 <BR> <TT>       </TT>0 beams unflagged<BR>
-<BR> <TT>       </TT>0 beams zeroed<BR>
 <P>
 <BR> <TT>       </TT>Processing 0004_20020425_024336.mb57<BR>
 <BR> <TT>       </TT>410 bathymetry data records processed<BR>
@@ -507,7 +498,6 @@ is flagged. Here is an example of the nonverbose output:
 <TT>        </TT>0 excessive spikes identified<BR>
 <BR> <TT>       </TT>148 beams flagged<BR>
 <BR> <TT>       </TT>0 beams unflagged<BR>
-<BR> <TT>       </TT>0 beams zeroed<BR>
 <P>
 <BR> <TT>       </TT>Processing 0005_20020425_034057.mb57<BR>
 <BR> <TT>       </TT>252 bathymetry data records processed<BR>
@@ -521,7 +511,6 @@ is flagged. Here is an example of the nonverbose output:
 <TT>        </TT>0 excessive spikes identified<BR>
 <BR> <TT>       </TT>100 beams flagged<BR>
 <BR> <TT>       </TT>0 beams unflagged<BR>
-<BR> <TT>       </TT>0 beams zeroed<BR>
 <P>
 <BR> <TT>       </TT>Processing 0006_20020425_045013.mb57<BR>
 <BR> <TT>       </TT>562 bathymetry data records processed<BR>
@@ -535,7 +524,6 @@ is flagged. Here is an example of the nonverbose output:
 <TT>        </TT>0 excessive spikes identified<BR>
 <BR> <TT>       </TT>41 beams flagged<BR>
 <BR> <TT>       </TT>0 beams unflagged<BR>
-<BR> <TT>       </TT>0 beams zeroed<BR>
 <P>
 <BR> <TT>       </TT>MBclean Processing Totals:<BR>
 <BR> <TT>       </TT>-------------------------<BR>
@@ -554,7 +542,6 @@ is flagged. Here is an example of the nonverbose output:
 <TT>        </TT>0 total excessive spikes identified<BR>
 <BR> <TT>       </TT>2702 total beams flagged<BR>
 <BR> <TT>       </TT>0 total beams unflagged<BR>
-<BR> <TT>       </TT>0 total beams zeroed<BR>
 <P>
 <A NAME="lbAI"> </A>
 <H2>SEE ALSO</H2>
@@ -592,7 +579,7 @@ bathymetry data (e.g. <B>mbedit</B>).
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 1 December 2014</P></CENTER>
+Last Updated: 14 April 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbcontour.html b/src/html/mbcontour.html
index 5c321cb..8d8ed59 100644
--- a/src/html/mbcontour.html
+++ b/src/html/mbcontour.html
@@ -11,13 +11,13 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbcontour</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  5 February 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
 <H2>NAME</H2>
 
-<B>mbcontour</B> - GMT compatible utility for color fill or color shaded relief
+<B>mbcontour</B> - <B>GMT</B> plug-in module for color fill or color shaded relief
 swath plots of swath sonar data using Postscript.
 <P>
 <A NAME="lbAC"> </A>
@@ -28,7 +28,7 @@ Version 5.0
 <A NAME="lbAD"> </A>
 <H2>SYNOPSIS</H2>
 
-<B>mbcontour</B> <B>-J</B><I>parameters</I> <B>-R</B><I>west/east/south/north
+<B>gmt mbcontour</B> <B>-J</B><I>parameters</I> <B>-R</B><I>west/east/south/north
 </I>[<B>-A</B><I>cont_int/col_int/tic_int/lab_int/tic_int/lab_hgt/lab_spacing</I>
 <B>-B</B><I>tickinfo</I> <B>-b</B><I>yr/mo/da/hr/mn/sc</I>
 <B>-C</B><I>contourfile</I> <B>-c</B><I>copies</I>
@@ -45,9 +45,10 @@ Version 5.0
 <A NAME="lbAE"> </A>
 <H2>DESCRIPTION</H2>
 
-<B>mbcontour</B> is a utility for swath contouring of swath bathymetry
-data using Postscript.  Like <B>mbswath</B>, <B>mbcontour</B>
-is fully compatible with the GMT package version 4. Two contouring
+<B>mbcontour</B> is a plug-in module for plotting bathymetry contours
+from swath sonar data using <B>GMT</B> (Generic Mapping Tools). Like
+<B>mbswath</B>, <B>mbcontour</B> is fully compatible with the <B>GMT</B>
+package version 5. Two contouring
 algorithms are available; the <B>-Z</B> option specifies which is used.
 The first, default approach draws contours between successive pings;
 this algorithm is simple and therefore fast but produces poor
@@ -82,9 +83,20 @@ of data files for use in all plotting without the performance penalty
 of <B>mbcontour</B> reading through all the data files, even those
 with no relevent data. We recommend that users maintain a ".inf"
 file for each swath data file used for gridding or plotting. The
-programs <B>mbswath</B> and <B>mbgrid</B> also use ".inf" files
+<B>GMT</B> modules <B>mbswath</B> and <B>mbgrid</B> also use ".inf" files
 in the same fashion.
 <P>
+In order for <B>GMT</B> to successfully execute <B>mbcontour</B>, the
+location of the shared library <I>libmbgmt</I> containing this module must be known to <B>GMT</B>.
+This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
+in the file gmt.conf that is part of the GMT installation, by setting
+this parameter in the file gmt.conf in the user's home directory, or by
+using the GMT module <B>gmtset</B> to modify this parameter in the
+current working directory. If, for instance, the <I>libmbgmt</I> shared library
+has been installed in the file /usr/lib/libmbgmt.dylib, then the
+GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
+<BR>        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -271,9 +283,7 @@ An "fnv" file contains only navigation information in a compact
 ASCII format (format 166), and is thus even quicker to read.
 When <B>mbcontour</B> is only generating a shiptrack plot, it will
 attempt to read an "fnv" file in lieu of the original data.
-<BR>
-
-Default: <I>infile</I> = "stdin".
+<P>
 <DT><B>-J</B>
 
 <DD>
@@ -527,7 +537,7 @@ Suppose the user has a Hydrosweep data file in the L-DEO in-house
 binary format (<B>MBIO</B> format id 24) called hs_ew9302_161_mn.mb24
 which lies in the region w/s/e/n = -32.1874/-26.6236/54.6349/56.7536.
 The following will suffice to generate a traditional four-color contour plot:
-<BR>    mbcontour -Idatalist -Jm2.44652         -R-25.7252/-23.0683/59.7415/61.0699
+<BR>    gmt mbcontour -Idatalist -Jm2.44652         -R-25.7252/-23.0683/59.7415/61.0699
 <BR>        -Ba0.5314g0.5314         -A50.0/250.0/250.0/250.0/0.01/0.1         -p1 -P -X1 -Y1 -K -V > mbcontour.ps
 <BR>
 
@@ -539,7 +549,7 @@ A plot including a navigation track can also be created using
 <B>mbcontour</B>.  Here the <B>-D</B> flag is used to add a plot
 of the ship track annotated with time marks every 0.25 hours,
 annotated time marks every hour, and day annotations every four hours:
-<BR>    mbcontour -Idatalist -Jm2.44652         -R-25.7252/-23.0683/59.7415/61.0699         -Ba0.5314g0.5314":.File hs_ew9302_161_bmn.mb24:"         -D0.25/1/4/0.1         -A50.0/250.0/250.0/250.0/0.01/0.1         -p1&nbsp [...]
+<BR>    gmt mbcontour -Idatalist -Jm2.44652         -R-25.7252/-23.0683/59.7415/61.0699         -Ba0.5314g0.5314":.File hs_ew9302_161_bmn.mb24:"         -D0.25/1/4/0.1         -A50.0/250.0/250.0/250.0/0.01/0.1        &nbsp [...]
 <P>
 <A NAME="lbAI"> </A>
 <H2>SEE ALSO</H2>
@@ -570,7 +580,7 @@ Please let us know.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 5 February 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbdumpesf.html b/src/html/mbdumpesf.html
index 36a7f50..aa40759 100644
--- a/src/html/mbdumpesf.html
+++ b/src/html/mbdumpesf.html
@@ -11,13 +11,13 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbdumpesf</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  3 May 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
 <H2>NAME</H2>
 
-<B>mbmask</B>, <B>mbdumpesf</B> - Output text version of beam edits from a binary edit save file.
+<B>mbdumpesf</B> - Output beam edits from a binary edit save file, either in the binary form or as an ASCII text dump.
 <P>
 <A NAME="lbAC"> </A>
 <H2>VERSION</H2>
@@ -27,7 +27,9 @@ Version 5.0
 <A NAME="lbAD"> </A>
 <H2>SYNOPSIS</H2>
 
-<B>mbdumpesf</B> <B>-I</B>file [<B>-V -H</B>]
+<B>mbdumpesf</B> <B>--input=</B><I>file</I>
+[<B>--output=</B><I>file</I> <B>--ignore-unflag</B> <B>--ignore-flag</B>
+<B>--ignore-filter</B> <B>--ignore-zero</B> <B>--verbose</B> <B>--help</B>]
 <P>
 <A NAME="lbAE"> </A>
 <H2>DESCRIPTION</H2>
@@ -35,8 +37,23 @@ Version 5.0
 Swath bathymetry data is typically edited either with interactive
 tools such as <B>mbedit</B> or automatic filters such as <B>mbclean</B>.
 In <B>MB-System</B>, the beam flags are stored in binary "edit save files"
-(file suffix ".esf"). The program <B>mbdumpesf</B> reads esf files and
-outputs each of the edit events as a text line to stdout.
+(file suffix ".esf"). The program <B>mbdumpesf</B> reads and outputs esf files. If
+no output file is specified, then each of the edit events is written in ASCII text
+as a single line to stdout. If an output file is specified with the <B>--output=</B><I>file</I>
+option, then the edit save data will be written to that file in binary form.
+<P>
+The four types of edit events supported by esf files are:
+<BR>
+
+<BR> <TT>       </TT>action=1: flag manually<BR>
+<BR> <TT>       </TT>action=2: unflag<BR>
+<BR> <TT>       </TT>action=3: zero - make beam null<BR>
+<BR> <TT>       </TT>action=4: flag by autofilter<BR>
+<BR>
+
+This program can be forced to ignore (exclude from the output) any of the event
+types using the options <B>--ignore-unflag</B>, <B>--ignore-flag</B>,
+<B>--ignore-filter</B>, and <B>--ignore-zero</B>.
 <P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
@@ -56,25 +73,31 @@ Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</
 <H2>MBDUMPESF OPTIONS</H2>
 
 <DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-"Edit save file" from which the edit events will be read.
-<DT><B>-V</B>
-
-<DD>
+<DT><B>--input=</B><I>file</I><DD>
+"Edit save file" (esf file) from which the edit events will be read.
+<DT><B>--output=</B><I>file</I><DD>
+Specifies output esf file. If this option is not used, then the edit
+event stream will be output to stdout as a sequence of ASCII text lines.
+<DT><B>--ignore-unflag</B><DD>
+Causes <B>mbdumpesf</B> to not output any unflag edit events read from
+the input.
+<DT><B>--ignore-flag</B><DD>
+Causes <B>mbdumpesf</B> to not output any flag edit events read from
+the input.
+<DT><B>--ignore-filter</B><DD>
+Causes <B>mbdumpesf</B> to not output any filter edit events read from
+the input.
+<DT><B>--ignore-zero</B><DD>
+Causes <B>mbdumpesf</B> to not output any zero edit events read from
+the input.
+<DT><B>--verbose</B><DD>
 Normally, <B>mbdumpesf</B> outputs one line for each edit event in
 the input esf file.  If the
-<B>-V</B> flag is given, then <B>mbdumpesf</B> also outputs the
+--verbose flag is given, then <B>mbdumpesf</B> also outputs the
 total number of each type of edit event at the end of the listing.
+<DT><B>--help</B><DD>
+This "help" flag causes the program to print out a description
+of its operation and then exit immediately.
 <P>
 </DL>
 <A NAME="lbAH"> </A>
@@ -158,7 +181,7 @@ Too simple to have any interesting problems.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 3 May 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbgrdtiff.html b/src/html/mbgrdtiff.html
index 2111f2f..a35d04b 100644
--- a/src/html/mbgrdtiff.html
+++ b/src/html/mbgrdtiff.html
@@ -11,14 +11,14 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbgrdtiff</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  28 September 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  5 February 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
 <H2>NAME</H2>
 
-<B>mbgrdtiff</B> - generates a geographically located TIFF image from
-a GMT grid file.
+<B>mbgrdtiff</B> - <B>GMT</B> plug-in module for generating a geographically
+located GeoTIFF image from a GMT grid file.
 <P>
 <A NAME="lbAC"> </A>
 <H2>VERSION</H2>
@@ -28,14 +28,19 @@ Version 5.0
 <A NAME="lbAD"> </A>
 <H2>SYNOPSIS</H2>
 
-<B>mbgrdtiff</B> <B>-C</B><I>cptfile</I> <B>-I</B><I>grdfile</I>
+<B>gmt mbgrdtiff</B> <B>-C</B><I>cptfile</I> <B>-I</B><I>grdfile</I>
 <B>-O</B><I>tiff_file</I> [<B>-H</B> <B>-K</B><I>intensfile</I> <B>-V -W</B>]
 <P>
 <A NAME="lbAE"> </A>
 <H2>DESCRIPTION</H2>
 
-<B>mbgrdtiff</B> generates a TIFF image from a <B>GMT</B> grid. The
-image generation is similar to that of the <B>GMT</B> program
+<B>mbgrdtiff</B> is a plug-in module to generate a Geographically located
+GeoTiff image from a <B>GMT</B> grid file using <B>GMT</B> (Generic Mapping Tools).
+Like <B>mbcontour</B> and <B>mbswath</B>, <B>mbgrdtiff</B>
+is fully compatible with the <B>GMT</B> package version 5.
+A GeoTIFF image file includes location, projection and scaling information.
+The image generation used by <B>mbgrdtiff</B> is identical to
+that of the Postscript-producing <B>GMT</B> program
 <B>grdimage</B>. In particular, the color map is applied from
 a <B>GMT</B> CPT file, and shading overlay grids may be applied.
 The image is 8 bits
@@ -56,6 +61,18 @@ may used in grid generation. Some software packages (e.g. Winfrog) do not
 recognize the embedded coordinate system information, and install require
 a parallel "world" file to specify the bounds and resolution. The <B>-W</B>
 option causes a world file to be generated with a ".tfw" suffix.
+<P>
+In order for <B>GMT</B> to successfully execute <B>mbgrdtiff</B>, the
+location of the shared library <I>libmbgmt</I> containing this module must be known to <B>GMT</B>.
+This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
+in the file gmt.conf that is part of the GMT installation, by setting
+this parameter in the file gmt.conf in the user's home directory, or by
+using the GMT module <B>gmtset</B> to modify this parameter in the
+current working directory. If, for instance, the <I>libmbgmt</I> shared library
+has been installed in the file /usr/lib/libmbgmt.dylib, then the
+GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
+<BR>        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -94,16 +111,18 @@ of its operation and then exit immediately.
 <I>grdfile</I>
 <BR>
 
-Sets the name of the gridded data file to be plotted.
+The first invocation of the <B>-I</B><I>grdfile</I> option sets
+the name of the gridded data file to be plotted.
 The data must be in a form acceptable to <B>GMT</B> version 3
 programs (see the <B>GMT</B> Cookbook & Technical Reference).
-<DT><B>-K</B>
+<DT><B>-I</B>
 
 <DD>
 <I>intensity_file</I>
 <BR>
 
-Sets the name of the gridded data file containing
+The second invocation of the <B>-I</B><I>grdfile</I> option sets
+the name of a gridded data file containing
 intensity values to be used for shading the map.
 Alternatively, <I>grdfile</I> may be a list of grid files
 (one filename on each line) to be used together. If a
@@ -145,7 +164,7 @@ ranging from 0 to 128 dB). In order to generate
 a 24 bit color TIFF image of the seafloor topography, we use:
 <BR>
 
-<BR> <TT>       </TT>mbgrdtiff -I PunaA_bath.grd  <TT>   </TT><TT>        </TT>-O PunaA_bath.tif  <TT>     </TT><TT>        </TT>-C bath.cpt -V<BR>
+<BR> <TT>       </TT>gmt mbgrdtiff -I PunaA_bath.grd  <TT>       </TT><TT>        </TT>-O PunaA_bath.tif  <TT>     </TT><TT>        </TT>-C bath.cpt -V<BR>
 <BR>
 
 where the color is controlled by a GMT cpt file bath.cpt
@@ -168,7 +187,7 @@ In order to generate
 an 8 bit grayscale TIFF image of the sidescan mosaic, we use:
 <BR>
 
-<BR> <TT>       </TT>mbgrdtiff -I PunaA_ss.grd  <TT>     </TT><TT>        </TT>-O PunaA_ss.tif  <TT>       </TT><TT>        </TT>-C ss.cpt -V<BR>
+<BR> <TT>       </TT>gmt mbgrdtiff -I PunaA_ss.grd  <TT> </TT><TT>        </TT>-O PunaA_ss.tif  <TT>       </TT><TT>        </TT>-C ss.cpt -V<BR>
 <BR>
 
 where the grayscale is controlled by a GMT cpt file ss.cpt
@@ -219,7 +238,7 @@ Let us know.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 28 September 2013</P></CENTER>
+Last Updated: 5 February 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbm_grd3dplot.html b/src/html/mbm_grd3dplot.html
index 5cb8e0a..eed9421 100644
--- a/src/html/mbm_grd3dplot.html
+++ b/src/html/mbm_grd3dplot.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbm_grd3dplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -51,13 +51,12 @@ Miscellaneous Options:
 <BR>
 
 [<B>-MGD</B><I>gmtdef/value</I>  <B>-MGF</B><I>scale_loc</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>m</I>]
+<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
 <B>-MGQ</B><I>dpi</I> <B>-MGS</B><I>scalefactor</I>
 <B>-MGT</B><I>x/y/size/angle/font/just/text</I>
 <B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>]
 <B>-MVM</B><I>mesh_pen</I> <B>-MVN</B>[<I>null[/r/g/b]</I>] ]
 <P>
-<P>
 <A NAME="lbAE"> </A>
 <H2>DESCRIPTION</H2>
 
@@ -78,6 +77,19 @@ provided. Truly ambitious users may edit the plot shellscript
 to take advantage of GMT capabilities not supported by this
 macro.
 <P>
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using <B>mbdefaults</B>; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a <B>-N</B> command line argument suppresses the screen
+display of the plot.
+<P>
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -595,12 +607,20 @@ of <I>scale_loc</I> are:
 <DT><B>-MGL</B>
 
 <DD>
-[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>m</I>]
+[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
 <BR>
 
-Draws a simple map scale centered on <I>lon0/lat0</I>.  Use <B>-Lx</B> to specify position in inch instead.
-Scale is calculated at latitude <I>slat</I>, <I>length</I> is in km [miles if m is appended].
+Draws a simple map scale centered on <I>lon0/lat0</I>.
 Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
+Use <B>-Lx</B> to specify the position in inches instead of map units.
+The scale is calculated at latitude <I>slat</I>; if the string "center" is used
+instead of a numerical value for <I>slat</I>, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value <I>length</I> is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append <I>+l</I> to label the scale with the
+relevant units, or append <I>+l"label"</I> to set a different label string.
 <DT><B>-MGQ</B>
 
 <DD>
@@ -761,7 +781,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
-The program
+Alternatively, invoking the plot generation shellscript with
+a <B>-N</B> command line argument also suppresses the screen
+display of the plot. The program
 to be used to display the Postscript is set
 using <B>mbdefaults</B>;
 the default value can be overridden by setting the environment
@@ -1113,7 +1135,7 @@ more complex.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 9 January 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbm_grdplot.html b/src/html/mbm_grdplot.html
index 80cd667..017a5ef 100644
--- a/src/html/mbm_grdplot.html
+++ b/src/html/mbm_grdplot.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbm_grdplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  2 August 2014 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -53,7 +53,7 @@ Miscellaneous Options:
 <BR>
 
 [<B>-MGD</B><I>gmtdef/value</I>  <B>-MGF</B><I>scale_loc</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>m</I>]
+<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
 <B>-MGQ</B><I>dpi</I> <B>-MGS</B><I>scalefactor</I>
 <B>-MGT</B><I>x/y/size/angle/font/just/text</I>
 <B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>]
@@ -95,6 +95,19 @@ to take advantage of <B>GMT</B> capabilities not supported by this
 macro. A companion macro <B>mbm_grd3dplot</B> can be used
 similarly to generate 3D perspective views of gridded data.
 <P>
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using <B>mbdefaults</B>; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a <B>-N</B> command line argument suppresses the screen
+display of the plot.
+<P>
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -632,13 +645,20 @@ of <I>scale_loc</I> are:
 <DT><B>-MGL</B>
 
 <DD>
-[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>m</I>]
+[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
 <BR>
 
-Draws a simple map scale centered
-on <I>lon0/lat0</I>.  Use <B>-Lx</B> to specify position in inch instead.
-Scale is calculated at latitude <I>slat</I>, <I>length</I> is in km [miles if m is appended].
+Draws a simple map scale centered on <I>lon0/lat0</I>.
 Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
+Use <B>-Lx</B> to specify the position in inches instead of map units.
+The scale is calculated at latitude <I>slat</I>; if the string "center" is used
+instead of a numerical value for <I>slat</I>, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value <I>length</I> is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append <I>+l</I> to label the scale with the
+relevant units, or append <I>+l"label"</I> to set a different label string.
 <DT><B>-MGQ</B>
 
 <DD>
@@ -1163,6 +1183,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
+Alternatively, invoking the plot generation shellscript with
+a <B>-N</B> command line argument also suppresses the screen
+display of the plot.
 The program
 to be used to display the Postscript is set
 using <B>mbdefaults</B>;
@@ -1607,7 +1630,7 @@ more complex.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 2 August 2014</P></CENTER>
+Last Updated: 9 January 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbm_histplot.html b/src/html/mbm_histplot.html
index 9a29df4..a9679cd 100644
--- a/src/html/mbm_histplot.html
+++ b/src/html/mbm_histplot.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbm_histplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -59,6 +59,19 @@ provided. Truly ambitious users may edit the plot shellscript
 to take advantage of GMT capabilities not supported by this
 macro.
 <P>
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using <B>mbdefaults</B>; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a <B>-N</B> command line argument suppresses the screen
+display of the plot.
+<P>
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -242,7 +255,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
-The program
+Alternatively, invoking the plot generation shellscript with
+a <B>-N</B> command line argument also suppresses the screen
+display of the plot. The program
 to be used to display the Postscript is set
 using <B>mbdefaults</B>;
 the default value can be overridden by setting the environment
@@ -392,7 +407,7 @@ Please let us know.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 9 January 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbm_plot.html b/src/html/mbm_plot.html
index 05b741e..5e51980 100644
--- a/src/html/mbm_plot.html
+++ b/src/html/mbm_plot.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbm_plot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -53,7 +53,7 @@ Miscellaneous Options:
 
 [<B>-MGD</B><I>gmtdef/value</I>
 <B>-MGF</B><I>scale_loc</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>m</I>]
+<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
 <B>-MGQ</B><I>dpi</I>
 <B>-MGT</B><I>x/y/size/angle/font/just/text</I>
 <B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>]
@@ -98,6 +98,19 @@ arguments are provided. Truly ambitious users may edit the
 plot shellscript to take advantage of MB-System and GMT
 capabilities not supported by this macro.
 <P>
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using <B>mbdefaults</B>; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a <B>-N</B> command line argument suppresses the screen
+display of the plot.
+<P>
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -655,12 +668,20 @@ of <I>scale_loc</I> are:
 <DT><B>-MGL</B>
 
 <DD>
-[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>m</I>]
+[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
 <BR>
 
-Draws a simple map scale centered on <I>lon0/lat0</I>.  Use <B>-Lx</B> to specify position in inch instead.
-Scale is calculated at latitude <I>slat</I>, <I>length</I> is in km [miles if m is appended].
+Draws a simple map scale centered on <I>lon0/lat0</I>.
 Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
+Use <B>-Lx</B> to specify the position in inches instead of map units.
+The scale is calculated at latitude <I>slat</I>; if the string "center" is used
+instead of a numerical value for <I>slat</I>, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value <I>length</I> is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append <I>+l</I> to label the scale with the
+relevant units, or append <I>+l"label"</I> to set a different label string.
 <DT><B>-MGQ</B>
 
 <DD>
@@ -1191,7 +1212,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
-The program
+Alternatively, invoking the plot generation shellscript with
+a <B>-N</B> command line argument also suppresses the screen
+display of the plot. The program
 to be used to display the Postscript is set
 using <B>mbdefaults</B>;
 the default value can be overridden by setting the environment
@@ -1552,7 +1575,7 @@ more complex.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 9 January 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbm_route2mission.html b/src/html/mbm_route2mission.html
index 4a97f85..1035ff3 100644
--- a/src/html/mbm_route2mission.html
+++ b/src/html/mbm_route2mission.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbm_route2mission</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  22 February 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -37,7 +37,7 @@ Version 5.0
 <B>-M</B><I>[sensorlist]</I> <B>-N</B>[<I>spiraldescentaltitude</I>] <B>-O</B><I>missionfile</I>
 <B>-P</B><I>[startlon/startlat | startdistance]</I>
 <B>-R</B><I>transmitpower/receivegain[/rangeminfraction[/pulsewidth]]</I>
-<B>-S</B><I>speed</I> <B>-T</B><I>starttime</I>
+<B>-S</B><I>speed</I> <B>-T</B><I>starttime</I> <B>-U</B><I>maxclimbrate</I>
 <B>-W</B><I>waypointspacing</I> <B>-V</B> <B>-H</B>]
 <P>
 <A NAME="lbAE"> </A>
@@ -333,6 +333,16 @@ This sets the expected time required for the AUV to reach the first waypoint
 in the survey mission. If neither
 the <B>-P</B> or <B>-T</B> options are specified, a distance of 500 meters
 to the first waypoint is assumed.
+<DT><B>-U</B>
+
+<DD>
+<I>maxclimbrate</I>
+<BR>
+
+This sets the maximum climb rate in degrees allowed to be planned for the
+AUV mission. If the topography has a greater slope, the AUV will be brought
+up earlier so the planned climb angle never exceed <I>maxclimbrate</I>.
+Default: <I>maxclimbrate</I> = 25 degrees.
 <DT><B>-W</B>
 
 <DD>
@@ -506,7 +516,7 @@ Perhaps.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 22 February 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbm_xyplot.html b/src/html/mbm_xyplot.html
index aa5dce5..66fbdce 100644
--- a/src/html/mbm_xyplot.html
+++ b/src/html/mbm_xyplot.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbm_xyplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -47,7 +47,7 @@ Miscellaneous Options:
 <BR>
 
 [<B>-MGD</B><I>gmtdef/value</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>m</I>]
+<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
 <B>-MGT</B><I>x/y/size/angle/font/just/text</I>
 <B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>] ]
 <P>
@@ -96,6 +96,19 @@ provided. Truly ambitious users may edit the plot shellscript
 to take advantage of GMT capabilities not supported by this
 macro.
 <P>
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using <B>mbdefaults</B>; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a <B>-N</B> command line argument suppresses the screen
+display of the plot.
+<P>
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -511,6 +524,23 @@ the plot is constructed. This command may be given repeatedly
 to set as many <B>GMT</B> defaults as required. For example, to
 set the basemap annotation font to Courier, use
 "-MGDANOT_FONT/Courier".
+<DT><B>-MGL</B>
+
+<DD>
+[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
+<BR>
+
+Draws a simple map scale centered on <I>lon0/lat0</I>.
+Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
+Use <B>-Lx</B> to specify the position in inches instead of map units.
+The scale is calculated at latitude <I>slat</I>; if the string "center" is used
+instead of a numerical value for <I>slat</I>, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value <I>length</I> is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append <I>+l</I> to label the scale with the
+relevant units, or append <I>+l"label"</I> to set a different label string.
 <DT><B>-MGT</B>
 
 <DD>
@@ -628,6 +658,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
+Alternatively, invoking the plot generation shellscript with
+a <B>-N</B> command line argument also suppresses the screen
+display of the plot.
 The program
 to be used to display the Postscript is set
 using <B>mbdefaults</B>;
@@ -930,7 +963,7 @@ Please let us know.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 9 January 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbnavadjust.html b/src/html/mbnavadjust.html
index 20fd459..21ce48f 100644
--- a/src/html/mbnavadjust.html
+++ b/src/html/mbnavadjust.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbnavadjust</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  22 April 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -67,8 +67,8 @@ when all vertical offsets have been corrected prior to importation
 into <B>MBnavadjust</B> (e.g. tidal corrections have been made).
 Otherwise, the offset analysis and inversions are three dimensional.
 <P>
-Previous attempts to address this problem (e.g. Nishimura et al. [1988])
-have focused on automating the identification of matching features
+Early attempts to address this problem (e.g. Nishimura et al. [1988])
+focused on automating the identification of matching features
 and their navigational offsets. The automated approach is
 problematic because seafloor features are complex, and the
 cross correlation function of matching features often exhibits
@@ -85,7 +85,7 @@ the initial navigation processing (e.g. <B>mbnavedit</B> is complete.
 When swath data files are imported into <B>mbnavadjust</B>, the data is
 taken from processed files generated by <B>mbprocess</B> whenever
 possible (when those files exist). If no processed file exists,
-the raw data is used. When the processing with <B>mbnavadjust</B>
+the raw data file is used. When the processing with <B>mbnavadjust</B>
 is completed and an optimal navigation solution is achieved, new
 navigation files are generated (".na#" files, see below for full
 description) which supercede the ".nve" files
@@ -97,6 +97,9 @@ navigation files that are ignored by <B>mbprocess</B>. This behavior
 can be reversed manually using <B>mbset</B>, but then the user will
 unnecessarily complicating his or her efforts.
 <P>
+A companion program <B>mbnavadjustmerge</B> can add <B>mbnavadjust</B> projects
+together or or modify <B>mbnavadjust</B> prooject settings. 
+<P>
 The inversion for an optimal navigation which fits the offsets identified
 at matching features must also be reasonable. This is achieved by
 minimizing perturbations to speed and acceleration in the inversion.
@@ -447,32 +450,33 @@ The <B>View</B> pulldown menu allows the user to set which table is displayed.
 The survey list will look something like:
 <BR>
 
-<BR> <TT>       </TT>00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000<BR>
-<BR> <TT>       </TT>01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999<BR>
-<BR> <TT>       </TT>02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999<BR>
+<BR> <TT>       </TT>00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000 good<BR>
+<BR> <TT>       </TT>01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999 good<BR>
+<BR> <TT>       </TT>02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999 good<BR>
 <BR>
 
 Here the first column is the survey counter, the second is the number
 of swath files included in each survey, and the following information
 consists of the start and end times of the data in each survey
-shown in YYYY/MM/DD HH:MM:SS.SSSSSS format.
+shown in YYYY/MM/DD HH:MM:SS.SSSSSS format, followed by the survey status
+(poor, good, fixed, fixedxy, fixedz).
 <P>
 The file list will look something like:
 <BR>
 
-<BR> <TT>       </TT>0000:00 gd   11  0.0  0.0 ../../20090803/20090803_081706.mb88<BR>
-<BR> <TT>       </TT>0001:00 gd   11  0.0  0.0 ../../20090803/20090803_083332.mb88<BR>
-<BR> <TT>       </TT>0002:00 gd   11  0.0  0.0 ../../20090803/20090803_085004.mb88<BR>
-<BR> <TT>       </TT>0003:00 gd   11  0.0  0.0 ../../20090803/20090803_090636.mb88<BR>
-<BR> <TT>       </TT>0004:00 gd   10  0.0  0.0 ../../20090803/20090803_092307.mb88<BR>
+<BR> <TT>       </TT>0000:00  good   11  0.0  0.0 ../../20090803/20090803_081706.mb88<BR>
+<BR> <TT>       </TT>0001:00  good   11  0.0  0.0 ../../20090803/20090803_083332.mb88<BR>
+<BR> <TT>       </TT>0002:00  good   11  0.0  0.0 ../../20090803/20090803_085004.mb88<BR>
+<BR> <TT>       </TT>0003:00  good   11  0.0  0.0 ../../20090803/20090803_090636.mb88<BR>
+<BR> <TT>       </TT>0004:00  good   10  0.0  0.0 ../../20090803/20090803_092307.mb88<BR>
 <BR> <TT>       </TT> <TT>       </TT>..........................................<BR>
-<BR> <TT>       </TT>0053:01 gd   12  0.0  0.0 ../../20090804/20090804_090127.mb88<BR>
-<BR> <TT>       </TT>0054:01 gd   10  0.0  0.0 ../../20090804/20090804_092036.mb88<BR>
-<BR> <TT>       </TT>0055:01 gd   11  0.0  0.0 ../../20090804/20090804_093707.mb88<BR>
-<BR> <TT>       </TT>0056:01 gd   10  0.0  0.0 ../../20090804/20090804_095339.mb88<BR>
-<BR> <TT>       </TT>0057:01 gd   11  0.0  0.0 ../../20090804/20090804_101010.mb88<BR>
+<BR> <TT>       </TT>0053:01  good   12  0.0  0.0 ../../20090804/20090804_090127.mb88<BR>
+<BR> <TT>       </TT>0054:01  good   10  0.0  0.0 ../../20090804/20090804_092036.mb88<BR>
+<BR> <TT>       </TT>0055:01  good   11  0.0  0.0 ../../20090804/20090804_093707.mb88<BR>
+<BR> <TT>       </TT>0056:01  good   10  0.0  0.0 ../../20090804/20090804_095339.mb88<BR>
+<BR> <TT>       </TT>0057:01  good   11  0.0  0.0 ../../20090804/20090804_101010.mb88<BR>
 <BR> <TT>       </TT> <TT>       </TT>..........................................<BR>
-<BR> <TT>       </TT>0104:02 fx    8  0.0  0.0 ../../MBARI/1998em300/mbari_1998_630_msn.mb57<BR>
+<BR> <TT>       </TT>0104:02  fixed   8  0.0  0.0 ../../MBARI/1998em300/mbari_1998_630_msn.mb57<BR>
 <BR>
 
 Here the first column is the file counter and survey counter separated by a colon.
@@ -1618,7 +1622,7 @@ Parker, R. L., <B>Geophysical Inverse Theory</B>, Princeton University Press, Pr
 <A NAME="lbAY"> </A>
 <H2>SEE ALSO</H2>
 
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1),
+<B><A HREF="mbnavadjustmerge.html">mbnavadjustmerge</A>(1)</B>, <B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1),
 <B><A HREF="mbnavedit.html">mbnavedit</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1)
 <P>
 <A NAME="lbAZ"> </A>
@@ -1667,7 +1671,7 @@ Good luck.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 22 April 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbnavadjustmerge.html b/src/html/mbnavadjustmerge.html
index 5fb9818..f394c89 100644
--- a/src/html/mbnavadjustmerge.html
+++ b/src/html/mbnavadjustmerge.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbnavadjustmerge</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  28 May 2014 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  21 March 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -30,11 +30,17 @@ Version 5.0
 <H2>SYNOPSIS</H2>
 
 <B>mbnavadjustmerge</B> --input=project-base [--input=project-add --output=project-output
+--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
+--set-global-tie-xyz=file:section[:snav]
+--set-global-tie-xyonly=file:section[:snav]
+--set-global-tie-zonly=file:section[:snav]
+--unset-global-tie=file:section
 --add-crossing=file1:section1/file2:section2
 --set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset
 --set-tie-xyz=file1:section1/file2:section2
 --set-tie-xyonly=file1:section1/file2:section2
 --set-tie-zonly=file1:section1/file2:section2
+--unset-tie=file1:section1/file2:section2
 --set-ties-xyz-with-file=file
 --set-ties-xyonly-with-file=file
 --set-ties-zonly-with-file=file
@@ -45,7 +51,8 @@ Version 5.0
 --set-ties-zonly-by-block=survey1/survey2
 --set-ties-zoffset-by-block=survey1/survey2/zoffset
 --skip-unset-crossings
-<BR> --verbose --help ]
+--insert-discontinuity=file:section
+--verbose --help ]
 <P>
 <A NAME="lbAE"> </A>
 <H2>DESCRIPTION</H2>
@@ -119,6 +126,42 @@ If the <B>output</B> option is
 not specified, then the <I>project-base</I> project is used as the
 output, and the <I>project-add</I> project is added on to the
 <I>project-base</I> project.
+<DT><B>--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]</B>
+
+<DD>
+This options sets a global tie for a navigation point in the project. Global ties are
+ties to the global reference frame, which generally means GPS positions (e.g. WGS84).
+The file and section id's must be specified, along with the x (east-west), y (north-south),
+and z (vertical postive up) offset values in meters. If the snav id (navigation point id)
+is not specified, it is assumed to be 0, the first navigation point in the
+specified section. If the uncertainties in the global tie (xsigma, ysigma, zsigma)
+are not specified, then xsigma = ysigma = 10 m and zsigma = 0.5 m are assumed.
+<DT><B>--set-global-tie-xyz=file:section[:snav]</B>
+
+<DD>
+This option sets the mode of the existing specified global tie in the
+<B>MBnavadjust</B> project to be "XYZ". This means all three
+coordinates of the tie will be used as constraints in the inversion
+for an optimal navigation model.
+<DT><B>--set-global-tie-xyonly=file:section[:snav]</B>
+
+<DD>
+This option sets the mode of the existing specified global tie in the
+<B>MBnavadjust</B> project to be "XY". This means only the horizontal
+coordinates of the tie will be used as constraints in the inversion
+for an optimal navigation model.
+<DT><B>--set-global-tie-zonly=file:section[:snav]</B>
+
+<DD>
+This option sets the mode of the existing specified global tie in the
+<B>MBnavadjust</B> project to be "Z". This means only the vertical
+coordinate of the tie will be used as a constraint in the inversion
+for an optimal navigation model.
+<DT><B>--unset-global-tie=file:section</B>
+
+<DD>
+This option unsets (deletes) the specified global tie in the
+<B>MBnavadjust</B> project. 
 <DT><B>--add-crossing=file1:section1/file2:section2</B>
 
 <DD>
@@ -150,6 +193,11 @@ This option sets the mode of the existing specified tie in the
 <B>MBnavadjust</B> project to be "Z". This means only the vertical
 coordinate of the tie will be used as a constraint in the inversion
 for an optimal navigation model.
+<DT><B>--unset-tie=file1:section1/file2:section2</B>
+
+<DD>
+This option unsets (deletes) the specified tie in the
+<B>MBnavadjust</B> project. 
 <DT><B>--set-ties-xyz-with-file=file</B>
 
 <DD>
@@ -293,7 +341,7 @@ the output project.
 <A NAME="lbAJ"> </A>
 <H2>BUGS</H2>
 
-It started out simple and bulletproof, but now it's too complicated to be bulletproof.
+It started out simple and bulletproof, but now it's too complicated to be bulletproof. It's probably nerfgunproof, though.
 Good luck.
 <P>
 
@@ -314,7 +362,7 @@ Good luck.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 28 May 2014</P></CENTER>
+Last Updated: 21 March 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbswath.html b/src/html/mbswath.html
index 8d0a455..63ed8cf 100644
--- a/src/html/mbswath.html
+++ b/src/html/mbswath.html
@@ -11,13 +11,13 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbswath</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.0  (1)<BR>Updated:  5 February 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
 <H2>NAME</H2>
 
-<B>mbswath</B> - GMT compatible utility for color fill or color shaded relief
+<B>mbswath</B> - <B>GMT</B> plug-in module for color fill or color shaded relief
 swath plots of swath sonar data using Postscript.
 <P>
 <A NAME="lbAC"> </A>
@@ -28,7 +28,7 @@ Version 5.0
 <A NAME="lbAD"> </A>
 <H2>SYNOPSIS</H2>
 
-<B>mbswath</B> <B>-C</B><I>cptfile</I> <B>-J</B><I>parameters</I>
+<B>gmt mbswath</B> <B>-C</B><I>cptfile</I> <B>-J</B><I>parameters</I>
 <B>-R</B><I>west/east/south/north</I> [<B>-A</B><I>factor/mode/depth</I>
 <B>-B</B><I>tickinfo</I> <B>-b</B><I>yr/mo/da/hr/mn/sc</I>
 <B>-c</B><I>copies</I> <B>-D</B><I>mode/scale/min/max</I>
@@ -43,16 +43,17 @@ Version 5.0
 <A NAME="lbAE"> </A>
 <H2>DESCRIPTION</H2>
 
-<B>mbswath</B> is a utility for plotting swath sonar data in color fill
-or color shaded relief using Postscript.  Like <B>mbcontour</B>, <B>mbswath</B>
-is fully compatible with the GMT package version 3, including the use
+<B>mbswath</B> is a plug-in module for plotting swath sonar data in color fill
+or color shaded relief using <B>GMT</B> (Generic Mapping Tools).
+Like <B>mbcontour</B>, <B>mbswath</B>
+is fully compatible with the <B>GMT</B> package version 5, including the use
 of GMT style color pallete (cpt) files to control the color table.
 A 24-bit true color <I>PostScript</I> file is output using one of
 three methods. Unless individual polygon fills are used (<B>-1</B> option),
 only one call to <B>mbswath</B> can be made for each plot because the
 color image produced covers the entire plot space.
-The program can read data from stdin (the default) or from one
-or more swath sonar files.
+The program can read data from a single swath sonar file or from
+multiple files as referenced by an MB-System datalist file.
 <P>
 Before opening an input swath data file, <B>mbmbswath</B> checks for
 an ascii file in the same directory having the same name except
@@ -68,13 +69,24 @@ of data files for use in all plotting without the performance penalty
 of <B>mbswath</B> reading through all the data files, even those
 with no relevent data. We recommend that users maintain a ".inf"
 file for each swath data file used for gridding or plotting. The
-programs <B>mbcontour</B> and <B>mbgrid</B> also use ".inf" files
+<B>GMT</B> modules <B>mbcontour</B> and <B>mbgrid</B> also use ".inf" files
 in the same fashion.
 <P>
 If <B>mbfilter</B> has been used to filter amplitude and/or sidescan
 data in the desired input, then the <B>-Z</B> option can be used
 to specify plotting the filtered rather than unfiltered data.
 <P>
+In order for <B>GMT</B> to successfully execute <B>mbswath</B>, the
+location of the shared library <I>libmbgmt</I> containing this module must be known to <B>GMT</B>.
+This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
+in the file gmt.conf that is part of the GMT installation, by setting
+this parameter in the file gmt.conf in the user's home directory, or by
+using the GMT module <B>gmtset</B> to modify this parameter in the
+current working directory. If, for instance, the <I>libmbgmt</I> shared library
+has been installed in the file /usr/lib/libmbgmt.dylib, then the
+GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
+<BR>        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
+<P>
 <A NAME="lbAF"> </A>
 <H2>AUTHORSHIP</H2>
 
@@ -258,9 +270,6 @@ generating a plot containing only bathymetry
 (<B>-Z</B><I>1</I> and <B>-Z</B><I>2</I>).
 the program
 will attempt to read an "fbt" file in lieu of the original data.
-<BR>
-
-Default: <I>infile</I> = "stdin".
 <DT><B>-J</B>
 
 <DD>
@@ -513,7 +522,7 @@ Suppose the user has a Hydrosweep data file in the L-DEO in-house
 binary format (<B>MBIO</B> format id 24) called hs_ew9302_157_mn.mb24
 which lies in the region w/s/e/n = -32.1874/-26.6236/54.6349/56.7536.
 The following will suffice to generate a color fill plot:
-<BR> <TT>       </TT>mbswath -Idatalist -Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536<BR>
+<BR> <TT>       </TT>gmt mbswath -Idatalist -Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536<BR>
 <BR> <TT>       </TT><TT>        </TT>-B1/1 -Ccolor.cpt -p1 -A1 -Q100 -Z2<BR>
 <BR> <TT>       </TT><TT>        </TT>-X1 -Y1.75 -V > mbswath.ps<BR>
 <BR>
@@ -525,8 +534,7 @@ where the file datalist contains:
 A more complicated plot including a navigation track and a color scale
 can be created using <B>mbswath</B> in conjunction with other GMT
 and GMT-compatible utilities.  The following is an example of a shellscript
-which generates such a plot and then displays it on the screen (assuming
-you have a Sun workstation):
+which generates such a plot and then displays it on the screen:
 <P>
 <BR> #
 <BR> # Shellscript to create Postscript plot of swath sonar data
@@ -555,7 +563,7 @@ you have a Sun workstation):
 <BR> #
 <BR> # Run mbswath
 <BR> echo Running mbswath...
-<BR> mbswath -Idatalist -Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536  <TT>    </TT>-B1.1128/1.1128":.Data File hs_ew9302_157_bmn.mb24:"  -Chs_ew9302_157_bmn.mb24.cpt -p1 -A1 -Q100 -G5/0 -Z2 -X1  -Y1.75 -K -V > hs_ew9302_157_bmn.mb24.ps<BR>
+<BR> gmt mbswath -Idatalist -Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536  <TT>        </TT>-B1.1128/1.1128":.Data File hs_ew9302_157_bmn.mb24:"  -Chs_ew9302_157_bmn.mb24.cpt -p1 -A1 -Q100 -G5/0 -Z2 -X1  -Y1.75 -K -V > hs_ew9302_157_bmn.mb24.ps<BR>
 <BR> #
 <BR> # Run mblist
 <BR> echo Running mblist...
@@ -563,11 +571,11 @@ you have a Sun workstation):
 <BR> #
 <BR> # Run pstrack
 <BR> echo Running pstrack...
-<BR> pstrack hs_ew9302_157_bmn.mb24.nav -Jm1.46578  <TT>        </TT>-R-32.1874/-26.6236/54.6349/56.7536 -B1.1128/1.1128":.Data File  hs_ew9302_157_bmn.mb24:" -W1p -Mt15ma1h -O -K >> hs_ew9302_157_bmn.mb24.ps<BR>
+<BR> gmt pstrack hs_ew9302_157_bmn.mb24.nav -Jm1.46578  <TT>    </TT>-R-32.1874/-26.6236/54.6349/56.7536 -B1.1128/1.1128":.Data File  hs_ew9302_157_bmn.mb24:" -W1p -Mt15ma1h -O -K >> hs_ew9302_157_bmn.mb24.ps<BR>
 <BR> #
 <BR> # Run psscale
 <BR> echo Running psscale...
-<BR> psscale  -Chs_ew9302_157_bmn.mb24.cpt -D4.0777/-0.5000/6.5242/0.1500h
+<BR> gmt psscale  -Chs_ew9302_157_bmn.mb24.cpt -D4.0777/-0.5000/6.5242/0.1500h
 <BR> <TT>       </TT>-B":.Depth (meters):" -O -V >> hs_ew9302_157_bmn.mb24.ps<BR>
 <BR> #
 <BR> # Delete surplus files
@@ -575,8 +583,8 @@ you have a Sun workstation):
 <BR> rm -f hs_ew9302_157_bmn.mb24.cpt datalist hs_ew9302_157_bmn.mb24.nav
 <BR> #
 <BR> # Run pageview
-<BR> echo Running pageview in background...
-<BR> pageview hs_ew9302_157_bmn.mb24.ps &
+<BR> echo Running gv in background...
+<BR> gv hs_ew9302_157_bmn.mb24.ps &
 <BR> #
 <BR> # All done!
 <BR> echo All done!
@@ -610,7 +618,7 @@ Let us know.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
+Last Updated: 5 February 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbsystem.html b/src/html/mbsystem.html
index 5105409..2b09590 100644
--- a/src/html/mbsystem.html
+++ b/src/html/mbsystem.html
@@ -11,7 +11,7 @@
 <CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
 <PRE>
 <H1>mbsystem</H1>
-Section:  MB-System 5.3  (1)<BR>Updated:  7 June 2013 <BR><A HREF="#index">Index</A>
+Section:  MB-System 5.5  (1)<BR>Updated:  26 January 2015 <BR><A HREF="#index">Index</A>
 <HR>
 
 <A NAME="lbAB"> </A>
@@ -23,7 +23,7 @@ processing swath sonar bathymetry, amplitude, and sidescan data.
 <A NAME="lbAC"> </A>
 <H2>VERSION</H2>
 
-Version 5.3
+Version 5.5
 <P>
 <A NAME="lbAD"> </A>
 <H2>AUTHORSHIP</H2>
@@ -72,7 +72,7 @@ GMT and netCDF), all of which are freely available as source code.
 <A NAME="lbAF"> </A>
 <H2>COPYRIGHT AND LICENSING</H2>
 
-<B>MB-System</B> Copyright (C) 1993-2012 by
+<B>MB-System</B> Copyright (C) 1993-2015 by
 <BR>
 
 David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
@@ -1670,7 +1670,7 @@ breaks.
 </PRE>
 
 <CENTER><P><BR>
-Last Updated: 7 June 2013</P></CENTER>
+Last Updated: 26 January 2015</P></CENTER>
 
 <HR>
 <P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
diff --git a/src/html/mbsystem_copyright.html b/src/html/mbsystem_copyright.html
index 516283c..00fd824 100644
--- a/src/html/mbsystem_copyright.html
+++ b/src/html/mbsystem_copyright.html
@@ -14,7 +14,7 @@
 <CENTER><P><B><FONT SIZE=+2>MB-System Copyright</FONT></B></P></CENTER>
 
 <CENTER>
-  <DT>MB-System Copyright © 1993-2014</DT>
+  <DT>MB-System Copyright © 1993-2015</DT>
 </CENTER>
 
 <CENTER><DT>by David W. Caress and Dale N. Chayes</DT></CENTER>
@@ -111,7 +111,7 @@ of the MB-System software package are NOT responsible for any damage that
 may follow from correct or incorrect use of these programs. </P>
 
 <CENTER><P><BR>
-Last Updated: $Id: mbsystem_copyright.html 2208 2014-10-29 08:18:46Z caress $</P></CENTER>
+Last Updated: $Id: mbsystem_copyright.html 2224 2015-02-04 19:14:05Z caress $</P></CENTER>
 
 <CENTER><P>
 <HR WIDTH="100%"></P></CENTER>
diff --git a/src/html/mbsystem_formats.html b/src/html/mbsystem_formats.html
index d642d41..848a2e6 100644
--- a/src/html/mbsystem_formats.html
+++ b/src/html/mbsystem_formats.html
@@ -1129,7 +1129,7 @@ sonars are supported: </P>
 </UL>
 
 <CENTER><P><BR>
-Last Updated: $Id: mbsystem_formats.html 2215 2014-11-29 22:21:19Z caress $ $Revision: $</P></CENTER>
+Last Updated: $Id: mb_format.h 2224 2015-02-04 19:14:05Z caress $ $Revision: $</P></CENTER>
 
 <P>
 <HR WIDTH="100%"></P>
diff --git a/src/html/mbsystem_how_to_get.html b/src/html/mbsystem_how_to_get.html
index 9a2ffbe..84314eb 100644
--- a/src/html/mbsystem_how_to_get.html
+++ b/src/html/mbsystem_how_to_get.html
@@ -26,7 +26,7 @@
     <li><a href="#MB-required">Other required and suggested software and data</a></li>
     <li><a href="#MB-unpack">How to unpack an MB-System source code distribution</a></li>
     <li><a href="#MB-install">How to install MB-System using the configure script</a></li>
-    <li><a href="#MB-install-old">How to install MB-System using the install_makefiles script</a></li>
+</li>
 </ul>
 </ul>
 </ul>
@@ -183,16 +183,7 @@ Software Foundation</a>.</li>
     Most current Unix/Linux operating systems include the required Motif
     libraries, either in the original proprietary form (Motif), or the not-quite-open-source form (OpenMotif). If you do not have these libraries, the OpenMotif 2 source is available through
     <a href="http://www.openmotif.org/">Motifzone</a>. An old alternative open source Motif-compatible
-    distribution called <a href="http://www.lesstif.org">LessTif </a>does not work with the new OpenGL based MB-System programs (MBgrdviz, MBeditviz) and should be avoided. </li>
-  <li><b>Levitus Database</b>: The MB-System program mblevitus depends
-on
-a 16 MByte data file that is not included in the MB-System tarfile.
-Click
-    <a href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/annual.gz">here</a>
-to ftp this file. Be sure to uncompress the file and to set the
-"LEVITUS"
-flag in the install_makefiles appropriately, as described below in the
-installation section.</li>
+    distribution called LessTif does not work with the current OpenGL based MB-System programs (MBgrdviz, MBeditviz) and should be avoided. </li>
   <li><strong>FFTW</strong>: The "Fastest Fourier Transform in the West" package is used by the sonagram calculation program MBbsegypsd to calculate, well, Fast Fourier Transforms. <a href="http://www.fftw.org/">FFTW</a> is commonly used and thus available on or for most current Unix operating systems.</li>
   <li><strong>OTPSnc</strong>: The Oregon State Ocean Tide Prediction Software package is required for the tidal modeling program MBotps (which in fact is just a convenient front end for the old-style-batch interface of OTPS). The OTPSnc package can be obtained from the<a href="http://www.oce.orst.edu/research/po/research/tide/"> tidal modeling group</a> at <a href="http://www.oce.orst.edu/">Oregon State University</a>.</li>
 </ul>
@@ -339,27 +330,50 @@ The configure command line options controlling the locations of prerequisites ar
 --with-otps-dir		Location of OTPS installation (optional)
 </pre>
 </ul>
-<p>The MB-System distribution includes the source code for the GSF and the PROJ4 packages. By default, the configure script seeks to build the GSF library as libmbgsf and seeks to link with a libproj built external to MB-System. Configure accepts commands to build MB-System without GSF or to use the included PROJ4 source.</p>
+<p>The MB-System distribution includes the source code for the PROJ4 package. By default, the configure script seeks to link with a libproj built external to MB-System. Configure accepts the command --enable-bundledproj to build MB-System using the included PROJ4 source.</p>
 <ul>
 <pre>
---without-gsf			Build without including or supporting GSF
-						The default is to build the bundled 
-						gsf library as libmbgsf and link with it
 --enable-bundledproj	Build using bundled proj package - the
 						default is to link with libproj
 </pre>
 </ul>
 <p>Note that specification of FFTW3, Motif, and OpenGL is optional. If the configure script does not find these packages and the user does not specify their locations, then some MB-System programs will not be built. Lack of FFTW3 means that mbsegypsd is not built. No OpenGL results in the visualization programs mbgrdviz and mbeditviz not being built. Lack of Motif means that no graphical programs of any type are built. </p>
+<p>Regardless of where the MB-System programs are installed, users must have that location included in their path environment variable in order to execute the programs from a command line. If MB-System has been installed using a package manager or installed manually into a common location (e.g. /usr/local/bin), the user path probably already references the needed location. If altering the user path variable is required, it can be accomplished by editing the initialization files hidden in [...]
+executable
+<em>perl</em> must also be available in the user's path for most of the macros
+to
+work.</p>
+<p>The GMT version 5 plug-in modules mbcontour, mbswath, and mbgrdtiff are invoked as
+modules of the program gmt:
+<ul>
+<pre>
+gmt mbcontour (....various arguments.....)
+gmt mbswath (....various arguments.....)
+gmt mbgrdtiff (....various arguments.....)
+</pre>
+</ul>
+In order for GMT to successfully execute the MB-System modules, the
+location of the shared library containing these modules must be known to
+GMT. This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
+in the file gmt.conf that is part of the GMT installation, by setting
+this parameter in the file gmt.conf in the user's home directory, or by using
+the GMT module gmtset to modify this parameter in the current working directory. If, for instance, the mbgmt shared library has been installed in the file /usr/lib/libmbgmt.dylib, then the GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
+<ul><pre>GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib</pre></ul></p>
+<p>Most users will also wish to specify which program they generally
+use to view Postscript plots on their screen. This parameter is set
+with the mbdefaults program (see the mbdefaults manual page for
+details).
+Popular open source options for Postscript display include ghostview and gv (gv is recommended). The postscript plots can also be imported into proprietary tools like Adobe Illustrator, Adobe Acrobat, or Preview on MacOs X. If one is working in a Unix museum, pageview works well on Sun workstations running Solaris, and xpsview is great on on Silicon Graphics machines running Irix.</p>
 
 <strong>Mac OS X</strong>
-<p>Many MacOsX users have their NetCDF, GMT, FFTW3, and OpenMotif installations through the Fink package manager, which installs packages in /sw. The configure script fails to find packages in /sw, and so the user must explicitly specify those packages. The OTPS tide modeling software used by mbotps is not packaged in Fink, and so must be manually installed by a user if mbotps is to work correctly. Installation of MB-System on a Mac running MacOsX 10.9 will likely use a configure command [...]
+<p>Many MacOsX users have their NetCDF, GMT5, FFTW3, and OpenMotif installations through the Fink package manager, which installs packages in /sw. The configure script fails to find packages in /sw, and so the user must explicitly specify those packages. The OTPS tide modeling software used by mbotps is not packaged in Fink, and so must be manually installed by a user if mbotps is to work correctly. Installation of MB-System on a Mac running MacOsX 10.9 or 10.10 will likely use a configu [...]
 <ul>
 <pre>
 sudo CFLAGS="-I/opt/X11/include -L/opt/X11/lib" \
 ./configure \
     --with-netcdf-include=/sw/include \
     --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
+    --with-gmt-include=/sw/include/gmt5 \
     --with-gmt-lib=/sw/lib \
     --with-proj-include=/sw/include \
     --with-proj-lib=/sw/lib \
@@ -367,7 +381,7 @@ sudo CFLAGS="-I/opt/X11/include -L/opt/X11/lib" \
     --with-fftw-lib=/sw/lib \
     --with-motif-include=/sw/include \
     --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/tides/OTPS2
+    --with-otps-dir=/usr/local/OTPS2
 </pre>
 </ul>
 <p>As shown here, one can also add to the commands seen by the compiler ("CFLAGS") and linker ("LDFLAGS") if desired or necessary by prefacing the configure command with arguments setting the environment variables CFLAGS and LDFLAGS. Here the current location of X11 header files and libraries must be specified because the new (to MacOsX) location of X11 in /opt is not known to the configure script. Another example is that in order to compile MB-System for user with a debugger, all compil [...]
@@ -377,7 +391,7 @@ sudo CFLAGS="-g -I/opt/X11/include -L/opt/X11/lib" \
 ./configure \
     --with-netcdf-include=/sw/include \
     --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
+    --with-gmt-include=/sw/include/gmt5 \
     --with-gmt-lib=/sw/lib \
     --with-proj-include=/sw/include \
     --with-proj-lib=/sw/lib \
@@ -385,7 +399,7 @@ sudo CFLAGS="-g -I/opt/X11/include -L/opt/X11/lib" \
     --with-fftw-lib=/sw/lib \
     --with-motif-include=/sw/include \
     --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/tides/OTPS2
+    --with-otps-dir=/usr/local/OTPS2
 </pre>
 </ul>
 
@@ -464,110 +478,8 @@ sudo ./configure
 </pre></ul>
 
 <center>
-  <p></p>
-<hr width="67%">
-</center>
-<center>
-<p><a name="MB-install-old"></a><b><font size="+2">How to Install MB-System Using the Install_makefiles Script</font></b></p>
-</center>
-<p>For over two decades, the only means to build MB-System distributions was a crude Perl script called install_makefiles that needed to be edited to set the operating system and the locations of prerequisite packages. Although a autoconf-type configure script is now provided, as described above, the old install_makefiles script is still included in the MB-System distribution and remains an alternative means to build and install MB-System.</p>
-<p>In order to
-use this alternative build system, you must edit the perl script
-mbsystem/install_makefiles, and set a number of parameters to reflect the system architecture, the location of the installation, and the locations of certain required libraries.
-This script will read template makefiles in the MB-System
-source
-directories and create makefiles with the correct dependencies, compile flags, and link flags. The important parameters to be set in install_makefiles are listed below. The install_makefiles script includes comments suggesting parameters to use for many common computer systems.</p>
-<p>These parameters must be set for all installations:</p>
-<ul>
-  <li> MBSYSTEM_HOME	- Absolute path to the directory containing install_makefiles.</li>
-  <li>OS		- Operating system (Recognized options are: DARWIN, LINUX, CYGWIN, SUN, IRIX, IRIX64, SOLARIS, HPUX, LYNX, CYGWIN or OTHER).</li>
-  <li>CFLAGS		- Compile flags for C source files. These vary with different operating systems and installations.</li>
-  <li>LFLAGS		- Load flags for all object files.</li>
-  <li>NETCDFLIBDIR	- Location of NetCDF library libnetcdf.a</li>
-  <li>NETCDFINCDIR	- Location of NetCDF include file netcdf.h</li>
-  <li>GMTLIBDIR-	Location of GMT libraries libgmt.a and libpsl.a</li>
-  <li>GMTINCDIR	- Location of GMT include files gmt.h, grd.h, and pslib.h</li>
-  <li>LEVITUS		- Path of Levitus global water properties data file. This is usually $MBSYSTEM_HOME/share/annual.</li>
-  <li>PROJECTIONS	- Path of PROJ4 projections database. This is usually $MBSYSTEM_HOME/share/Projections.dat.<br>
-  </li>
-</ul>
-<p>These two parameters are required to build the graphical tools mbedit, mbnavedit, mbvelocitytool, mbnavadjust,                                mbgrdviz, and mbeditviz. If these parameters are not both set, no graphical tools will be built.</p>
-<ul>
-  <li>MOTIFINCDIR	- Location of Motif include files.</li>
-  <li>MOTIFLIBS	- X11 and Motif libraries required for graphical tools.<br>
-  </li>
-</ul>
-<p>This parameter must be set to build the  openGL tools mbgrdviz and mbeditviz:</p>
-<ul>
-  <li>OPENGLLIBS	- OpenGL libraries required for new graphical tools, including mbgrdviz and mbeditviz. If this parameter is not set, mbgrdviz and mbeditviz will not be built<br>
-  </li>
-</ul>
-<p>This parameter must be set to build the sonogram calculation program mbsegypsd:</p>
-<ul>
-  <li>FFTWLIBDIR	- location of FFTW library providing fast Fourier transform.</li>
-  <li>FFTWINCDIR - location of FFTW include files</li>
-</ul>
-<p>This parameter must be set for the tidal modeling program mbotps to work:</p>
-<ul>
-  <li>OTPSDIR	- location of OTPSnc tide prediction program predict_tide.</li>
-</ul>
-<p>This optional parameter can be used to specify a  non-default C compiler:</p>
-<ul>
-  <li>CC		- C compiler to be used.<br>
-  </li>
-</ul>
-<p>These optional parameters can be used to  specify linking with an independent installation of the PROJ4 library. In this case, the PROJ4 library included with MB-System will not be built.</p>
-<ul>
-  <li>PROJLIB         - Path to PROJ4 library (usually libproj.a)</li>
-  <li>PROJINCDIR      - Location of PROJ4 include file proj_api.h<br>
-  </li>
-</ul>
-<p>These optional parameters can be used to  specify linking with an independent installation of the GSF library. In this case, the GSF library included with MB-System will not be built.</p>
-<ul>
-  <li>GSFLIB          - Path to GSF library (usually libgsf.a)</li>
-  <li>GSFINCDIR       - Location of GSF include file gsf.h</li>
-</ul>
-<p>To
-  execute
-  install_makefiles, do the following:</p>
-<ul>
-  <pre>% cd mbsystem-5.3.1955 </pre>
-  <pre>% install_makefiles</pre>
-</ul>
-<p>Because install_makefiles is a perl script, the executable perl must
-be available in the installer's path. Once install_makefiles has been
-correctly
-configured and run, give the command "make all" to generate the
-executable programs:</p>
-<ul>
-  <pre>% make all</pre>
-</ul>
-<p>The make command will descend recursively down through the directory
-structure, compiling source files, linking object files, and copying
-executables
-and manual pages to the appropriate directories. The executables will
-be
-placed in mbsystem-5.1.3/bin, the libraries in mbsystem-5.1.3/lib, and
-the manual pages
-in mbsystem-5.1.3/man/man1.</p>
-<p>Naturally, in order for users to use the MB-System utilities, the
-directory
-containing the executables must be included in their path. Altering the user path variable is generally accomplished by editing the initialization files hidden in the user's home directory. Which files need to be edited depends on which command line shell is being used. If the user works with <em>csh</em>, then the <em>.cshrc</em> and <em>.login </em>files need to be changed. If the shell is <em>bash</em>, then the <em>.bashrc</em> and <em>.profile</em> files must be altered. See the man [...]
-executable
-<em>perl</em> must also be available in the user's path for most of the macros
-to
-work.</p>
-<p>Most users will also wish to specify which program they generally
-use
-to view Postscript plots on their screen. This parameter is set
-
-with the mbdefaults program (see the mbdefaults manual page for
-details).
-Popular open source options for Postscript display include ghostview and gv. The postscript plots can also be imported into proprietary tools like Adobe Illustrator, Adobe Acrobat, or Preview on MacOs X. On old Unix machines,  pageview worked well on Sun workstations running Solaris, and xpsview on on Silicon
-Graphics machines running Irix.</p>
-<center>
 <p><br>
-Last Updated: $Id: mbsystem_how_to_get.html 2185 2014-05-11 06:34:36Z caress $</p>
+Last Updated: $Id: mbsystem_how_to_get.html 2225 2015-02-05 07:31:48Z caress $</p>
 </center>
 <p>
 </p>
diff --git a/src/html/mbsystem_man_list.html b/src/html/mbsystem_man_list.html
index 64fa019..12c82ed 100644
--- a/src/html/mbsystem_man_list.html
+++ b/src/html/mbsystem_man_list.html
@@ -42,9 +42,6 @@ as a function of the seafloor
 grazing angle.</li>
   <li> <a href="mbclean.html">mbclean</a>: Identifies and flags bad
 beams in swath sonar bathymetry data.</li>
-  <li> <a href="mbcontour.html">mbcontour</a>: Generate GMT compatible
-Postscript
-color swath contour plots.</li>
   <li> <a href="mbcopy.html">mbcopy</a>: Copy swath sonar data files.</li>
   <li> <a href="mbctdlist.html">mbctdlist</a>: List CTD data in swath sonar data files.</li>
   <li> <a href="mbdatalist.html">mbdatalist</a>: Parses recursive
@@ -70,13 +67,7 @@ in swath sonar bathymetry data.</li>
     sonar
   data formats supported by the MBIO library.</li>
   <li> <a href="mbgetesf.html">mbgetesf</a>: Extract bathymetry edits
-in
-edit
-save file format.</li>
-  <li> <a href="mbgrdtiff.html">mbgrdtiff</a>: Generate TIFF image
-from
-gridded
-data.</li>
+in edit save file format.</li>
   <li> <a href="mbgrdviz.html">mbgrdviz</a>: Vizualize GMT grids.</li>
   <li> <a href="mbgrid.html">mbgrid</a>: Grid bathymetry, amplitude,
 and
@@ -154,9 +145,6 @@ velocity profiles
   <li> <a href="mbsvpselect.html">mbsvpselect</a>: Select the best
 available sound speed model for each swath file in a survey according to 
 user specified criteria.</li>
-  <li> <a href="mbswath.html">mbswath</a>: Generate GMT compatible
-Postscript
-color and color shaded relief swath plots.</li>
   <li> <a href="mbswplspreprocess.html">mbswplspreprocess</a>: Preprocess
 SwathPlus SXP data (format 222), including applying time lag and biases to
 attitude and navigation data.</li>
@@ -178,6 +166,18 @@ format id 71).</li>
 Reson 7k data (format 88), including applying time lag and biases to
 attitude and navigation data.</li>
 </ul>
+MB-system also includes three plug-in modules for the GMT software package that are built as a shared library that can be called by GMT. Here are links to the Unix manual
+pages:
+<ul>
+  <li> <a href="mbcontour.html">mbcontour</a>: Generate GMT compatible
+Postscript
+color swath contour plots.</li>
+  <li> <a href="mbgrdtiff.html">mbgrdtiff</a>: Generate TIFF image
+from gridded data.</li>
+  <li> <a href="mbswath.html">mbswath</a>: Generate GMT compatible
+Postscript
+color and color shaded relief swath plots.</li>
+</ul>
 Macros are programs or shellscripts which make use of programs from the
 MB-System and other software packages to accomplish common tasks
 easily.
@@ -253,7 +253,7 @@ data
 files
 and writes a shellscript which will generate GMT plot of the data.</li>
 </ul>
-<center>Last Updated: $Id: mbsystem_man_list.html 2187 2014-05-28 23:56:32Z caress $
+<center>Last Updated: $Id: mbsystem_man_list.html 2224 2015-02-04 19:14:05Z caress $
 </center>
 <p>
 </p>
diff --git a/src/html/mbsystem_version.txt b/src/html/mbsystem_version.txt
index 089eb16..e3da06c 100644
--- a/src/html/mbsystem_version.txt
+++ b/src/html/mbsystem_version.txt
@@ -1,2 +1,2 @@
-MB-System Version:  "5.4.2219"
-MB-System Release Date:  "11 December 2014"
+MB-System Version:  "5.5.2252"
+MB-System Release Date:  "1 July 2015"
diff --git a/src/html/mbsystem_whatsnew.html b/src/html/mbsystem_whatsnew.html
index 8b7200a..c5517b0 100644
--- a/src/html/mbsystem_whatsnew.html
+++ b/src/html/mbsystem_whatsnew.html
@@ -10,6 +10,21 @@
 </HEAD>
 <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
 
+<H1 ALIGN=CENTER>What's New in MB-System Version 5.5</H1>
+
+<P>The version 5.5.x releases of MB-System includes a number of changes and
+improvements relative to the earlier version 5 releases. The most significant change is integration with GMT 5 in place of the deprecated GMT versions. A detailed listing of bug fixes and other changes is found in the <a href="ChangeLog.txt">ChangeLog</a> file. The most prominent particulars follow: </P>
+
+<UL>
+  <LI>Integration with GMT 5</LI>
+  
+  <UL>
+  <LI>The GMT-compatible MB-System programs mbcontour, mbswath, and mbgrdtiff are now plug-in GMT modules built as a shared library rather than stand-alone MB-System programs.</LI>
+  <LI>The MB-System plot macros mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_xyplot, and mbm_histplot now generate plotting scripts that work with GMT5 but will not work with GMT 4.</LI>
+  <LI>There is no backward compatibility with GMT 4.</LI>
+  <LI>The old "install_makefiles" build system has been removed; the configure script introduced with the 5.4 versions is now the only option for building MB-System.</LI>
+  </UL>
+</UL>  
 <H1 ALIGN=CENTER>What's New in MB-System Version 5.4</H1>
 
 <P>The version 5.4.x releases of MB-System includes a number of changes and
@@ -32,6 +47,7 @@ improvements relative to the earlier version 5 releases. The most significant ch
   <LI>3DatDepth lidar data format is supported as format 231 (MBF_3DDEPTHP).</LI>
   <LI>Electronic Navigation Ltd. WASSP multibeam sonar data format supported as format 241 (MBF_WASSPENL).</LI>
   <LI>NGDC MGD77T data format for tab delimited underway marine geophysical data is supported as format 174 (MBF_MGD77TAB).</LI>
+  <LI>Photogrammetric topography from stereo pair photography supported as format 251 (MBF_PHOTGRAM).</LI>
   </UL>
 </UL>
 <UL>
@@ -381,7 +397,7 @@ multibeam data.</LI>
 </UL>
 
 <CENTER><P><BR>
-Last Updated: $Id: mbsystem_whatsnew.html 2183 2014-04-16 19:54:45Z caress $ </P></CENTER>
+Last Updated: $Id: mbsystem_whatsnew.html 2224 2015-02-04 19:14:05Z caress $ </P></CENTER>
 
 <P>
 <HR WIDTH="67%"></P>
diff --git a/src/macros/Makefile.in b/src/macros/Makefile.in
index b8823f9..736186d 100644
--- a/src/macros/Makefile.in
+++ b/src/macros/Makefile.in
@@ -169,8 +169,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -187,6 +185,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -250,19 +249,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -275,8 +281,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/macros/Makefile.template b/src/macros/Makefile.template
deleted file mode 100644
index d8f8141..0000000
--- a/src/macros/Makefile.template
+++ /dev/null
@@ -1,198 +0,0 @@
-#     The MB-system:	Makefile.template  5/23/94
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 1993-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system in the src/macros directory level
-# Author:	D. W. Caress
-# Date:		May 23, 1994
-#
-# $Log: Makefile.template,v $
-# Revision 5.7  2009/03/13 07:05:58  caress
-# Release 5.1.2beta02
-#
-# Revision 5.6  2008/12/31 08:47:38  caress
-# Updates towards release 5.1.1
-#
-# Revision 5.5  2006/06/16 19:30:58  caress
-# Check in after the Santa Monica Basin Mapping AUV Expedition.
-#
-# Revision 5.4  2006/02/03 21:06:55  caress
-# Added mbm_makedatalist.
-#
-# Revision 5.3  2006/01/11 07:30:28  caress
-# Working towards 5.0.8
-#
-# Revision 5.2  2005/11/05 01:34:20  caress
-# Much work over the past two months.
-#
-# Revision 5.1  2004/07/27 19:58:11  caress
-# Added macro mbm_route2mission.perl
-#
-# Revision 5.0  2003/07/27 20:52:57  caress
-# Release 5.0.0
-#
-# Revision 4.14  2003/03/10 07:39:54  caress
-# Added mr1pr library
-#
-# Revision 4.13  2002/08/21 00:54:20  caress
-# Release 5.0.beta22
-#
-# Revision 4.12  2002/07/20 20:44:38  caress
-# Release 5.0.beta20
-#
-# Revision 4.11  2001/06/03 07:01:28  caress
-# Release 5.0.beta01
-#
-# Revision 4.10  2000/09/30 07:20:07  caress
-# Snapshot for Dale.
-#
-# Revision 4.9  1999/12/29  00:17:55  caress
-# Added mbm_grdtiff.
-#
-# Revision 4.8  1999/10/06  20:42:31  caress
-# Added mbm_grd2arc
-#
-# Revision 4.7  1999/06/25  17:53:31  caress
-# Added mbm_grid macro.
-#
-# Revision 4.6  1996/08/12  21:13:48  caress
-# Added mbm_dslnavfix macro.
-#
-# Revision 4.5  1995/08/17  16:43:48  caress
-# Revision for release 4.3.
-#
-# Revision 4.4  1995/08/17  15:08:03  caress
-# Revision for release 4.3.
-#
-# Revision 4.3  1995/07/27  20:38:17  caress
-# Added mbm_xyplot.
-#
-# Revision 4.2  1994/10/31  19:43:01  caress
-# Change man pages from section 1 to l.
-#
-# Revision 4.1  1994/10/21  11:36:58  caress
-# Release V4.0
-#
-# Revision 4.0  1994/05/24  02:32:35  caress
-# First cut.
-#
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the MB-system macros and man pages
-all:	$(BINDIR)/mbm_xbt \
-	$(BINDIR)/mbm_plot \
-	$(BINDIR)/mbm_grdplot \
-	$(BINDIR)/mbm_grd3dplot \
-	$(BINDIR)/mbm_xyplot \
-	$(BINDIR)/mbm_stat \
-	$(BINDIR)/mbm_grid \
-	$(BINDIR)/mbm_grd2arc \
-	$(BINDIR)/mbm_arc2grd \
-	$(BINDIR)/mbm_grdcut \
-	$(BINDIR)/mbm_grdinfo \
-	$(BINDIR)/mbm_grdtiff \
-	$(BINDIR)/mbm_utm \
-	$(BINDIR)/mbm_grd2geovrml \
-	$(BINDIR)/mbm_copy \
-	$(BINDIR)/mbm_route2mission \
-	$(BINDIR)/mbm_makedatalist \
-	$(BINDIR)/mbm_histplot \
-	$(BINDIR)/mbm_multiprocess \
-	$(BINDIR)/mbm_multidatalist \
-	$(BINDIR)/mbm_multicopy \
-	$(BINDIR)/mbm_bpr \
-	$(BINDIR)/mbm_makesvp
-
-
-### make clean does nothing
-clean:
-
-### link or copy the executables
-$(BINDIR)/mbm_xbt:	mbm_xbt
-	cp mbm_xbt $(BINDIR)/mbm_xbt
-	chmod 775 $(BINDIR)/mbm_xbt
-$(BINDIR)/mbm_plot:	mbm_plot
-	cp mbm_plot $(BINDIR)/mbm_plot
-	chmod 775 $(BINDIR)/mbm_plot
-$(BINDIR)/mbm_grdplot:	mbm_grdplot
-	cp mbm_grdplot $(BINDIR)/mbm_grdplot
-	chmod 775 $(BINDIR)/mbm_grdplot
-$(BINDIR)/mbm_grd3dplot:	mbm_grd3dplot
-	cp mbm_grd3dplot $(BINDIR)/mbm_grd3dplot
-	chmod 775 $(BINDIR)/mbm_grd3dplot
-$(BINDIR)/mbm_xyplot:	mbm_xyplot
-	cp mbm_xyplot $(BINDIR)/mbm_xyplot
-	chmod 775 $(BINDIR)/mbm_xyplot
-$(BINDIR)/mbm_stat:	mbm_stat
-	cp mbm_stat $(BINDIR)/mbm_stat
-	chmod 775 $(BINDIR)/mbm_stat
-$(BINDIR)/mbm_grid:	mbm_grid
-	cp mbm_grid $(BINDIR)/mbm_grid
-	chmod 775 $(BINDIR)/mbm_grid
-$(BINDIR)/mbm_grd2arc:	mbm_grd2arc
-	cp mbm_grd2arc $(BINDIR)/mbm_grd2arc
-	chmod 775 $(BINDIR)/mbm_grd2arc
-$(BINDIR)/mbm_arc2grd:	mbm_arc2grd
-	cp mbm_arc2grd $(BINDIR)/mbm_arc2grd
-	chmod 775 $(BINDIR)/mbm_arc2grd
-$(BINDIR)/mbm_grdcut:	mbm_grdcut
-	cp mbm_grdcut $(BINDIR)/mbm_grdcut
-	chmod 775 $(BINDIR)/mbm_grdcut
-$(BINDIR)/mbm_grdinfo:	mbm_grdinfo
-	cp mbm_grdinfo $(BINDIR)/mbm_grdinfo
-	chmod 775 $(BINDIR)/mbm_grdinfo
-$(BINDIR)/mbm_grdtiff:	mbm_grdtiff
-	cp mbm_grdtiff $(BINDIR)/mbm_grdtiff
-	chmod 775 $(BINDIR)/mbm_grdtiff
-$(BINDIR)/mbm_utm:	mbm_utm
-	cp mbm_utm $(BINDIR)/mbm_utm
-	chmod 775 $(BINDIR)/mbm_utm
-$(BINDIR)/mbm_grd2geovrml:	mbm_grd2geovrml
-	cp mbm_grd2geovrml $(BINDIR)/mbm_grd2geovrml
-	chmod 775 $(BINDIR)/mbm_grd2geovrml
-$(BINDIR)/mbm_copy:	mbm_copy
-	cp mbm_copy $(BINDIR)/mbm_copy
-	chmod 775 $(BINDIR)/mbm_copy
-$(BINDIR)/mbm_route2mission:	mbm_route2mission
-	cp mbm_route2mission $(BINDIR)/mbm_route2mission
-	chmod 775 $(BINDIR)/mbm_route2mission
-$(BINDIR)/mbm_makedatalist:	mbm_makedatalist
-	cp mbm_makedatalist $(BINDIR)/mbm_makedatalist
-	chmod 775 $(BINDIR)/mbm_makedatalist
-$(BINDIR)/mbm_histplot:	mbm_histplot
-	cp mbm_histplot $(BINDIR)/mbm_histplot
-	chmod 775 $(BINDIR)/mbm_histplot
-$(BINDIR)/mbm_multiprocess:	mbm_multiprocess
-	cp mbm_multiprocess $(BINDIR)/mbm_multiprocess
-	chmod 775 $(BINDIR)/mbm_multiprocess
-$(BINDIR)/mbm_multidatalist:	mbm_multidatalist
-	cp mbm_multidatalist $(BINDIR)/mbm_multidatalist
-	chmod 775 $(BINDIR)/mbm_multidatalist
-$(BINDIR)/mbm_multicopy:	mbm_multicopy
-	cp mbm_multicopy $(BINDIR)/mbm_multicopy
-	chmod 775 $(BINDIR)/mbm_multicopy
-$(BINDIR)/mbm_bpr:	mbm_bpr
-	cp mbm_bpr $(BINDIR)/mbm_bpr
-	chmod 775 $(BINDIR)/mbm_bpr
-$(BINDIR)/mbm_makesvp:	mbm_makesvp
-	cp mbm_makesvp $(BINDIR)/mbm_makesvp
-	chmod 775 $(BINDIR)/mbm_makesvp
diff --git a/src/macros/mbm_arc2grd b/src/macros/mbm_arc2grd
index 3942e34..55b10da 100755
--- a/src/macros/mbm_arc2grd
+++ b/src/macros/mbm_arc2grd
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_arc2grd.perl	4/21/01
-#    $Id: mbm_arc2grd 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_arc2grd 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 2001-2014 by
+#    Copyright (c) 2001-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -35,7 +35,7 @@
 #    10 km off the windward side of Oahu)
 #
 # Version:
-#   $Id: mbm_arc2grd 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_arc2grd 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_arc2grd.perl,v $
@@ -82,7 +82,7 @@ $verbose =  ($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_arc2grd 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_arc2grd 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nMacro to convert a ArcView ASCII grid to an GMT grid file in the \n";
 	print "GMT NetCDF grid format. This allows users to import the grid\n";
 	print "into GMT. The grid will have the same grid interval in both \n";
diff --git a/src/macros/mbm_bpr b/src/macros/mbm_bpr
index 998ce07..3ec9877 100755
--- a/src/macros/mbm_bpr
+++ b/src/macros/mbm_bpr
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_bpr.perl	5/13/2002
-#    $Id: mbm_bpr 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_bpr 2231 2015-02-21 01:46:02Z caress $
 #
-#    Copyright (c) 2012-2014 by
+#    Copyright (c) 2012-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -31,11 +31,8 @@
 #   May 13, 2002
 #
 # Version:
-#   $Id: mbm_bpr 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_bpr 2231 2015-02-21 01:46:02Z caress $
 #
-# Revisions:
-#   $Log: mbm_bpr.perl,v $
-#   Initial revision.
 #
 use Getopt::Std;
 
@@ -67,7 +64,7 @@ my $verbose  = ($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$ProgramName:\n";
-	print "\nVersion: $Id: mbm_bpr 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_bpr 2231 2015-02-21 01:46:02Z caress $\n";
 	print "\nMB-System macro to process data from a Seabird SBE53 pressure\n";
 	print "sensor into a tidal model for use by mbprocess\n";
 	print "\nUsage: \n";
@@ -269,10 +266,10 @@ if ($tmode == 0) {
   }
   $tidemax *= 1.1;
   if ($ntide > 0) {
-    $cmd = "mbm_xyplot -R$time_ds[0]/$time_ds[$count-1]/-$tidemax/$tidemax -IW0/0/0:$ofile -IW255/0/0:$modelfile -O$plotfile -L\"Tide Data from BPR <$ofile> (black) & Tide Model (red):Seconds:Tide (meters)\" -V";
+    $cmd = "mbm_xyplot -R$time_ds[0]/$time_ds[$count-1]/-$tidemax/$tidemax -IWblack:$ofile -IWred:$modelfile -O$plotfile -L\"Tide Data from BPR <$ofile> (black) & Tide Model (red):Seconds:Tide (meters)\" -V";
   }
   else {
-    $cmd = "mbm_xyplot -R$time_ds[0]/$time_ds[$count-1]/-$tidemax/$tidemax -IW0/0/0:$ofile -O$plotfile -L\"Tide Data from BPR <$ofile>:Seconds:Tide (meters)\" -V";
+    $cmd = "mbm_xyplot -R$time_ds[0]/$time_ds[$count-1]/-$tidemax/$tidemax -IWblack:$ofile -O$plotfile -L\"Tide Data from BPR <$ofile>:Seconds:Tide (meters)\" -V";
   }
   print "  Executing $cmd\n\n";
   $line = `$cmd`;
diff --git a/src/macros/mbm_copy b/src/macros/mbm_copy
index 30c210a..7416b59 100755
--- a/src/macros/mbm_copy
+++ b/src/macros/mbm_copy
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_plot.perl	1/17/2003
-#    $Id: mbm_copy 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_copy 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 2003-2014 by
+#    Copyright (c) 2003-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -32,7 +32,7 @@
 #   January 17, 2003
 #
 # Version:
-#   $Id: mbm_copy 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_copy 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_copy.perl,v $
@@ -64,7 +64,7 @@ $verbose = 		($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_copy 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_copy 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nMacro to apply mbcopy to all files referenced through\n";
 	print "a datalist, using the MB-System file suffix convention\n";
 	print "to name the output files.\n";
diff --git a/src/macros/mbm_dslnavfix b/src/macros/mbm_dslnavfix
index eb6ac13..46d6c8f 100755
--- a/src/macros/mbm_dslnavfix
+++ b/src/macros/mbm_dslnavfix
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_dslnavfix.perl	8/9/96
-#    $Id: mbm_dslnavfix 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_dslnavfix 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1996-2014 by
+#    Copyright (c) 1996-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -34,7 +34,7 @@
 #   August 9, 1996
 #
 # Version:
-#   $Id: mbm_dslnavfix 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_dslnavfix 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_dslnavfix.perl,v $
@@ -91,7 +91,7 @@ $verbose =    		($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_dslnavfix 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_dslnavfix 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nMacro to take WHOI DSL AMS-120 processed navigation \n";
 	print "in UTM projected eastings and northings and produce \n";
 	print "navigation in longitude and latitude. The output navigation \n";
diff --git a/src/macros/mbm_fmtvel b/src/macros/mbm_fmtvel
index eec6ff1..8324432 100755
--- a/src/macros/mbm_fmtvel
+++ b/src/macros/mbm_fmtvel
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_fmtvel.perl	6/18/93
-#    $Id: mbm_fmtvel 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_fmtvel 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -36,7 +36,7 @@
 #   May 19, 1993
 #
 # Version:
-#   $Id: mbm_fmtvel 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_fmtvel 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_fmtvel.perl,v $
@@ -101,7 +101,7 @@ $format =  ($opt_F || $opt_f);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_fmtvel 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_fmtvel 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nPerl shellscript to generate a list of the C-mean (mean water velocity) \nand C-keel (surface water velocity) used by Hydrosweepin its internal \nprocessing.  This macro executes the programhsdump and then scans the \noutput for the desired values.The only allowed formats are 5 (raw \nHydrosweep data) and 8(L-DEO in-house binary Hydrosweep data).\n";
 	print "\nUsage: $program_name -Fformat -Ifile\n";
 	exit 0;
diff --git a/src/macros/mbm_grd2arc b/src/macros/mbm_grd2arc
index fc59cc9..291d140 100755
--- a/src/macros/mbm_grd2arc
+++ b/src/macros/mbm_grd2arc
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_grd2arc.perl	6/11/99
-#    $Id: mbm_grd2arc 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_grd2arc 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1999-2014 by
+#    Copyright (c) 1999-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -36,7 +36,7 @@
 #   October 5, 1999
 #
 # Version:
-#   $Id: mbm_grd2arc 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_grd2arc 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_grd2arc.perl,v $
@@ -80,7 +80,7 @@ $verbose =  ($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grd2arc 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_grd2arc 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nMacro to convert a GMT grid file in the GMT NetCDF grid format \n";
 	print "to an ArcView ASCII grid. This allows users to import the grid\n";
 	print "into Arc/Info and ArcView. The grids must have the same grid \n";
diff --git a/src/macros/mbm_grd2geovrml b/src/macros/mbm_grd2geovrml
index 0ecb93c..6469647 100755
--- a/src/macros/mbm_grd2geovrml
+++ b/src/macros/mbm_grd2geovrml
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:     mbm_grd2geovrml.perl              11/7/2001
-$ver = '$Id: mbm_grd2geovrml 2175 2014-03-18 23:03:39Z caress $';
+$ver = '$Id: mbm_grd2geovrml 2227 2015-02-05 21:12:31Z caress $';
 #
-#    Copyright (c) 2003-2014 by
+#    Copyright (c) 2003-2015 by
 #    Mike McCann (mccann at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -55,7 +55,7 @@ $ver = '$Id: mbm_grd2geovrml 2175 2014-03-18 23:03:39Z caress $';
 #   November 7, 2001
 #
 # Version:
-#   $Id: mbm_grd2geovrml 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_grd2geovrml 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #
diff --git a/src/macros/mbm_grd3dplot b/src/macros/mbm_grd3dplot
index e6da9d6..daa4198 100755
--- a/src/macros/mbm_grd3dplot
+++ b/src/macros/mbm_grd3dplot
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_grd3dplot.perl	8/6/95
-#    $Id: mbm_grd3dplot 2180 2014-04-02 20:58:34Z caress $
+#    $Id: mbm_grd3dplot 2234 2015-03-05 07:41:54Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -50,7 +50,7 @@
 #
 # Miscellaneous Options:
 #            [-MGDgmtdef/value -FMGscale_loc
-#            -MGL[f][x]lon0/lat0/slat/length[m]
+#            -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
 #            -MGQdpi -MGSscalefactor -MGTx/y/size/angle/font/just/text
 #            -MGU[/dx/dy/][label] -MVMmesh_pen -MVNnull -MVZzlevel ]
 #
@@ -61,117 +61,7 @@
 #   August 8, 1994
 #
 # Version:
-#   $Id: mbm_grd3dplot 2180 2014-04-02 20:58:34Z caress $
-#
-# Revisions:
-#   $Log: mbm_grd3dplot.perl,v $
-#   Revision 5.18  2008/09/11 20:06:45  caress
-#   Checking in updates made during cruise AT15-36.
-#
-#   Revision 5.17  2007/10/08 04:31:20  caress
-#   Added some large page definitions.
-#
-#   Revision 5.16  2006/07/05 19:50:21  caress
-#   Working towards 5.1.0beta
-#
-#   Revision 5.15  2006/01/20 17:39:15  caress
-#   Working towards 5.0.8
-#
-#   Revision 5.14  2006/01/18 15:09:27  caress
-#   Now parses grdinfo output from GMT 4.1.
-#
-#   Revision 5.13  2005/11/05 01:34:20  caress
-#   Much work over the past two months.
-#
-#   Revision 5.12  2005/03/25 04:05:40  caress
-#   Fixed handling of tickinfo string.
-#   For mbm_plot only, added control on filename annotation direction.
-#
-#   Revision 5.11  2004/10/06 18:56:11  caress
-#   Release 5.0.5 update.
-#
-#   Revision 5.10  2004/09/16 19:11:48  caress
-#   Supports postscript viewer ggv.
-#
-#   Revision 5.9  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.8  2002/11/14 03:50:19  caress
-#   Release 5.0.beta27
-#
-#   Revision 5.7  2002/08/02 01:00:05  caress
-#   Release 5.0.beta22
-#
-#   Revision 5.6  2002/07/25 19:05:02  caress
-#   Release 5.0.beta21
-#
-#   Revision 5.5  2002/04/06 02:51:54  caress
-#   Release 5.0.beta16
-#
-#   Revision 5.4  2001/12/18 04:26:12  caress
-#   Version 5.0.beta11.
-#
-# Revision 5.3  2001/10/10  23:56:01  dcaress
-# Regrettably, I don't remember what I changed...
-#
-#   Revision 5.2  2001-06-02 23:59:24-07  caress
-#   Release 5.0.beta01
-#
-#   Revision 5.1  2001/03/22 21:05:45  caress
-#   Trying to make release 5.0.beta0
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.14  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.13  1999/12/29  00:17:55  caress
-# Release 4.6.8
-#
-# Revision 4.12  1999/06/25  17:55:47  caress
-# I must have changed something!
-#
-# Revision 4.11  1999/05/06  23:46:32  caress
-# Release 4.6a
-#
-# Revision 4.10  1999/04/16  01:25:51  caress
-# Version 4.6 final release?
-#
-# Revision 4.9  1999/04/15  19:28:52  caress
-# Fixed sprintf statements.
-#
-# Revision 4.8  1999/02/04  23:39:54  caress
-# MB-System version 4.6beta7
-#
-# Revision 4.7  1999/01/26  19:46:58  caress
-# Fixed parsing of grdinfo output from GMT 3.1.
-#
-# Revision 4.6  1998/10/05  17:00:15  caress
-# MB-System version 4.6beta
-#
-# Revision 4.5  1997/09/15  19:05:23  caress
-# Real Version 4.5
-#
-# Revision 4.4  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.4  1997/04/17  15:06:49  caress
-# MB-System 4.5 Beta Release
-#
-# Revision 4.3  1995/11/22  22:46:40  caress
-# Check in during general flail.
-#
-# Revision 4.2  1995/09/28  19:52:25  caress
-# Fixed handling of null plane specification.
-#
-# Revision 4.1  1995/09/28  18:05:43  caress
-# Various bug fixes working toward release 4.3.
-#
-# Revision 4.0  1995/08/17  14:51:59  caress
-# Revision for release 4.3.
-#
-#
+#   $Id: mbm_grd3dplot 2234 2015-03-05 07:41:54Z caress $
 #
 #
 $program_name = "mbm_grd3dplot";
@@ -369,7 +259,7 @@ $zbounds = 		($opt_Z || $opt_z);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grd3dplot 2180 2014-04-02 20:58:34Z caress $\n";
+	print "\nVersion: $Id: mbm_grd3dplot 2234 2015-03-05 07:41:54Z caress $\n";
 	print "\nMacro to generate a shellscript of GMT commands which, when \n";
 	print "executed, will generate a 3D perspective Postscript plot of  \n";
 	print "gridded data.  Several styles of plots can be generated, \n";
@@ -1572,6 +1462,17 @@ if ($coast_control
 	$coast_resolution = "f";
 	}
 
+# if length scale bar requested check to see if map center needs to be defined
+if ($length_scale && $length_scale =~ /\S+center\S+/)
+        {
+        # add map lon lat (or x y) center to the length scale argument
+        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
+        $xcen = 0.5 * ($xmin + $xmax);
+        $ycen = 0.5 * ($ymin + $ymax);
+        $b = "$xcen/$ycen";
+        $length_scale = "$a$b$c";
+        }
+
 # come up with the filenames
 $cmdfile = "$root.cmd";
 $psfile = "$root.ps";
@@ -1583,7 +1484,7 @@ else
 	{
 	$cptfile = "$root.cpt";
 	}
-$gmtfile = "gmtdefaults4\$\$";
+$gmtfile = "gmt.conf\$\$";
 
 # set some gmtisms
 $first_gmt = 1;
@@ -1592,35 +1493,27 @@ $middle = "-K -O -V >> \$PS_FILE";
 $end = "-O -V >> \$PS_FILE";
 
 # set macro gmt default settings
-$gmt_def = "MEASURE_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAPER_MEDIA/$page_gmt_name{$pagesize}+";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT/Helvetica";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT/Helvetica";
+$gmt_def = "PROJ_LENGTH_UNIT/inch";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT/Helvetica";
+$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT_SIZE/$page_header_font{$pagesize}";
+$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FRAME_WIDTH/$frame_size";
+$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "TICK_LENGTH/$tick_size";
+$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAGE_ORIENTATION/LANDSCAPE";
+$gmt_def = "COLOR_BACKGROUND/black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/0/0/0";
+$gmt_def = "COLOR_FOREGROUND/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/255/255/255";
+$gmt_def = "COLOR_NAN/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PLOT_DEGREE_FORMAT/$degree_format";
+$gmt_def = "FORMAT_GEO_MAP/$degree_format";
 push(@gmt_macro_defs, $gmt_def);
 
 # open the shellscript file
@@ -1650,15 +1543,17 @@ printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
 print FCMD "set DATA_FILE       = $file_data\n";
 print FCMD "set INTENSITY_FILE  = $file_intensity\n";
 
-# Reset GMT defaults, saving old defaults
-print FCMD "#\n# Save existing GMT defaults\n";
-print FCMD "echo Saving GMT defaults...\n";
-print FCMD "gmtdefaults -L > $gmtfile\n";
-print FCMD "#\n# Set new GMT defaults\n";
-print FCMD "echo Setting new GMT defaults...\n";
+# Set temporary GMT defaults
+print FCMD "#\n# Delete any existing gmt.conf file\n";
+print FCMD "if (-e gmt.conf) then\n";
+print FCMD "echo Deleting gmt.conf...\n";
+print FCMD "/bin/rm gmt.conf\n";
+print FCMD "endif\n";
+print FCMD "#\n# Set temporary GMT defaults\n";
+print FCMD "echo Setting temporary GMT defaults...\n";
 foreach $gmt_def (@gmt_macro_defs) {
 	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmtset $gmt_par $gmt_var\n";
+	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 	}
 
 # Reset GMT defaults as per user commands
@@ -1668,7 +1563,7 @@ if (@gmt_defs)
 	print FCMD "echo Setting user defined GMT defaults...\n";
 	foreach $gmt_def (@gmt_defs) {
 		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmtset $gmt_par $gmt_var\n";
+		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 		}
 	}
 
@@ -1690,7 +1585,7 @@ if ($color_mode && !$file_cpt)
 		{
 		if ($verbose)
 			{
-			print "Running grdhisteq...\n";
+			print "Running gmt module grdhisteq...\n";
 			}
 		$ncolors_minus = $ncolors - 1;
 		@grdhisteq = `grdhisteq $files_data[0] -C$ncolors_minus -D`;
@@ -1861,8 +1756,8 @@ if ($data_scale)
 	{
 	printf FCMD "#\n# Rescale data\n";
 	printf FCMD "echo Rescaling data by $data_scale...\n";
-	printf FCMD "echo Running grdmath...\n";
-	printf FCMD "grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
+	printf FCMD "echo Running gmt module grdmath...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
 	$file_use = "\$DATA_FILE.scale";
 	}
 
@@ -1871,17 +1766,17 @@ if ($data_scale)
 # 	{
 # 	printf FCMD "#\n# Get shading array\n";
 # 	printf FCMD "echo Getting shading array...\n";
-# 	printf FCMD "echo Running grdgradient...\n";
-#	printf FCMD "grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
+# 	printf FCMD "echo Running gmt module grdgradient...\n";
+#	printf FCMD "gmt grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
 #	if (!$gridprojected)
 #		{
-#		printf FCMD " -M";
+#		printf FCMD " -fg";
 #		}
 #	printf FCMD "\n";
-# 	printf FCMD "echo Running grdhisteq...\n";
-# 	printf FCMD "grdhisteq \$DATA_FILE.grad -G\$DATA_FILE.eq -N\n";
-# 	printf FCMD "echo Running grdmath...\n";
-# 	printf FCMD "grdmath \$DATA_FILE.eq $magnitude x = \$DATA_FILE.int\n";
+# 	printf FCMD "echo Running gmt module grdhisteq...\n";
+# 	printf FCMD "gmt grdhisteq \$DATA_FILE.grad -G\$DATA_FILE.eq -N\n";
+# 	printf FCMD "echo Running gmt module grdmath...\n";
+# 	printf FCMD "gmt grdmath \$DATA_FILE.eq $magnitude x = \$DATA_FILE.int\n";
 # 	printf FCMD "/bin/rm -f \$DATA_FILE.grad \$DATA_FILE.eq\n";
 # 	$file_shade = "\$DATA_FILE.int";
 # 	}
@@ -1896,40 +1791,40 @@ if ($color_mode == 2)
 
 	printf FCMD "#\n# Get shading array\n";
 	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running grdgradient to get x component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
+	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
-	printf FCMD "echo Running grdgradient to get y component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
+	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
 
-	printf FCMD "echo Running grdmath to get adjusted x gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
-	printf FCMD "echo Running grdmath to get adjusted y gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
+	printf FCMD "echo Running gmt module grdmath to get adjusted x gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
+	printf FCMD "echo Running gmt module grdmath to get adjusted y gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
 
-	printf FCMD "echo Running grdmath to get normalization factor...\n";
-	printf FCMD "grdmath \$DATA_FILE.magx 2.0 POW \\\n";
+	printf FCMD "echo Running gmt module grdmath to get normalization factor...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.magx 2.0 POW \\\n";
 		printf FCMD "\t\$DATA_FILE.magy 2.0 POW ADD \\\n";
 		printf FCMD "\t1.0 ADD SQRT = \$DATA_FILE.denom\n";
 
-	printf FCMD "echo Running grdmath to get normalized x gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
-	printf FCMD "echo Running grdmath to get normalized y gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
-	printf FCMD "echo Running grdmath to get normalized z gradient...\n";
-	printf FCMD "grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized x gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized y gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized z gradient...\n";
+	printf FCMD "gmt grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
 
-	printf FCMD "echo Running grdmath to apply lighting vector to normalized gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.normx $light_x MUL \\\n";
+	printf FCMD "echo Running gmt module grdmath to apply lighting vector to normalized gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.normx $light_x MUL \\\n";
 		printf FCMD "\t\$DATA_FILE.normy $light_y MUL ADD \\\n";
 		printf FCMD "\t\$DATA_FILE.normz $light_z MUL ADD -0.5 ADD = \$DATA_FILE.int\n";
 
@@ -1945,10 +1840,10 @@ if ($color_mode == 3 && $file_intensity && $stretch_shade)
 	{
 	printf FCMD "#\n# Get shading array\n";
 	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running grdhisteq...\n";
-	printf FCMD "grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
-	printf FCMD "echo Running grdmath...\n";
-	printf FCMD "grdmath \$INTENSITY_FILE.eq $magnitude x = \$INTENSITY_FILE.int\n";
+	printf FCMD "echo Running gmt module grdhisteq...\n";
+	printf FCMD "gmt grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
+	printf FCMD "echo Running gmt module grdmath...\n";
+	printf FCMD "gmt grdmath \$INTENSITY_FILE.eq $magnitude x = \$INTENSITY_FILE.int\n";
 	printf FCMD "/bin/rm -f \$INTENSITY_FILE.eq\n";
 	$file_shade = "\$INTENSITY_FILE.int";
 	}
@@ -1964,23 +1859,23 @@ elsif ($color_mode >= 4)
 	{
 	printf FCMD "#\n# Get slope array\n";
 	printf FCMD "echo Getting slope array...\n";
-	printf FCMD "echo Running grdgradient to get x component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
+	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
-	printf FCMD "echo Running grdgradient to get y component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
+	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
 
-	printf FCMD "echo Running grdmath to get slope magnitude...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
+	printf FCMD "echo Running gmt module grdmath to get slope magnitude...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
 	printf FCMD "\t\$DATA_FILE.drvy 2.0 POW ADD SQRT \\\n";
 	if ($color_mode == 5)
 		{
@@ -2025,46 +1920,47 @@ elsif ($nlabels < 2)
 # set basemap axes annotation
 if ($tick_info)
 	{
-	$axes = $tick_info;
-	if (!($tick_info =~ /.*:\..*/))
-		{
-		$axes = "$axes:.\"$tlabel\":";
-		}
+	$axes = "-B$tick_info";
 	}
 else
 	{
 	# figure out some reasonable tick intervals for the basemap
 	&GetBaseTick;
-	if ($view_azimuth >= 0.0 && $view_azimuth < 90.0)
-		{
-		$axes = "$base_tick/$base_tick/$base_tick_z:.\"$tlabel\":NEZ";
-		}
-	elsif ($view_azimuth >= 90.0 && $view_azimuth < 180.0)
-		{
-		$axes = "$base_tick/$base_tick/$base_tick_z:.\"$tlabel\":SEZ";
-		}
-	elsif ($view_azimuth >= 180.0 && $view_azimuth < 270.0)
-		{
-		$axes = "$base_tick/$base_tick/$base_tick_z:.\"$tlabel\":WSZ";
-		}
-	elsif ($view_azimuth >= 270.0 && $view_azimuth < 360.0)
-		{
-		$axes = "$base_tick/$base_tick/$base_tick_z:.\"$tlabel\":WNZ";
-		}
+        $axes = "-Bxy$base_tick -Bz$base_tick_z"
+	}
+if ($view_azimuth >= 0.0 && $view_azimuth < 90.0)
+        {
+        $axes = "$axes -BNEZ";
+        }
+elsif ($view_azimuth >= 90.0 && $view_azimuth < 180.0)
+        {
+        $axes = "$axes -BSEZ";
+        }
+elsif ($view_azimuth >= 180.0 && $view_azimuth < 270.0)
+        {
+        $axes = "$axes -BWSZ";
+        }
+elsif ($view_azimuth >= 270.0 && $view_azimuth < 360.0)
+        {
+        $axes = "$axes -BWNZ";
+        }
+if ($tlabel)
+	{
+        $axes = "$axes+t\"$tlabel\"";
 	}
 
 # do grdview plot
 if ($color_mode)
 	{
 	printf FCMD "#\n# Make 3D view\n";
-	printf FCMD "echo Running grdview...\n";
+	printf FCMD "echo Running gmt module grdview...\n";
 	if ($color_mode == 4)
 		{
-		printf FCMD "grdview $file_slope \\\n\t";
+		printf FCMD "gmt grdview $file_slope \\\n\t";
 		}
 	else
 		{
-		printf FCMD "grdview $file_use \\\n\t";
+		printf FCMD "gmt grdview $file_use \\\n\t";
 		}
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
 	printf FCMD "-E$view_control \\\n\t";
@@ -2124,8 +2020,8 @@ if ($color_mode)
 if ($coast_control)
 	{
 	printf FCMD "#\n# Make coastline data plot\n";
-	printf FCMD "echo Running pscoast...\n";
-	printf FCMD "pscoast \\\n\t";
+	printf FCMD "echo Running gmt module pscoast...\n";
+	printf FCMD "gmt pscoast \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
 	printf FCMD "-E$view_control \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
@@ -2176,17 +2072,17 @@ if ($coast_control)
 if ($color_mode && $color_mode < 7 && $color_pallette < 5)
 	{
 	printf FCMD "#\n# Make color scale\n";
-	printf FCMD "echo Running psscale...\n";
-	printf FCMD "psscale -C\$CPT_FILE \\\n\t";
+	printf FCMD "echo Running gmt module psscale...\n";
+	printf FCMD "gmt psscale -C\$CPT_FILE \\\n\t";
 	printf FCMD "-D%.4f/%.4f/%.4f/%.4f%s \\\n\t",
 		$colorscale_offx,$colorscale_offy,
 		$colorscale_length,$colorscale_thick,
 		$colorscale_vh;
-	print FCMD "-B\":$slabel:\" \\\n\t";
-	if ($stretch_color)
-		{
-		print FCMD "-L \\\n\t";
-		}
+	print FCMD "-B+l\"$slabel\" \\\n\t";
+#	if ($stretch_color)
+#		{
+#		print FCMD "-L \\\n\t";
+#		}
 	if ($portrait)
 		{
 		printf FCMD "-P ";
@@ -2198,8 +2094,8 @@ if ($color_mode && $color_mode < 7 && $color_pallette < 5)
 if (@text)
 	{
 	printf FCMD "#\n# Make text labels\n";
-	printf FCMD "echo Running pstext...\n";
-	printf FCMD "pstext -J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
+	printf FCMD "echo Running gmt module pstext...\n";
+	printf FCMD "gmt pstext -J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
 	printf FCMD "-E$view_control \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	printf FCMD "$middle <<EOT\n";
@@ -2215,8 +2111,8 @@ if (@text)
 
 # do psbasemap plot
 printf FCMD "#\n# Make basemap\n";
-printf FCMD "echo Running psbasemap...\n";
-printf FCMD "psbasemap -J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
+printf FCMD "echo Running gmt module psbasemap...\n";
+printf FCMD "gmt psbasemap -J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
 	printf FCMD "-E$view_control \\\n\t";
 printf FCMD "-R\$MAP_REGION \\\n\t";
 printf FCMD "-B$axes \\\n\t";
@@ -2245,6 +2141,7 @@ printf FCMD "$end\n";
 # delete surplus files
 print FCMD "#\n# Delete surplus files\n";
 print FCMD "echo Deleting surplus files...\n";
+print FCMD "/bin/rm -f gmt.conf\n";
 if (!$file_cpt)
 	{
 	print FCMD "/bin/rm -f \$CPT_FILE\n";
@@ -2253,11 +2150,10 @@ if ($data_scale)
 	{
 	printf FCMD "/bin/rm -f $file_use\n";
 	}
-
-# reset GMT defaults
-print FCMD "#\n# Reset GMT default fonts\n";
-print FCMD "echo Resetting GMT fonts...\n";
-print FCMD "/bin/mv $gmtfile .gmtdefaults4\n";
+if ($file_slope)
+	{
+	printf FCMD "/bin/rm -f $file_slope\n";
+	}
 
 # display image on screen if desired
 print FCMD "#\n# Run $ps_viewer\n";
@@ -2332,13 +2228,17 @@ elsif ($ps_viewer eq "evince")
 	}
 if ($no_view_ps)
 	{
+        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "#echo Running $ps_viewer in background...\n";
 	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "#endif\n";
 	}
 else
 	{
+        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "echo Running $ps_viewer in background...\n";
 	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "endif\n";
 	}
 
 # claim it's all over
@@ -2773,16 +2673,6 @@ $width_max_portrait = $page_width_in{$pagesize}
 		- $space_left - $space_right;
 $height_max_portrait = $page_height_in{$pagesize}
 		- $space_bottom - $space_top;
-$frame_size = 0.075;
-if (($frame_size / $height_max_portrait) > 0.01)
-	{
-	$frame_size = 0.01 * $height_max_portrait;
-	}
-$tick_size = 0.075;
-if (($tick_size / $height_max_portrait) > 0.01)
-	{
-	$tick_size = 0.01 * $height_max_portrait;
-	}
 }
 #-----------------------------------------------------------------------
 sub GetProjection {
@@ -3110,27 +3000,27 @@ sub GetBaseTick {
 	$base_tick = &min($base_tick_x, $base_tick_y);
 	if ($base_tick < 0.0002777777)
 		{
-		$base_tick = "1c";
+		$base_tick = "1s";
 		}
 	elsif ($base_tick < 0.0005555555)
 		{
-		$base_tick = "2c";
+		$base_tick = "2s";
 		}
 	elsif ($base_tick < 0.0013888889)
 		{
-		$base_tick = "5c";
+		$base_tick = "5s";
 		}
 	elsif ($base_tick < 0.0027777778)
 		{
-		$base_tick = "10c";
+		$base_tick = "10s";
 		}
 	elsif ($base_tick < 0.0041666667)
 		{
-		$base_tick = "15c";
+		$base_tick = "15s";
 		}
 	elsif ($base_tick < 0.0083333333)
 		{
-		$base_tick = "30c";
+		$base_tick = "30s";
 		}
 	elsif ($base_tick < 0.0166667)
 		{
diff --git a/src/macros/mbm_grdcut b/src/macros/mbm_grdcut
index 78b24e4..bb0fce1 100755
--- a/src/macros/mbm_grdcut
+++ b/src/macros/mbm_grdcut
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_arc2grd.perl	4/23/01
-#    $Id: mbm_grdcut 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_grdcut 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 2001-2014 by
+#    Copyright (c) 2001-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -38,7 +38,7 @@
 #    10 km off the Kohala coast of Hawaii)
 #
 # Version:
-#   $Id: mbm_grdcut 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_grdcut 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_grdcut.perl,v $
@@ -97,7 +97,7 @@ $verbose += 1;
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdcut 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_grdcut 2227 2015-02-05 21:12:31Z caress $\n";
  	print "Macro to painlessly cut out a region from a GMT grd grid file.\n";
 	print "The GMT program grdcut requires that one specify bounds which\n";
 	print "exactly match grid cell boundaries. Frequently, one just wants\n";
diff --git a/src/macros/mbm_grdinfo b/src/macros/mbm_grdinfo
index ec6db8d..6a3ac06 100755
--- a/src/macros/mbm_grdinfo
+++ b/src/macros/mbm_grdinfo
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_grdinfo.perl	4/26/01
-#    $Id: mbm_grdinfo 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_grdinfo 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 2001-2014 by
+#    Copyright (c) 2001-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -38,7 +38,7 @@
 #    10 km off the windward coast of Oahu)
 ##
 # Version:
-#   $Id: mbm_grdinfo 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_grdinfo 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_grdinfo.perl,v $
@@ -94,7 +94,7 @@ $verbose = 		($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdinfo 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_grdinfo 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nMacro to get information regarding a GMT grd file when the\n";
 	print "region of interest is a subset of the area covered in the\n";
 	print "input file. If no bounds are specified, the program grdinfo \n";
diff --git a/src/macros/mbm_grdplot b/src/macros/mbm_grdplot
index ade8f9a..33908be 100755
--- a/src/macros/mbm_grdplot
+++ b/src/macros/mbm_grdplot
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_grdplot.perl	8/6/95
-#    $Id: mbm_grdplot 2201 2014-08-21 00:49:46Z caress $
+#    $Id: mbm_grdplot 2238 2015-04-15 06:00:52Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -49,7 +49,7 @@
 #
 # Miscellaneous Options:
 #            [-MGDgmtdef/value -MGFscale_loc";
-#            -MGL[f][x]lon0/lat0/slat/length[m]
+#            -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
 #            -MGQdpi -MGSscalefactor -MGTx/y/size/angle/font/just/text
 #            -MGU[/dx/dy/][label] -MCAanot_int/[ffont_size][aangle][/r/g/b][o]]
 #            -MCGgap/width -MCQcut -MCT[+|-][gap/length][:LH] -MCWtype[pen]
@@ -67,173 +67,7 @@
 #   October 19, 1994
 #
 # Version:
-#   $Id: mbm_grdplot 2201 2014-08-21 00:49:46Z caress $
-#
-# Revisions:
-#   $Log: mbm_grdplot.perl,v $
-#   Revision 5.33  2008/09/11 20:06:45  caress
-#   Checking in updates made during cruise AT15-36.
-#
-#   Revision 5.32  2008/07/10 06:43:40  caress
-#   Preparing for 5.1.1beta20
-#
-#   Revision 5.31  2008/05/16 22:36:21  caress
-#   Release 5.1.1beta18
-#
-#   Revision 5.30  2008/02/12 02:52:50  caress
-#   Working on adding sealevel colormap, but haven't finished it at this point.
-#
-#   Revision 5.29  2008/01/14 17:47:41  caress
-#   Fixed typo.
-#
-#   Revision 5.28  2007/10/08 04:30:55  caress
-#   Added some large page definitions.
-#
-#   Revision 5.27  2007/03/02 20:34:26  caress
-#   Fixed plotting of ping/shot number annotation along navigation tracks.
-#
-#   Revision 5.26  2006/12/15 21:42:49  caress
-#   Incremental CVS update.
-#
-#   Revision 5.25  2006/09/11 18:55:52  caress
-#   Changes during Western Flyer and Thomas Thompson cruises, August-September
-#   2006.
-#
-#   Revision 5.24  2006/08/09 22:36:23  caress
-#   The macro mbm_grdplot now handles calls for a linear plot with
-#   decreasing x values (e.g. using -Jx-0.01/20 to specify the projection).
-#
-#   Revision 5.23  2006/08/04 03:56:41  caress
-#   Working towards 5.1.0 release.
-#
-#   Revision 5.22  2006/07/05 19:50:21  caress
-#   Working towards 5.1.0beta
-#
-#   Revision 5.21  2006/06/22 04:45:42  caress
-#   Working towards 5.1.0
-#
-#   Revision 5.20  2006/06/16 19:30:58  caress
-#   Check in after the Santa Monica Basin Mapping AUV Expedition.
-#
-#   Revision 5.19  2006/01/20 17:39:15  caress
-#   Working towards 5.0.8
-#
-#   Revision 5.18  2006/01/18 15:09:27  caress
-#   Now parses grdinfo output from GMT 4.1.
-#
-#   Revision 5.17  2006/01/06 18:26:26  caress
-#   Working towards 5.0.8
-#
-#   Revision 5.16  2005/11/05 01:34:20  caress
-#   Much work over the past two months.
-#
-#   Revision 5.15  2005/04/07 04:12:39  caress
-#   Implemented feature to generate contours from a separate grid file. Contributed by Gordon Keith.
-#
-#   Revision 5.14  2005/03/25 04:05:39  caress
-#   Fixed handling of tickinfo string.
-#   For mbm_plot only, added control on filename annotation direction.
-#
-#   Revision 5.13  2004/12/18 01:31:26  caress
-#   Working towards release 5.0.6.
-#
-#   Revision 5.12  2004/10/06 18:56:11  caress
-#   Release 5.0.5 update.
-#
-#   Revision 5.11  2004/09/16 19:11:48  caress
-#   Supports postscript viewer ggv.
-#
-#   Revision 5.10  2004/06/18 04:16:55  caress
-#   Adding support for segy i/o and working on support for Reson 7k format 88.
-#
-#   Revision 5.9  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.8  2002/11/14 03:50:19  caress
-#   Release 5.0.beta27
-#
-#   Revision 5.7  2002/08/02 01:00:05  caress
-#   Release 5.0.beta22
-#
-#   Revision 5.6  2002/04/06 02:51:54  caress
-#   Release 5.0.beta16
-#
-#   Revision 5.5  2001/12/18 04:26:12  caress
-#   Version 5.0.beta11.
-#
-# Revision 5.4  2001/11/02  21:07:40  caress
-# Adjusted handling of segmented xy files.
-#
-# Revision 5.3  2001/10/10  23:56:01  dcaress
-# Regrettably, I don't remember what I changed...
-#
-#   Revision 5.2  2001-06-02 23:59:24-07  caress
-#   Release 5.0.beta01
-#
-#   Revision 5.1  2001/03/22 21:05:45  caress
-#   Trying to make release 5.0.beta0
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.16  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.15  1999/12/29  00:17:55  caress
-# Release 4.6.8
-#
-# Revision 4.14  1999/08/08  04:17:04  caress
-# Added coastline plots.
-#
-# Revision 4.13  1999/06/25  17:55:47  caress
-# I must have changed something!
-#
-# Revision 4.12  1999/05/06  23:46:32  caress
-# Release 4.6a
-#
-# Revision 4.11  1999/04/16  01:25:51  caress
-# Version 4.6 final release?
-#
-# Revision 4.10  1999/04/15  19:28:52  caress
-# Fixed sprintf statements.
-#
-# Revision 4.9  1999/02/04  23:39:54  caress
-# MB-System version 4.6beta7
-#
-# Revision 4.8  1999/01/26  19:46:58  caress
-# Fixed parsing of grdinfo output from GMT 3.1.
-#
-# Revision 4.7  1998/10/05  17:00:15  caress
-# MB-System version 4.6beta
-#
-# Revision 4.6  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.6  1997/04/17  15:06:49  caress
-# MB-System 4.5 Beta Release
-#
-# Revision 4.5  1995/11/22  22:46:40  caress
-# Check in during general flail.
-#
-# Revision 4.4  1995/09/28  18:05:43  caress
-# Various bug fixes working toward release 4.3.
-#
-# Revision 4.3  1995/08/17  14:52:53  caress
-# Revision for release 4.3.
-#
-# Revision 4.2  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.1  1995/02/14  19:50:31  caress
-# Version 4.2
-#
-# Revision 4.0  1994/10/21  11:49:39  caress
-# Release V4.0
-#
-# Revision 1.1  1994/10/21  11:36:58  caress
-# Initial revision
-#
+#   $Id: mbm_grdplot 2238 2015-04-15 06:00:52Z caress $
 #
 #
 $program_name = "mbm_grdplot";
@@ -439,7 +273,7 @@ $zbounds = 		($opt_Z || $opt_z);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdplot 2201 2014-08-21 00:49:46Z caress $\n";
+	print "\nVersion: $Id: mbm_grdplot 2238 2015-04-15 06:00:52Z caress $\n";
 	print "\nMacro to generate a shellscript of GMT commands which, \n";
 	print "when executed, will generate a Postscript plot of gridded \n";
 	print "data.  Several styles of plots can be generated, including \n";
@@ -1136,7 +970,7 @@ if (!$bounds || !$zbounds || $zmode == 1)
 	{
 	if ($verbose > 0)
 		{
-		print "\nRunning grdinfo to get file bounds and min max...\n";
+		print "\nRunning gmt module grdinfo to get file bounds and min max...\n";
 		}
 
 	foreach $file_grd (@files_data) {
@@ -2094,6 +1928,17 @@ if ($pingnumber_mode)
 			. "/" . "$pingnumber_tick_len";
 	}
 
+# if length scale bar requested check to see if map center needs to be defined
+if ($length_scale && $length_scale =~ /\S+center\S+/)
+        {
+        # add map lon lat (or x y) center to the length scale argument
+        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
+        $xcen = 0.5 * ($xmin + $xmax);
+        $ycen = 0.5 * ($ymin + $ymax);
+        $b = "$xcen/$ycen";
+        $length_scale = "$a$b$c";
+        }
+
 # come up with the filenames
 $cmdfile = "$root.cmd";
 $psfile = "$root.ps";
@@ -2105,7 +1950,7 @@ else
 	{
 	$cptfile = "$root.cpt";
 	}
-$gmtfile = "gmtdefaults4\$\$";
+$gmtfile = "gmt.conf\$\$";
 
 # set some gmtisms
 $first_gmt = 1;
@@ -2114,36 +1959,37 @@ $middle = "-K -O -V >> \$PS_FILE";
 $end = "-O -V >> \$PS_FILE";
 
 # set macro gmt default settings
-$gmt_def = "MEASURE_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-# If + is added then the media is EPS
-$gmt_def = "PAPER_MEDIA/$page_gmt_name{$pagesize}+";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT/Helvetica";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT/Helvetica";
+$gmt_def = "PROJ_LENGTH_UNIT/inch";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT/Helvetica";
+$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT_SIZE/$page_header_font{$pagesize}";
+$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FRAME_WIDTH/$frame_size";
+$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "TICK_LENGTH/$tick_size";
+$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAGE_ORIENTATION/LANDSCAPE";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/0/0/0";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/255/255/255";
+if ($color_flip)
+    {
+    $gmt_def = "COLOR_BACKGROUND/white";
+    push(@gmt_macro_defs, $gmt_def);
+    $gmt_def = "COLOR_FOREGROUND/black";
+    push(@gmt_macro_defs, $gmt_def);
+    }
+else
+    {
+    $gmt_def = "COLOR_BACKGROUND/black";
+    push(@gmt_macro_defs, $gmt_def);
+    $gmt_def = "COLOR_FOREGROUND/white";
+    push(@gmt_macro_defs, $gmt_def);
+    }
+$gmt_def = "COLOR_NAN/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PLOT_DEGREE_FORMAT/$degree_format";
+$gmt_def = "FORMAT_GEO_MAP/$degree_format";
 push(@gmt_macro_defs, $gmt_def);
 
 # open the shellscript file
@@ -2170,15 +2016,17 @@ print FCMD "set MAP_REGION      = $bounds_plot\n";
 printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
 printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
 
-# Reset GMT defaults, saving old defaults
-print FCMD "#\n# Save existing GMT defaults\n";
-print FCMD "echo Saving GMT defaults...\n";
-print FCMD "gmtdefaults -L > $gmtfile\n";
-print FCMD "#\n# Set new GMT defaults\n";
-print FCMD "echo Setting new GMT defaults...\n";
+# Set temporary GMT defaults
+print FCMD "#\n# Delete any existing gmt.conf file\n";
+print FCMD "if (-e gmt.conf) then\n";
+print FCMD "echo Deleting gmt.conf...\n";
+print FCMD "/bin/rm gmt.conf\n";
+print FCMD "endif\n";
+print FCMD "#\n# Set temporary GMT defaults\n";
+print FCMD "echo Setting temporary GMT defaults...\n";
 foreach $gmt_def (@gmt_macro_defs) {
 	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmtset $gmt_par $gmt_var\n";
+	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 	}
 
 # Reset GMT defaults as per user commands
@@ -2188,7 +2036,7 @@ if (@gmt_defs)
 	print FCMD "echo Setting user defined GMT defaults...\n";
 	foreach $gmt_def (@gmt_defs) {
 		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmtset $gmt_par $gmt_var\n";
+		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 		}
 	}
 
@@ -2220,9 +2068,10 @@ if ($color_mode && !$file_cpt)
 		{
 		if ($verbose)
 			{
-			print "Running grdhisteq...\n";
+			print "Running gmt module grdhisteq:\n";
+                        print "\tgmt grdhisteq $files_data[0] -C$ncolors -D\n";
 			}
-		@grdhisteq = `grdhisteq $files_data[0] -C$ncolors -D`;
+		@grdhisteq = `gmt grdhisteq $files_data[0] -C$ncolors -D`;
 		foreach $d (@grdhisteq) {
 			($d1, $d2) = $d =~ /(\S+)\s+(\S+).*/;
 			if ($d2 > $d1)
@@ -2478,8 +2327,8 @@ if ($data_scale)
 	{
 	printf FCMD "#\n# Rescale data\n";
 	printf FCMD "echo Rescaling data by $data_scale...\n";
-	printf FCMD "echo Running grdmath...\n";
-	printf FCMD "grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
+	printf FCMD "echo Running gmt module grdmath...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
 	$file_use = "\$DATA_FILE.scale";
 	}
 
@@ -2488,16 +2337,16 @@ if ($data_scale)
 #	{
 #	printf FCMD "#\n# Get shading array\n";
 #	printf FCMD "echo Getting shading array...\n";
-#	printf FCMD "echo Running grdgradient...\n";
-#	printf FCMD "grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
+#	printf FCMD "echo Running gmt module grdgradient...\n";
+#	printf FCMD "gmt grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
 #	if ($gridprojected == 0)
 #		{
-#		printf FCMD " -M";
+#		printf FCMD " -fg";
 #		}
 #	printf FCMD "\n";
-#	printf FCMD "echo Running grdhisteq...\n";
+#	printf FCMD "echo Running gmt module grdhisteq...\n";
 #	printf FCMD "grdhisteq \$DATA_FILE.grad -G\$DATA_FILE.eq -N\n";
-#	printf FCMD "echo Running grdmath...\n";
+#	printf FCMD "echo Running gmt module grdmath...\n";
 #	printf FCMD "grdmath \$DATA_FILE.eq $magnitude x = \$DATA_FILE.int\n";
 #	printf FCMD "/bin/rm -f \$DATA_FILE.grad \$DATA_FILE.eq\n";
 #	$file_shade = "\$DATA_FILE.int";
@@ -2513,40 +2362,40 @@ if ($color_mode == 2)
 
 	printf FCMD "#\n# Get shading array\n";
 	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running grdgradient to get x component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
+	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
 	if ($gridprojected == 0)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
-	printf FCMD "echo Running grdgradient to get y component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
+	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
 	if ($gridprojected == 0)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
 
-	printf FCMD "echo Running grdmath to get adjusted x gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
-	printf FCMD "echo Running grdmath to get adjusted y gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
+	printf FCMD "echo Running gmt module grdmath to get adjusted x gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
+	printf FCMD "echo Running gmt module grdmath to get adjusted y gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
 
-	printf FCMD "echo Running grdmath to get normalization factor...\n";
-	printf FCMD "grdmath \$DATA_FILE.magx 2.0 POW \\\n";
+	printf FCMD "echo Running gmt module grdmath to get normalization factor...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.magx 2.0 POW \\\n";
 	printf FCMD "\t\$DATA_FILE.magy 2.0 POW ADD \\\n";
 	printf FCMD "\t1.0 ADD SQRT = \$DATA_FILE.denom\n";
 
-	printf FCMD "echo Running grdmath to get normalized x gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
-	printf FCMD "echo Running grdmath to get normalized y gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
-	printf FCMD "echo Running grdmath to get normalized z gradient...\n";
-	printf FCMD "grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized x gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized y gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized z gradient...\n";
+	printf FCMD "gmt grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
 
-	printf FCMD "echo Running grdmath to apply lighting vector to normalized gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.normx $light_x MUL \\\n";
+	printf FCMD "echo Running gmt module grdmath to apply lighting vector to normalized gradient...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.normx $light_x MUL \\\n";
 	printf FCMD "\t\$DATA_FILE.normy $light_y MUL ADD \\\n";
 	printf FCMD "\t\$DATA_FILE.normz $light_z MUL ADD -0.5 ADD = \$DATA_FILE.int\n";
 
@@ -2562,10 +2411,10 @@ elsif ($color_mode == 3 && $file_int && $stretch_shade)
 	{
 	printf FCMD "#\n# Get shading array\n";
 	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running grdhisteq...\n";
-	printf FCMD "grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
-	printf FCMD "echo Running grdmath...\n";
-	printf FCMD "grdmath \$INTENSITY_FILE.eq $magnitude MUL = \$INTENSITY_FILE.int\n";
+	printf FCMD "echo Running gmt module grdhisteq...\n";
+	printf FCMD "gmt grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
+	printf FCMD "echo Running gmt module grdmath...\n";
+	printf FCMD "gmt grdmath \$INTENSITY_FILE.eq $magnitude MUL = \$INTENSITY_FILE.int\n";
 	printf FCMD "/bin/rm -f \$INTENSITY_FILE.eq\n";
 	$file_shade = "\$INTENSITY_FILE.int";
 	}
@@ -2581,23 +2430,23 @@ elsif ($color_mode >= 4)
 	{
 	printf FCMD "#\n# Get slope array\n";
 	printf FCMD "echo Getting slope array...\n";
-	printf FCMD "echo Running grdgradient to get x component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
+	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
 	if ($gridprojected == 0)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
-	printf FCMD "echo Running grdgradient to get y component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
+	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
+	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
 	if ($gridprojected == 0)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
 
-	printf FCMD "echo Running grdmath to get slope magnitude...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
+	printf FCMD "echo Running gmt module grdmath to get slope magnitude...\n";
+	printf FCMD "gmt grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
 	printf FCMD "\t\$DATA_FILE.drvy 2.0 POW ADD SQRT \\\n";
 	if ($color_mode == 5)
 		{
@@ -2613,14 +2462,14 @@ elsif ($color_mode >= 4)
 if ($color_mode)
 	{
 	printf FCMD "#\n# Make color image\n";
-	printf FCMD "echo Running grdimage...\n";
+	printf FCMD "echo Running gmt module grdimage...\n";
 	if ($color_mode == 4)
 		{
-		printf FCMD "grdimage $file_slope -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
+		printf FCMD "gmt grdimage $file_slope -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 		}
 	else
 		{
-		printf FCMD "grdimage $file_use -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
+		printf FCMD "gmt grdimage $file_use -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 		}
 	printf FCMD "-R\$MAP_REGION -C\$CPT_FILE \\\n\t";
 	if ($color_mode == 2 || $color_mode == 3)
@@ -2658,8 +2507,8 @@ if ($contour_mode)
 		$contour_file = $file_use
 		}
 	printf FCMD "#\n# Make contour plot\n";
-	printf FCMD "echo Running grdcontour...\n";
-	printf FCMD "grdcontour $contour_file -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
+	printf FCMD "echo Running gmt module grdcontour...\n";
+	printf FCMD "gmt grdcontour $contour_file -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	printf FCMD "-C$contour_control \\\n\t";
 	if (!$contour_pen)
@@ -2737,31 +2586,66 @@ elsif ($nlabels < 2)
 if ($gridprojected == 2 && $tick_info && $tick_info =~ /\S+\/\S+/)
 	{
 	($base_tick_x, $base_tick_y) = $tick_info =~ /(\S+)\/(\S+)/;
-	$base_tick_x = "$base_tick_x" . "\":$xunits:\"";
-	$base_tick_y = "$base_tick_y" . "\":$yunits:\"";
-	$axes = "$base_tick_x/$base_tick_y:.\"$tlabel\":WESN";
+        if ($xunits)
+                {
+                $axes = "-Bx$base_tick_x+l\"$xunits\"";
+                }
+        else
+                {
+                $axes = "-Bx$base_tick_x";
+                }
+        if ($yunits)
+                {
+                $axes = "$axes -By$base_tick_y+l\"$yunits\"";
+                }
+        else
+                {
+                $axes = "$axes -By$base_tick_y";
+                }
 	}
 elsif ($tick_info)
 	{
-	$axes = $tick_info;
-	if (!($tick_info =~ /.*:\..*/))
-		{
-		$axes = "$axes:.\"$tlabel\":";
-		}
+	$axes = "-B$tick_info";
 	}
 else
 	{
 	# figure out some reasonable tick intervals for the basemap
 	&GetBaseTick;
-	$axes = "$base_tick_x/$base_tick_y:.\"$tlabel\":";
+        if ($base_tick_x == $base_tick_y)
+                {
+                $axes = "-B$base_tick"
+                }
+        else
+                {
+                if ($xunits)
+                        {
+                        $axes = "-Bx$base_tick_x+l\"$xunits\"";
+                        }
+                else
+                        {
+                        $axes = "-Bx$base_tick_x";
+                        }
+                if ($yunits)
+                        {
+                        $axes = "$axes -By$base_tick_y+l\"$yunits\"";
+                        }
+                else
+                        {
+                        $axes = "$axes -By$base_tick_y";
+                        }
+                }
+	}
+if ($tlabel)
+	{
+	$axes = "$axes -B+t\"$tlabel\"";
 	}
 
 # do coastline plots
 if ($coast_control)
 	{
 	printf FCMD "#\n# Make coastline data plot\n";
-	printf FCMD "echo Running pscoast...\n";
-	printf FCMD "pscoast \\\n\t";
+	printf FCMD "echo Running gmt module pscoast...\n";
+	printf FCMD "gmt pscoast \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	if ($coast_lakefill)
@@ -2811,8 +2695,8 @@ if ($coast_control)
 for ($i = 0; $i < scalar(@xyfiles); $i++)
 	{
 	printf FCMD "#\n# Make xy data plot\n";
-	printf FCMD "echo Running psxy...\n";
-	printf FCMD "psxy $xyfiles[$i] \\\n\t";
+	printf FCMD "echo Running gmt module psxy...\n";
+	printf FCMD "gmt psxy $xyfiles[$i] \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	if ($xyfills[$i] ne "N")
@@ -2867,8 +2751,8 @@ if ($swathnavdatalist)
 		}
 
 	printf FCMD "#\n# Make swath nav plot\n";
-	printf FCMD "echo Running mbcontour...\n";
-	printf FCMD "mbcontour -F$swathformat -I $swathnavdatalist \\\n\t";
+	printf FCMD "echo Running gmt module mbcontour...\n";
+	printf FCMD "gmt mbcontour -F$swathformat -I$swathnavdatalist \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	if ($navigation_mode)
@@ -2906,17 +2790,17 @@ if ($swathnavdatalist)
 if ($color_mode && ($color_pallette < 5 || $color_pallette >= 8) && $gridprojected != 2)
 	{
 	printf FCMD "#\n# Make color scale\n";
-	printf FCMD "echo Running psscale...\n";
-	printf FCMD "psscale -C\$CPT_FILE \\\n\t";
+	printf FCMD "echo Running gmt module psscale...\n";
+	printf FCMD "gmt psscale -C\$CPT_FILE \\\n\t";
 	printf FCMD "-D%.4f/%.4f/%.4f/%.4f%s \\\n\t",
 		$colorscale_offx,$colorscale_offy,
 		$colorscale_length,$colorscale_thick,
 		$colorscale_vh;
-	print FCMD "-B\":$slabel:\" \\\n\t";
-	if ($stretch_color)
-		{
-		print FCMD "-L \\\n\t";
-		}
+	print FCMD "-B+l\"$slabel\" \\\n\t";
+#	if ($stretch_color)
+#		{
+#		print FCMD "-L \\\n\t";
+#		}
 	if ($portrait)
 		{
 		printf FCMD "-P ";
@@ -2928,8 +2812,8 @@ if ($color_mode && ($color_pallette < 5 || $color_pallette >= 8) && $gridproject
 if (@text)
 	{
 	printf FCMD "#\n# Make text labels\n";
-	printf FCMD "echo Running pstext...\n";
-	printf FCMD "pstext -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
+	printf FCMD "echo Running gmt module pstext...\n";
+	printf FCMD "gmt pstext -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	printf FCMD "$middle <<EOT\n";
 	foreach $text_info (@text) {
@@ -2944,10 +2828,10 @@ if (@text)
 
 # do psbasemap plot
 printf FCMD "#\n# Make basemap\n";
-printf FCMD "echo Running psbasemap...\n";
-printf FCMD "psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
+printf FCMD "echo Running gmt module psbasemap...\n";
+printf FCMD "gmt psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "-B$axes \\\n\t";
+printf FCMD "$axes \\\n\t";
 if ($length_scale)
 	{
 	printf FCMD "-L$length_scale \\\n\t";
@@ -2969,6 +2853,7 @@ printf FCMD "$end\n";
 # delete surplus files
 print FCMD "#\n# Delete surplus files\n";
 print FCMD "echo Deleting surplus files...\n";
+print FCMD "/bin/rm -f gmt.conf\n";
 if (!$file_cpt)
 	{
 	print FCMD "/bin/rm -f \$CPT_FILE\n";
@@ -2977,11 +2862,10 @@ if ($data_scale)
 	{
 	printf FCMD "/bin/rm -f $file_use\n";
 	}
-
-# reset GMT defaults
-print FCMD "#\n# Reset GMT default fonts\n";
-print FCMD "echo Resetting GMT fonts...\n";
-print FCMD "/bin/mv $gmtfile .gmtdefaults4\n";
+if ($file_slope)
+	{
+	printf FCMD "/bin/rm -f $file_slope\n";
+	}
 
 # display image on screen if desired
 print FCMD "#\n# Run $ps_viewer\n";
@@ -3056,13 +2940,17 @@ elsif ($ps_viewer eq "evince")
 	}
 if ($no_view_ps)
 	{
+        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "#echo Running $ps_viewer in background...\n";
 	print FCMD "#$ps_viewer $view_pageflag $psfile &\n";
+        print FCMD "#endif\n";
 	}
 else
 	{
+        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "echo Running $ps_viewer in background...\n";
 	print FCMD "$ps_viewer $view_pageflag $psfile &\n";
+        print FCMD "endif\n";
 	}
 
 # claim it's all over
@@ -3609,16 +3497,6 @@ $width_max_portrait = $page_width_in{$pagesize}
 		- $space_left - $space_right;
 $height_max_portrait = $page_height_in{$pagesize}
 		- $space_bottom - $space_top;
-$frame_size = 0.075;
-if (($frame_size / $height_max_portrait) > 0.01)
-	{
-	$frame_size = 0.01 * $height_max_portrait;
-	}
-$tick_size = 0.075;
-if (($tick_size / $height_max_portrait) > 0.01)
-	{
-	$tick_size = 0.01 * $height_max_portrait;
-	}
 }
 #-----------------------------------------------------------------------
 sub GetProjection {
@@ -3965,15 +3843,16 @@ sub GetBaseTick {
 	if ($gridprojected == 2)
 		{
 		$base_gridline_y = $base_tick_y / 2;
-		$base_tick_x = "$base_tick_x" . "\":Trace Number:\"";
-		$base_tick_y = "a$base_tick_y" . "g$base_gridline_y" . "\":Time (sec):\"";
+		$base_tick_y = "a$base_tick_y" . "g$base_gridline_y";
+                $base_tick_xlabel = "\"Trace Number\"";
+                $base_tick_ylabel = "\"Time (sec)\"";
 		}
 
 	# deal with generic linear grids
 	elsif ($gridprojected == 3)
 		{
-		$base_tick_x = "$base_tick_x" . "\":$xunits:\"";
-		$base_tick_y = "$base_tick_y" . "\":$yunits:\"";
+		$base_tick_xlabel = "\"$xunits\"";
+		$base_tick_ylabel = "\"$yunits\"";
 		}
 
 	# deal with linear plot of projected grid
@@ -3990,35 +3869,35 @@ sub GetBaseTick {
 		$base_tick = &min($base_tick_x, $base_tick_y);
 		if ($base_tick < 0.00006944444445)
 			{
-			$base_tick = "0.25c";
+			$base_tick = "0.25s";
 			}
 		elsif ($base_tick < 0.00013888888889)
 			{
-			$base_tick = "0.5c";
+			$base_tick = "0.5s";
 			}
 		elsif ($base_tick < 0.0002777777)
 			{
-			$base_tick = "1c";
+			$base_tick = "1s";
 			}
 		elsif ($base_tick < 0.0005555555)
 			{
-			$base_tick = "2c";
+			$base_tick = "2s";
 			}
 		elsif ($base_tick < 0.0013888889)
 			{
-			$base_tick = "5c";
+			$base_tick = "5s";
 			}
 		elsif ($base_tick < 0.0027777778)
 			{
-			$base_tick = "10c";
+			$base_tick = "10s";
 			}
 		elsif ($base_tick < 0.0041666667)
 			{
-			$base_tick = "15c";
+			$base_tick = "15s";
 			}
 		elsif ($base_tick < 0.0083333333)
 			{
-			$base_tick = "30c";
+			$base_tick = "30s";
 			}
 		elsif ($base_tick < 0.0166667)
 			{
diff --git a/src/macros/mbm_grdtiff b/src/macros/mbm_grdtiff
index 796cca5..8e9b588 100755
--- a/src/macros/mbm_grdtiff
+++ b/src/macros/mbm_grdtiff
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_grdtiff.perl	11/3/1999
-#    $Id: mbm_grdtiff 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_grdtiff 2234 2015-03-05 07:41:54Z caress $
 #
-#    Copyright (c) 1999-2014 by
+#    Copyright (c) 1999-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -47,34 +47,7 @@
 #   October 19, 1994
 #
 # Version:
-#   $Id: mbm_grdtiff 2175 2014-03-18 23:03:39Z caress $
-#
-# Revisions:
-#   $Log: mbm_grdtiff.perl,v $
-#   Revision 5.5  2006/07/05 19:50:21  caress
-#   Working towards 5.1.0beta
-#
-#   Revision 5.4  2006/02/10 01:27:40  caress
-#   Fixed parsing of grdinfo output to handle changes to GMT4.1.
-#
-#   Revision 5.3  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.2  2002/08/02 01:00:05  caress
-#   Release 5.0.beta22
-#
-#   Revision 5.1  2001/06/03 06:59:24  caress
-#   Release 5.0.beta01
-#
-#   Revision 5.0  2000/12/01 22:58:01  caress
-#   First cut at Version 5.0.
-#
-# Revision 4.1  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.0  1999/12/29  00:17:04  caress
-# Initial revision.
-#
+#   $Id: mbm_grdtiff 2234 2015-03-05 07:41:54Z caress $
 #
 #
 #
@@ -178,7 +151,7 @@ $zbounds = 		($opt_Z || $opt_z);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdtiff 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_grdtiff 2234 2015-03-05 07:41:54Z caress $\n";
         print "\nMacro to generate a shellscript which, when executed, will \n";
         print "generate a geographically located TIFF image of gridded \n";
         print "data. The primary purpose of this macro is to allow the simple, \n";
@@ -507,7 +480,7 @@ if (!$bounds || !$zbounds || $zmode == 1)
 	{
 	if ($verbose > 0)
 		{
-		print "\nRunning grdinfo to get file bounds and min max...\n";
+		print "\nRunning gmt module grdinfo to get file bounds and min max...\n";
 		}
 
 	foreach $file_grd (@files_data) {
@@ -845,26 +818,25 @@ else
 	{
 	$cptfile = "$root.cpt";
 	}
-$gmtfile = "gmtdefaults\$\$";
+$gmtfile = "gmt.conf\$\$";
 
 # set macro gmt default settings
-$gmt_def = "COLOR_BACKGROUND/0/0/0";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-if ($gmt_version eq "3.0"
-	|| $gmt_version eq "3.1")
-	{
-	$gmt_def = "DEGREE_FORMAT/3";
-	push(@gmt_macro_defs, $gmt_def);
-	}
+if ($color_flip)
+    {
+    $gmt_def = "COLOR_BACKGROUND/white";
+    push(@gmt_macro_defs, $gmt_def);
+    $gmt_def = "COLOR_FOREGROUND/black";
+    push(@gmt_macro_defs, $gmt_def);
+    }
 else
-	{
-	$gmt_def = "PLOT_DEGREE_FORMAT/ddd:mm";
-	push(@gmt_macro_defs, $gmt_def);
-	}
+    {
+    $gmt_def = "COLOR_BACKGROUND/black";
+    push(@gmt_macro_defs, $gmt_def);
+    $gmt_def = "COLOR_FOREGROUND/white";
+    push(@gmt_macro_defs, $gmt_def);
+    }
+$gmt_def = "COLOR_NAN/white";
+push(@gmt_macro_defs, $gmt_def);
 
 # open the shellscript file
 if (!open(FCMD,">$cmdfile"))
@@ -889,7 +861,7 @@ print FCMD "set MAP_REGION      = $bounds_plot\n";
 # Reset GMT defaults, saving old defaults
 print FCMD "#\n# Save existing GMT defaults\n";
 print FCMD "echo Saving GMT defaults...\n";
-print FCMD "gmtdefaults -L > $gmtfile\n";
+print FCMD "gmtdefaults > $gmtfile\n";
 print FCMD "#\n# Set new GMT defaults\n";
 print FCMD "echo Setting new GMT defaults...\n";
 foreach $gmt_def (@gmt_macro_defs) {
@@ -926,7 +898,7 @@ if ($color_mode && !$file_cpt)
 		{
 		if ($verbose)
 			{
-			print "Running grdhisteq...\n";
+			print "Running gmt module grdhisteq...\n";
 			}
 		$ncolors_minus = $ncolors - 1;
 		@grdhisteq = `grdhisteq $files_data[0] -C$ncolors_minus -D`;
@@ -1171,7 +1143,7 @@ if ($data_scale)
 	{
 	printf FCMD "#\n# Rescale data\n";
 	printf FCMD "echo Rescaling data by $data_scale...\n";
-	printf FCMD "echo Running grdmath...\n";
+	printf FCMD "echo Running gmt module grdmath...\n";
 	printf FCMD "grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
 	$file_use = "\$DATA_FILE.scale";
 	}
@@ -1181,16 +1153,16 @@ if ($data_scale)
 #	{
 #	printf FCMD "#\n# Get shading array\n";
 #	printf FCMD "echo Getting shading array...\n";
-#	printf FCMD "echo Running grdgradient...\n";
+#	printf FCMD "echo Running gmt module grdgradient...\n";
 #	printf FCMD "grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
 #	if (!$gridprojected)
 #		{
-#		printf FCMD " -M";
+#		printf FCMD " -fg";
 #		}
 #	printf FCMD "\n";
-#	printf FCMD "echo Running grdhisteq...\n";
+#	printf FCMD "echo Running gmt module grdhisteq...\n";
 #	printf FCMD "grdhisteq \$DATA_FILE.grad -G\$DATA_FILE.eq -N\n";
-#	printf FCMD "echo Running grdmath...\n";
+#	printf FCMD "echo Running gmt module grdmath...\n";
 #	printf FCMD "grdmath \$DATA_FILE.eq $magnitude x = \$DATA_FILE.int\n";
 #	printf FCMD "/bin/rm -f \$DATA_FILE.grad \$DATA_FILE.eq\n";
 #	$file_shade = "\$DATA_FILE.int";
@@ -1206,39 +1178,39 @@ if ($color_mode == 2)
 
 	printf FCMD "#\n# Get shading array\n";
 	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running grdgradient to get x component of the gradient...\n";
+	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
 	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
-	printf FCMD "echo Running grdgradient to get y component of the gradient...\n";
+	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
 	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
 
-	printf FCMD "echo Running grdmath to get adjusted x gradient...\n";
+	printf FCMD "echo Running gmt module grdmath to get adjusted x gradient...\n";
 	printf FCMD "grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
-	printf FCMD "echo Running grdmath to get adjusted y gradient...\n";
+	printf FCMD "echo Running gmt module grdmath to get adjusted y gradient...\n";
 	printf FCMD "grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
 
-	printf FCMD "echo Running grdmath to get normalization factor...\n";
+	printf FCMD "echo Running gmt module grdmath to get normalization factor...\n";
 	printf FCMD "grdmath \$DATA_FILE.magx 2.0 POW \\\n";
 		printf FCMD "\t\$DATA_FILE.magy 2.0 POW ADD \\\n";
 		printf FCMD "\t1.0 ADD SQRT = \$DATA_FILE.denom\n";
 
-	printf FCMD "echo Running grdmath to get normalized x gradient...\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized x gradient...\n";
 	printf FCMD "grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
-	printf FCMD "echo Running grdmath to get normalized y gradient...\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized y gradient...\n";
 	printf FCMD "grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
-	printf FCMD "echo Running grdmath to get normalized z gradient...\n";
+	printf FCMD "echo Running gmt module grdmath to get normalized z gradient...\n";
 	printf FCMD "grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
 
-	printf FCMD "echo Running grdmath to apply lighting vector to normalized gradient...\n";
+	printf FCMD "echo Running gmt module grdmath to apply lighting vector to normalized gradient...\n";
 	printf FCMD "grdmath \$DATA_FILE.normx $light_x MUL \\\n";
 		printf FCMD "\t\$DATA_FILE.normy $light_y MUL ADD \\\n";
 		printf FCMD "\t\$DATA_FILE.normz $light_z MUL ADD -0.5 ADD = \$DATA_FILE.int\n";
@@ -1255,9 +1227,9 @@ if ($color_mode == 3 && $file_int && $stretch_shade)
 	{
 	printf FCMD "#\n# Get shading array\n";
 	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running grdhisteq...\n";
+	printf FCMD "echo Running gmt module grdhisteq...\n";
 	printf FCMD "grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
-	printf FCMD "echo Running grdmath...\n";
+	printf FCMD "echo Running gmt module grdmath...\n";
 	printf FCMD "grdmath \$INTENSITY_FILE.eq $magnitude x = \$INTENSITY_FILE.int\n";
 	printf FCMD "/bin/rm -f \$INTENSITY_FILE.eq\n";
 	$file_shade = "\$INTENSITY_FILE.int";
@@ -1274,22 +1246,22 @@ elsif ($color_mode >= 4)
 	{
 	printf FCMD "#\n# Get slope array\n";
 	printf FCMD "echo Getting slope array...\n";
-	printf FCMD "echo Running grdgradient to get x component of the gradient...\n";
+	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
 	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
-	printf FCMD "echo Running grdgradient to get y component of the gradient...\n";
+	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
 	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
 	if (!$gridprojected)
 		{
-		printf FCMD " -M";
+		printf FCMD " -fg";
 		}
 	printf FCMD "\n";
 
-	printf FCMD "echo Running grdmath to get slope magnitude...\n";
+	printf FCMD "echo Running gmt module grdmath to get slope magnitude...\n";
 	printf FCMD "grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
 	printf FCMD "\t\$DATA_FILE.drvy 2.0 POW ADD SQRT \\\n";
 	if ($color_mode == 5)
@@ -1306,25 +1278,25 @@ elsif ($color_mode >= 4)
 if ($color_mode)
 	{
 	printf FCMD "#\n# Make tiff image\n";
-	printf FCMD "echo Running mbgrdtiff...\n";
+	printf FCMD "echo Running gmt module mbgrdtiff...\n";
 	if ($color_mode == 4)
 		{
-		printf FCMD "mbgrdtiff -I $file_slope \\\n\t";
+		printf FCMD "gmt mbgrdtiff -I$file_slope \\\n\t";
 		}
 	else
 		{
-		printf FCMD "mbgrdtiff -I $file_use \\\n\t";
+		printf FCMD "gmt mbgrdtiff -I$file_use \\\n\t";
 		}
-	printf FCMD "-O \$TIFF_FILE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	printf FCMD "-C \$CPT_FILE \\\n\t";
+	printf FCMD "-O\$TIFF_FILE \\\n\t";
+	printf FCMD "-R\$MAP_REGION -Jx1.0 \\\n\t";
+	printf FCMD "-C\$CPT_FILE \\\n\t";
 	if ($color_mode == 2 || $color_mode == 3)
 		{
-		printf FCMD "-K $file_shade \\\n\t";
+		printf FCMD "-I$file_shade \\\n\t";
 		}
 	elsif ($color_mode == 5)
 		{
-		printf FCMD "-K $file_slope \\\n\t";
+		printf FCMD "-I$file_slope \\\n\t";
 		}
 	if ($make_worldfile == 1)
 		{
@@ -1337,6 +1309,7 @@ if ($color_mode)
 # delete surplus files
 print FCMD "#\n# Delete surplus files\n";
 print FCMD "echo Deleting surplus files...\n";
+print FCMD "/bin/rm -f gmt.conf\n";
 if (!$file_cpt)
 	{
 	print FCMD "/bin/rm -f \$CPT_FILE\n";
@@ -1345,23 +1318,26 @@ if ($data_scale)
 	{
 	printf FCMD "/bin/rm -f $file_use\n";
 	}
-
-# reset GMT defaults
-print FCMD "#\n# Reset GMT default fonts\n";
-print FCMD "echo Resetting GMT fonts...\n";
-print FCMD "/bin/mv $gmtfile .gmtdefaults\n";
+if ($file_slope)
+	{
+	printf FCMD "/bin/rm -f $file_slope\n";
+	}
 
 # display image on screen if desired
 print FCMD "#\n# Run $img_viewer\n";
 if ($no_view_tiff)
 	{
+        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "#echo Running $img_viewer in background...\n";
 	print FCMD "#$img_viewer $tiffile &\n";
+        print FCMD "#endif\n";
 	}
 else
 	{
+        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "echo Running $img_viewer in background...\n";
 	print FCMD "$img_viewer $tiffile &\n";
+        print FCMD "endif\n";
 	}
 
 # claim it's all over
diff --git a/src/macros/mbm_grid b/src/macros/mbm_grid
index fa8e8b7..3cd4267 100755
--- a/src/macros/mbm_grid
+++ b/src/macros/mbm_grid
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_grid.perl	6/11/99
-#    $Id: mbm_grid 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_grid 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1999-2014 by
+#    Copyright (c) 1999-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -52,7 +52,7 @@
 #   June 11, 1999
 #
 # Version:
-#   $Id: mbm_grid 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_grid 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_grid.perl,v $
@@ -137,7 +137,7 @@ $bathdef = 		($opt_Z || $opt_z);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grid 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_grid 2227 2015-02-05 21:12:31Z caress $\n";
         print "Macro to generate a shellscript of MB-System commands \n";
         print "which, when executed, will generate a grid or mosaic of the \n";
         print "specified swath sonar data. The grid or mosaic may be of \n";
diff --git a/src/macros/mbm_histplot b/src/macros/mbm_histplot
index 5a23a09..d440d76 100755
--- a/src/macros/mbm_histplot
+++ b/src/macros/mbm_histplot
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_histplot.perl	3/20/2006
-#    $Id: mbm_histplot 2180 2014-04-02 20:58:34Z caress $
+#    $Id: mbm_histplot 2234 2015-03-05 07:41:54Z caress $
 #
-#    Copyright (c) 2006-2014 by
+#    Copyright (c) 2006-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -46,7 +46,7 @@
 #   March 20, 2006
 #
 # Version:
-#   $Id: mbm_histplot 2180 2014-04-02 20:58:34Z caress $
+#   $Id: mbm_histplot 2234 2015-03-05 07:41:54Z caress $
 #
 # Revisions:
 #   $Log: mbm_histplot.perl,v $
@@ -183,7 +183,7 @@ $execute = 		($opt_X || $opt_x);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_histplot 2180 2014-04-02 20:58:34Z caress $\n";
+	print "\nVersion: $Id: mbm_histplot 2234 2015-03-05 07:41:54Z caress $\n";
 	print "\nMacro to generate a shellscript of GMT commands which, \n";
 	print "when executed, will generate a Postscript histogram plot\n";
 	print "of a set of data values.\n";
@@ -714,44 +714,46 @@ $xoffset = ($width - $plot_width
 $yoffset = ($height - $plot_height
 	- $space_bottom - $space_top) / 2 + $space_bottom;
 
+# if length scale bar requested check to see if map center needs to be defined
+if ($length_scale && $length_scale =~ /\S+center\S+/)
+        {
+        # add map lon lat (or x y) center to the length scale argument
+        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
+        $xcen = 0.5 * ($xmin + $xmax);
+        $ycen = 0.5 * ($ymin + $ymax);
+        $b = "$xcen/$ycen";
+        $length_scale = "$a$b$c";
+        }
+
 # come up with the filenames
 $cmdfile = "$root.cmd";
 $psfile = "$root.ps";
-$gmtfile = "gmtdefaults4\$\$";
 
 # set some gmtisms
 $first = "-X\$X_OFFSET -Y\$Y_OFFSET -V >! \$PS_FILE";
 
 # set macro gmt default settings
-$gmt_def = "MEASURE_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAPER_MEDIA/$page_gmt_name{$pagesize}+";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT/Helvetica";
+$gmt_def = "PROJ_LENGTH_UNIT/inch";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT/Helvetica";
+$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT/Helvetica";
+$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT_SIZE/$page_header_font{$pagesize}";
+$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FRAME_WIDTH/$frame_size";
+$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "TICK_LENGTH/$tick_size";
+$gmt_def = "COLOR_BACKGROUND/black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAGE_ORIENTATION/LANDSCAPE";
+$gmt_def = "COLOR_FOREGROUND/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/0/0/0";
+$gmt_def = "COLOR_NAN/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PLOT_DEGREE_FORMAT/ddd:mm";
+$gmt_def = "FORMAT_GEO_MAP/$degree_format";
 push(@gmt_macro_defs, $gmt_def);
 
 # open the shellscript file
@@ -778,15 +780,17 @@ print FCMD "set MAP_REGION      = $bounds_plot\n";
 printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
 printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
 
-# Reset GMT defaults, saving old defaults
-print FCMD "#\n# Save existing GMT defaults\n";
-print FCMD "echo Saving GMT defaults...\n";
-print FCMD "gmtdefaults -L >! $gmtfile\n";
-print FCMD "#\n# Set new GMT defaults\n";
-print FCMD "echo Setting new GMT defaults...\n";
+# Set temporary GMT defaults
+print FCMD "#\n# Delete any existing gmt.conf file\n";
+print FCMD "if (-e gmt.conf) then\n";
+print FCMD "echo Deleting gmt.conf...\n";
+print FCMD "/bin/rm gmt.conf\n";
+print FCMD "endif\n";
+print FCMD "#\n# Set temporary GMT defaults\n";
+print FCMD "echo Setting temporary GMT defaults...\n";
 foreach $gmt_def (@gmt_macro_defs) {
 	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmtset $gmt_par $gmt_var\n";
+	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 	}
 
 # Reset GMT defaults as per user commands
@@ -796,7 +800,7 @@ if (@gmt_defs)
 	print FCMD "echo Setting user defined GMT defaults...\n";
 	foreach $gmt_def (@gmt_defs) {
 		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmtset $gmt_par $gmt_var\n";
+		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 		}
 	}
 
@@ -838,32 +842,32 @@ if ($nlabels < 3)
 # set basemap axes annotation
 if ($tick_info)
 	{
-	$axes = $tick_info;
-	if (!($tick_info =~ /.*:\..*/))
-		{
-		$axes = "$axes:.\"$tlabel\":";
-		}
+	$axes = "-B$tick_info";
 	}
 elsif ($projection =~ /^[Xx].*/ && !$geographic)
 	{
 	# figure out some reasonable tick intervals for the basemap
 	&GetBaseTickLinear;
-	$axes = "$base_tick_x:\"$xlabel\":/$base_tick_y:\"$ylabel\"::.\"$tlabel\":";
+	$axes = "-Bx$base_tick_x+l\"$xlabel\" -By$base_tick_y+l\"$ylabel\"";
 	}
 else
 	{
 	# figure out some reasonable tick intervals for the basemap
 	&GetBaseTick;
-	$axes = "$base_tick:\"$xlabel\":/$base_tick:\"$ylabel\"::.\"$tlabel\":";
+	$axes = "-B$base_tick";
+	}
+if ($tlabel)
+	{
+	$axes = "$axes -B+t\"$tlabel\"";
 	}
 
 # do histogram plot
 printf FCMD "#\n# Make histogram\n";
 printf FCMD "echo Running pshistogram...\n";
-printf FCMD "pshistogram $file_data \\\n\t";
+printf FCMD "gmt pshistogram $file_data \\\n\t";
 printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "-B$axes \\\n\t";
+printf FCMD "$axes \\\n\t";
 printf FCMD "-W$cellwidth -Z1 \\\n\t";
 if ($pen)
 	{
@@ -890,6 +894,7 @@ printf FCMD "$first\n";
 # delete surplus files
 print FCMD "#\n# Delete surplus files\n";
 print FCMD "echo Deleting surplus files...\n";
+print FCMD "/bin/rm -f gmt.conf\n";
 if (!$file_cpt)
 	{
 	print FCMD "/bin/rm -f \$CPT_FILE\n";
@@ -905,12 +910,6 @@ if (! $save_temp_files) {
     }
 }
 
-
-# reset GMT defaults
-print FCMD "#\n# Reset GMT default fonts\n";
-print FCMD "echo Resetting GMT fonts...\n";
-print FCMD "/bin/mv $gmtfile .gmtdefaults4\n";
-
 # display image on screen if desired
 print FCMD "#\n# Run $ps_viewer\n";
 if ($ps_viewer eq "xpsview")
@@ -984,13 +983,17 @@ elsif ($ps_viewer eq "evince")
 	}
 if ($no_view_ps)
 	{
+        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "#echo Running $ps_viewer in background...\n";
 	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "#endif\n";
 	}
 else
 	{
+        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "echo Running $ps_viewer in background...\n";
 	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "endif\n";
 	}
 
 # claim it's all over
@@ -1203,16 +1206,6 @@ $width_max_portrait = $page_width_in{$pagesize}
 		- $space_left - $space_right;
 $height_max_portrait = $page_height_in{$pagesize}
 		- $space_bottom - $space_top;
-$frame_size = 0.075;
-if (($frame_size / $height_max_portrait) > 0.01)
-	{
-	$frame_size = 0.01 * $height_max_portrait;
-	}
-$tick_size = 0.075;
-if (($tick_size / $height_max_portrait) > 0.01)
-	{
-	$tick_size = 0.01 * $height_max_portrait;
-	}
 }
 #-----------------------------------------------------------------------
 sub GetProjection {
@@ -1574,27 +1567,27 @@ sub GetBaseTick {
 	$base_tick = &min($base_tick_x, $base_tick_y);
 	if ($base_tick < 0.0002777777)
 		{
-		$base_tick = "1c";
+		$base_tick = "1s";
 		}
 	elsif ($base_tick < 0.0005555555)
 		{
-		$base_tick = "2c";
+		$base_tick = "2s";
 		}
 	elsif ($base_tick < 0.0013888889)
 		{
-		$base_tick = "5c";
+		$base_tick = "5s";
 		}
 	elsif ($base_tick < 0.0027777778)
 		{
-		$base_tick = "10c";
+		$base_tick = "10s";
 		}
 	elsif ($base_tick < 0.0041666667)
 		{
-		$base_tick = "15c";
+		$base_tick = "15s";
 		}
 	elsif ($base_tick < 0.0083333333)
 		{
-		$base_tick = "30c";
+		$base_tick = "30s";
 		}
 	elsif ($base_tick < 0.0166667)
 		{
diff --git a/src/macros/mbm_makedatalist b/src/macros/mbm_makedatalist
index c68d82e..c2b61ea 100755
--- a/src/macros/mbm_makedatalist
+++ b/src/macros/mbm_makedatalist
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_makedatalist.perl	27/1/2006
-#    $Id: mbm_makedatalist 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_makedatalist 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 2006-2014 by
+#    Copyright (c) 2006-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -33,7 +33,7 @@
 #   January 27, 2006
 #
 # Version:
-#   $Id: mbm_makedatalist 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_makedatalist 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_makedatalist.perl,v $
@@ -60,7 +60,7 @@ $verbose = 		($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_makedatalist 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_makedatalist 2227 2015-02-05 21:12:31Z caress $\n";
         print "Macro to generate an MB-System datalist file referencing all\n";
         print "identifiable swath files in the specified directory. If no directory\n";
         print "is specified with the -I option, then the current directory is used.\n";
diff --git a/src/macros/mbm_makesvp b/src/macros/mbm_makesvp
index 648ae2c..155076e 100755
--- a/src/macros/mbm_makesvp
+++ b/src/macros/mbm_makesvp
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_plot.perl	10/5/2013
-#    $Id: mbm_makesvp 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_makesvp 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 2013-2014 by
+#    Copyright (c) 2013-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -34,7 +34,7 @@
 #   October 5, 2013
 #
 # Version:
-#   $Id: mbm_makesvp 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_makesvp 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_makesvp.perl,v $
@@ -55,7 +55,7 @@ $verbose = 		($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "Version: $Id: mbm_makesvp 2175 2014-03-18 23:03:39Z caress $\n";
+	print "Version: $Id: mbm_makesvp 2227 2015-02-05 21:12:31Z caress $\n";
 	print "Macro to extract sound speed and depth data from a datalist of swath files,\n";
 	print "and generate a sound velocity profile model from averages of the sound\n";
 	print "speed values in regular depth ranges. This macro is intended for use\n";
diff --git a/src/macros/mbm_multicopy b/src/macros/mbm_multicopy
index 9848584..7bae4bd 100755
--- a/src/macros/mbm_multicopy
+++ b/src/macros/mbm_multicopy
@@ -3,7 +3,7 @@
 #    The MB-system:	mbm_multicopy.perl	7/17/2011
 #   $Id: mbm_multi7kprocess.pl 19XX 2011-07-17 15:15:00Z ferreira $
 #
-#    Copyright (c) 2011-2014 by
+#    Copyright (c) 2011-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -53,11 +53,11 @@ $command_line = "@ARGV";
 &MBGetopts('CcF:f:HhI:i:X:x:TtVv');
 $oformat = 		($opt_F || $opt_f);
 $help =    		($opt_H || $opt_h);
-$datalist =    		($opt_I || $opt_i);
+$datalist =    		($opt_I || $opt_i || datalist.mb-1);
 $check =    		($opt_C || $opt_c);
 $test =    		($opt_T || $opt_t);
 $verbose = 		($opt_V || $opt_v);
-$nprocesses =        	($opt_X || $opt_x);
+$nprocesses =        	($opt_X || $opt_x || 4);
 
 # print out help message if required
 if ($help)
@@ -72,16 +72,18 @@ if ($help)
 	exit 0;
 	}
 
-# check for input file
-if (!$datalist)
+# exiting if CPU number is lower than 1
+if ($cpu < 1)
 	{
-	print "\a";
-	die "No input datalist specified - $program_name aborted\n";
+	print "\nExiting $program_name, CPU(s) number(s) should be\n equal or bigger than one...\n\n";
+	exit 0;
 	}
-elsif (! -e $datalist)
+	
+# make sure that the input file exists
+if (! -f $datalist)
 	{
-	print "\a";
-	die "Specified input datalist cannot be opened - $program_name aborted\n";
+	print "\nExiting $program_name, Input file $datalist does not exist...\n\n";
+	exit 0;
 	}
 
 # tell the world we got started
diff --git a/src/macros/mbm_multidatalist b/src/macros/mbm_multidatalist
index 8a09d2c..854c1b6 100755
--- a/src/macros/mbm_multidatalist
+++ b/src/macros/mbm_multidatalist
@@ -3,7 +3,7 @@
 #    The MB-system:	mbm_multidatalist.perl	7/18/2011
 #   $Id: mbm_multidatalisz.pl 19XX 2011-07-18 15:40:00Z ferreira $
 #
-#    Copyright (c) 2011-2014 by
+#    Copyright (c) 2011-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -49,7 +49,7 @@ $help =    		($opt_H || $opt_h);
 $datalist =    		($opt_I || $opt_i || "datalist.mb-1");
 $regenerate =    	($opt_N || $opt_n);
 $verbose = 		($opt_V || $opt_v);
-$cpu =        		($opt_X || $opt_x || 1);
+$cpu =        		($opt_X || $opt_x || 4);
 
 # print out help message if required
 if ($help)
@@ -75,6 +75,13 @@ if ($cpu < 1)
 	print "\nExiting $program_name, CPU(s) number(s) should be\n equal or bigger than one...\n\n";
 	exit 0;
 	}
+	
+# make sure that the input file exists
+if !(-f $datalist)
+	{
+	print "\nExiting $program_name, Input file $datalist does not exist...\n\n";
+	exit 0;
+	}
 
 # set the mbdatalist control option
 if ($regenerate)
diff --git a/src/macros/mbm_multiprocess b/src/macros/mbm_multiprocess
index 09eec9d..248f7a1 100755
--- a/src/macros/mbm_multiprocess
+++ b/src/macros/mbm_multiprocess
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_multiprocess.perl	7/01/2011
-#   $Id: mbm_multiprocess 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_multiprocess 2234 2015-03-05 07:41:54Z caress $
 #
-#    Copyright (c) 2011-2014 by
+#    Copyright (c) 2011-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -32,7 +32,7 @@
 #   July 01, 2011
 #
 # Version:
-#   $Id: mbm_multiprocess 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_multiprocess 2234 2015-03-05 07:41:54Z caress $
 #
 # Revisions:
 #
@@ -54,9 +54,9 @@ $program_name = "mbm_multiprocess";
 $command_line = "@ARGV";
 &Getopts('I:i:X:x:HhVv');
 $help =    		($opt_H || $opt_h);
-$datalist =    		($opt_I || $opt_i);
+$datalist =    		($opt_I || $opt_i || "datalist.mb-1");
 $verbose = 		($opt_V || $opt_v);
-$cpu =        		($opt_X || $opt_x);
+$cpu =        		($opt_X || $opt_x || 4);
 
 # print out help message if required
 if ($help)
@@ -82,6 +82,13 @@ if ($cpu < 1)
 	print "\nExiting $program_name, CPU(s) number(s) should be\n equal or bigger than one...\n\n";
 	exit 0;
 	}
+	
+# make sure that the input file exists
+if (! -f $datalist)
+	{
+	print "\nExiting $program_name, Input file $datalist does not exist...\n\n";
+	exit 0;
+	}
 
 # loop over all files referenced in datalist
 @mbdatalist = `mbdatalist -F-1 -I$datalist`;
diff --git a/src/macros/mbm_plot b/src/macros/mbm_plot
index 08d9cbe..f11ec63 100755
--- a/src/macros/mbm_plot
+++ b/src/macros/mbm_plot
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_plot.perl	6/18/93
-#    $Id: mbm_plot 2192 2014-07-07 14:32:05Z caress $
+#    $Id: mbm_plot 2234 2015-03-05 07:41:54Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -52,7 +52,7 @@
 #
 # Miscellaneous Options:
 #            [-MGDgmtdef/value -MGFscale_loc
-#            -MGL[f][x]lon0/lat0/slat/length[m]
+#            -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
 #            -MGTx/y/size/angle/font/just/text
 #            -MGQdpi -MGU[/dx/dy/][label]
 #            -MMAfactor/mode/depth -MMByr/mo/da/hr/mn/sc
@@ -72,237 +72,7 @@
 #   June 17, 1993
 #
 # Version:
-#   $Id: mbm_plot 2192 2014-07-07 14:32:05Z caress $
-#
-# Revisions:
-#   $Log: mbm_plot.perl,v $
-#   Revision 5.28  2009/03/02 18:59:05  caress
-#   Moving towards 5.1.2beta1.
-#
-#   Revision 5.27  2008/09/11 20:06:45  caress
-#   Checking in updates made during cruise AT15-36.
-#
-#   Revision 5.26  2007/11/16 17:54:10  caress
-#   Changes as of 11/16/2007
-#
-#   Revision 5.25  2007/10/08 04:30:07  caress
-#   Added some large page definitions.
-#
-#   Revision 5.24  2007/05/14 17:09:45  caress
-#   Val Schmidt improved the error notices.
-#
-#   Revision 5.23  2007/03/02 20:34:26  caress
-#   Fixed plotting of ping/shot number annotation along navigation tracks.
-#
-#   Revision 5.22  2006/11/10 22:02:59  caress
-#   Added ping number/shot number navigation track annotation.
-#
-#   Revision 5.21  2006/07/05 19:50:21  caress
-#   Working towards 5.1.0beta
-#
-#   Revision 5.20  2006/06/16 19:30:58  caress
-#   Check in after the Santa Monica Basin Mapping AUV Expedition.
-#
-#   Revision 5.19  2006/01/20 17:39:15  caress
-#   Working towards 5.0.8
-#
-#   Revision 5.18  2005/11/05 01:34:20  caress
-#   Much work over the past two months.
-#
-#   Revision 5.17  2005/03/25 04:05:40  caress
-#   Fixed handling of tickinfo string.
-#   For mbm_plot only, added control on filename annotation direction.
-#
-#   Revision 5.16  2004/12/18 01:31:26  caress
-#   Working towards release 5.0.6.
-#
-#   Revision 5.15  2004/09/16 22:43:32  caress
-#   Fixed bug using -MME option.
-#
-#   Revision 5.14  2004/09/16 19:11:48  caress
-#   Supports postscript viewer ggv.
-#
-#   Revision 5.13  2003/04/22 21:10:12  caress
-#   Made datalist.mb-1 default input file.
-#
-#   Revision 5.12  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.11  2002/09/19 00:35:04  caress
-#   Release 5.0.beta23
-#
-#   Revision 5.10  2002/09/07 03:13:59  caress
-#   Fixed typo.
-#
-#   Revision 5.9  2002/07/25 19:05:02  caress
-#   Release 5.0.beta21
-#
-#   Revision 5.8  2002/04/06 02:51:54  caress
-#   Release 5.0.beta16
-#
-#   Revision 5.7  2001/12/18 04:26:12  caress
-#   Version 5.0.beta11.
-#
-# Revision 5.6  2001/11/20  00:36:45  caress
-# Now reads inf files with -R option first and runs mbinfo
-# only if really needed (if file bounds not completely
-# inside specified bounds).
-#
-# Revision 5.5  2001/11/02  21:07:40  caress
-# Adjusted handling of segmented xy files.
-#
-# Revision 5.4  2001/10/29  20:07:39  caress
-# Now checks that the number of records is > 0 before
-# using the min max data values in mbinfo output.
-#
-# Revision 5.3  2001/10/11  01:32:11  caress
-# Replaced use of perl function MBparsedatalist
-# with call to new program mbdatalist.
-#
-# Revision 5.2  2001/10/10  23:56:01  dcaress
-# Regrettably, I don't remember what I changed...
-#
-#   Revision 5.1  2001-03-22 13:05:45-08  caress
-#   Trying to make release 5.0.beta0
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.28  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.27  2000/09/11  21:54:49  caress
-# Added support for recursive and commented datalists.
-#
-# Revision 4.26  2000/01/13  22:48:11  caress
-# Fixed usage of .inf files
-#
-# Revision 4.25  1999/12/29  00:17:55  caress
-# Release 4.6.8
-#
-# Revision 4.24  1999/08/08  04:17:04  caress
-# Added coastline plots.
-#
-# Revision 4.23  1999/06/25  17:55:47  caress
-# I must have changed something!
-#
-# Revision 4.22  1999/05/06  23:46:32  caress
-# Release 4.6a
-#
-# Revision 4.21  1999/04/16  01:25:51  caress
-# Version 4.6 final release?
-#
-# Revision 4.20  1999/04/15  19:28:52  caress
-# Fixed sprintf statements.
-#
-# Revision 4.19  1999/03/31  18:09:36  caress
-# MB-System 4.6beta7
-#
-# Revision 4.18  1999/02/04  23:39:54  caress
-# MB-System version 4.6beta7
-#
-# Revision 4.17  1998/10/13  18:08:37  caress
-# Fixed typos.
-#
-# Revision 4.16  1998/10/05  17:00:15  caress
-# MB-System version 4.6beta
-#
-# Revision 4.15  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.16  1997/04/17  15:06:49  caress
-# MB-System 4.5 Beta Release
-#
-# Revision 4.15  1997/03/26  15:37:14  caress
-# Comment changes.
-#
-# Revision 4.14  1997/01/28  18:34:03  caress
-# Added printout of actual data lon lat bounds in addition
-# to stretched bounds for plot.
-#
-# Revision 4.13  1996/03/12  17:28:19  caress
-# Check-in after flail with format 63.
-#
-# Revision 4.12  1995/11/22  22:46:40  caress
-# Check in during general flail.
-#
-# Revision 4.11  1995/09/28  18:05:43  caress
-# Various bug fixes working toward release 4.3.
-#
-# Revision 4.10  1995/08/17  14:52:53  caress
-# Revision for release 4.3.
-#
-# Revision 4.9  1995/07/18  17:24:57  caress
-# Now uses -G option of mbinfo.
-#
-# Revision 4.8  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.7  1995/05/05  17:00:23  caress
-# Fixed typo.
-#
-# Revision 4.6  1995/05/03  17:30:42  caress
-# Fixed some typos noted by Mike Realander <miker at ocean.washington.edu>
-#
-# Revision 4.5  1995/03/20  16:42:45  caress
-# Fixed synopsis.
-#
-# Revision 4.4  1995/02/14  19:50:31  caress
-# Version 4.2
-#
-# Revision 4.3  1994/10/21  13:54:57  caress
-# Release V4.0
-#
-# Revision 4.2  1994/10/21  11:36:58  caress
-# Release V4.0
-#
-# Revision 4.1  1994/05/02  00:19:44  caress
-# Added 2 significant digits to basemap tick intervals.
-#
-# Revision 4.0  1994/03/05  23:52:40  caress
-# First cut at version 4.0
-#
-# Revision 4.3  1994/03/05  03:01:33  caress
-# Added capability to handle amplitude and sidescan plots.
-#
-# Revision 4.2  1994/03/03  04:11:13  caress
-# Fixed copyright message.
-#
-# Revision 4.1  1994/02/26  21:15:42  caress
-# Altered parsing of mbinfo output to be consistent
-# with changes in version 4 mbinfo.
-#
-# Revision 4.0  1994/02/26  19:37:57  caress
-# First cut at new version.
-#
-# Revision 3.7  1993/11/27  18:31:54  caress
-# Fixed syntax error in last fix.
-#
-# Revision 3.6  1993/11/27  18:24:07  caress
-# Made choice of tick interval more rational.
-#
-# Revision 3.5  1993/08/17  16:58:36  caress
-# Set location of perl to /usr/local/bin/perl
-#
-# Revision 3.4  1993/08/16  23:03:59  caress
-# I'm not sure what the changes are - I'm just checking in the
-# current version.
-#
-# Revision 3.3  1993/07/03  02:08:27  caress
-# Changed /usr/local/bin/perl to /usr/lib/perl for L-DEO installation.
-#
-# Revision 3.2  1993/06/19  15:06:54  caress
-# Fixed handling of command line argument "-O".
-#
-# Revision 3.1  1993/06/19  11:50:30  caress
-# Improved autoscaling so that a reasonable box including
-# all of the data is always (I hope) used.  Also added -P
-# option to turn on the invocation of pageview; pageview
-# is now put in the output shellscript only if requested.
-#
-# Revision 3.0  1993/06/19  01:00:18  caress
-# Initial version.
+#   $Id: mbm_plot 2234 2015-03-05 07:41:54Z caress $
 #
 #
 $program_name = "mbm_plot";
@@ -492,7 +262,7 @@ $zbounds = 		($opt_Z || $opt_z);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_plot 2192 2014-07-07 14:32:05Z caress $\n";
+	print "\nVersion: $Id: mbm_plot 2234 2015-03-05 07:41:54Z caress $\n";
 	print "\nMacro to generate a shellscript of MB-System and GMT commands \n";
 	print "which, when executed, will generate a Postscript plot of the \n";
 	print "specified swath sonar data. The plot may include bathymetry color \n";
@@ -589,9 +359,6 @@ if ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
        	$ymax = &GetDecimalDegrees($ymax_raw);
        	}
 
-# set ping averaging
-$mb_pings = 1;
-
 # parse misc commands
 if ($misc)
 	{
@@ -697,12 +464,6 @@ if ($misc)
 			($lonflip) = $cmd =~ /^[Mm][Ll](.+)/;
 			}
 
-		# set ping averaging
-		if ($cmd =~ /^[Mm][Pp]./)
-			{
-			($mb_pings) = $cmd =~ /^[Mm][Pp](.+)/;
-			}
-
 		# set minimum ship speed
 		if ($cmd =~ /^[Mm][Ss]./)
 			{
@@ -2102,6 +1863,17 @@ if ($coast_control
 	$coast_resolution = "f";
 	}
 
+# if length scale bar requested check to see if map center needs to be defined
+if ($length_scale && $length_scale =~ /\S+center\S+/)
+        {
+        # add map lon lat (or x y) center to the length scale argument
+        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
+        $xcen = 0.5 * ($xmin + $xmax);
+        $ycen = 0.5 * ($ymin + $ymax);
+        $b = "$xcen/$ycen";
+        $length_scale = "$a$b$s";
+        }
+
 # come up with the filenames
 $cmdfile = "$root.cmd";
 $psfile = "$root.ps";
@@ -2115,7 +1887,6 @@ else
 	}
 $cptfile = "$root.cpt";
 $cptshadefile = "$root.shade.cpt";
-$gmtfile = "gmtdefaults4\$\$";
 
 # set some gmtisms
 $first_gmt = 1;
@@ -2124,35 +1895,27 @@ $middle = "-K -O -V >> \$PS_FILE";
 $end = "-O -V >> \$PS_FILE";
 
 # set macro gmt default settings
-$gmt_def = "MEASURE_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAPER_MEDIA/$page_gmt_name{$pagesize}+";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT/Helvetica";
+$gmt_def = "PROJ_LENGTH_UNIT/inch";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT/Helvetica";
+$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT/Helvetica";
+$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT_SIZE/$page_header_font{$pagesize}";
+$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FRAME_WIDTH/$frame_size";
+$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "TICK_LENGTH/$tick_size";
+$gmt_def = "COLOR_BACKGROUND/black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAGE_ORIENTATION/LANDSCAPE";
+$gmt_def = "COLOR_FOREGROUND/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/0/0/0";
+$gmt_def = "COLOR_NAN/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PLOT_DEGREE_FORMAT/$degree_format";
+$gmt_def = "FORMAT_GEO_MAP/$degree_format";
 push(@gmt_macro_defs, $gmt_def);
 
 # set shade control if not set by user
@@ -2227,17 +1990,17 @@ if ($nlabels < 2)
 # set basemap axes annotation
 if ($tick_info)
 	{
-	$axes = $tick_info;
-	if (!($tick_info =~ /.*:\..*/))
-		{
-		$axes = "$axes:.\"$tlabel\":";
-		}
+	$axes = "-B$tick_info";
 	}
 else
 	{
 	# figure out some reasonable tick intervals for the basemap
 	&GetBaseTick;
-	$axes = "$base_tick/$base_tick:.\"$tlabel\":";
+        $axes = "-B$base_tick"
+ 	}
+if ($tlabel)
+	{
+	$axes = "$axes -B+t\"$tlabel\"";
 	}
 
 # open the shellscript file
@@ -2266,15 +2029,17 @@ printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
 print FCMD "set INPUT_FILE      = $file_data\n";
 print FCMD "set INPUT_FORMAT    = $format\n";
 
-# Reset GMT defaults, saving old defaults
-print FCMD "#\n# Save existing GMT defaults\n";
-print FCMD "echo Saving GMT defaults...\n";
-print FCMD "gmtdefaults -L > $gmtfile\n";
-print FCMD "#\n# Set new GMT defaults\n";
-print FCMD "echo Setting new GMT defaults...\n";
+# Set temporary GMT defaults
+print FCMD "#\n# Delete any existing gmt.conf file\n";
+print FCMD "if (-e gmt.conf) then\n";
+print FCMD "echo Deleting gmt.conf...\n";
+print FCMD "/bin/rm gmt.conf\n";
+print FCMD "endif\n";
+print FCMD "#\n# Set temporary GMT defaults\n";
+print FCMD "echo Setting temporary GMT defaults...\n";
 foreach $gmt_def (@gmt_macro_defs) {
 	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmtset $gmt_par $gmt_var\n";
+	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 	}
 
 # Reset GMT defaults as per user commands
@@ -2284,7 +2049,7 @@ if (@gmt_defs)
 	print FCMD "echo Setting user defined GMT defaults...\n";
 	foreach $gmt_def (@gmt_defs) {
 		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmtset $gmt_par $gmt_var\n";
+		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 		}
 	}
 
@@ -2509,7 +2274,7 @@ if ($color_mode)
 	{
 	print FCMD "#\n# Run mbswath\n";
 	print FCMD "echo Running mbswath...\n";
-	printf FCMD "mbswath -f-1 -I$file_list \\\n\t";
+	printf FCMD "gmt mbswath -F-1 -I$file_list \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	printf FCMD "-C\$CPT_FILE \\\n\t";
@@ -2549,7 +2314,6 @@ if ($color_mode)
 		{
 		printf FCMD "-E$mb_etime \\\n\t";
 		}
-	printf FCMD "-p$mb_pings \\\n\t";
 	if ($mb_speedmin)
 		{
 		printf FCMD "-S$mb_speedmin \\\n\t";
@@ -2582,7 +2346,7 @@ if ($contour_mode || $navigation_mode)
 	{
 	print FCMD "#\n# Run mbcontour\n";
 	print FCMD "echo Running mbcontour...\n";
-	printf FCMD "mbcontour -f-1 -I$file_list \\\n\t";
+	printf FCMD "gmt mbcontour -F-1 -I$file_list \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	if ($contour_mode && $contour_algorithm)
@@ -2623,7 +2387,6 @@ if ($contour_mode || $navigation_mode)
 		{
 		printf FCMD "-E$mb_etime \\\n\t";
 		}
-	printf FCMD "-p$mb_pings \\\n\t";
 	if ($mb_speedmin)
 		{
 		printf FCMD "-S$mb_speedmin \\\n\t";
@@ -2656,7 +2419,7 @@ if ($coast_control)
 	{
 	printf FCMD "#\n# Make coastline data plot\n";
 	printf FCMD "echo Running pscoast...\n";
-	printf FCMD "pscoast \\\n\t";
+	printf FCMD "gmt pscoast \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	if ($coast_lakefill)
@@ -2707,7 +2470,7 @@ for ($i = 0; $i < scalar(@xyfiles); $i++)
 	{
 	printf FCMD "#\n# Make xy data plot\n";
 	printf FCMD "echo Running psxy...\n";
-	printf FCMD "psxy $xyfiles[$i] \\\n\t";
+	printf FCMD "gmt psxy $xyfiles[$i] \\\n\t";
 	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	if ($xyfills[$i] ne "N")
@@ -2746,16 +2509,16 @@ if ($color_mode && $color_pallette < 5)
 	{
 	printf FCMD "#\n# Make color scale\n";
 	printf FCMD "echo Running psscale...\n";
-	printf FCMD "psscale -C\$CPT_FILE \\\n\t";
+	printf FCMD "gmt psscale -C\$CPT_FILE \\\n\t";
 	printf FCMD "-D%.4f/%.4f/%.4f/%.4f%s \\\n\t",
 		$colorscale_offx,$colorscale_offy,
 		$colorscale_length,$colorscale_thick,
 		$colorscale_vh;
-	print FCMD "-B\":$slabel:\" \\\n\t";
-	if ($stretch_color)
-		{
-		print FCMD "-L \\\n\t";
-		}
+	print FCMD "-B+l\"$slabel\" \\\n\t";
+#	if ($stretch_color)
+#		{
+#		print FCMD "-L \\\n\t";
+#		}
 	if ($portrait)
 		{
 		printf FCMD "-P ";
@@ -2768,7 +2531,7 @@ if (@text)
 	{
 	printf FCMD "#\n# Make text labels\n";
 	printf FCMD "echo Running pstext...\n";
-	printf FCMD "pstext -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
+	printf FCMD "gmt pstext -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 	printf FCMD "-R\$MAP_REGION \\\n\t";
 	printf FCMD "$middle <<EOT\n";
 	foreach $text_info (@text) {
@@ -2784,9 +2547,9 @@ if (@text)
 # do psbasemap plot
 printf FCMD "#\n# Make basemap\n";
 printf FCMD "echo Running psbasemap...\n";
-printf FCMD "psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
+printf FCMD "gmt psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "-B$axes \\\n\t";
+printf FCMD "$axes \\\n\t";
 if ($length_scale)
 	{
 	printf FCMD "-L$length_scale \\\n\t";
@@ -2808,17 +2571,13 @@ printf FCMD "$end\n";
 # delete surplus files
 print FCMD "#\n# Delete surplus files\n";
 print FCMD "echo Deleting surplus files...\n";
+print FCMD "/bin/rm -f gmt.conf\n";
 print FCMD "/bin/rm -f \$CPT_FILE\n";
 if ($format > -1)
 	{
 	print FCMD "/bin/rm -f $file_list\n";
 	}
 
-# reset GMT defaults
-print FCMD "#\n# Reset GMT default fonts\n";
-print FCMD "echo Resetting GMT fonts...\n";
-print FCMD "/bin/mv $gmtfile .gmtdefaults4\n";
-
 # display image on screen if desired
 print FCMD "#\n# Run $ps_viewer\n";
 if ($ps_viewer eq "xpsview")
@@ -2892,13 +2651,17 @@ elsif ($ps_viewer eq "evince")
 	}
 if ($no_view_ps)
 	{
+        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "#echo Running $ps_viewer in background...\n";
 	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "#endif\n";
 	}
 else
 	{
+        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
 	print FCMD "echo Running $ps_viewer in background...\n";
 	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "endif\n";
 	}
 
 # claim it's all over
@@ -3132,7 +2895,7 @@ if ($verbose)
 		printf "    Histogram stretch applied to amplitude shading\n";
 		}
 	if ($mb_btime || $mb_etime
-		|| $mb_pings != 1 || $mb_speedmin
+		|| $mb_speedmin
 		|| $mb_timegap)
 		{
 		print "\n  General MB-System Controls:\n";
@@ -3145,10 +2908,6 @@ if ($verbose)
 		{
 		print "    End time:                 $mb_etime\n";
 		}
-	if ($mb_pings != 1)
-		{
-		print "    Ping averaging:           $mb_pings\n";
-		}
 	if ($mb_speedmin)
 		{
 		print "    Minimum speed:            $mb_speedmin\n";
@@ -3452,16 +3211,6 @@ $width_max_portrait = $page_width_in{$pagesize}
 		- $space_left - $space_right;
 $height_max_portrait = $page_height_in{$pagesize}
 		- $space_bottom - $space_top;
-$frame_size = 0.075;
-if (($frame_size / $height_max_portrait) > 0.01)
-	{
-	$frame_size = 0.01 * $height_max_portrait;
-	}
-$tick_size = 0.075;
-if (($tick_size / $height_max_portrait) > 0.01)
-	{
-	$tick_size = 0.01 * $height_max_portrait;
-	}
 }
 #-----------------------------------------------------------------------
 sub GetProjection {
@@ -3790,27 +3539,27 @@ sub GetBaseTick {
 	$base_tick = &min($base_tick_x, $base_tick_y);
 	if ($base_tick < 0.0002777777)
 		{
-		$base_tick = "1c";
+		$base_tick = "1s";
 		}
 	elsif ($base_tick < 0.0005555555)
 		{
-		$base_tick = "2c";
+		$base_tick = "2s";
 		}
 	elsif ($base_tick < 0.0013888889)
 		{
-		$base_tick = "5c";
+		$base_tick = "5s";
 		}
 	elsif ($base_tick < 0.0027777778)
 		{
-		$base_tick = "10c";
+		$base_tick = "10s";
 		}
 	elsif ($base_tick < 0.0041666667)
 		{
-		$base_tick = "15c";
+		$base_tick = "15s";
 		}
 	elsif ($base_tick < 0.0083333333)
 		{
-		$base_tick = "30c";
+		$base_tick = "30s";
 		}
 	elsif ($base_tick < 0.0166667)
 		{
diff --git a/src/macros/mbm_rollerror b/src/macros/mbm_rollerror
index 6edfb66..56ab53e 100755
--- a/src/macros/mbm_rollerror
+++ b/src/macros/mbm_rollerror
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_rollover.perl	6/18/93
-#    $Id: mbm_rollerror 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_rollerror 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -33,7 +33,7 @@
 #   June 13, 1993
 #
 # Version:
-#   $Id: mbm_rollerror 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_rollerror 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_rollerror.perl,v $
diff --git a/src/macros/mbm_route2mission b/src/macros/mbm_route2mission
index af42410..e4b309f 100755
--- a/src/macros/mbm_route2mission
+++ b/src/macros/mbm_route2mission
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system: mbm_route2mission.perl   7/18/2004
-#    $Id: mbm_route2mission 2195 2014-07-10 00:10:27Z caress $
+#    $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $
 #
-#    Copyright (c) 2004-2014 by
+#    Copyright (c) 2004-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -36,76 +36,9 @@
 #      Moss Landing, CA
 #
 # Version:
-# $Id: mbm_route2mission 2195 2014-07-10 00:10:27Z caress $
+# $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $
 #
 # Revisions:
-#   $Log: mbm_route2mission.perl,v $
-#   Revision 5.21  2008/12/05 17:32:51  caress
-#   Check-in mods 5 December 2008 including contributions from Gordon Keith.
-#
-#   Revision 5.20  2008/11/16 21:51:18  caress
-#   Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
-#
-#   Revision 5.19  2008/10/17 07:52:44  caress
-#   Check in on October 17, 2008.
-#
-#   Revision 5.18  2008/09/27 03:27:10  caress
-#   Working towards release 5.1.1beta24
-#
-#   Revision 5.17  2008/09/11 20:06:46  caress
-#   Checking in updates made during cruise AT15-36.
-#
-#   Revision 5.16  2008/05/16 22:36:21  caress
-#   Release 5.1.1beta18
-#
-#   Revision 5.15  2008/02/12 02:51:51  caress
-#   Changes in preparation for 2008 MBARI Mapping AUV operations.
-#
-#   Revision 5.14  2007/10/08 05:45:46  caress
-#   Added zero point setpoint to descent sequences and can output WPL files.
-#
-#   Revision 5.13  2007/05/14 17:10:12  caress
-#   Mods during May 2007 Lucia Canyon cruise.
-#
-#   Revision 5.12  2007/03/02 20:33:37  caress
-#   Fixed informational output.
-#
-#   Revision 5.11  2006/11/26 09:42:01  caress
-#   Making distribution 5.1.0.
-#
-#   Revision 5.10  2006/11/10 22:36:04  caress
-#   Working towards release 5.1.0
-#
-#   Revision 5.9  2006/09/11 18:55:52  caress
-#   Changes during Western Flyer and Thomas Thompson cruises, August-September
-#   2006.
-#
-#   Revision 5.8  2006/07/27 18:42:51  caress
-#   Working towards 5.1.0
-#
-#   Revision 5.7  2006/06/16 19:30:58  caress
-#   Check in after the Santa Monica Basin Mapping AUV Expedition.
-#
-#   Revision 5.6  2006/04/11 19:12:53  caress
-#   Updates during Mapping AUV test operations.
-#
-#   Revision 5.5  2005/11/05 01:34:20  caress
-#   Much work over the past two months.
-#
-#   Revision 5.4  2005/06/04 04:28:43  caress
-#   Added support for new waypoint_depth AUV behavior.
-#
-#   Revision 5.3  2005/04/07 04:14:12  caress
-#   Added mission speed and mapping sonar options.
-#
-#   Revision 5.2  2004/12/02 06:27:45  caress
-#   Fixes to support MBARI AUV program.
-#
-#   Revision 5.1  2004/09/16 19:29:11  caress
-#   Development to support for MBARI Mapping AUV.
-#
-#   Revision 5.0  2004/07/27 19:56:43  caress
-#   Macro to translate MBgrdviz route file into MBARI AUV mission file.
 #
 #
 $program_name = "mbm_route2mission";
@@ -189,6 +122,7 @@ $mb_pingrate = 3.0;
 $mb_transmitgain = 220.0;
 $mb_receivegain = 75.0;
 $mb_minrangefraction = 0.2;
+$mb_maxrangefraction = 3.5;
 $mb_pulsewidth = 0.000060;
 $resongainsetcount = 0;
 $mb_snippetmode = 1;
@@ -228,12 +162,12 @@ $descendrate = 0.417; # m/s
 
 #$forwarddist = 0;
 $waypointdist = 200.0;
-$maxslopedeg = 25;
+$maxclimbrate = 25;
 $DTR  = 3.1415926 / 180.0;
-$maxslope = sin($DTR * $maxslopedeg) / cos($DTR * $maxslopedeg);
+$maxslope = sin($DTR * $maxclimbrate) / cos($DTR * $maxclimbrate);
 
 # Deal with command line arguments
-&MBGetopts('A:a:B:b:C:c:D:d:F:f:G:g:HhI:i:J:j:L%l%M%mN%n%O:o:P:p:R:r:S:s:T:t:W:w:V*v*Zz');
+&MBGetopts('A:a:B:b:C:c:D:d:F:f:G:g:HhI:i:J:j:L%l%M%mN%n%O:o:P:p:R:r:S:s:T:t:U:u:W:w:V*v*Zz');
 $altitudearg =		($opt_A || $opt_a);
 $behaviorarg =		($opt_B || $opt_b);
 $aborttime = 		($opt_C || $opt_c);
@@ -253,6 +187,7 @@ $startposition =	($opt_P || $opt_p);
 $multibeamsettings =	($opt_R || $opt_r);
 $speedarg =		($opt_S || $opt_s);
 $starttime =		($opt_T || $opt_t);
+$maxclimbrate =		($opt_U || $opt_u || $maxclimbrate);
 $waypointdist =		($opt_W || $opt_w || $waypointdist);
 $verbose =		($opt_V || $opt_v);
 $outputoff =		($opt_Z || $opt_z);
@@ -260,7 +195,7 @@ $outputoff =		($opt_Z || $opt_z);
 # print out help message if required
 if ($help) {
     print "\r\n$program_name:\r\n";
-    print "\nVersion: $Id: mbm_route2mission 2195 2014-07-10 00:10:27Z caress $\r\n";
+    print "\nVersion: $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $\r\n";
     print "\r\nPerl shellscript to translate survey route file derived from \r\n";
     print "MBgrdviz into an MBARI AUV mission script. Developed for use\r\n";
     print "in survey planning for the MBARI Mapping AUV.\r\n";
@@ -269,9 +204,9 @@ if ($help) {
     print "\t\t-Bbehavior1[/behavior2[/behavior3[/behavior4[/behavior5]]]] \r\n";
     print "\t\t-Caborttime -Ddepthconstant[/depthconstant2] -Fforwarddistance -Ggpsmode \r\n";
     print "\t\t-Jdepthprofilefile -Lapproachdepth -M[sonarlist] -N \r\n";
-    print "-Omissionfile \r\n\t\t-P[startlon/startlat | startdistance] \r\n";
+    print "\t\t-Omissionfile -P[startlon/startlat | startdistance] \r\n";
     print "\t\t-Rtransmitpower/receivegain[/rangeminfraction[/pulsewidth]] \r\n";
-    print "\t\t-Tstarttime -Wwaypointspacing -Z -V -H]\r\n";
+    print "\t\t-Tstarttime -Umaxclimbrate -Wwaypointspacing -Z -V -H]\r\n";
     exit 0;
 }
 
@@ -464,11 +399,11 @@ if ($sensor && !$sensorarg)
 	}
 if ($mappingsonar && $beamdata)
 	{
-	$logmode = 3;
+	$logmode = 2;
 	}
 elsif ($mappingsonar)
 	{
-	$logmode = 3;
+	$logmode = 2;
 	}
 elsif ($deltat)
 	{
@@ -484,9 +419,15 @@ elsif ($spiraldescent)
 	}
 if ($multibeamsettings =~ /\S+\/\S+\/\S+\/\S+/)
 	{
-	($mb_transmitgain,$mb_receivegain,$mb_minrangefraction,$pulsewidth) = $multibeamsettings =~ /(\S+)\/(\S+)\/(\S+)\/(\S+)/;
+	($mb_transmitgain,$mb_receivegain,$mb_minrangefraction,$mb_maxrangefraction,$pulsewidth)
+			= $multibeamsettings =~ /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
 	$mb_pulsewidth = $pulsewidth / 1000000.0;
 	}
+elsif ($multibeamsettings =~ /\S+\/\S+\/\S+\/\S+/)
+	{
+	($mb_transmitgain,$mb_receivegain,$mb_minrangefraction,$mb_maxrangefraction)
+			= $multibeamsettings =~ /(\S+)\/(\S+)\/(\S+)\/(\S+)/;
+	}
 elsif ($multibeamsettings =~ /\S+\/\S+\/\S+/)
 	{
 	($mb_transmitgain,$mb_receivegain,$mb_minrangefraction) = $multibeamsettings =~ /(\S+)\/(\S+)\/(\S+)/;
@@ -673,6 +614,7 @@ if ($debug)
 # vehicle a safe distance above the bottom.
 $nmissionpoints = 0;
 $lastmode = 0;
+$maxslope = sin($DTR * $maxclimbrate) / cos($DTR * $maxclimbrate);
 for ($i = 0; $i < $npoints; $i++)
 	{
 	# process points of interest
@@ -1034,9 +976,10 @@ elsif ($verbose)
 		printf "                                 Multibeam transmit gain:          $mb_transmitgain dB\r\n";
 		printf "                                 Multibeam pulse width:            $mb_pulsewidth usec\r\n";
 		printf "                                 Multibeam minimum range fraction: $mb_minrangefraction\r\n";
+		printf "                                 Multibeam maximum range fraction: $mb_maxrangefraction\r\n";
 		if ($beamdata)
 			{
-			printf "                                 Multibeam beam data collection enabled (100 m range)\r\n";
+			printf "                               Multibeam beam data collection enabled (100 m range)\r\n";
 			}
 		if ($subbottom)
 			{
@@ -1101,7 +1044,7 @@ elsif ($verbose)
 		printf "    Forward Looking Distance: $forwarddist (m)\r\n";
 		}
 	printf "    Waypoint Spacing:         $waypointdist (m)\r\n";
-	printf "    Maximum upward slope:     %f degrees  %f ratio\r\n", $maxslopedeg, $maxslope;
+	printf "    Maximum climb rate:       %f degrees  %f ratio\r\n", $maxclimbrate, $maxslope;
 	if ($starttime)
 		{
 		printf "    Time to First Waypoint:   %d (s)\r\n", $starttime;
@@ -1156,6 +1099,9 @@ if (!$outputoff)
 	printf MFILE "# by the MB-System program $program_name run by\r\n";
 	printf MFILE "# user <$user> on cpu <$host> at <$date>\r\n";
 	printf MFILE "# \r\n";
+	printf MFILE "# Program mbm_route2mission version:\r\n";
+	printf MFILE "#     $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $\r\n";
+	printf MFILE "# \r\n";
 	printf MFILE "# Mission Summary:\r\n";
 	printf MFILE "#     Route File:               $routefile\r\n";
 	printf MFILE "#     Mission File:             $missionfile\r\n";
@@ -1188,9 +1134,10 @@ if (!$outputoff)
 		printf MFILE "#                                 Multibeam transmit gain:          $mb_transmitgain dB\r\n";
 		printf MFILE "#                                 Multibeam pulse width:            $mb_pulsewidth usec\r\n";
 		printf MFILE "#                                 Multibeam minimum range fraction: $mb_minrangefraction\r\n";
+		printf MFILE "#                                 Multibeam maximum range fraction: $mb_maxrangefraction\r\n";
 		if ($beamdata)
 			{
-			printf MFILE "#                                 Multibeam beam data collection enabled (100 m range)\r\n";
+			printf MFILE "#                               Multibeam beam data collection enabled (100 m range)\r\n";
 			}
 		if ($subbottom)
 			{
@@ -1255,6 +1202,7 @@ if (!$outputoff)
 		printf MFILE "#     Forward Looking Distance:   $forwarddist (m)\r\n";
 		}
 	printf MFILE "#     Waypoint Spacing:           $waypointdist (m)\r\n";
+	printf MFILE "#     Maximum climb rate:         $maxclimbrate (degrees)\r\n";
 	if ($starttime)
 		{
 		printf MFILE "#     Time to First Waypoint:     %d (s)\r\n", $starttime;
@@ -1455,9 +1403,9 @@ printf "Behavior: stopCamera (distance:%.2f m\n",$mdistances[$nmissionpoints-1];
 			$sonaraltitudeuse = $sonaraltitude;
 			}
 
-		# sonar range allows for 150 degree swath on flat bottom
+		# if $mb_maxrangefraction = 3.5 then sonar range allows for 150 degree swath on flat bottom
 		# sonar range cut off at 100 m for recorded full beamformed data
-		$mb_range = 3.5 * $sonaraltitudeuse;
+		$mb_range = $mb_maxrangefraction * $sonaraltitudeuse;
 		if ($mb_range > 200.0)
 			{
 			$mb_range = 200.0;
@@ -1481,7 +1429,6 @@ printf "Behavior: stopCamera (distance:%.2f m\n",$mdistances[$nmissionpoints-1];
 			$sbp_duration = 300.0;
 			}
 
-
 		# do ascend, gps, descend at line starts and ends if specified
 		if (($iwaypoint != $nwaypoints - 1)
 			&& (($gpsmode == 1 && ($mstartstops[$i] == 1))
@@ -2419,10 +2366,10 @@ print "Behavior: gps\r\n";
 		#  $sslo_range & $sbp_duration calculated near start of program
 		# from ping rate
 		$sonaraltitudeuse = $altitudedesired;
-		$mb_range = 4.0 * $sonaraltitudeuse;
-		if ($mb_range > 350.0)
+		$mb_range = $mb_maxrangefraction * $sonaraltitudeuse;
+		if ($mb_range > 200.0)
 			{
-			$mb_range = 350.0;
+			$mb_range = 200.0;
 			}
 		if ($beamdata && $mb_range > 100.0)
 			{
@@ -2588,12 +2535,20 @@ print "Behavior: delta_t (start, reset, logMode = 0)\r\n";
 		}
 	close(TFILE);
 	$topodatafile = "$root" . "_mission.xy";
-	open(TFILE,">$topodatafile") || die "Cannot open output distance vs topo file: $topodatafile\r\n$program_name aborted.\r\n";
+	open(TFILE,">$topodatafile") || die "Cannot open output distance vs auv depth file: $topodatafile\r\n$program_name aborted.\r\n";
 	for ($i = 0; $i < $nmissionpoints-1; $i++)
 		{
 		printf TFILE "%f %f\r\n", $mdistances[$i], -$mmissiondepths[$i];
 		}
 	close(TFILE);
+	$topodatafile = "$root" . "_altitude.xy";
+	open(TFILE,">$topodatafile") || die "Cannot open output distance vs altitude file: $topodatafile\r\n$program_name aborted.\r\n";
+	for ($i = 0; $i < $nmissionpoints-1; $i++)
+		{
+		$altitude = -$mmissiondepths[$i] - $mtopos[$i];
+		printf TFILE "%f %f\r\n", $mdistances[$i], $altitude;
+		}
+	close(TFILE);
 	}
 
 # End it all
diff --git a/src/macros/mbm_stat b/src/macros/mbm_stat
index 7926785..b287ea0 100755
--- a/src/macros/mbm_stat
+++ b/src/macros/mbm_stat
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_stat.perl	8/14/93
-#    $Id: mbm_stat 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_stat 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -30,7 +30,7 @@
 #   August 14, 1993
 #
 # Version:
-#   $Id: mbm_stat 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_stat 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_stat.perl,v $
@@ -74,7 +74,7 @@ $verbose = ($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_stat 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_stat 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nPerl shellscript to extract beam statistics from the ouput of mbinfo.\n";
 	print "\nUsage: $program_name -Ifile [-V -H]\n";
 	exit 0;
diff --git a/src/macros/mbm_utm b/src/macros/mbm_utm
index c30de77..f11c447 100755
--- a/src/macros/mbm_utm
+++ b/src/macros/mbm_utm
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_utm.perl	5/13/2002
-#    $Id: mbm_utm 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_utm 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 2002-2014 by
+#    Copyright (c) 2002-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -34,7 +34,7 @@
 #   May 13, 2002
 #
 # Version:
-#   $Id: mbm_utm 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_utm 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_utm.perl,v $
@@ -74,7 +74,7 @@ $verbose = 		($opt_V || $opt_v);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_utm 2175 2014-03-18 23:03:39Z caress $\n";
+	print "\nVersion: $Id: mbm_utm 2227 2015-02-05 21:12:31Z caress $\n";
 	print "\nMB-System macro to perform forward and inverse UTM projections";
 	print "of ASCII data triples using the GMT program mapproject. ";
 	print "Forward projections translate from geographic data ";
diff --git a/src/macros/mbm_vrefcheck b/src/macros/mbm_vrefcheck
index 8884ae9..1d7a25e 100755
--- a/src/macros/mbm_vrefcheck
+++ b/src/macros/mbm_vrefcheck
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_vrefcheck.perl	6/18/93
-#    $Id: mbm_vrefcheck 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_vrefcheck 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -32,7 +32,7 @@
 #   June 13, 1993
 #
 # Version:
-#   $Id: mbm_vrefcheck 2175 2014-03-18 23:03:39Z caress $
+#   $Id: mbm_vrefcheck 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_vrefcheck.perl,v $
diff --git a/src/macros/mbm_xbt b/src/macros/mbm_xbt
index 5a9942b..24aba00 100755
--- a/src/macros/mbm_xbt
+++ b/src/macros/mbm_xbt
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system: mbm_xbt.perl   6/18/93
-#    $Id: mbm_xbt 2175 2014-03-18 23:03:39Z caress $
+#    $Id: mbm_xbt 2227 2015-02-05 21:12:31Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -79,7 +79,7 @@
 #
 #
 # Version:
-# $Id: mbm_xbt 2175 2014-03-18 23:03:39Z caress $
+# $Id: mbm_xbt 2227 2015-02-05 21:12:31Z caress $
 #
 # Revisions:
 #   $Log: mbm_xbt.perl,v $
@@ -377,7 +377,7 @@ sub useage {
 
 
     print "\nUsage: $ProgramName -Ifile \n";
-    print "\nVersion: $Id: mbm_xbt 2175 2014-03-18 23:03:39Z caress $\n";
+    print "\nVersion: $Id: mbm_xbt 2227 2015-02-05 21:12:31Z caress $\n";
     print "\t[-C -Ssalinity -Fformat -Llatitude -V -H -C]\n\n";
 
     print "\tPerl shellscript to translate various XBT (with -F option) \n";
diff --git a/src/macros/mbm_xyplot b/src/macros/mbm_xyplot
index ec730ee..6ea157f 100755
--- a/src/macros/mbm_xyplot
+++ b/src/macros/mbm_xyplot
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
 #--------------------------------------------------------------------
 #    The MB-system:	mbm_xyplot.perl	8/6/95
-#    $Id: mbm_xyplot 2180 2014-04-02 20:58:34Z caress $
+#    $Id: mbm_xyplot 2234 2015-03-05 07:41:54Z caress $
 #
-#    Copyright (c) 1993-2014 by
+#    Copyright (c) 1993-2015 by
 #    D. W. Caress (caress at mbari.org)
 #      Monterey Bay Aquarium Research Institute
 #      Moss Landing, CA
@@ -43,7 +43,7 @@
 #            -Ltitle[:scale_label] -Mmisc -Q -Rw/e/s/n -X]
 #
 # Miscellaneous Options:
-#            [-MGDgmtdef/value -MGL[f][x]lon0/lat0/slat/length[m]
+#            [-MGDgmtdef/value -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
 #            -MGTx/y/size/angle/font/just/text
 #            -MGU[/dx/dy/][label] ]
 #
@@ -54,96 +54,7 @@
 #   August 9, 1995
 #
 # Version:
-#   $Id: mbm_xyplot 2180 2014-04-02 20:58:34Z caress $
-#
-# Revisions:
-#   $Log: mbm_xyplot.perl,v $
-#   Revision 5.15  2008/09/11 20:06:46  caress
-#   Checking in updates made during cruise AT15-36.
-#
-#   Revision 5.14  2007/10/08 04:29:06  caress
-#   Added some large page definitions.
-#
-#   Revision 5.13  2006/07/05 19:50:21  caress
-#   Working towards 5.1.0beta
-#
-#   Revision 5.12  2006/06/16 19:30:58  caress
-#   Check in after the Santa Monica Basin Mapping AUV Expedition.
-#
-#   Revision 5.11  2006/01/06 18:26:26  caress
-#   Working towards 5.0.8
-#
-#   Revision 5.10  2005/11/05 01:34:20  caress
-#   Much work over the past two months.
-#
-#   Revision 5.9  2005/03/25 04:05:40  caress
-#   Fixed handling of tickinfo string.
-#   For mbm_plot only, added control on filename annotation direction.
-#
-#   Revision 5.8  2004/09/16 19:12:55  caress
-#   Supports postscript viewer ggv.
-#
-#   Revision 5.7  2003/11/25 21:25:43  caress
-#   Implemented Val Schmidt's changes.
-#
-#   Revision 5.6  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.5  2002/04/06 02:51:54  caress
-#   Release 5.0.beta16
-#
-#   Revision 5.4  2001/12/18 04:26:12  caress
-#   Version 5.0.beta11.
-#
-# Revision 5.3  2001/11/02  21:07:40  caress
-# Adjusted handling of segmented xy files.
-#
-# Revision 5.2  2001/10/10  23:56:01  dcaress
-# Regrettably, I don't remember what I changed...
-#
-#   Revision 5.1  2001-06-30 10:36:53-07  caress
-#   Release 5.0.beta02
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.10  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.9  1999/06/25  17:55:47  caress
-# I must have changed something!
-#
-# Revision 4.8  1999/05/06  23:46:32  caress
-# Release 4.6a
-#
-# Revision 4.7  1999/04/16  01:25:51  caress
-# Version 4.6 final release?
-#
-# Revision 4.6  1999/04/15  19:28:52  caress
-# Fixed sprintf statements.
-#
-# Revision 4.5  1999/02/04  23:39:54  caress
-# MB-System version 4.6beta7
-#
-# Revision 4.4  1998/10/05  17:00:15  caress
-# MB-System version 4.6beta
-#
-# Revision 4.3  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.3  1997/04/17  15:06:49  caress
-# MB-System 4.5 Beta Release
-#
-# Revision 4.2  1996/03/12  17:28:19  caress
-# Check-in after flail with format 63.
-#
-# Revision 4.1  1995/09/28  18:05:43  caress
-# Various bug fixes working toward release 4.3.
-#
-# Revision 4.0  1995/08/17  14:53:25  caress
-# Revision for release 4.3.
-#
-#
+#   $Id: mbm_xyplot 2234 2015-03-05 07:41:54Z caress $
 #
 #
 $program_name = "mbm_xyplot";
@@ -272,7 +183,7 @@ $delete_temp_files = 	($opt_Z || $opt_z);
 if ($help)
 	{
 	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_xyplot 2180 2014-04-02 20:58:34Z caress $\n";
+	print "\nVersion: $Id: mbm_xyplot 2234 2015-03-05 07:41:54Z caress $\n";
 	print "\nMacro to generate a shellscript of GMT commands which,  \n";
 	print "when executed, will generate a Postscript plot of xy data. \n";
 	print "Axes may be linear, log,  or any of several geographic  \n";
@@ -475,7 +386,7 @@ else
 # either of two mechanisms. The first method is to specify multiple
 # input file flags and associated arguments ( e.g. mbm_xyplot
 # -i[fileargs]:file -i[fileargs]:file ...). The second method is to
-# use the utilize the multi-segemnt feature psxy. The -M flag allows
+# use the utilize the multi-segemnt feature psxy. The program allows
 # multiple "segments" of x,y pairs to be listed in a single file each
 # separated by a single line having a special character. The default
 # character is ">", and indeed that is the ONLY character supported
@@ -1144,10 +1055,21 @@ if ($coast_control
 	$coast_resolution = "f";
 	}
 
+# if length scale bar requested check to see if map center needs to be defined
+if ($length_scale && $length_scale =~ /\S+center\S+/)
+        {
+        # add map lon lat (or x y) center to the length scale argument
+        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
+        $xcen = 0.5 * ($xmin + $xmax);
+        $ycen = 0.5 * ($ymin + $ymax);
+        $b = "$xcen/$ycen";
+        $length_scale = "$a$b$c";
+        }
+
 # come up with the filenames
 $cmdfile = "$root.cmd";
 $psfile = "$root.ps";
-$gmtfile = "gmtdefaults4\$\$";
+$gmtfile = "gmt.conf\$\$";
 
 # set some gmtisms
 $first_gmt = 1;
@@ -1156,35 +1078,27 @@ $middle = "-K -O -V >> \$PS_FILE";
 $end = "-O -V >> \$PS_FILE";
 
 # set macro gmt default settings
-$gmt_def = "MEASURE_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAPER_MEDIA/$page_gmt_name{$pagesize}+";
+$gmt_def = "PROJ_LENGTH_UNIT/inch";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT/Helvetica";
+$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT/Helvetica";
+$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT/Helvetica";
+$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "ANOT_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "LABEL_FONT_SIZE/$page_anot_font{$pagesize}";
+$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "HEADER_FONT_SIZE/$page_header_font{$pagesize}";
+$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FRAME_WIDTH/$frame_size";
+$gmt_def = "COLOR_BACKGROUND/black";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "TICK_LENGTH/$tick_size";
+$gmt_def = "COLOR_FOREGROUND/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PAGE_ORIENTATION/LANDSCAPE";
+$gmt_def = "COLOR_NAN/white";
 push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/0/0/0";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/255/255/255";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PLOT_DEGREE_FORMAT/$degree_format";
+$gmt_def = "FORMAT_GEO_MAP/$degree_format";
 push(@gmt_macro_defs, $gmt_def);
 
 # open the shellscript file
@@ -1211,15 +1125,17 @@ print FCMD "set MAP_REGION      = $bounds_plot\n";
 printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
 printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
 
-# Reset GMT defaults, saving old defaults
-print FCMD "#\n# Save existing GMT defaults\n";
-print FCMD "echo Saving GMT defaults...\n";
-print FCMD "gmtdefaults -L >! $gmtfile\n";
-print FCMD "#\n# Set new GMT defaults\n";
-print FCMD "echo Setting new GMT defaults...\n";
+# Set temporary GMT defaults
+print FCMD "#\n# Delete any existing gmt.conf file\n";
+print FCMD "if (-e gmt.conf) then\n";
+print FCMD "echo Deleting gmt.conf...\n";
+print FCMD "/bin/rm gmt.conf\n";
+print FCMD "endif\n";
+print FCMD "#\n# Set temporary GMT defaults\n";
+print FCMD "echo Setting temporary GMT defaults...\n";
 foreach $gmt_def (@gmt_macro_defs) {
 	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmtset $gmt_par $gmt_var\n";
+	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
 	}
 
 # Reset GMT defaults as per user commands
@@ -1281,38 +1197,23 @@ if ($nlabels < 3)
 # set basemap axes annotation
 if ($tick_info)
 	{
-	if ($tick_info =~ /.*\/.*/)
-		{
-		($xtick, $ytick) = $tick_info =~ /(.*)\/(.*)/;
-		}
-	if ($tick_info =~ /.*:\..*/)
-		{
-		($title) = $tick_info =~ /.*:\.(.*)/;
-		}
-	else
-		{
-		$title = $tlabel;
-		}
-	if ($xtick && $ytick)
-		{
-		$axes = "$xtick:\"$xlabel\":/$ytick:\"$ylabel\"::.\"$title\":";
-		}
-	else
-		{
-		$axes = "$axes:.\"$title\":";
-		}
+	$axes = "-B$tick_info";
 	}
 elsif ($projection =~ /^[Xx].*/ && !$geographic)
 	{
 	# figure out some reasonable tick intervals for the basemap
 	&GetBaseTickLinear;
-	$axes = "$base_tick_x:\"$xlabel\":/$base_tick_y:\"$ylabel\"::.\"$tlabel\":";
+	$axes = "-Bx$base_tick_x+l\"$xlabel\" -By$base_tick_y+l\"$ylabel\"";
 	}
 else
 	{
 	# figure out some reasonable tick intervals for the basemap
 	&GetBaseTick;
-	$axes = "$base_tick:\"$xlabel\":/$base_tick:\"$ylabel\"::.\"$tlabel\":";
+	$axes = "-B$base_tick";
+	}
+if ($tlabel)
+	{
+	$axes = "$axes -B+t\"$tlabel\"";
 	}
 
 # do xy plots
@@ -1335,10 +1236,10 @@ for ($i = 0; $i < scalar(@xyfiles); $i++)
 		{
 		printf FCMD "-G$xyfills[$i] \\\n\t";
 		}
-	if ($xysegments[$i] ne "N")
-		{
-		printf FCMD "-M \\\n\t";
-		}
+#	if ($xysegments[$i] ne "N")
+#		{
+#		printf FCMD "-M \\\n\t";
+#		}
 	if ($portrait)
 		{
 		printf FCMD "-P ";
@@ -1428,7 +1329,7 @@ printf FCMD "#\n# Make basemap\n";
 printf FCMD "echo Running psbasemap...\n";
 printf FCMD "psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
 printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "-B$axes \\\n\t";
+printf FCMD "$axes \\\n\t";
 if ($length_scale)
 	{
 	printf FCMD "-L$length_scale \\\n\t";
@@ -1450,6 +1351,7 @@ printf FCMD "$end\n";
 # delete surplus files
 print FCMD "#\n# Delete surplus files\n";
 print FCMD "echo Deleting surplus files...\n";
+print FCMD "/bin/rm -f gmt.conf\n";
 if (!$file_cpt)
 	{
 	print FCMD "/bin/rm -f \$CPT_FILE\n";
@@ -1465,12 +1367,6 @@ if ($delete_temp_files) {
     }
 }
 
-
-# reset GMT defaults
-print FCMD "#\n# Reset GMT default fonts\n";
-print FCMD "echo Resetting GMT fonts...\n";
-print FCMD "/bin/mv $gmtfile .gmtdefaults4\n";
-
 # display image on screen if desired
 print FCMD "#\n# Run $ps_viewer\n";
 if ($ps_viewer eq "xpsview")
@@ -1544,13 +1440,17 @@ elsif ($ps_viewer eq "evince")
 	}
 if ($no_view_ps)
 	{
+        print FCMD "#if (!($#argv > 0 && (\"$1\" == \"-N\" || \"$1\" == \"-n\"))) then\n";
 	print FCMD "#echo Running $ps_viewer in background...\n";
 	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "#endif\n";
 	}
 else
 	{
+        print FCMD "if (!($#argv > 0 && (\"$1\" == \"-N\" || \"$1\" == \"-n\"))) then\n";
 	print FCMD "echo Running $ps_viewer in background...\n";
 	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
+        print FCMD "endif\n";
 	}
 
 # claim it's all over
@@ -1820,16 +1720,6 @@ $width_max_portrait = $page_width_in{$pagesize}
 		- $space_left - $space_right;
 $height_max_portrait = $page_height_in{$pagesize}
 		- $space_bottom - $space_top;
-$frame_size = 0.075;
-if (($frame_size / $height_max_portrait) > 0.01)
-	{
-	$frame_size = 0.01 * $height_max_portrait;
-	}
-$tick_size = 0.075;
-if (($tick_size / $height_max_portrait) > 0.01)
-	{
-	$tick_size = 0.01 * $height_max_portrait;
-	}
 }
 #-----------------------------------------------------------------------
 sub GetProjection {
@@ -2191,27 +2081,27 @@ sub GetBaseTick {
 	$base_tick = &min($base_tick_x, $base_tick_y);
 	if ($base_tick < 0.0002777777)
 		{
-		$base_tick = "1c";
+		$base_tick = "1s";
 		}
 	elsif ($base_tick < 0.0005555555)
 		{
-		$base_tick = "2c";
+		$base_tick = "2s";
 		}
 	elsif ($base_tick < 0.0013888889)
 		{
-		$base_tick = "5c";
+		$base_tick = "5s";
 		}
 	elsif ($base_tick < 0.0027777778)
 		{
-		$base_tick = "10c";
+		$base_tick = "10s";
 		}
 	elsif ($base_tick < 0.0041666667)
 		{
-		$base_tick = "15c";
+		$base_tick = "15s";
 		}
 	elsif ($base_tick < 0.0083333333)
 		{
-		$base_tick = "30c";
+		$base_tick = "30s";
 		}
 	elsif ($base_tick < 0.0166667)
 		{
diff --git a/src/man/Makefile.in b/src/man/Makefile.in
index 810d89f..cc94646 100644
--- a/src/man/Makefile.in
+++ b/src/man/Makefile.in
@@ -199,8 +199,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -217,6 +215,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -280,19 +279,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -305,8 +311,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/man/Makefile.template b/src/man/Makefile.template
deleted file mode 100644
index 1b038f3..0000000
--- a/src/man/Makefile.template
+++ /dev/null
@@ -1,47 +0,0 @@
-#     The MB-system:	Makefile.template  5/21/2013
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2013-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/man directory level
-# Author:	D. W. Caress
-# Date:		May 21, 2013
-#
-# $Log: Makefile.template,v $
-#
-#
-
-### sets locations of vital objects
-MANDIR = ../../man
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all copies the man pages to the mbsystem/man directory
-all:	$(MANDIR) $(MANDIR)/man1 $(MANDIR)/man3
-	cp man1/*.1 $(MANDIR)/man1
-	cp man3/*.3 $(MANDIR)/man3
-	cp whatis $(MANDIR)
-	chmod 664 $(MANDIR)/man1/*
-	chmod 664 $(MANDIR)/man3/*
-	chmod 664 $(MANDIR)/whatis
-$(MANDIR):
-	mkdir $(MANDIR)
-$(MANDIR)/man1:
-	mkdir $(MANDIR)/man1
-$(MANDIR)/man3:
-	mkdir $(MANDIR)/man3
-
-### make clean removes the man pages
-clean:
-	rm -r -f $(MANDIR)
diff --git a/src/man/man1/Makefile.in b/src/man/man1/Makefile
similarity index 72%
copy from src/man/man1/Makefile.in
copy to src/man/man1/Makefile
index b2313f9..9ccab27 100644
--- a/src/man/man1/Makefile.in
+++ b/src/man/man1/Makefile
@@ -1,5 +1,5 @@
 # Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
+# src/man/man1/Makefile.  Generated from Makefile.in by configure.
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
@@ -12,8 +12,8 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
- at SET_MAKE@
-VPATH = @srcdir@
+
+
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
   case $${target_option-} in \
@@ -59,10 +59,10 @@ am__make_running_with_option = \
   test $$has_opt = yes
 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgdatadir = $(datadir)/mbsystem
+pkgincludedir = $(includedir)/mbsystem
+pkglibdir = $(libdir)/mbsystem
+pkglibexecdir = $(libexecdir)/mbsystem
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -75,8 +75,8 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
+build_triplet = x86_64-apple-darwin13.4.0
+host_triplet = x86_64-apple-darwin13.4.0
 subdir = src/man/man1
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -90,16 +90,16 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
 am__v_P_0 = false
 am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
 am__v_GEN_0 = @echo "  GEN     " $@;
 am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
 am__v_at_0 = @
 am__v_at_1 = 
 SOURCES =
@@ -142,155 +142,159 @@ NROFF = nroff
 MANS = $(man_MANS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
+ACLOCAL = ${SHELL} /Users/caress/sandbox/mbsystem/missing aclocal-1.14
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AUTOCONF = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoconf
+AUTOHEADER = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoheader
+AUTOMAKE = ${SHELL} /Users/caress/sandbox/mbsystem/missing automake-1.14
+AWK = awk
+CC = gcc
+CCAS = gcc
+CCASDEPMODE = depmode=gcc3
+CCASFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
+CPP = gcc -E
+CPPFLAGS = 
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = false
+DSYMUTIL = dsymutil
+DUMPBIN = 
+ECHO_C = \c
+ECHO_N = 
+ECHO_T = 
+EGREP = /sw/bin/grep -E
+EXEEXT = 
+FGREP = /sw/bin/grep -F
+GREP = /sw/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
+LDFLAGS = -L/opt/X11/lib
+LIBM = 
+LIBOBJS = 
+LIBS = -lm 
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBTOOL_DEPS = ./ltmain.sh
+LIPO = lipo
+LN_S = ln -s
+LTLIBOBJS = 
+LT_SYS_LIBRARY_PATH = 
+MAINT = #
+MAKEINFO = ${SHELL} /Users/caress/sandbox/mbsystem/missing makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = ../../.././install-sh -c -d
+NM = /usr/bin/nm
+NMEDIT = nmedit
+OBJDUMP = false
+OBJEXT = o
+OTOOL = otool
+OTOOL64 = :
+OTPS_DIR = /usr/local/OTPS2
+PACKAGE = mbsystem
+PACKAGE_BUGREPORT = http://listserver.mbari.org/sympa/arc/mbsystem
+PACKAGE_NAME = mbsystem
+PACKAGE_STRING = mbsystem 5.5.2252
+PACKAGE_TARNAME = mbsystem
+PACKAGE_URL = http://www.mbari.org/data/mbsystem/
+PACKAGE_VERSION = 5.5.2252
+PATH_SEPARATOR = :
+PKG_CONFIG = 
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = 
+RANLIB = ranlib
+SED = /sw/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 5.5.2252
+XDR_LIB = 
+abs_builddir = /Users/caress/sandbox/mbsystem/src/man/man1
+abs_srcdir = /Users/caress/sandbox/mbsystem/src/man/man1
+abs_top_builddir = /Users/caress/sandbox/mbsystem
+abs_top_srcdir = /Users/caress/sandbox/mbsystem
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-apple-darwin13.4.0
+build_alias = 
+build_cpu = x86_64
+build_os = darwin13.4.0
+build_vendor = apple
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+fftw_app = 
+host = x86_64-apple-darwin13.4.0
+host_alias = 
+host_cpu = x86_64
+host_os = darwin13.4.0
+host_vendor = apple
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /Users/caress/sandbox/mbsystem/install-sh
+libGLU_CFLAGS = 
+libGLU_LIBS = 
+libXm_CFLAGS = 
+libXm_LIBS = 
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+libfftw3_CFLAGS = 
+libfftw3_LIBS = 
+libfftw_CPPFLAGS = -I/sw/include
+libfftw_LIBS = -L/sw/lib -R /sw/lib -lfftw3
+libgmt_CFLAGS = 
+libgmt_CPPFLAGS = -I/sw/include/gmt
+libgmt_LIBS = -L/sw/lib -R /sw/lib -lgmt -lpsl
+libmotif_CPPFLAGS = -I/sw/include
+libmotif_LIBS = -L/sw/lib -R /sw/lib -lXm -lXt -lX11
+libnetcdf_CFLAGS = 
+libnetcdf_CPPFLAGS = -I/sw/include
+libnetcdf_LIBS = -L/sw/lib -R /sw/lib -lnetcdf
+libopengl_CPPFLAGS = 
+libopengl_LIBS = -lGL -lGLU
+libproj_CFLAGS = 
+libproj_CPPFLAGS = -I/sw/include
+libproj_LIBS = -L/sw/lib -R /sw/lib -lproj
+libpsl_CFLAGS = 
+libpsl_LIBS = 
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mbsystemdatadir = ${datarootdir}/mbsystem
+mbsystemhtmldir = ${datarootdir}/doc/${PACKAGE_TARNAME}/html
+mbsystempsdir = ${datarootdir}/doc/${PACKAGE_TARNAME}/ps
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /Users/caress/sandbox/mbsystem
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../../
+top_builddir = ../../..
+top_srcdir = ../../..
 man_MANS = \
 mbhsdump.1 \
 mb7k2jstar.1 \
@@ -376,12 +380,12 @@ mbsystem.1 \
 mbtime.1 \
 mbvelocitytool.1
 
- at BUILD_PROJ_TRUE@man_PROJ = proj.1 geod.1 
+#man_PROJ = proj.1 geod.1 
 EXTRA_DIST = $(man_MANS) $(man_PROJ)
 all: all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -406,9 +410,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+$(top_srcdir)/configure: # $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
diff --git a/src/man/man1/Makefile.in b/src/man/man1/Makefile.in
index b2313f9..e9f0651 100644
--- a/src/man/man1/Makefile.in
+++ b/src/man/man1/Makefile.in
@@ -170,8 +170,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -188,6 +186,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -251,19 +250,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -276,8 +282,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/man/man1/mbauvloglist.1 b/src/man/man1/mbauvloglist.1
index 2eb8983..89f9971 100644
--- a/src/man/man1/mbauvloglist.1
+++ b/src/man/man1/mbauvloglist.1
@@ -1,4 +1,4 @@
-.TH mbauvloglist 1 "21 October 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbauvloglist 1 "18 February 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbauvloglist\fP \- Lists table data from an MBARI AUV mission log file.
 
@@ -7,7 +7,7 @@ Version 5.0
 
 .SH SYNOPSIS
 \fBmbauvloglist\fP \fB\-I\fP\fIfile\fP [\fB\-F\fP\fIprintformat\fP \fB\-L\fP\fIlonflip\fP
-\fB\-O\fP\fIlist\fP \fB\-P \-S\fP \fB\-V \-H\fP ]
+\fB\-M\fP\fImode\fP \fB\-N\fP\fInavfile\fP \fB\-O\fP\fIlist\fP \fB\-P \-S\fP \fB\-V \-H\fP ]
 
 .SH DESCRIPTION
 MBauvloglist reads an MBARI AUV mission log file and lists specified
@@ -51,6 +51,15 @@ to specify each of the desired values in the desired order of columns. The \fB\-
 can be used to set the printing format. Otherwise, the default format specified in the
 log header will be used.
 
+The \fB-M\fP\fImode\fP option sets the output mode. By default, the output will be ASCII
+text with tab characters between fields, which is equivalent to \fB-M\fP\fI0\fP. If
+f\Imode\fP = 1, then the output will be ASCII text with comma delimiters. If \fImode\fP = 1,
+then the output will binary values (8-btye double or 4-byte int values) with nothing between
+the desired fields.
+
+For log files that do not include navigation, an external navigation file in the "fnv"
+format may be specified using the \fB-N\fP option. 
+
 As of August 2009, the contents of the MBARI Mapping AUV missions logs are:
 
 DropWeight.log Contents:
@@ -301,11 +310,55 @@ the range from 0 to 360 degrees.
 Default: \fBmbauvloglist\fP uses the user default \fIlonflip\fP set using
 \fBmbdefaults\fP.
 .TP
+.B \-M
+\fImode\fP
+.br
+Specifies the output mode. If \fImode\fP = 0, then the output is
+ASCII text with tab delimiters between fields. If \fImode\fP = 1,
+then the output is ASCII text with comma delimiters between fields.
+If \fImode\fP = 2, then the output is binary with no values or breaks
+between fields. Default: ASCII text with tab delimiters.
+.TP
+.B \-N
+\fInavfile\fP
+.br
+Specifies a navigation file in the "fnv" format that contains position,
+heading, sensor depth, and attitude data. Values merged (interpolated)
+from these data can be specified for output using the
+     mergeLon
+     mergeLat
+     mergeHeading
+     mergeSpeed
+     mergeDraft
+     mergeSensordepth
+     mergeRoll
+     mergePitch
+     mergeHeave
+.br
+valuenames in the \fB-O\fP option.
+.TP
 .B \-O
 \fIvaluename\fP
 .br
 Causes \fBmbauvloglist\fP to output the specified value. This option can be
 given multiple times, and the values will be output in the order specified.
+The valid valuename strings consist of those defined in the header of the
+log file being parsed, plus the following:
+     zero
+     timeTag
+     mergeLon
+     mergeLat
+     mergeHeading
+     mergeSpeed
+     mergeDraft
+     mergeSensordepth
+     mergeRoll
+     mergePitch
+     mergeHeave
+.br
+All of the special values are double values. Those beginning with "merge"
+derive from interpolation of data from an external navigation file
+specified using the \fB-N\fP option.
 .TP
 .B \-P
 .br
diff --git a/src/man/man1/mbclean.1 b/src/man/man1/mbclean.1
index 5805e12..eadd29e 100644
--- a/src/man/man1/mbclean.1
+++ b/src/man/man1/mbclean.1
@@ -1,4 +1,4 @@
-.TH mbclean 1 "1 December 2014" "MB-System 5.0" "MB-System 5.0"
+.TH mbclean 1 "14 April 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbclean\fP \- Tool to automatically flag bad beams in swath sonar bathymetry data.
 
@@ -231,13 +231,7 @@ are handled.
  			The flagged beam is the one furthest from the local
  			median depth.
  	\fImode\fP = 2:	Flags both beams associated with each outlier slope.
- 	\fImode\fP = 3:	Zeros one beam associated with each outlier slope.
- 			The zeroed beam is the one furthest from the local
- 			median depth.
- 	\fImode\fP = 4:	Zeros both beams associated with each outlier slope.
-If the data format of the input file
-prohibits storage of negative depths, an error message will be output
-and the program will exit. Default: \fImode\fP = 1.
+Default: \fImode\fP = 1.
 .TP
 .B \-P
 \fIspeed_low/speed_high\fP
@@ -382,7 +376,6 @@ is flagged. Here is an example of the nonverbose output:
 	0 excessive spikes identified
  	1665 beams flagged
  	0 beams unflagged
- 	0 beams zeroed
 
  	Processing 0002_20020425_011607.mb57
  	259 bathymetry data records processed
@@ -396,7 +389,6 @@ is flagged. Here is an example of the nonverbose output:
 	0 excessive spikes identified
  	242 beams flagged
  	0 beams unflagged
- 	0 beams zeroed
 
  	Processing 0003_20020425_022926.mb57
  	65 bathymetry data records processed
@@ -410,7 +402,6 @@ is flagged. Here is an example of the nonverbose output:
 	0 excessive spikes identified
  	506 beams flagged
  	0 beams unflagged
- 	0 beams zeroed
 
  	Processing 0004_20020425_024336.mb57
  	410 bathymetry data records processed
@@ -424,7 +415,6 @@ is flagged. Here is an example of the nonverbose output:
 	0 excessive spikes identified
  	148 beams flagged
  	0 beams unflagged
- 	0 beams zeroed
 
  	Processing 0005_20020425_034057.mb57
  	252 bathymetry data records processed
@@ -438,7 +428,6 @@ is flagged. Here is an example of the nonverbose output:
 	0 excessive spikes identified
  	100 beams flagged
  	0 beams unflagged
- 	0 beams zeroed
 
  	Processing 0006_20020425_045013.mb57
  	562 bathymetry data records processed
@@ -452,7 +441,6 @@ is flagged. Here is an example of the nonverbose output:
 	0 excessive spikes identified
  	41 beams flagged
  	0 beams unflagged
- 	0 beams zeroed
 
  	MBclean Processing Totals:
  	-------------------------
@@ -471,7 +459,6 @@ is flagged. Here is an example of the nonverbose output:
 	0 total excessive spikes identified
  	2702 total beams flagged
  	0 total beams unflagged
- 	0 total beams zeroed
 
 .SH SEE ALSO
 \fBmbsystem\fP(1), \fBmbedit\fP(1),
diff --git a/src/man/man1/mbcontour.1 b/src/man/man1/mbcontour.1
index 8c7c4ca..c67da53 100644
--- a/src/man/man1/mbcontour.1
+++ b/src/man/man1/mbcontour.1
@@ -1,13 +1,13 @@
-.TH mbcontour 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbcontour 1 "5 February 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
-\fBmbcontour\fP \- GMT compatible utility for color fill or color shaded relief
+\fBmbcontour\fP \- \fBGMT\fP plug-in module for color fill or color shaded relief
 swath plots of swath sonar data using Postscript.
 
 .SH VERSION
 Version 5.0
 
 .SH SYNOPSIS
-\fBmbcontour\fP \fB\-J\fIparameters\fP \fB\-R\fIwest/east/south/north
+\fBgmt mbcontour\fP \fB\-J\fIparameters\fP \fB\-R\fIwest/east/south/north
 \fP[\fB\-A\fIcont_int/col_int/tic_int/lab_int/tic_int/lab_hgt/lab_spacing\fP
 \fB\-B\fItickinfo\fP \fB\-b\fIyr/mo/da/hr/mn/sc\fP
 \fB\-C\fIcontourfile\fP \fB\-c\fIcopies\fP
@@ -22,9 +22,10 @@ Version 5.0
 \fB\-V \-H\fP]
 
 .SH DESCRIPTION
-\fBmbcontour\fP is a utility for swath contouring of swath bathymetry
-data using Postscript.  Like \fBmbswath\fP, \fBmbcontour\fP
-is fully compatible with the GMT package version 4. Two contouring
+\fBmbcontour\fP is a plug-in module for plotting bathymetry contours
+from swath sonar data using \fBGMT\fP (Generic Mapping Tools). Like
+\fBmbswath\fP, \fBmbcontour\fP is fully compatible with the \fBGMT\fP
+package version 5. Two contouring
 algorithms are available; the \fB\-Z\fP option specifies which is used.
 The first, default approach draws contours between successive pings;
 this algorithm is simple and therefore fast but produces poor
@@ -59,9 +60,20 @@ of data files for use in all plotting without the performance penalty
 of \fBmbcontour\fP reading through all the data files, even those
 with no relevent data. We recommend that users maintain a ".inf"
 file for each swath data file used for gridding or plotting. The
-programs \fBmbswath\fP and \fBmbgrid\fP also use ".inf" files
+\fBGMT\fP modules \fBmbswath\fP and \fBmbgrid\fP also use ".inf" files
 in the same fashion.
 
+In order for \fBGMT\fP to successfully execute \fBmbcontour\fP, the
+location of the shared library \fIlibmbgmt\fP containing this module must be known to \fBGMT\fP.
+This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
+in the file gmt.conf that is part of the GMT installation, by setting
+this parameter in the file gmt.conf in the user's home directory, or by
+using the GMT module \fBgmtset\fP to modify this parameter in the
+current working directory. If, for instance, the \fIlibmbgmt\fP shared library
+has been installed in the file /usr/lib/libmbgmt.dylib, then the
+GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
+        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -216,8 +228,7 @@ An "fnv" file contains only navigation information in a compact
 ASCII format (format 166), and is thus even quicker to read.
 When \fBmbcontour\fP is only generating a shiptrack plot, it will
 attempt to read an "fnv" file in lieu of the original data.
-.br
-Default: \fIinfile\fP = "stdin".
+
 .TP
 .B \-J
 Selects the map projection. Scale is inch/degree, 1:xxxxx.
@@ -413,7 +424,7 @@ Suppose the user has a Hydrosweep data file in the L-DEO in-house
 binary format (\fBMBIO\fP format id 24) called hs_ew9302_161_mn.mb24
 which lies in the region w/s/e/n = \-32.1874/-26.6236/54.6349/56.7536.
 The following will suffice to generate a traditional four-color contour plot:
-    mbcontour \-Idatalist \-Jm2.44652 \
+    gmt mbcontour \-Idatalist \-Jm2.44652 \
         -R-25.7252/-23.0683/59.7415/61.0699
         -Ba0.5314g0.5314 \
         -A50.0/250.0/250.0/250.0/0.01/0.1 \
@@ -426,7 +437,7 @@ A plot including a navigation track can also be created using
 \fBmbcontour\fP.  Here the \fB\-D\fP flag is used to add a plot
 of the ship track annotated with time marks every 0.25 hours,
 annotated time marks every hour, and day annotations every four hours:
-    mbcontour \-Idatalist \-Jm2.44652 \
+    gmt mbcontour \-Idatalist \-Jm2.44652 \
         -R-25.7252/-23.0683/59.7415/61.0699 \
         -Ba0.5314g0.5314":.File hs_ew9302_161_bmn.mb24:" \
         -D0.25/1/4/0.1 \
diff --git a/src/man/man1/mbdumpesf.1 b/src/man/man1/mbdumpesf.1
index e39efdd..f9efba2 100644
--- a/src/man/man1/mbdumpesf.1
+++ b/src/man/man1/mbdumpesf.1
@@ -1,19 +1,34 @@
-.TH mbdumpesf 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbdumpesf 1 "3 May 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
-\fBmbmask\fP, \fBmbdumpesf\fP \- Output text version of beam edits from a binary edit save file.
+\fBmbdumpesf\fP \- Output beam edits from a binary edit save file, either in the binary form or as an ASCII text dump.
 
 .SH VERSION
 Version 5.0
 
 .SH SYNOPSIS
-\fBmbdumpesf\fP \fB\-I\fPfile [\fB\-V \-H\fP]
+\fBmbdumpesf\fP \fB\-\-input=\fP\fIfile\fP
+[\fB\-\-output=\fP\fIfile\fP \fB\-\-ignore-unflag\fP \fB\-\-ignore-flag\fP
+\fB\-\-ignore-filter\fP \fB\-\-ignore-zero\fP \fB\-\-verbose\fP \fB\-\-help\fP]
 
 .SH DESCRIPTION
 Swath bathymetry data is typically edited either with interactive
 tools such as \fBmbedit\fP or automatic filters such as \fBmbclean\fP.
 In \fBMB-System\fP, the beam flags are stored in binary "edit save files"
-(file suffix ".esf"). The program \fBmbdumpesf\fP reads esf files and
-outputs each of the edit events as a text line to stdout.
+(file suffix ".esf"). The program \fBmbdumpesf\fP reads and outputs esf files. If
+no output file is specified, then each of the edit events is written in ASCII text
+as a single line to stdout. If an output file is specified with the \fB\-\-output=\fP\fIfile\fP
+option, then the edit save data will be written to that file in binary form.
+
+The four types of edit events supported by esf files are:
+.br
+ 	action=1: flag manually
+ 	action=2: unflag
+ 	action=3: zero \- make beam null
+ 	action=4: flag by autofilter
+.br
+This program can be forced to ignore (exclude from the output) any of the event
+types using the options \fB\-\-ignore-unflag\fP, \fB\-\-ignore-flag\fP,
+\fB\-\-ignore-filter\fP, and \fB\-\-ignore-zero\fP.
 
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
@@ -26,20 +41,38 @@ Dale N. Chayes (dale at ldeo.columbia.edu)
 
 .SH MBDUMPESF OPTIONS
 .TP
-.B \-H
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
+\fB\-\-input=\fP\fIfile\fP
+"Edit save file" (esf file) from which the edit events will be read.
 .TP
-.B \-I
-\fIfile\fP
-.br
-"Edit save file" from which the edit events will be read.
+\fB\-\-output=\fP\fIfile\fP
+Specifies output esf file. If this option is not used, then the edit
+event stream will be output to stdout as a sequence of ASCII text lines.
+.TP
+\fB\-\-ignore-unflag\fP
+Causes \fBmbdumpesf\fP to not output any unflag edit events read from
+the input.
+.TP
+\fB\-\-ignore-flag\fP
+Causes \fBmbdumpesf\fP to not output any flag edit events read from
+the input.
+.TP
+\fB\-\-ignore-filter\fP
+Causes \fBmbdumpesf\fP to not output any filter edit events read from
+the input.
 .TP
-.B \-V
+\fB\-\-ignore-zero\fP
+Causes \fBmbdumpesf\fP to not output any zero edit events read from
+the input.
+.TP
+\fB\-\-verbose\fP
 Normally, \fBmbdumpesf\fP outputs one line for each edit event in
 the input esf file.  If the
-\fB\-V\fP flag is given, then \fBmbdumpesf\fP also outputs the
+\-\-verbose flag is given, then \fBmbdumpesf\fP also outputs the
 total number of each type of edit event at the end of the listing.
+.TP
+\fB\-\-help\fP
+This "help" flag causes the program to print out a description
+of its operation and then exit immediately.
 
 .SH EXAMPLES
 Suppose one has edited a swath file 20080422_222636.mb88, resulting
diff --git a/src/man/man1/mbgrdtiff.1 b/src/man/man1/mbgrdtiff.1
index ebf2194..2ef2e13 100644
--- a/src/man/man1/mbgrdtiff.1
+++ b/src/man/man1/mbgrdtiff.1
@@ -1,18 +1,23 @@
-.TH mbgrdtiff 1 "28 September 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbgrdtiff 1 "5 February 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
-\fBmbgrdtiff\fP \- generates a geographically located TIFF image from
-a GMT grid file.
+\fBmbgrdtiff\fP \- \fBGMT\fP plug-in module for generating a geographically
+located GeoTIFF image from a GMT grid file.
 
 .SH VERSION
 Version 5.0
 
 .SH SYNOPSIS
-\fBmbgrdtiff\fP \fB\-C\fIcptfile\fP \fB\-I\fIgrdfile\fP
+\fBgmt mbgrdtiff\fP \fB\-C\fIcptfile\fP \fB\-I\fIgrdfile\fP
 \fB\-O\fItiff_file\fP [\fB\-H\fP \fB\-K\fIintensfile\fP \fB\-V -W\fP]
 
 .SH DESCRIPTION
-\fBmbgrdtiff\fP generates a TIFF image from a \fBGMT\fP grid. The
-image generation is similar to that of the \fBGMT\fP program
+\fBmbgrdtiff\fP is a plug-in module to generate a Geographically located
+GeoTiff image from a \fBGMT\fP grid file using \fBGMT\fP (Generic Mapping Tools).
+Like \fBmbcontour\fP and \fBmbswath\fP, \fBmbgrdtiff\fP
+is fully compatible with the \fBGMT\fP package version 5.
+A GeoTIFF image file includes location, projection and scaling information.
+The image generation used by \fBmbgrdtiff\fP is identical to
+that of the Postscript-producing \fBGMT\fP program
 \fBgrdimage\fP. In particular, the color map is applied from
 a \fBGMT\fP CPT file, and shading overlay grids may be applied.
 The image is 8 bits
@@ -33,6 +38,18 @@ may used in grid generation. Some software packages (e.g. Winfrog) do not
 recognize the embedded coordinate system information, and install require
 a parallel "world" file to specify the bounds and resolution. The \fB-W\fP
 option causes a world file to be generated with a ".tfw" suffix.
+
+In order for \fBGMT\fP to successfully execute \fBmbgrdtiff\fP, the
+location of the shared library \fIlibmbgmt\fP containing this module must be known to \fBGMT\fP.
+This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
+in the file gmt.conf that is part of the GMT installation, by setting
+this parameter in the file gmt.conf in the user's home directory, or by
+using the GMT module \fBgmtset\fP to modify this parameter in the
+current working directory. If, for instance, the \fIlibmbgmt\fP shared library
+has been installed in the file /usr/lib/libmbgmt.dylib, then the
+GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
+        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -59,14 +76,16 @@ of its operation and then exit immediately.
 .B \-I
 \fIgrdfile\fP
 .br
-Sets the name of the gridded data file to be plotted.
+The first invocation of the \fB-I\fP\fIgrdfile\fP option sets
+the name of the gridded data file to be plotted.
 The data must be in a form acceptable to \fBGMT\fP version 3
 programs (see the \fBGMT\fP Cookbook & Technical Reference).
 .TP
-.B \-K
+.B \-I
 \fIintensity_file\fP
 .br
-Sets the name of the gridded data file containing
+The second invocation of the \fB-I\fP\fIgrdfile\fP option sets
+the name of a gridded data file containing
 intensity values to be used for shading the map.
 Alternatively, \fIgrdfile\fP may be a list of grid files
 (one filename on each line) to be used together. If a
@@ -100,7 +119,7 @@ contains a sidescan mosaic (reflectivity values
 ranging from 0 to 128 dB). In order to generate
 a 24 bit color TIFF image of the seafloor topography, we use:
 .br
- 	mbgrdtiff \-I PunaA_bath.grd \
+ 	gmt mbgrdtiff \-I PunaA_bath.grd \
  		-O PunaA_bath.tif \
  		-C bath.cpt \-V
 .br
@@ -121,7 +140,7 @@ containing:
 In order to generate
 an 8 bit grayscale TIFF image of the sidescan mosaic, we use:
 .br
- 	mbgrdtiff \-I PunaA_ss.grd \
+ 	gmt mbgrdtiff \-I PunaA_ss.grd \
  		-O PunaA_ss.tif \
  		-C ss.cpt \-V
 .br
diff --git a/src/man/man1/mbm_grd3dplot.1 b/src/man/man1/mbm_grd3dplot.1
index 9b96ba9..b5b842e 100644
--- a/src/man/man1/mbm_grd3dplot.1
+++ b/src/man/man1/mbm_grd3dplot.1
@@ -1,4 +1,4 @@
-.TH mbm_grd3dplot 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbm_grd3dplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbm_grd3dplot\fP \- Create an executable shellscript which will generate
 a GMT 3D perspective plot of gridded data in a GMT grd file.
@@ -28,13 +28,12 @@ Additional Options:
 Miscellaneous Options:
 .br
 [\fB\-MGD\fP\fIgmtdef/value\fP  \fB\-MGF\fP\fIscale_loc\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIm\fP]
+\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
 \fB\-MGQ\fP\fIdpi\fP \fB\-MGS\fP\fIscalefactor\fP
 \fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
 \fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP]
 \fB\-MVM\fP\fImesh_pen\fP \fB\-MVN\fP[\fInull[/r/g/b]\fP] ]
 
-
 .SH DESCRIPTION
 \fBmbm_grd3dplot\fP is a macro to generate a shellscript of GMT commands which, when
 executed, will generate a 3D perspective Postscript plot of
@@ -53,6 +52,19 @@ provided. Truly ambitious users may edit the plot shellscript
 to take advantage of GMT capabilities not supported by this
 macro.
 
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using \fBmbdefaults\fP; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a \fB-N\fP command line argument suppresses the screen
+display of the plot.
+
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -468,11 +480,19 @@ of \fIscale_loc\fP are:
 [Default \fIscale_loc\fP = b]
 .TP
 .B \-MGL
-[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIm\fP]
+[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
 .br
-Draws a simple map scale centered on \fIlon0/lat0\fP.  Use \fB\-Lx\fP to specify position in inch instead.
-Scale is calculated at latitude \fIslat\fP, \fIlength\fP is in km [miles if m is appended].
+Draws a simple map scale centered on \fIlon0/lat0\fP.
 Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
+Use \fB\-Lx\fP to specify the position in inches instead of map units.
+The scale is calculated at latitude \fIslat\fP; if the string "center" is used
+instead of a numerical value for \fIslat\fP, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value \fIlength\fP is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append \fI+l\fP to label the scale with the
+relevant units, or append \fI+l"label"\fP to set a different label string.
 .TP
 .B \-MGQ
 \fIdpi\fP
@@ -616,7 +636,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
-The program
+Alternatively, invoking the plot generation shellscript with
+a \fB-N\fP command line argument also suppresses the screen
+display of the plot. The program
 to be used to display the Postscript is set
 using \fBmbdefaults\fP;
 the default value can be overridden by setting the environment
diff --git a/src/man/man1/mbm_grdplot.1 b/src/man/man1/mbm_grdplot.1
index 20ab969..d2ab93e 100644
--- a/src/man/man1/mbm_grdplot.1
+++ b/src/man/man1/mbm_grdplot.1
@@ -1,4 +1,4 @@
-.TH mbm_grdplot 1 "2 August 2014" "MB-System 5.0" "MB-System 5.0"
+.TH mbm_grdplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbm_grdplot\fP \- Create an executable shellscript which will generate
 a GMT map of gridded data in a GMT grd file.
@@ -30,7 +30,7 @@ Additional Options:
 Miscellaneous Options:
 .br
 [\fB\-MGD\fP\fIgmtdef/value\fP  \fB\-MGF\fP\fIscale_loc\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIm\fP]
+\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
 \fB\-MGQ\fP\fIdpi\fP \fB\-MGS\fP\fIscalefactor\fP
 \fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
 \fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP]
@@ -70,6 +70,19 @@ to take advantage of \fBGMT\fP capabilities not supported by this
 macro. A companion macro \fBmbm_grd3dplot\fP can be used
 similarly to generate 3D perspective views of gridded data.
 
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using \fBmbdefaults\fP; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a \fB-N\fP command line argument suppresses the screen
+display of the plot.
+
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -509,12 +522,19 @@ of \fIscale_loc\fP are:
 [Default \fIscale_loc\fP = b]
 .TP
 .B \-MGL
-[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIm\fP]
+[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
 .br
-Draws a simple map scale centered
-on \fIlon0/lat0\fP.  Use \fB\-Lx\fP to specify position in inch instead.
-Scale is calculated at latitude \fIslat\fP, \fIlength\fP is in km [miles if m is appended].
+Draws a simple map scale centered on \fIlon0/lat0\fP.
 Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
+Use \fB\-Lx\fP to specify the position in inches instead of map units.
+The scale is calculated at latitude \fIslat\fP; if the string "center" is used
+instead of a numerical value for \fIslat\fP, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value \fIlength\fP is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append \fI+l\fP to label the scale with the
+relevant units, or append \fI+l"label"\fP to set a different label string.
 .TP
 .B \-MGQ
 \fIdpi\fP
@@ -966,6 +986,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
+Alternatively, invoking the plot generation shellscript with
+a \fB-N\fP command line argument also suppresses the screen
+display of the plot.
 The program
 to be used to display the Postscript is set
 using \fBmbdefaults\fP;
diff --git a/src/man/man1/mbm_histplot.1 b/src/man/man1/mbm_histplot.1
index d9e98bf..5dae6c9 100644
--- a/src/man/man1/mbm_histplot.1
+++ b/src/man/man1/mbm_histplot.1
@@ -1,4 +1,4 @@
-.TH mbm_histplot 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbm_histplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbm_histplot\fP \- Create an executable shellscript which will generate
 a GMT histogram plot of a dataset.
@@ -35,6 +35,19 @@ provided. Truly ambitious users may edit the plot shellscript
 to take advantage of GMT capabilities not supported by this
 macro.
 
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using \fBmbdefaults\fP; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a \fB-N\fP command line argument suppresses the screen
+display of the plot.
+
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -190,7 +203,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
-The program
+Alternatively, invoking the plot generation shellscript with
+a \fB-N\fP command line argument also suppresses the screen
+display of the plot. The program
 to be used to display the Postscript is set
 using \fBmbdefaults\fP;
 the default value can be overridden by setting the environment
diff --git a/src/man/man1/mbm_plot.1 b/src/man/man1/mbm_plot.1
index c8f908a..f36903b 100644
--- a/src/man/man1/mbm_plot.1
+++ b/src/man/man1/mbm_plot.1
@@ -1,4 +1,4 @@
-.TH mbm_plot 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbm_plot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbm_plot\fP \- Create an executable shellscript which will generate
 a GMT plot of swath sonar swath data.
@@ -30,7 +30,7 @@ Miscellaneous Options:
 .br
 [\fB\-MGD\fP\fIgmtdef/value\fP
 \fB\-MGF\fP\fIscale_loc\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIm\fP]
+\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
 \fB\-MGQ\fP\fIdpi\fP
 \fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
 \fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP]
@@ -73,6 +73,19 @@ arguments are provided. Truly ambitious users may edit the
 plot shellscript to take advantage of MB-System and GMT
 capabilities not supported by this macro.
 
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using \fBmbdefaults\fP; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a \fB-N\fP command line argument suppresses the screen
+display of the plot.
+
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -532,11 +545,19 @@ of \fIscale_loc\fP are:
 [Default \fIscale_loc\fP = b]
 .TP
 .B \-MGL
-[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIm\fP]
+[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
 .br
-Draws a simple map scale centered on \fIlon0/lat0\fP.  Use \fB\-Lx\fP to specify position in inch instead.
-Scale is calculated at latitude \fIslat\fP, \fIlength\fP is in km [miles if m is appended].
+Draws a simple map scale centered on \fIlon0/lat0\fP.
 Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
+Use \fB\-Lx\fP to specify the position in inches instead of map units.
+The scale is calculated at latitude \fIslat\fP; if the string "center" is used
+instead of a numerical value for \fIslat\fP, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value \fIlength\fP is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append \fI+l\fP to label the scale with the
+relevant units, or append \fI+l"label"\fP to set a different label string.
 .TP
 .B \-MGQ
 \fIdpi\fP
@@ -1011,7 +1032,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
-The program
+Alternatively, invoking the plot generation shellscript with
+a \fB-N\fP command line argument also suppresses the screen
+display of the plot. The program
 to be used to display the Postscript is set
 using \fBmbdefaults\fP;
 the default value can be overridden by setting the environment
diff --git a/src/man/man1/mbm_route2mission.1 b/src/man/man1/mbm_route2mission.1
index 43ac006..5b9b155 100644
--- a/src/man/man1/mbm_route2mission.1
+++ b/src/man/man1/mbm_route2mission.1
@@ -1,4 +1,4 @@
-.TH mbm_route2mission 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbm_route2mission 1 "22 February 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbm_route2mission\fP \- Macro to convert an \fBmbgrdviz\fP route file into an
 MBARI AUV mission script.
@@ -16,7 +16,7 @@ Version 5.0\fP
 \fB\-M\fP\fI[sensorlist]\fP \fB\-N\fP[\fIspiraldescentaltitude\fP] \fB\-O\fP\fImissionfile\fP
 \fB\-P\fP\fI[startlon/startlat | startdistance]\fP
 \fB\-R\fP\fItransmitpower/receivegain[/rangeminfraction[/pulsewidth]]\fP
-\fB\-S\fP\fIspeed\fP \fB\-T\fP\fIstarttime\fP
+\fB\-S\fP\fIspeed\fP \fB\-T\fP\fIstarttime\fP \fB\-U\fP\fImaxclimbrate\fP
 \fB\-W\fP\fIwaypointspacing\fP \fB\-V\fP \fB\-H\fP]
 
 .SH DESCRIPTION
@@ -271,6 +271,14 @@ in the survey mission. If neither
 the \fB\-P\fP or \fB\-T\fP options are specified, a distance of 500 meters
 to the first waypoint is assumed.
 .TP
+.B \-U
+\fImaxclimbrate\fP
+.br
+This sets the maximum climb rate in degrees allowed to be planned for the
+AUV mission. If the topography has a greater slope, the AUV will be brought
+up earlier so the planned climb angle never exceed \fImaxclimbrate\fP.
+Default: \fImaxclimbrate\fP = 25 degrees.
+.TP
 .B \-W
 \fIwaypointspacing\fP
 .br
diff --git a/src/man/man1/mbm_xyplot.1 b/src/man/man1/mbm_xyplot.1
index b02571d..e07a6ee 100644
--- a/src/man/man1/mbm_xyplot.1
+++ b/src/man/man1/mbm_xyplot.1
@@ -1,4 +1,4 @@
-.TH mbm_xyplot 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbm_xyplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbm_xyplot\fP \- Create an executable shellscript which will generate
 a GMT plot of xy data.
@@ -24,7 +24,7 @@ Additional Options:
 Miscellaneous Options:
 .br
 [\fB\-MGD\fP\fIgmtdef/value\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIm\fP]
+\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
 \fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
 \fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP] ]
 
@@ -71,6 +71,19 @@ provided. Truly ambitious users may edit the plot shellscript
 to take advantage of GMT capabilities not supported by this
 macro.
 
+By default the output plot generation shellscript
+includes lines which execute a program to display the Postscript
+image on the screen. The program to be used to display the Postscript
+is set using \fBmbdefaults\fP; the default value can be overridden
+by setting the environment variable $MB_PS_VIEWER.
+Invoking the plot generation shellscript with
+a \fB-N\fP command line argument suppresses the screen
+display of the plot.
+
+The plot scripts generated by this macro will work with
+GMT version 5.0 and later, and are not compatible with
+earlier versions of GMT.
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -409,6 +422,21 @@ to set as many \fBGMT\fP defaults as required. For example, to
 set the basemap annotation font to Courier, use
 "-MGDANOT_FONT/Courier".
 .TP
+.B \-MGL
+[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
+.br
+Draws a simple map scale centered on \fIlon0/lat0\fP.
+Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
+Use \fB\-Lx\fP to specify the position in inches instead of map units.
+The scale is calculated at latitude \fIslat\fP; if the string "center" is used
+instead of a numerical value for \fIslat\fP, then the macro will set
+the scaling according to the center of the plot bounds.
+The scale length value \fIlength\fP is in km 
+by default, but the units can be specified as one of e|f|k|M|n|u, where
+e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
+and u = US survey feet. Append \fI+l\fP to label the scale with the
+relevant units, or append \fI+l"label"\fP to set a different label string.
+.TP
 .B \-MGT
 \fIx/y/size/angle/font/just/text\fP
 .br
@@ -516,6 +544,9 @@ a program to display the Postscript image on the screen.
 This option causes those lines to be commented out so
 that executing the shellscript produces a Postscript plot
 but does not attempt to display it on the screen.
+Alternatively, invoking the plot generation shellscript with
+a \fB-N\fP command line argument also suppresses the screen
+display of the plot.
 The program
 to be used to display the Postscript is set
 using \fBmbdefaults\fP;
diff --git a/src/man/man1/mbnavadjust.1 b/src/man/man1/mbnavadjust.1
index dc9bf40..e8b4495 100644
--- a/src/man/man1/mbnavadjust.1
+++ b/src/man/man1/mbnavadjust.1
@@ -1,4 +1,4 @@
-.TH mbnavadjust 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbnavadjust 1 "22 April 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbnavadjust\fP \- Package that solves for optimal navigation by
 matching bathymetry of overlapping swaths.
@@ -44,8 +44,8 @@ when all vertical offsets have been corrected prior to importation
 into \fBMBnavadjust\fP (e.g. tidal corrections have been made).
 Otherwise, the offset analysis and inversions are three dimensional.
 
-Previous attempts to address this problem (e.g. Nishimura et al. [1988])
-have focused on automating the identification of matching features
+Early attempts to address this problem (e.g. Nishimura et al. [1988])
+focused on automating the identification of matching features
 and their navigational offsets. The automated approach is
 problematic because seafloor features are complex, and the
 cross correlation function of matching features often exhibits
@@ -62,7 +62,7 @@ the initial navigation processing (e.g. \fBmbnavedit\fP is complete.
 When swath data files are imported into \fBmbnavadjust\fP, the data is
 taken from processed files generated by \fBmbprocess\fP whenever
 possible (when those files exist). If no processed file exists,
-the raw data is used. When the processing with \fBmbnavadjust\fP
+the raw data file is used. When the processing with \fBmbnavadjust\fP
 is completed and an optimal navigation solution is achieved, new
 navigation files are generated (".na#" files, see below for full
 description) which supercede the ".nve" files
@@ -74,6 +74,9 @@ navigation files that are ignored by \fBmbprocess\fP. This behavior
 can be reversed manually using \fBmbset\fP, but then the user will
 unnecessarily complicating his or her efforts.
 
+A companion program \fBmbnavadjustmerge\fP can add \fBmbnavadjust\fP projects
+together or or modify \fBmbnavadjust\fP prooject settings. 
+
 The inversion for an optimal navigation which fits the offsets identified
 at matching features must also be reasonable. This is achieved by
 minimizing perturbations to speed and acceleration in the inversion.
@@ -369,30 +372,31 @@ The \fBView\fP pulldown menu allows the user to set which table is displayed.
 
 The survey list will look something like:
 .br
- 	00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000
- 	01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999
- 	02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999
+ 	00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000 good
+ 	01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999 good
+ 	02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999 good
 .br
 Here the first column is the survey counter, the second is the number
 of swath files included in each survey, and the following information
 consists of the start and end times of the data in each survey
-shown in YYYY/MM/DD HH:MM:SS.SSSSSS format.
+shown in YYYY/MM/DD HH:MM:SS.SSSSSS format, followed by the survey status
+(poor, good, fixed, fixedxy, fixedz).
 
 The file list will look something like:
 .br
- 	0000:00 gd   11  0.0  0.0 ../../20090803/20090803_081706.mb88
- 	0001:00 gd   11  0.0  0.0 ../../20090803/20090803_083332.mb88
- 	0002:00 gd   11  0.0  0.0 ../../20090803/20090803_085004.mb88
- 	0003:00 gd   11  0.0  0.0 ../../20090803/20090803_090636.mb88
- 	0004:00 gd   10  0.0  0.0 ../../20090803/20090803_092307.mb88
+ 	0000:00  good   11  0.0  0.0 ../../20090803/20090803_081706.mb88
+ 	0001:00  good   11  0.0  0.0 ../../20090803/20090803_083332.mb88
+ 	0002:00  good   11  0.0  0.0 ../../20090803/20090803_085004.mb88
+ 	0003:00  good   11  0.0  0.0 ../../20090803/20090803_090636.mb88
+ 	0004:00  good   10  0.0  0.0 ../../20090803/20090803_092307.mb88
  	 	..........................................
- 	0053:01 gd   12  0.0  0.0 ../../20090804/20090804_090127.mb88
- 	0054:01 gd   10  0.0  0.0 ../../20090804/20090804_092036.mb88
- 	0055:01 gd   11  0.0  0.0 ../../20090804/20090804_093707.mb88
- 	0056:01 gd   10  0.0  0.0 ../../20090804/20090804_095339.mb88
- 	0057:01 gd   11  0.0  0.0 ../../20090804/20090804_101010.mb88
+ 	0053:01  good   12  0.0  0.0 ../../20090804/20090804_090127.mb88
+ 	0054:01  good   10  0.0  0.0 ../../20090804/20090804_092036.mb88
+ 	0055:01  good   11  0.0  0.0 ../../20090804/20090804_093707.mb88
+ 	0056:01  good   10  0.0  0.0 ../../20090804/20090804_095339.mb88
+ 	0057:01  good   11  0.0  0.0 ../../20090804/20090804_101010.mb88
  	 	..........................................
- 	0104:02 fx    8  0.0  0.0 ../../MBARI/1998em300/mbari_1998_630_msn.mb57
+ 	0104:02  fixed   8  0.0  0.0 ../../MBARI/1998em300/mbari_1998_630_msn.mb57
 .br
 Here the first column is the file counter and survey counter separated by a colon.
 The second column indicates the file navigations state; "gd" indicates good
@@ -1391,7 +1395,7 @@ Phys. Earth Planet. Inter., 47, 333-345, 1987.
 Parker, R. L., \fBGeophysical Inverse Theory\fP, Princeton University Press, Princeton, NJ, 1994.
 
 .SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbio\fP(1), \fBmbprocess\fP(1),
+\fBmbnavadjustmerge(1)\fP, \fBmbsystem\fP(1), \fBmbio\fP(1), \fBmbprocess\fP(1),
 \fBmbnavedit\fP(1), \fBmbset\fP(1)
 
 .SH BUGS
diff --git a/src/man/man1/mbnavadjustmerge.1 b/src/man/man1/mbnavadjustmerge.1
index 63e7dfd..82ebbae 100644
--- a/src/man/man1/mbnavadjustmerge.1
+++ b/src/man/man1/mbnavadjustmerge.1
@@ -1,4 +1,4 @@
-.TH mbnavadjustmerge 1 "28 May 2014" "MB-System 5.0" "MB-System 5.0"
+.TH mbnavadjustmerge 1 "21 March 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
 \fBmbnavadjustmerge\fP \- Tool to merge two MBnavadjust projects,
 either adding one to the first or outputting a new project combining
@@ -9,11 +9,17 @@ Version 5.0
 
 .SH SYNOPSIS
 \fBmbnavadjustmerge\fP --input=project-base [--input=project-add --output=project-output
+--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
+--set-global-tie-xyz=file:section[:snav]
+--set-global-tie-xyonly=file:section[:snav]
+--set-global-tie-zonly=file:section[:snav]
+--unset-global-tie=file:section
 --add-crossing=file1:section1/file2:section2
 --set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset
 --set-tie-xyz=file1:section1/file2:section2
 --set-tie-xyonly=file1:section1/file2:section2
 --set-tie-zonly=file1:section1/file2:section2
+--unset-tie=file1:section1/file2:section2
 --set-ties-xyz-with-file=file
 --set-ties-xyonly-with-file=file
 --set-ties-zonly-with-file=file
@@ -25,7 +31,8 @@ Version 5.0
 --set-ties-zonly-by-block=survey1/survey2
 --set-ties-zoffset-by-block=survey1/survey2/zoffset
 --skip-unset-crossings
- --verbose --help ]
+--insert-discontinuity=file:section
+--verbose --help ]
 
 .SH DESCRIPTION
 \fBMBnavadjustmerge\fP is a command line program that merges two
@@ -87,6 +94,37 @@ not specified, then the \fIproject-base\fP project is used as the
 output, and the \fIproject-add\fP project is added on to the
 \fIproject-base\fP project.
 .TP
+.B \--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
+This options sets a global tie for a navigation point in the project. Global ties are
+ties to the global reference frame, which generally means GPS positions (e.g. WGS84).
+The file and section id's must be specified, along with the x (east-west), y (north-south),
+and z (vertical postive up) offset values in meters. If the snav id (navigation point id)
+is not specified, it is assumed to be 0, the first navigation point in the
+specified section. If the uncertainties in the global tie (xsigma, ysigma, zsigma)
+are not specified, then xsigma = ysigma = 10 m and zsigma = 0.5 m are assumed.
+.TP
+.B \--set-global-tie-xyz=file:section[:snav]
+This option sets the mode of the existing specified global tie in the
+\fBMBnavadjust\fP project to be "XYZ". This means all three
+coordinates of the tie will be used as constraints in the inversion
+for an optimal navigation model.
+.TP
+.B \--set-global-tie-xyonly=file:section[:snav]
+This option sets the mode of the existing specified global tie in the
+\fBMBnavadjust\fP project to be "XY". This means only the horizontal
+coordinates of the tie will be used as constraints in the inversion
+for an optimal navigation model.
+.TP
+.B \--set-global-tie-zonly=file:section[:snav]
+This option sets the mode of the existing specified global tie in the
+\fBMBnavadjust\fP project to be "Z". This means only the vertical
+coordinate of the tie will be used as a constraint in the inversion
+for an optimal navigation model.
+.TP
+.B \--unset-global-tie=file:section
+This option unsets (deletes) the specified global tie in the
+\fBMBnavadjust\fP project. 
+.TP
 .B \--add-crossing=file1:section1/file2:section2
 This option adds the specified crossing to the \fBMBnavadjust\fP project.
 .TP
@@ -113,6 +151,10 @@ This option sets the mode of the existing specified tie in the
 coordinate of the tie will be used as a constraint in the inversion
 for an optimal navigation model.
 .TP
+.B \--unset-tie=file1:section1/file2:section2
+This option unsets (deletes) the specified tie in the
+\fBMBnavadjust\fP project. 
+.TP
 .B \--set-ties-xyz-with-file=file
 This option sets the mode of all ties involved with the specified
 file in the \fBMBnavadjust\fP project to be "XYZ". This means all three
@@ -233,5 +275,5 @@ the output project.
 \fBmbnavadjust\fP(1), \fBmbset\fP(1)
 
 .SH BUGS
-It started out simple and bulletproof, but now it's too complicated to be bulletproof.
+It started out simple and bulletproof, but now it's too complicated to be bulletproof. It's probably nerfgunproof, though.
 Good luck.
diff --git a/src/man/man1/mbswath.1 b/src/man/man1/mbswath.1
index fb1e841..abaab4e 100644
--- a/src/man/man1/mbswath.1
+++ b/src/man/man1/mbswath.1
@@ -1,13 +1,13 @@
-.TH mbswath 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
+.TH mbswath 1 "5 February 2015" "MB-System 5.0" "MB-System 5.0"
 .SH NAME
-\fBmbswath\fP \- GMT compatible utility for color fill or color shaded relief
+\fBmbswath\fP \- \fBGMT\fP plug-in module for color fill or color shaded relief
 swath plots of swath sonar data using Postscript.
 
 .SH VERSION
 Version 5.0
 
 .SH SYNOPSIS
-\fBmbswath\fP \fB\-C\fIcptfile\fP \fB\-J\fIparameters\fP
+\fBgmt mbswath\fP \fB\-C\fIcptfile\fP \fB\-J\fIparameters\fP
 \fB\-R\fIwest/east/south/north\fP [\fB\-A\fIfactor/mode/depth\fP
 \fB\-B\fItickinfo\fP \fB\-b\fIyr/mo/da/hr/mn/sc\fP
 \fB\-c\fIcopies\fP \fB\-D\fImode/scale/min/max\fP
@@ -20,16 +20,17 @@ Version 5.0
 \fB\-V \-H\fP]
 
 .SH DESCRIPTION
-\fBmbswath\fP is a utility for plotting swath sonar data in color fill
-or color shaded relief using Postscript.  Like \fBmbcontour\fP, \fBmbswath\fP
-is fully compatible with the GMT package version 3, including the use
+\fBmbswath\fP is a plug-in module for plotting swath sonar data in color fill
+or color shaded relief using \fBGMT\fP (Generic Mapping Tools).
+Like \fBmbcontour\fP, \fBmbswath\fP
+is fully compatible with the \fBGMT\fP package version 5, including the use
 of GMT style color pallete (cpt) files to control the color table.
 A 24-bit true color \fIPostScript\fP file is output using one of
 three methods. Unless individual polygon fills are used (\fB\-1\fP option),
 only one call to \fBmbswath\fP can be made for each plot because the
 color image produced covers the entire plot space.
-The program can read data from stdin (the default) or from one
-or more swath sonar files.
+The program can read data from a single swath sonar file or from
+multiple files as referenced by an MB-System datalist file.
 
 Before opening an input swath data file, \fBmbmbswath\fP checks for
 an ascii file in the same directory having the same name except
@@ -45,13 +46,24 @@ of data files for use in all plotting without the performance penalty
 of \fBmbswath\fP reading through all the data files, even those
 with no relevent data. We recommend that users maintain a ".inf"
 file for each swath data file used for gridding or plotting. The
-programs \fBmbcontour\fP and \fBmbgrid\fP also use ".inf" files
+\fBGMT\fP modules \fBmbcontour\fP and \fBmbgrid\fP also use ".inf" files
 in the same fashion.
 
 If \fBmbfilter\fP has been used to filter amplitude and/or sidescan
 data in the desired input, then the \fB\-Z\fP option can be used
 to specify plotting the filtered rather than unfiltered data.
 
+In order for \fBGMT\fP to successfully execute \fBmbswath\fP, the
+location of the shared library \fIlibmbgmt\fP containing this module must be known to \fBGMT\fP.
+This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
+in the file gmt.conf that is part of the GMT installation, by setting
+this parameter in the file gmt.conf in the user's home directory, or by
+using the GMT module \fBgmtset\fP to modify this parameter in the
+current working directory. If, for instance, the \fIlibmbgmt\fP shared library
+has been installed in the file /usr/lib/libmbgmt.dylib, then the
+GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
+        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
+
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
 .br
@@ -201,8 +213,6 @@ generating a plot containing only bathymetry
 (\fB\-Z\fP\fI1\fP and \fB\-Z\fP\fI2\fP).
 the program
 will attempt to read an "fbt" file in lieu of the original data.
-.br
-Default: \fIinfile\fP = "stdin".
 .TP
 .B \-J
 Selects the map projection. Scale is inch/degree, 1:xxxxx.
@@ -395,7 +405,7 @@ Suppose the user has a Hydrosweep data file in the L-DEO in-house
 binary format (\fBMBIO\fP format id 24) called hs_ew9302_157_mn.mb24
 which lies in the region w/s/e/n = \-32.1874/-26.6236/54.6349/56.7536.
 The following will suffice to generate a color fill plot:
- 	mbswath \-Idatalist \-Jm1.46578 \-R-32.1874/-26.6236/54.6349/56.7536
+ 	gmt mbswath \-Idatalist \-Jm1.46578 \-R-32.1874/-26.6236/54.6349/56.7536
  		-B1/1 \-Ccolor.cpt \-p1 \-A1 \-Q100 \-Z2
  		-X1 \-Y1.75 \-V > mbswath.ps
 .br
@@ -405,8 +415,7 @@ where the file datalist contains:
 A more complicated plot including a navigation track and a color scale
 can be created using \fBmbswath\fP in conjunction with other GMT
 and GMT-compatible utilities.  The following is an example of a shellscript
-which generates such a plot and then displays it on the screen (assuming
-you have a Sun workstation):
+which generates such a plot and then displays it on the screen:
 
  #
  # Shellscript to create Postscript plot of swath sonar data
@@ -435,7 +444,7 @@ you have a Sun workstation):
  #
  # Run mbswath
  echo Running mbswath...
- mbswath \-Idatalist \-Jm1.46578 \-R-32.1874/-26.6236/54.6349/56.7536 \
+ gmt mbswath \-Idatalist \-Jm1.46578 \-R-32.1874/-26.6236/54.6349/56.7536 \
  	-B1.1128/1.1128":.Data File hs_ew9302_157_bmn.mb24:" \
  	-Chs_ew9302_157_bmn.mb24.cpt \-p1 \-A1 \-Q100 \-G5/0 \-Z2 \-X1 \
  	-Y1.75 \-K \-V > hs_ew9302_157_bmn.mb24.ps
@@ -446,13 +455,13 @@ you have a Sun workstation):
  #
  # Run pstrack
  echo Running pstrack...
- pstrack hs_ew9302_157_bmn.mb24.nav \-Jm1.46578 \
+ gmt pstrack hs_ew9302_157_bmn.mb24.nav \-Jm1.46578 \
  	-R-32.1874/-26.6236/54.6349/56.7536 \-B1.1128/1.1128":.Data File \
  	hs_ew9302_157_bmn.mb24:" \-W1p \-Mt15ma1h \-O \-K >> hs_ew9302_157_bmn.mb24.ps
  #
  # Run psscale
  echo Running psscale...
- psscale  \-Chs_ew9302_157_bmn.mb24.cpt \-D4.0777/-0.5000/6.5242/0.1500h
+ gmt psscale  \-Chs_ew9302_157_bmn.mb24.cpt \-D4.0777/-0.5000/6.5242/0.1500h
  	-B":.Depth (meters):" \-O \-V >> hs_ew9302_157_bmn.mb24.ps
  #
  # Delete surplus files
@@ -460,8 +469,8 @@ you have a Sun workstation):
  rm \-f hs_ew9302_157_bmn.mb24.cpt datalist hs_ew9302_157_bmn.mb24.nav
  #
  # Run pageview
- echo Running pageview in background...
- pageview hs_ew9302_157_bmn.mb24.ps &
+ echo Running gv in background...
+ gv hs_ew9302_157_bmn.mb24.ps &
  #
  # All done!
  echo All done!
diff --git a/src/man/man1/mbsystem.1 b/src/man/man1/mbsystem.1
index 362a9c9..4e1ba7b 100644
--- a/src/man/man1/mbsystem.1
+++ b/src/man/man1/mbsystem.1
@@ -1,10 +1,10 @@
-.TH mbsystem 1 "7 June 2013" "MB-System 5.3" "MB-System 5.3"
+.TH mbsystem 1 "26 January 2015" "MB-System 5.5" "MB-System 5.5"
 .SH NAME
 \fBmbsystem\fP \- A set of utilities for manipulating and
 processing swath sonar bathymetry, amplitude, and sidescan data.
 
 .SH VERSION
-Version 5.3
+Version 5.5
 
 .SH AUTHORSHIP
 David W. Caress (caress at mbari.org)
@@ -44,7 +44,7 @@ by the GNU Project. \fBMB-System\fP installation depends on some other software
 GMT and netCDF), all of which are freely available as source code.
 
 .SH COPYRIGHT AND LICENSING
-\fBMB-System\fP Copyright (C) 1993-2012 by
+\fBMB-System\fP Copyright (C) 1993-2015 by
 .br
 David W. Caress (caress at mbari.org)
     Monterey Bay Aquarium Research Institute
diff --git a/src/man/man3/Makefile.in b/src/man/man3/Makefile
similarity index 70%
copy from src/man/man3/Makefile.in
copy to src/man/man3/Makefile
index 098acec..e6c66e7 100644
--- a/src/man/man3/Makefile.in
+++ b/src/man/man3/Makefile
@@ -1,5 +1,5 @@
 # Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
+# src/man/man3/Makefile.  Generated from Makefile.in by configure.
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
@@ -12,8 +12,8 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
- at SET_MAKE@
-VPATH = @srcdir@
+
+
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
   case $${target_option-} in \
@@ -59,10 +59,10 @@ am__make_running_with_option = \
   test $$has_opt = yes
 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgdatadir = $(datadir)/mbsystem
+pkgincludedir = $(includedir)/mbsystem
+pkglibdir = $(libdir)/mbsystem
+pkglibexecdir = $(libexecdir)/mbsystem
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -75,8 +75,8 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
+build_triplet = x86_64-apple-darwin13.4.0
+host_triplet = x86_64-apple-darwin13.4.0
 subdir = src/man/man3
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -90,16 +90,16 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
 am__v_P_0 = false
 am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
 am__v_GEN_0 = @echo "  GEN     " $@;
 am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
 am__v_at_0 = @
 am__v_at_1 = 
 SOURCES =
@@ -142,162 +142,166 @@ NROFF = nroff
 MANS = $(man_MANS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
+ACLOCAL = ${SHELL} /Users/caress/sandbox/mbsystem/missing aclocal-1.14
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AUTOCONF = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoconf
+AUTOHEADER = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoheader
+AUTOMAKE = ${SHELL} /Users/caress/sandbox/mbsystem/missing automake-1.14
+AWK = awk
+CC = gcc
+CCAS = gcc
+CCASDEPMODE = depmode=gcc3
+CCASFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
+CPP = gcc -E
+CPPFLAGS = 
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = false
+DSYMUTIL = dsymutil
+DUMPBIN = 
+ECHO_C = \c
+ECHO_N = 
+ECHO_T = 
+EGREP = /sw/bin/grep -E
+EXEEXT = 
+FGREP = /sw/bin/grep -F
+GREP = /sw/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
+LDFLAGS = -L/opt/X11/lib
+LIBM = 
+LIBOBJS = 
+LIBS = -lm 
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBTOOL_DEPS = ./ltmain.sh
+LIPO = lipo
+LN_S = ln -s
+LTLIBOBJS = 
+LT_SYS_LIBRARY_PATH = 
+MAINT = #
+MAKEINFO = ${SHELL} /Users/caress/sandbox/mbsystem/missing makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = ../../.././install-sh -c -d
+NM = /usr/bin/nm
+NMEDIT = nmedit
+OBJDUMP = false
+OBJEXT = o
+OTOOL = otool
+OTOOL64 = :
+OTPS_DIR = /usr/local/OTPS2
+PACKAGE = mbsystem
+PACKAGE_BUGREPORT = http://listserver.mbari.org/sympa/arc/mbsystem
+PACKAGE_NAME = mbsystem
+PACKAGE_STRING = mbsystem 5.5.2252
+PACKAGE_TARNAME = mbsystem
+PACKAGE_URL = http://www.mbari.org/data/mbsystem/
+PACKAGE_VERSION = 5.5.2252
+PATH_SEPARATOR = :
+PKG_CONFIG = 
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = 
+RANLIB = ranlib
+SED = /sw/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 5.5.2252
+XDR_LIB = 
+abs_builddir = /Users/caress/sandbox/mbsystem/src/man/man3
+abs_srcdir = /Users/caress/sandbox/mbsystem/src/man/man3
+abs_top_builddir = /Users/caress/sandbox/mbsystem
+abs_top_srcdir = /Users/caress/sandbox/mbsystem
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-apple-darwin13.4.0
+build_alias = 
+build_cpu = x86_64
+build_os = darwin13.4.0
+build_vendor = apple
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+fftw_app = 
+host = x86_64-apple-darwin13.4.0
+host_alias = 
+host_cpu = x86_64
+host_os = darwin13.4.0
+host_vendor = apple
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /Users/caress/sandbox/mbsystem/install-sh
+libGLU_CFLAGS = 
+libGLU_LIBS = 
+libXm_CFLAGS = 
+libXm_LIBS = 
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+libfftw3_CFLAGS = 
+libfftw3_LIBS = 
+libfftw_CPPFLAGS = -I/sw/include
+libfftw_LIBS = -L/sw/lib -R /sw/lib -lfftw3
+libgmt_CFLAGS = 
+libgmt_CPPFLAGS = -I/sw/include/gmt
+libgmt_LIBS = -L/sw/lib -R /sw/lib -lgmt -lpsl
+libmotif_CPPFLAGS = -I/sw/include
+libmotif_LIBS = -L/sw/lib -R /sw/lib -lXm -lXt -lX11
+libnetcdf_CFLAGS = 
+libnetcdf_CPPFLAGS = -I/sw/include
+libnetcdf_LIBS = -L/sw/lib -R /sw/lib -lnetcdf
+libopengl_CPPFLAGS = 
+libopengl_LIBS = -lGL -lGLU
+libproj_CFLAGS = 
+libproj_CPPFLAGS = -I/sw/include
+libproj_LIBS = -L/sw/lib -R /sw/lib -lproj
+libpsl_CFLAGS = 
+libpsl_LIBS = 
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mbsystemdatadir = ${datarootdir}/mbsystem
+mbsystemhtmldir = ${datarootdir}/doc/${PACKAGE_TARNAME}/html
+mbsystempsdir = ${datarootdir}/doc/${PACKAGE_TARNAME}/ps
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /Users/caress/sandbox/mbsystem
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../../
+top_builddir = ../../..
+top_srcdir = ../../..
 man_MANS = mbio.3  
- at BUILD_PROJ_TRUE@man_PROJ = pj_init.3 
+#man_PROJ = pj_init.3 
 EXTRA_DIST = $(man_MANS) $(man_PROJ)
 all: all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -322,9 +326,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+$(top_srcdir)/configure: # $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
diff --git a/src/man/man3/Makefile.in b/src/man/man3/Makefile.in
index 098acec..89ea14b 100644
--- a/src/man/man3/Makefile.in
+++ b/src/man/man3/Makefile.in
@@ -170,8 +170,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -188,6 +186,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -251,19 +250,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -276,8 +282,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/mbaux/Makefile.am b/src/mbaux/Makefile.am
index 7a83baa..1f653a4 100644
--- a/src/mbaux/Makefile.am
+++ b/src/mbaux/Makefile.am
@@ -1,7 +1,7 @@
 if BUILD_MOTIF
   XGRLIB = libmbxgr.la
 endif
-lib_LTLIBRARIES = libmbps.la libmbaux.la $(XGRLIB)
+lib_LTLIBRARIES = libmbaux.la $(XGRLIB)
 
 if BUILD_MOTIF
   XGRINC = mb_xgraphics.h
@@ -13,20 +13,16 @@ AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      ${libnetcdf_CPPFLAGS}
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
 
-libmbps_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbps_la_SOURCES = mb_pslibface.c
-libmbps_la_LIBADD = ${libgmt_LIBS} ${libnetcdf_LIBS} 
-
 libmbaux_la_LDFLAGS = -no-undefined -version-info 0:0:0
 libmbaux_la_SOURCES = \
 		      mb_spline.c mb_zgrid.c mb_surface.c mb_cheb.c \
-		      mb_delaun.c mb_track.c mb_truecont.c mb_readgrd.c \
+		      mb_delaun.c mb_track.c mb_truecont.c mb_readwritegrd.c \
 		      mb_intersectgrid.c
-libmbaux_la_LIBADD =  ${top_builddir}/src/mbio/libmbio.la libmbps.la \
+libmbaux_la_LIBADD =  ${top_builddir}/src/mbio/libmbio.la \
 			${libgmt_LIBS} ${libnetcdf_LIBS}
 
 if BUILD_MOTIF
  libmbxgr_la_LDFLAGS = -no-undefined -version-info 0:0:0
  libmbxgr_la_SOURCES = mb_xgraphics.c
- libmbxgr_la_LIBADD = ${motif_LIBS}
+ libmbxgr_la_LIBADD = ${libmotif_LIBS}
 endif
diff --git a/src/mbaux/Makefile.in b/src/mbaux/Makefile.in
index afd2e37..8d916c6 100644
--- a/src/mbaux/Makefile.in
+++ b/src/mbaux/Makefile.in
@@ -124,10 +124,10 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libmbaux_la_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
-	libmbps.la $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 am_libmbaux_la_OBJECTS = mb_spline.lo mb_zgrid.lo mb_surface.lo \
 	mb_cheb.lo mb_delaun.lo mb_track.lo mb_truecont.lo \
-	mb_readgrd.lo mb_intersectgrid.lo
+	mb_readwritegrd.lo mb_intersectgrid.lo
 libmbaux_la_OBJECTS = $(am_libmbaux_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -136,12 +136,6 @@ am__v_lt_1 =
 libmbaux_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(libmbaux_la_LDFLAGS) $(LDFLAGS) -o $@
-libmbps_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am_libmbps_la_OBJECTS = mb_pslibface.lo
-libmbps_la_OBJECTS = $(am_libmbps_la_OBJECTS)
-libmbps_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbps_la_LDFLAGS) $(LDFLAGS) -o $@
 @BUILD_MOTIF_TRUE at libmbxgr_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
 am__libmbxgr_la_SOURCES_DIST = mb_xgraphics.c
 @BUILD_MOTIF_TRUE at am_libmbxgr_la_OBJECTS = mb_xgraphics.lo
@@ -184,10 +178,8 @@ AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(libmbaux_la_SOURCES) $(libmbps_la_SOURCES) \
-	$(libmbxgr_la_SOURCES)
-DIST_SOURCES = $(libmbaux_la_SOURCES) $(libmbps_la_SOURCES) \
-	$(am__libmbxgr_la_SOURCES_DIST)
+SOURCES = $(libmbaux_la_SOURCES) $(libmbxgr_la_SOURCES)
+DIST_SOURCES = $(libmbaux_la_SOURCES) $(am__libmbxgr_la_SOURCES_DIST)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -243,8 +235,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -261,6 +251,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -324,19 +315,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -349,8 +347,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -365,7 +361,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @BUILD_MOTIF_TRUE at XGRLIB = libmbxgr.la
-lib_LTLIBRARIES = libmbps.la libmbaux.la $(XGRLIB)
+lib_LTLIBRARIES = libmbaux.la $(XGRLIB)
 @BUILD_MOTIF_TRUE at XGRINC = mb_xgraphics.h
 include_HEADERS = mb_aux.h $(XGRINC)
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
@@ -373,21 +369,18 @@ AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      ${libnetcdf_CPPFLAGS}
 
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-libmbps_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbps_la_SOURCES = mb_pslibface.c
-libmbps_la_LIBADD = ${libgmt_LIBS} ${libnetcdf_LIBS} 
 libmbaux_la_LDFLAGS = -no-undefined -version-info 0:0:0
 libmbaux_la_SOURCES = \
 		      mb_spline.c mb_zgrid.c mb_surface.c mb_cheb.c \
-		      mb_delaun.c mb_track.c mb_truecont.c mb_readgrd.c \
+		      mb_delaun.c mb_track.c mb_truecont.c mb_readwritegrd.c \
 		      mb_intersectgrid.c
 
-libmbaux_la_LIBADD = ${top_builddir}/src/mbio/libmbio.la libmbps.la \
+libmbaux_la_LIBADD = ${top_builddir}/src/mbio/libmbio.la \
 			${libgmt_LIBS} ${libnetcdf_LIBS}
 
 @BUILD_MOTIF_TRUE at libmbxgr_la_LDFLAGS = -no-undefined -version-info 0:0:0
 @BUILD_MOTIF_TRUE at libmbxgr_la_SOURCES = mb_xgraphics.c
- at BUILD_MOTIF_TRUE@libmbxgr_la_LIBADD = ${motif_LIBS}
+ at BUILD_MOTIF_TRUE@libmbxgr_la_LIBADD = ${libmotif_LIBS}
 all: all-am
 
 .SUFFIXES:
@@ -461,9 +454,6 @@ clean-libLTLIBRARIES:
 libmbaux.la: $(libmbaux_la_OBJECTS) $(libmbaux_la_DEPENDENCIES) $(EXTRA_libmbaux_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libmbaux_la_LINK) -rpath $(libdir) $(libmbaux_la_OBJECTS) $(libmbaux_la_LIBADD) $(LIBS)
 
-libmbps.la: $(libmbps_la_OBJECTS) $(libmbps_la_DEPENDENCIES) $(EXTRA_libmbps_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbps_la_LINK) -rpath $(libdir) $(libmbps_la_OBJECTS) $(libmbps_la_LIBADD) $(LIBS)
-
 libmbxgr.la: $(libmbxgr_la_OBJECTS) $(libmbxgr_la_DEPENDENCIES) $(EXTRA_libmbxgr_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libmbxgr_la_LINK) $(am_libmbxgr_la_rpath) $(libmbxgr_la_OBJECTS) $(libmbxgr_la_LIBADD) $(LIBS)
 
@@ -476,8 +466,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_cheb.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_delaun.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_intersectgrid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_pslibface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_readgrd.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_readwritegrd.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_spline.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_surface.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_track.Plo at am__quote@
diff --git a/src/mbaux/Makefile.template b/src/mbaux/Makefile.template
deleted file mode 100644
index 141d04e..0000000
--- a/src/mbaux/Makefile.template
+++ /dev/null
@@ -1,115 +0,0 @@
-#     The MB-system:	Makefile.template  9/8/00
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2000-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbaux directory level
-# Author:	D. W. Caress
-# Date:		September 8, 2000
-#
-# $Log: Makefile.template,v $
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of GMT and netcdf include files:
-GMTINCDIR = /ocean/mgg/gmt2/src
-NETCDFINCDIR = /ocean/mgg/netcdf/include
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -O2
-ARCHIVE = ar rcv
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the mbaux library and associated include files
-all:	$(LIBDIR)/libmbaux.a \
-	$(LIBDIR)/libmbps.a \
-	$(LIBDIR)/libmbxgr.a \
-	$(INCDIR)/mb_aux.h \
-	$(INCDIR)/mb_xgraphics.h
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### put together the libraries
-$(LIBDIR)/libmbaux.a:	\
-		mb_spline.o \
-		mb_zgrid.o \
-		mb_surface.o \
-		mb_cheb.o \
-		mb_delaun.o \
-		mb_track.o \
-		mb_truecont.o \
-		mb_readgrd.o \
-		mb_intersectgrid.o
-	$(ARCHIVE) $(LIBDIR)/libmbaux.a \
-		mb_spline.o \
-		mb_zgrid.o \
-		mb_surface.o \
-		mb_cheb.o \
-		mb_delaun.o \
-		mb_track.o \
-		mb_truecont.o \
-		mb_readgrd.o \
-		mb_intersectgrid.o
-	ranlib $(LIBDIR)/libmbaux.a
-$(LIBDIR)/libmbps.a:	\
-		mb_pslibface.o
-	$(ARCHIVE) $(LIBDIR)/libmbps.a \
-		mb_pslibface.o
-	ranlib $(LIBDIR)/libmbps.a
-$(LIBDIR)/libmbxgr.a:	\
-		mb_xgraphics.o
-	$(ARCHIVE) $(LIBDIR)/libmbxgr.a \
-		mb_xgraphics.o
-	ranlib $(LIBDIR)/libmbxgr.a
-
-### compile the source files
-mb_spline.o:	mb_spline.c ../mbio/mb_status.h ../mbio/mb_define.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_spline.c
-mb_zgrid.o:	mb_zgrid.c ../mbio/mb_define.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_zgrid.c
-mb_surface.o:	mb_surface.c mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_surface.c
-mb_cheb.o:	mb_cheb.c ../mbio/mb_status.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_cheb.c
-mb_delaun.o:	mb_delaun.c ../mbio/mb_status.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_delaun.c
-mb_pslibface.o:	mb_pslibface.c  ../mbio/mb_status.h  ../mbio/mb_define.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) -I$(NETCDFINCDIR) mb_pslibface.c
-mb_track.o:	mb_track.c ../mbio/mb_status.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_track.c
-mb_truecont.o:	mb_truecont.c ../mbio/mb_status.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_truecont.c
-mb_readgrd.o:	mb_readgrd.c ../mbio/mb_status.h ../mbio/mb_define.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) -I$(NETCDFINCDIR) mb_readgrd.c
-mb_xgraphics.o:	mb_xgraphics.c ../mbio/mb_status.h mb_xgraphics.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_xgraphics.c
-mb_intersectgrid.o:	mb_intersectgrid.c ../mbio/mb_status.h mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio mb_intersectgrid.c
-
-### copy the include files to the include file directory
-$(INCDIR)/mb_aux.h:	mb_aux.h
-	cp mb_aux.h $(INCDIR)/mb_aux.h
-	chmod 664 $(INCDIR)/mb_aux.h
-$(INCDIR)/mb_xgraphics.h:	mb_xgraphics.h
-	cp mb_xgraphics.h $(INCDIR)/mb_xgraphics.h
-	chmod 664 $(INCDIR)/mb_xgraphics.h
diff --git a/src/mbaux/mb_aux.h b/src/mbaux/mb_aux.h
index 3f4f1ca..c6d8fef 100644
--- a/src/mbaux/mb_aux.h
+++ b/src/mbaux/mb_aux.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_aux.h	5/16/94
- *    $Id: mb_aux.h 2196 2014-07-14 05:52:06Z caress $
+ *    $Id: mb_aux.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c); 1993-2014 by
+ *    Copyright (c); 1993-2015 by
  *    David W. Caress (caress at mbari.org);
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,43 +23,6 @@
  * Name change:	mb_countour.h changed to mb_aux.h
  * Date:	October 13, 2009
  *
- * $Log: mb_contour.h,v $
- * Revision 5.7  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.6  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.5  2005/11/04 22:49:51  caress
- * Programs changed to register arrays through mb_register_array(); rather than allocating the memory directly with mb_realloc(); or mb_malloc();.
- *
- * Revision 5.4  2005/03/25 04:10:51  caress
- * Control over the filename annotation orientation has been added and the orientation itself has been fixed.
- *
- * Revision 5.3  2004/12/18 01:32:50  caress
- * Added filename annotation.
- *
- * Revision 5.2  2003/04/17 20:47:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2001/03/22 21:06:19  caress
- * Trying to make release 5.0.beta0
- *
- * Revision 5.0  2000/12/01  22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:54:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1998/10/04  04:18:07  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1994/10/21  11:34:20  caress
- * Release V4.0
- *
- * Revision 4.0  1994/05/16  22:12:46  caress
- * First cut at new contouring scheme.
- *
  *
  */
 
@@ -306,8 +269,8 @@ int mb_delaun(
 	int	*kv2,
 	int	*error);
 
-/* mb_readgrd function prototypes */
-int mb_readgrd(int verbose, char *grdfile,
+/* mb_readwritegrd function prototypes */
+int mb_read_gmt_grd(int verbose, char *grdfile,
 			int	*grid_projection_mode,
 			char	*grid_projection_id,
 			float	*nodatavalue,
@@ -326,6 +289,28 @@ int mb_readgrd(int verbose, char *grdfile,
 			float	**data_dzdx,
 			float	**data_dzdy,
 			int	*error);
+int mb_write_gmt_grd(int verbose,
+			char *grdfile,
+			float *grid,
+			float nodatavalue,
+			int nx,
+			int ny,
+			double xmin,
+			double xmax,
+			double ymin,
+			double ymax,
+			double zmin,
+			double zmax,
+			double dx,
+			double dy,
+			char *xlab,
+			char *ylab,
+			char *zlab,
+			char *titl,
+			char *projection,
+			int argc,
+			char **argv,
+			int *error);
 
 /* mb_spline function prototypes */
 int mb_spline_init(int verbose, double *x, double *y,
diff --git a/src/mbaux/mb_cheb.c b/src/mbaux/mb_cheb.c
index d861a6f..b905783 100644
--- a/src/mbaux/mb_cheb.c
+++ b/src/mbaux/mb_cheb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_cheb.c			3/23/00
- *    $Id: mb_cheb.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_cheb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbaux/mb_delaun.c b/src/mbaux/mb_delaun.c
index d05d2df..088457c 100644
--- a/src/mbaux/mb_delaun.c
+++ b/src/mbaux/mb_delaun.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_delaun.c	4/19/94
- *    $Id: mb_delaun.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_delaun.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -95,43 +95,6 @@
  * Author:	D. W. Caress
  * Date:	April, 1994
  *
- * $Log: mb_delaun.c,v $
- * Revision 5.1  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/10/11  01:00:12  caress
- * Convert to ANSI C
- *
- * Revision 4.7  2000/09/30  06:54:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  1997/09/15  19:03:27  caress
- * Real Version 4.5
- *
- * Revision 4.5  1997/04/21  16:53:56  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/04/22  13:18:44  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1996/04/22  13:18:44  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1995/03/06  19:39:52  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  11:34:20  caress
- * Release V4.0
- *
- * Revision 4.1  1994/05/24  03:11:40  caress
- * Fixed include.
- *
- * Revision 4.0  1994/05/16  22:09:29  caress
- * First cut at new contouring scheme
- *
  *
  */
 
@@ -143,11 +106,12 @@
 /* mbio include files */
 #include "mb_status.h"
 #include "mb_define.h"
+#include "mb_aux.h"
 
 /* some defines */
 #define	LARGE	1.0e10
 
-static char rcs_id[] = "$Id: mb_delaun.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mb_delaun.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------------*/
 /* 	function mb_delaun creates a network of triangles connecting an
diff --git a/src/mbaux/mb_intersectgrid.c b/src/mbaux/mb_intersectgrid.c
index 1e89661..56bbeb0 100644
--- a/src/mbaux/mb_intersectgrid.c
+++ b/src/mbaux/mb_intersectgrid.c
@@ -2,7 +2,7 @@
  *    The MB-system:	mb_intersectgrid.c	10/20/2012
  *    $Id:  $
  *
- *    Copyright (c) 2012-2014 by
+ *    Copyright (c) 2012-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -69,7 +69,7 @@ int mb_topogrid_init(int verbose, mb_path topogridfile, int *lonflip,
 	/* read in the data */
 	strcpy(topogrid->file, topogridfile);
 	topogrid->data = NULL;
-	status = mb_readgrd(verbose, topogrid->file, &topogrid->projection_mode, topogrid->projection_id, &topogrid->nodatavalue,
+	status = mb_read_gmt_grd(verbose, topogrid->file, &topogrid->projection_mode, topogrid->projection_id, &topogrid->nodatavalue,
 				&topogrid->nxy, &topogrid->nx, &topogrid->ny, &topogrid->min, &topogrid->max,
 				&topogrid->xmin, &topogrid->xmax, &topogrid->ymin, &topogrid->ymax,
 				&topogrid->dx, &topogrid->dy, &topogrid->data, NULL, NULL, error);
diff --git a/src/mbaux/mb_pslibface.c b/src/mbaux/mb_pslibface.c
deleted file mode 100644
index de1ea6a..0000000
--- a/src/mbaux/mb_pslibface.c
+++ /dev/null
@@ -1,389 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_pslibface.c	5/15/94
- *    $Id: mb_pslibface.c 2175 2014-03-18 23:03:39Z caress $
- *
- *    Copyright (c) 1993-2014 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MB_PSLIBFACE is a set of functions which provide an interface
- * between the program MBCONTOUR and the PSLIB Postscript plotting
- * library from GMT.  This code is separated from MBCONTOUR so that
- * a similar set of interface functions for pen plotting can be linked
- * to the same source code.
- *
- * Author:	D. W. Caress
- * Date:	May 15, 1994
- *
- * $Log: mb_pslibface.c,v $
- * Revision 5.7  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.6  2006/12/15 21:42:49  caress
- * Incremental CVS update.
- *
- * Revision 5.5  2006/06/22 04:45:42  caress
- * Working towards 5.1.0
- *
- * Revision 5.4  2006/06/02 03:01:30  caress
- * Put in ifdefs to handle new GMT version.
- *
- * Revision 5.3  2006/01/18 15:11:05  caress
- * Had to change ps_text calls to work with pslib from GMT 4.1.
- *
- * Revision 5.2  2006/01/11 07:33:01  caress
- * Working towards 5.0.8
- *
- * Revision 5.1  2004/05/21 23:19:26  caress
- * Changes to support GMT 4.0
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.14  2000/10/11  01:01:26  caress
- * Convert to ANSI C
- *
- * Revision 4.13  2000/10/11  01:00:12  caress
- * Convert to ANSI C
- *
- * Revision 4.12  2000/09/30  06:54:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.11  1999/04/16  01:24:27  caress
- * Final version 4.6 release?
- *
- * Revision 4.10  1999/02/04  23:41:29  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.9  1998/10/04  04:18:07  caress
- * MB-System version 4.6beta
- *
- * Revision 4.8  1997/09/15  19:03:27  caress
- * Real Version 4.5
- *
- * Revision 4.7  1997/04/21  16:53:56  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1996/04/22  13:18:44  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1996/04/22  13:18:44  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1995/11/15  22:34:22  caress
- * Now handles non-region bounds (lower left point
- * + upper right point) properly.
- *
- * Revision 4.4  1995/08/07  17:31:39  caress
- * Moved to GMT V3.
- *
- * Revision 4.3  1995/03/06  19:39:52  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/07/29  19:04:31  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * >> using unix second time base.
- *
- * Revision 4.1  1994/05/25  15:08:49  caress
- * Fixed plot_exit.
- *
- * Revision 4.0  1994/05/16  22:14:24  caress
- * First cut at new contouring scheme.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* GMT include files */
-#include "gmt.h"
-#include "pslib.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-/* global variables */
-int	argc_save;
-char	**argv_save;
-double	inchtolon;
-int	ncolor;
-int	*red;
-int	*green;
-int	*blue;
-int	rgb[3];
-
-static char rcs_id[]="$Id: mb_pslibface.c 2175 2014-03-18 23:03:39Z caress $";
-
-/*--------------------------------------------------------------------------*/
-/* 	function plot_init initializes the GMT plotting. */
-int mb_plot_init(	int	verbose,
-		int	argc,
-		char	**argv,
-		double	*bounds_use,
-		double	*scale,
-		double	*inch2lon,
-		int	*error)
-{
-	char	*function_name = "mb_plot_init";
-	int	status = MB_SUCCESS;
-	int	errflg = 0;
-	double	bounds[4];
-	double	x1, y1, x2, y2, xx1, yy1, xx2, yy2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       argc:             %d\n",argc);
-		fprintf(stderr,"dbg2       argv:             %p\n",(void *)argv);
-		fprintf(stderr,"dbg2       bounds_use[0]:    %f\n",bounds_use[0]);
-		fprintf(stderr,"dbg2       bounds_use[1]:    %f\n",bounds_use[1]);
-		fprintf(stderr,"dbg2       bounds_use[2]:    %f\n",bounds_use[2]);
-		fprintf(stderr,"dbg2       bounds_use[3]:    %f\n",bounds_use[3]);
-		fprintf(stderr,"dbg2       scale:            %f\n",*scale);
-		}
-
-	/* save argc and argv */
-	argc_save = argc;
-	argv_save = argv;
-
-	/* deal with gmt options */
-	GMT_begin (argc, argv);
-	for (i = 1; i < argc; i++)
-		{
-		if (argv[i][0] == '-')
-			{
-			switch (argv[i][1])
-				{
-				/* Common parameters */
-
-				case 'B':
-				case 'J':
-				case 'K':
-				case 'O':
-				case 'P':
-				case 'R':
-				case 'U':
-				case 'V':
-				case 'X':
-				case 'x':
-				case 'Y':
-				case 'y':
-				case 'c':
-				case '\0':
-					errflg += GMT_get_common_args (argv[i],
-						&bounds[0], &bounds[1],
-						&bounds[2], &bounds[3]);
-					break;
-
-				/* Supplemental parameters */
-
-				case 'F':
-					sscanf (&argv[i][2], "%d/%d/%d",
-						&gmtdefs.basemap_frame_rgb[0],
-						&gmtdefs.basemap_frame_rgb[1],
-						&gmtdefs.basemap_frame_rgb[2]);
-					break;
-				}
-			}
-		}
-
-	/* if error flagged then return */
-	if (errflg)
-		{
-		status = MB_FAILURE;
-		return(status);
-		}
-
-	/* set up map */
-	GMT_map_setup(bounds[0],bounds[1],bounds[2],bounds[3]);
-
-	/* initialize plotting */
-	GMT_plotinit (argc, argv);
-
-	/* copy bounds in correct order for use by this program */
-	if (project_info.region == MB_YES)
-		{
-		bounds_use[0] = bounds[0];
-		bounds_use[1] = bounds[1];
-		bounds_use[2] = bounds[2];
-		bounds_use[3] = bounds[3];
-		}
-	else
-		{
-		bounds_use[0] = bounds[0];
-		bounds_use[1] = bounds[2];
-		bounds_use[2] = bounds[1];
-		bounds_use[3] = bounds[3];
-		}
-
-	/* set clip path */
-	GMT_map_clip_on (GMT_no_rgb, 3);
-
-	/* get inches to longitude scale */
-	x1 = 0.0;
-	y1 = 0.0;
-	x2 = 1.0;
-	y2 = 0.0;
-	GMT_xy_to_geo(&xx1,&yy1,x1,y1);
-	GMT_xy_to_geo(&xx2,&yy2,x2,y2);
-	*inch2lon = xx2 - xx1;
-	inchtolon = *inch2lon;
-
-	/* set line width */
-	ps_setline(0);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bounds[0]:  %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:  %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:  %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:  %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       scale:      %f\n",*scale);
-		fprintf(stderr,"dbg2       inchtolon:  %f\n",*inch2lon);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function plot_end ends the GMT plotting. */
-int mb_plot_end(int verbose, int *error)
-{
-	char	*function_name = "mb_plot_end";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* turn off clipping */
-	ps_clipoff();
-
-	/* plot basemap if required */
-	if (frame_info.plot)
-		{
-		ps_setpaint (gmtdefs.basemap_frame_rgb);
-		GMT_map_basemap ();
-		rgb[0] = 0;
-		rgb[1] = 0;
-		rgb[2] = 0;
-		ps_setpaint (rgb);
-		}
-
-	/* end the plot */
-	GMT_plotend ();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_plot_exit(int argc, char **argv)
-{
-	int	status = MB_SUCCESS;
-
-	GMT_end(argc, argv);
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-void mb_set_colors(int ncol, int *rd, int *gn, int *bl)
-{
-	ncolor = ncol;
-	red = rd;
-	green = gn;
-	blue = bl;
-	return;
-}
-
-/*--------------------------------------------------------------------*/
-void mb_plot(double x, double y, int ipen)
-{
-	double	xx, yy;
-	GMT_geo_to_xy(x,y,&xx,&yy);
-	ps_plot(xx,yy,ipen);
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mb_setline(int linewidth)
-{
-        ps_setline(linewidth);
-        return;
-}
-/*--------------------------------------------------------------------*/
-void mb_newpen(int ipen)
-{
-	if (ipen > -1 && ipen < ncolor)
-		{
-		rgb[0] = red[ipen];
-		rgb[1] = green[ipen];
-		rgb[2] = blue[ipen];
-		ps_setpaint(rgb);
-		}
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mb_justify_string(double height, char *string, double *s)
-{
-	int	len;
-
-	len = strlen(string);
-	s[0] = 0.0;
-	s[1] = 0.185*height*len;
-	s[2] = 0.37*len*height;
-	s[3] = 0.37*len*height;
-
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mb_plot_string(double x, double y, double hgt, double angle, char *label)
-{
-	double	point;
-	double	height;
-	double	xx, yy;
-
-	height = hgt/inchtolon;
-	point = height*72.;
-	GMT_geo_to_xy(x,y,&xx,&yy);
-	ps_text(xx,yy,point,label,angle,5,0);
-
-	return;
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_readgrd.c b/src/mbaux/mb_readgrd.c
deleted file mode 100644
index bce6e4c..0000000
--- a/src/mbaux/mb_readgrd.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_readgrd.c	12/10/2007
- *    $Id: mb_readgrd.c 2175 2014-03-18 23:03:39Z caress $
- *
- *    Copyright (c) 2007-2014 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * Standalone function to read a GMT grid for programs not interfacing
- * with other GMT functionality.
- *
- * Author:	D. W. Caress
- * Date:	September 3, 2007
- *
- * $Log: mb_readgrd.c,v $
- * Revision 5.1  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.0  2007/10/08 05:47:27  caress
- * Added grd reading function.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* GMT include files */
-#include "gmt.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* get NaN detector */
-#if defined(isnanf)
-#define check_fnan(x) isnanf((x))
-#elif defined(isnan)
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNANF == 1
-#define check_fnan(x) isnanf(x)
-extern int isnanf(float x);
-#elif HAVE_ISNAN == 1
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNAND == 1
-#define check_fnan(x) isnand((double)(x))
-#else
-#define check_fnan(x) ((x) != (x))
-#endif
-
-/* Projection defines */
-#define ModelTypeProjected	     1
-#define ModelTypeGeographic	     2
-#define GCS_WGS_84		  4326
-
-/* default no data value define */
-#define	DEFAULT_NODATA		-9999999.9
-
-static char rcs_id[] = "$Id: mb_readgrd.c 2175 2014-03-18 23:03:39Z caress $";
-
-/* global variables */
-static char program_name[] = "mb_readgrd";
-static int	pargc;
-static char	**pargv;
-
-/*--------------------------------------------------------------------------*/
-int mb_readgrd(int verbose, char *grdfile,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data,
-			float	**data_dzdx,
-			float	**data_dzdy,
-			int	*error)
-{
-	char function_name[] = "mb_readgrd";
-	int	status = MB_SUCCESS;
-	struct GRD_HEADER header;
-	int	modeltype;
-	int	projectionid;
-        mb_path    projectionname;
-	int	off;
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
-#else
-	int	pad[4];
-#endif
-	int	nscan;
-	int	utmzone;
-	char	NorS;
-	float	*rawdata;
-	float	*usedata;
-	double	mtodeglon, mtodeglat;
-	double	ddx, ddy;
-	int	kx0, kx2, ky0, ky2;
-	int	i, j, k, ii, jj, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n", verbose);
-		fprintf(stderr,"dbg2       grdfile:         %s\n", grdfile);
-		}
-
-	/* do required initialization */
-/*	GMT_begin (pargc, pargv);
-	GMT_put_history(pargc, pargv);
-	GMT_get_common_args (projection, xmin, xmax, ymin, ymax);*/
-	project_info.degree[0] = 0;
-	project_info.degree[1] = 0;
-	GMT_program = program_name;
-	GMT_grd_init (&header, pargc, pargv, FALSE);
-	GMT_io_init ();
-	GMT_grdio_init ();
-	GMT_make_fnan (GMT_f_NaN);
-	GMT_make_dnan (GMT_d_NaN);
-
-	/* read input grd file header */
-	if (GMT_read_grd_info (grdfile, &header))
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* proceed if ok */
-	if (status == MB_SUCCESS)
-		{
-		/* try to get projection from the grd file remark */
-		if (strncmp(&(header.remark[2]), "Projection: ", 12) == 0)
-			{
-			if ((nscan = sscanf(&(header.remark[2]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
-				{
-				if (NorS == 'N')
-					{
-					projectionid = 32600 + utmzone;
-					}
-				else if (NorS == 'S')
-					{
-					projectionid = 32700 + utmzone;
-					}
-				else
-					{
-					projectionid = 32600 + utmzone;
-					}
-				modeltype = ModelTypeProjected;
-				sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
-				*grid_projection_mode = MB_PROJECTION_PROJECTED;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-
-				project_info.degree[0] = FALSE;
-				}
-			else if ((nscan = sscanf(&(header.remark[2]), "Projection: epsg%d", &projectionid)) == 1)
-				{
-				sprintf(projectionname, "epsg%d", projectionid);
-				modeltype = ModelTypeProjected;
-				*grid_projection_mode = MB_PROJECTION_PROJECTED;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-
-				project_info.degree[0] = FALSE;
-				}
-			else
-				{
-				strcpy(projectionname, "Geographic WGS84");
-				modeltype = ModelTypeGeographic;
-				projectionid = GCS_WGS_84;
-				*grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-
-				project_info.degree[0] = TRUE;
-				GMT_io.in_col_type[0] = GMT_IS_LON;
-				GMT_io.in_col_type[1] = GMT_IS_LAT;
-				}
-			}
-		else
-			{
-			strcpy(projectionname, "Geographic WGS84");
-			modeltype = ModelTypeGeographic;
-			projectionid = GCS_WGS_84;
-			*grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-
-			project_info.degree[0] = TRUE;
-			GMT_io.in_col_type[0] = GMT_IS_LON;
-			GMT_io.in_col_type[1] = GMT_IS_LAT;
-			}
-
-		/* set up internal arrays */
-    		*nodatavalue = MIN(DEFAULT_NODATA, header.z_min - 10 * (header.z_max - header.z_min));
-    		*nxy = header.nx * header.ny;
-    		*nx = header.nx;
-    		*ny = header.ny;
-    		*xmin = header.x_min;
-    		*xmax = header.x_max;
-    		*ymin = header.y_min;
-    		*ymax = header.y_max;
-    		*dx = header.x_inc;
-    		*dy = header.y_inc;
-    		*min = header.z_min;
-    		*max = header.z_max;
-
-    		status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
-    					(void **)&rawdata, error);
-    		if (status == MB_SUCCESS)
-			{
-			status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
-    					(void **)&usedata, error);
-			*data = usedata;
-			}
-    		if (status == MB_SUCCESS && data_dzdx != NULL)
-			{
-			status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
-    					(void **)&usedata, error);
-			*data_dzdx = usedata;
-			}
-    		if (status == MB_SUCCESS && data_dzdy != NULL)
-			{
-			status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
-    					(void **)&usedata, error);
-			*data_dzdy = usedata;
-			}
-		}
-
-	/* proceed if ok */
-	if (status == MB_SUCCESS)
-		{
-		/* Determine the wesn to be used to read the grdfile */
-		off = (header.node_offset) ? 0 : 1;
-		GMT_map_setup (*xmin, *xmax, *ymin, *ymax);
-#ifdef GMT_MINOR_VERSION
-		GMT_grd_setregion (&header, xmin,  xmax, ymin, ymax, BCR_BILINEAR);
-#else
-		GMT_grd_setregion (&header, xmin,  xmax, ymin, ymax);
-#endif
-
-		/* read the grid */
-		pad[0] = 0;
-		pad[1] = 0;
-		pad[2] = 0;
-		pad[3] = 0;
-		if (GMT_read_grd (grdfile, &header, rawdata,
-				    *xmin, *xmax, *ymin, *ymax,
-				    pad, FALSE))
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* free GMT memory */
-		GMT_free ((void *)GMT_io.skip_if_NaN);
-		GMT_free ((void *)GMT_io.in_col_type);
-		GMT_free ((void *)GMT_io.out_col_type);
-		}
-
-	/* reorder grid to internal convention */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<*nx;i++)
-		for (j=0;j<*ny;j++)
-			{
-			k = i * *ny + j;
-			kk = (*ny - 1 - j) * *nx + i;
-			if (check_fnan(rawdata[kk]))
-				(*data)[k] = *nodatavalue;
-			else
-				(*data)[k] = rawdata[kk];
-			}
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&rawdata, error);
-		}
-
-	/* calculate derivatives */
-	if (status == MB_SUCCESS && data_dzdx != NULL && data_dzdy != NULL)
-		{
-		ddx = *dx;
-		ddy = *dy;
-		if (*grid_projection_mode == MB_PROJECTION_GEOGRAPHIC)
-			{
-			mb_coor_scale(verbose,0.5 * (*ymin + *ymax), &mtodeglon, &mtodeglat);
-			ddx /= mtodeglon;
-			ddy /= mtodeglon;
-			}
-		for (i=0;i<*nx;i++)
-		for (j=0;j<*ny;j++)
-			{
-			k = i * (*ny) + j;
-			ii = 0;
-			jj = 0;
-			if (i > 0)
-				{
-				kx0 = (i - 1) * (*ny) + j;
-				ii++;
-				}
-			else
-				kx0 = k;
-			if (i < *nx - 1)
-				{
-				kx2 = (i + 1) * (*ny) + j;
-				ii++;
-				}
-			else
-				kx0 = k;
-			if (j > 0)
-				{
-				ky0 = i * (*ny) + j + 1;
-				jj++;
-				}
-			else
-				ky0 = k;
-			if (j < *ny - 1)
-				{
-				ky2 = i * (*ny) + j - 1;
-				jj++;
-				}
-			else
-				ky2 = k;
-			if (ii > 0)
-				(*data_dzdx)[k] = ((*data)[kx2] - (*data)[kx0]) / (((double)ii) * ddx);
-			if (jj > 0)
-				(*data_dzdy)[k] = ((*data)[ky2] - (*data)[ky0]) / (((double)jj) * ddy);
-			}
-		}
-
-	/* print debug info */
-	if (verbose > 0)
-		{
-		fprintf(stderr,"\nGrid read:\n");
-		fprintf(stderr,"  Dimensions: %d %d\n", header.nx, header.ny);
-		if (modeltype == ModelTypeProjected)
-			{
-			fprintf(stderr,"  Projected Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"  Projected Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"  Easting:    %f %f  %f\n",
-				header.x_min, header.x_max, header.x_inc);
-			fprintf(stderr,"  Northing:   %f %f  %f\n",
-				header.y_min, header.y_max, header.y_inc);
-			}
-		else
-			{
-			fprintf(stderr,"  Geographic Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"  Geographic Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"  Longitude:  %f %f  %f\n",
-				header.x_min, header.x_max, header.x_inc);
-			fprintf(stderr,"  Latitude:   %f %f  %f\n",
-				header.y_min, header.y_max, header.y_inc);
-			}
-		fprintf(stderr,"  Internal Grid Projection Mode:         %d\n",
-	    			*grid_projection_mode);
-		fprintf(stderr,"  Internal Grid Projection ID:           %s\n",
-	    			grid_projection_id);
-
-		fprintf(stderr,"Data Read:\n");
-		fprintf(stderr,"  grid_projection_mode:     %d\n", *grid_projection_mode);
-		fprintf(stderr,"  grid_projection_id:       %s\n", grid_projection_id);
-		fprintf(stderr,"  nodatavalue:              %f\n", *nodatavalue);
-		fprintf(stderr,"  nx:                       %d\n", *nx);
-		fprintf(stderr,"  ny:                       %d\n", *ny);
-		fprintf(stderr,"  min:                      %f\n", *min);
-		fprintf(stderr,"  max:                      %f\n", *max);
-		fprintf(stderr,"  xmin:                     %f\n", *xmin);
-		fprintf(stderr,"  xmax:                     %f\n", *xmax);
-		fprintf(stderr,"  ymin:                     %f\n", *ymin);
-		fprintf(stderr,"  ymax:                     %f\n", *ymax);
-		fprintf(stderr,"  dx:                       %f\n", *dx);
-		fprintf(stderr,"  dy:                       %f\n", *dy);
-		fprintf(stderr,"  data:                     %p\n", *data);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       Dimensions: %d %d\n", header.nx, header.ny);
-		if (modeltype == ModelTypeProjected)
-			{
-			fprintf(stderr,"dbg2       Projected Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"dbg2       Projected Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"dbg2       Easting:                  %f %f  %f\n",header.x_min, header.x_max, header.x_inc);
-			fprintf(stderr,"dbg2       Northing:                 %f %f  %f\n",header.y_min, header.y_max, header.y_inc);
-			}
-		else
-			{
-			fprintf(stderr,"dbg2       Geographic Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"dbg2       Geographic Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"dbg2       Longitude:                %f %f  %f\n",header.x_min, header.x_max, header.x_inc);
-			fprintf(stderr,"dbg2       Latitude:                 %f %f  %f\n",header.y_min, header.y_max, header.y_inc);
-			}
-		fprintf(stderr,"dbg2       Internal Grid Projection Mode: %d\n", *grid_projection_mode);
-		fprintf(stderr,"dbg2       Internal Grid Projection ID:   %s\n", grid_projection_id);
-		fprintf(stderr,"Data Read:\n");
-		fprintf(stderr,"dbg2       grid_projection_mode:     %d\n", *grid_projection_mode);
-		fprintf(stderr,"dbg2       grid_projection_id:       %s\n", grid_projection_id);
-		fprintf(stderr,"dbg2       nodatavalue:              %f\n", *nodatavalue);
-		fprintf(stderr,"dbg2       nx:                       %d\n", *nx);
-		fprintf(stderr,"dbg2       ny:                       %d\n", *ny);
-		fprintf(stderr,"dbg2       min:                      %f\n", *min);
-		fprintf(stderr,"dbg2       max:                      %f\n", *max);
-		fprintf(stderr,"dbg2       xmin:                     %f\n", *xmin);
-		fprintf(stderr,"dbg2       xmax:                     %f\n", *xmax);
-		fprintf(stderr,"dbg2       ymin:                     %f\n", *ymin);
-		fprintf(stderr,"dbg2       ymax:                     %f\n", *ymax);
-		fprintf(stderr,"dbg2       dx:                       %f\n", *dx);
-		fprintf(stderr,"dbg2       dy:                       %f\n", *dy);
-		fprintf(stderr,"dbg2       data:                     %p\n", *data);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_readwritegrd.c b/src/mbaux/mb_readwritegrd.c
new file mode 100644
index 0000000..27063cd
--- /dev/null
+++ b/src/mbaux/mb_readwritegrd.c
@@ -0,0 +1,629 @@
+/*--------------------------------------------------------------------
+ *    The MB-system:	mb_grdio.c	12/10/2007
+ *    $Id: mb_readwritegrd.c 2247 2015-05-29 21:28:28Z caress $
+ *
+ *    Copyright (c) 2007-2015 by
+ *    David W. Caress (caress at mbari.org)
+ *      Monterey Bay Aquarium Research Institute
+ *      Moss Landing, CA 95039
+ *    and Dale N. Chayes (dale at ldeo.columbia.edu)
+ *      Lamont-Doherty Earth Observatory
+ *      Palisades, NY 10964
+ *
+ *    See README file for copying and redistribution conditions.
+ *--------------------------------------------------------------------*/
+/*
+ * Standalone functions to read or write a GMT grid for programs not interfacing
+ * with other GMT functionality.
+ *
+ * Author:	D. W. Caress
+ * Date:	September 3, 2007
+ *
+ */
+
+/* standard include files */
+#include <stdio.h>
+#include <unistd.h>
+#include <math.h>
+#include <string.h>
+#include <time.h>
+
+/* GMT include files */
+#include "gmt.h"
+
+/* MBIO include files */
+#include "mb_status.h"
+#include "mb_define.h"
+#include "mb_aux.h"
+
+/* Projection defines */
+#define ModelTypeProjected	     1
+#define ModelTypeGeographic	     2
+#define GCS_WGS_84		  4326
+
+static char rcs_id[] = "$Id: mb_readwritegrd.c 2247 2015-05-29 21:28:28Z caress $";
+
+/*--------------------------------------------------------------------------*/
+int mb_read_gmt_grd(int verbose, char *grdfile,
+			int	*grid_projection_mode,
+			char	*grid_projection_id,
+			float	*nodatavalue,
+			int	*nxy,
+			int	*nx,
+			int	*ny,
+			double	*min,
+			double	*max,
+			double	*xmin,
+			double	*xmax,
+			double	*ymin,
+			double	*ymax,
+			double	*dx,
+			double	*dy,
+			float	**data,
+			float	**data_dzdx,
+			float	**data_dzdy,
+			int	*error)
+{
+	char function_name[] = "mb_read_gmt_grd";
+	int	status = MB_SUCCESS;
+	void *API = NULL;			/* GMT API control structure pointer */
+	struct GMT_GRID *G = NULL;		/* GMT grid structure pointer */
+	struct GMT_GRID_HEADER *header;		/* GMT grid header structure pointer */
+	int	modeltype;
+	int	projectionid;
+        mb_path    projectionname;
+	int	nscan;
+	int	utmzone;
+	char	NorS;
+	float	*usedata;
+	double	mtodeglon, mtodeglat;
+	double	ddx, ddy;
+	int	kx0, kx2, ky0, ky2;
+	int	i, j, k, ii, jj, kk;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:         %d\n", verbose);
+		fprintf(stderr,"dbg2       grdfile:         %s\n", grdfile);
+		}
+		
+	/* Initializing new GMT session */
+	if ((API = GMT_Create_Session (function_name, 2U, 0U, NULL)) == NULL) exit (EXIT_FAILURE);
+	
+	/* read in the grid */
+	if ((G = GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_ALL, NULL, grdfile, NULL)) == NULL) exit (EXIT_FAILURE);
+	header = G->header;
+
+	/* proceed if ok */
+	if (status == MB_SUCCESS)
+		{
+		/* try to get projection from the grd file remark */
+		if (strncmp(&(header->remark[2]), "Projection: ", 12) == 0)
+			{
+			if ((nscan = sscanf(&(header->remark[2]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
+				{
+				if (NorS == 'N')
+					{
+					projectionid = 32600 + utmzone;
+					}
+				else if (NorS == 'S')
+					{
+					projectionid = 32700 + utmzone;
+					}
+				else
+					{
+					projectionid = 32600 + utmzone;
+					}
+				modeltype = ModelTypeProjected;
+				sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
+				*grid_projection_mode = MB_PROJECTION_PROJECTED;
+				sprintf(grid_projection_id, "epsg%d", projectionid);
+				}
+			else if ((nscan = sscanf(&(header->remark[2]), "Projection: epsg%d", &projectionid)) == 1)
+				{
+				sprintf(projectionname, "epsg%d", projectionid);
+				modeltype = ModelTypeProjected;
+				*grid_projection_mode = MB_PROJECTION_PROJECTED;
+				sprintf(grid_projection_id, "epsg%d", projectionid);
+				}
+			else
+				{
+				strcpy(projectionname, "Geographic WGS84");
+				modeltype = ModelTypeGeographic;
+				projectionid = GCS_WGS_84;
+				*grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
+				sprintf(grid_projection_id, "epsg%d", projectionid);
+				}
+			}
+		else
+			{
+			strcpy(projectionname, "Geographic WGS84");
+			modeltype = ModelTypeGeographic;
+			projectionid = GCS_WGS_84;
+			*grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
+			sprintf(grid_projection_id, "epsg%d", projectionid);
+			}
+
+		/* set up internal arrays */
+    		*nodatavalue = MIN(MB_DEFAULT_GRID_NODATA, header->z_min - 10 * (header->z_max - header->z_min));
+    		*nxy = header->nx * header->ny;
+    		*nx = header->nx;
+    		*ny = header->ny;
+    		*xmin = header->wesn[0];
+    		*xmax = header->wesn[1];
+    		*ymin = header->wesn[2];
+    		*ymax = header->wesn[3];
+    		*dx = header->inc[0];
+    		*dy = header->inc[1];
+    		*min = header->z_min;
+    		*max = header->z_max;
+
+    		status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
+    					(void **)&usedata, error);
+    		if (status == MB_SUCCESS)
+			{
+			*data = usedata;
+			}
+    		if (status == MB_SUCCESS && data_dzdx != NULL)
+			{
+			status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
+    					(void **)&usedata, error);
+			*data_dzdx = usedata;
+			}
+    		if (status == MB_SUCCESS && data_dzdy != NULL)
+			{
+			status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
+    					(void **)&usedata, error);
+			*data_dzdy = usedata;
+			}
+		}
+
+	/* copy grid data, reordering to internal convention */
+	if (status == MB_SUCCESS)
+		{
+		for (i=0;i<*nx;i++)
+		for (j=0;j<*ny;j++)
+			{
+			k = i * *ny + j;
+			kk = (*ny + header->pad[2] + header->pad[3] - 1 - j)
+				* (*nx + header->pad[0] + header->pad[1])
+				+ (i + header->pad[0]);
+			if (MB_IS_FNAN(G->data[kk]))
+				(*data)[k] = *nodatavalue;
+			else
+				(*data)[k] = G->data[kk];
+			}
+		}
+
+	/* calculate derivatives */
+	if (status == MB_SUCCESS && data_dzdx != NULL && data_dzdy != NULL)
+		{
+		ddx = *dx;
+		ddy = *dy;
+		if (*grid_projection_mode == MB_PROJECTION_GEOGRAPHIC)
+			{
+			mb_coor_scale(verbose,0.5 * (*ymin + *ymax), &mtodeglon, &mtodeglat);
+			ddx /= mtodeglon;
+			ddy /= mtodeglon;
+			}
+		for (i=0;i<*nx;i++)
+		for (j=0;j<*ny;j++)
+			{
+			k = i * (*ny) + j;
+			ii = 0;
+			jj = 0;
+			if (i > 0)
+				{
+				kx0 = (i - 1) * (*ny) + j;
+				ii++;
+				}
+			else
+				kx0 = k;
+			if (i < *nx - 1)
+				{
+				kx2 = (i + 1) * (*ny) + j;
+				ii++;
+				}
+			else
+				kx0 = k;
+			if (j > 0)
+				{
+				ky0 = i * (*ny) + j + 1;
+				jj++;
+				}
+			else
+				ky0 = k;
+			if (j < *ny - 1)
+				{
+				ky2 = i * (*ny) + j - 1;
+				jj++;
+				}
+			else
+				ky2 = k;
+			if (ii > 0)
+				(*data_dzdx)[k] = ((*data)[kx2] - (*data)[kx0]) / (((double)ii) * ddx);
+			if (jj > 0)
+				(*data_dzdy)[k] = ((*data)[ky2] - (*data)[ky0]) / (((double)jj) * ddy);
+			}
+		}
+
+	/* Destroy GMT session */
+	if (GMT_Destroy_Session (API)) exit (EXIT_FAILURE);
+
+	/* print debug info */
+	if (verbose > 0)
+		{
+		fprintf(stderr,"\nGrid read:\n");
+		fprintf(stderr,"  Dimensions:     %d %d\n", header->nx, header->ny);
+		fprintf(stderr,"  Registration:   %d\n", header->registration);
+		if (modeltype == ModelTypeProjected)
+			{
+			fprintf(stderr,"  Projected Coordinate System Name: %s\n", projectionname);
+			fprintf(stderr,"  Projected Coordinate System ID:   %d\n", projectionid);
+			fprintf(stderr,"  Easting:    %f %f  %f\n",
+				header->wesn[0], header->wesn[1], header->inc[0]);
+			fprintf(stderr,"  Northing:   %f %f  %f\n",
+				header->wesn[2], header->wesn[3], header->inc[1]);
+			}
+		else
+			{
+			fprintf(stderr,"  Geographic Coordinate System Name: %s\n", projectionname);
+			fprintf(stderr,"  Geographic Coordinate System ID:   %d\n", projectionid);
+			fprintf(stderr,"  Longitude:  %f %f  %f\n",
+				header->wesn[0], header->wesn[1], header->inc[0]);
+			fprintf(stderr,"  Latitude:   %f %f  %f\n",
+				header->wesn[2], header->wesn[3], header->inc[1]);
+			}
+		fprintf(stderr,"  Grid Projection Mode:     %d\n", *grid_projection_mode);
+		fprintf(stderr,"  Grid Projection ID:       %s\n", grid_projection_id);
+		fprintf(stderr,"  Data Extrema:             %f %f\n", header->z_min, header->z_max);
+		fprintf(stderr,"  Other Grid Parameters:\n");
+		fprintf(stderr,"    z_scale_factor:         %f\n", header->z_scale_factor);
+		fprintf(stderr,"    z_add_offset:           %f\n", header->z_add_offset);
+		fprintf(stderr,"    type:                   %d\n", header->type);
+		fprintf(stderr,"    bits:                   %d\n", header->bits);
+		fprintf(stderr,"    complex_mode:           %d\n", header->complex_mode);
+		fprintf(stderr,"    mx:                     %d\n", header->mx);
+		fprintf(stderr,"    my:                     %d\n", header->my);
+		fprintf(stderr,"    nm:                     %zu\n", header->nm);
+		fprintf(stderr,"    size:                   %zu\n", header->size);
+		fprintf(stderr,"    pad:                    %d %d %d %d\n", header->pad[0], header->pad[1], header->pad[2], header->pad[3]);
+		fprintf(stderr,"    data ptr:               %p\n", G->data);
+		}
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBBA function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       Dimensions: %d %d\n", header->nx, header->ny);
+		if (modeltype == ModelTypeProjected)
+			{
+			fprintf(stderr,"dbg2       Projected Coordinate System Name: %s\n", projectionname);
+			fprintf(stderr,"dbg2       Projected Coordinate System ID:   %d\n", projectionid);
+			fprintf(stderr,"dbg2       Easting:                  %f %f  %f\n",header->wesn[0], header->wesn[1], header->inc[0]);
+			fprintf(stderr,"dbg2       Northing:                 %f %f  %f\n",header->wesn[2], header->wesn[3], header->inc[1]);
+			}
+		else
+			{
+			fprintf(stderr,"dbg2       Geographic Coordinate System Name: %s\n", projectionname);
+			fprintf(stderr,"dbg2       Geographic Coordinate System ID:   %d\n", projectionid);
+			fprintf(stderr,"dbg2       Longitude:                %f %f  %f\n",header->wesn[0], header->wesn[1], header->inc[0]);
+			fprintf(stderr,"dbg2       Latitude:                 %f %f  %f\n",header->wesn[2], header->wesn[3], header->inc[1]);
+			}
+		fprintf(stderr,"dbg2       Internal Grid Projection Mode: %d\n", *grid_projection_mode);
+		fprintf(stderr,"dbg2       Internal Grid Projection ID:   %s\n", grid_projection_id);
+		fprintf(stderr,"Data Read:\n");
+		fprintf(stderr,"dbg2       grid_projection_mode:     %d\n", *grid_projection_mode);
+		fprintf(stderr,"dbg2       grid_projection_id:       %s\n", grid_projection_id);
+		fprintf(stderr,"dbg2       nodatavalue:              %f\n", *nodatavalue);
+		fprintf(stderr,"dbg2       nx:                       %d\n", *nx);
+		fprintf(stderr,"dbg2       ny:                       %d\n", *ny);
+		fprintf(stderr,"dbg2       min:                      %f\n", *min);
+		fprintf(stderr,"dbg2       max:                      %f\n", *max);
+		fprintf(stderr,"dbg2       xmin:                     %f\n", *xmin);
+		fprintf(stderr,"dbg2       xmax:                     %f\n", *xmax);
+		fprintf(stderr,"dbg2       ymin:                     %f\n", *ymin);
+		fprintf(stderr,"dbg2       ymax:                     %f\n", *ymax);
+		fprintf(stderr,"dbg2       dx:                       %f\n", *dx);
+		fprintf(stderr,"dbg2       dy:                       %f\n", *dy);
+		fprintf(stderr,"dbg2       data:                     %p\n", *data);
+		fprintf(stderr,"dbg2       error:           %d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:          %d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}/*--------------------------------------------------------------------*/
+/*
+ * function write_cdfgrd writes output grid to a
+ * GMT version 2 netCDF grd file
+ */
+int mb_write_gmt_grd(int verbose,
+			char *grdfile,
+			float *grid,
+			float nodatavalue,
+			int nx,
+			int ny,
+			double xmin,
+			double xmax,
+			double ymin,
+			double ymax,
+			double zmin,
+			double zmax,
+			double dx,
+			double dy,
+			char *xlab,
+			char *ylab,
+			char *zlab,
+			char *titl,
+			char *projection,
+			int argc,
+			char **argv,
+			int *error)
+{
+	char	*function_name = "write_cdfgrd";
+	int	status = MB_SUCCESS;
+	
+	double	wesn[4];
+	double	inc[2];
+	unsigned int registration;
+	int	pad;
+	void *API = NULL;			/* GMT API control structure pointer */
+	struct GMT_GRID *G = NULL;		/* GMT grid structure pointer */
+	struct GMT_GRID_HEADER *header;		/* GMT grid header structure pointer */
+
+	int	modeltype;
+	int	projectionid;
+	int	grid_projection_mode;
+        mb_path	projectionname;
+	mb_path	grid_projection_id;
+	mb_path	program_name;
+	mb_path	remark;
+	int	nscan;
+	int	utmzone;
+	char	NorS;
+	time_t	right_now;
+	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
+	int	first = MB_NO;
+	double	min = 0.0;
+	double	max = 0.0;
+	double	NaN;
+	int	nx_node_registration;
+	int	i, j, k, kk;
+	char	*ctime();
+	char	*getenv();
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  Function <%s> called\n",
+			function_name);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
+		fprintf(stderr,"dbg2       grdfile:    %s\n",grdfile);
+		fprintf(stderr,"dbg2       grid:       %p\n",(void *)grid);
+		fprintf(stderr,"dbg2       nodatavalue:%f\n", nodatavalue);
+		fprintf(stderr,"dbg2       nx:         %d\n",nx);
+		fprintf(stderr,"dbg2       ny:         %d\n",ny);
+		fprintf(stderr,"dbg2       xmin:       %f\n",xmin);
+		fprintf(stderr,"dbg2       xmax:       %f\n",xmax);
+		fprintf(stderr,"dbg2       ymin:       %f\n",ymin);
+		fprintf(stderr,"dbg2       ymax:       %f\n",ymax);
+		fprintf(stderr,"dbg2       dx:         %f\n",dx);
+		fprintf(stderr,"dbg2       dy:         %f\n",dy);
+		fprintf(stderr,"dbg2       xlab:       %s\n",xlab);
+		fprintf(stderr,"dbg2       ylab:       %s\n",ylab);
+		fprintf(stderr,"dbg2       zlab:       %s\n",zlab);
+		fprintf(stderr,"dbg2       projection: %s\n",projection);
+		fprintf(stderr,"dbg2       titl:       %s\n",titl);
+		fprintf(stderr,"dbg2       argc:       %d\n",argc);
+		fprintf(stderr,"dbg2       *argv:      %p\n",(void *)*argv);
+		}
+		
+	/* Initializing new GMT session */
+	if ((API = GMT_Create_Session (function_name, 2U, 0U, NULL)) == NULL)
+		{
+		status = MB_FAILURE;
+		*error = MB_ERROR_MEMORY_FAIL;
+		return(status);
+		}
+	
+	/* set grid creation control values */
+	/* GMT_GRID_NODE_REG (0) for node grids, GMT_GRID_PIXEL_REG (1) for pixel grids */
+	nx_node_registration = lround((xmax - xmin) / dx + 1);
+	if (nx == nx_node_registration)
+		{
+		registration = GMT_GRID_NODE_REG;
+		}
+	else if (nx == nx_node_registration - 1)
+		{
+		registration = GMT_GRID_PIXEL_REG;
+		}
+	else
+		{
+		registration = GMT_GRID_DEFAULT_REG;
+		}
+
+	wesn[0] = xmin;                   	/* Min/max x and y coordinates */
+	wesn[1] = xmax;                   	/* Min/max x and y coordinates */
+	wesn[2] = ymin;                   	/* Min/max x and y coordinates */
+	wesn[3] = ymax;                   	/* Min/max x and y coordinates */
+	inc[0] = dx;                    	/* x and y increment */
+	inc[1] = dy;                    	/* x and y increment */
+	pad = 0;
+	
+	/* create structure for the grid */
+	if ((G = GMT_Create_Data (API, GMT_IS_GRID, GMT_IS_SURFACE, GMT_GRID_ALL, NULL, wesn, inc,
+				     registration, pad, NULL)) == NULL)
+		{
+		status = MB_FAILURE;
+		*error = MB_ERROR_MEMORY_FAIL;
+		return(status);
+		}
+		
+	/* Get some projection and user info needed for the grid remark field */
+	if ((nscan = sscanf(projection, "UTM%d%c", &utmzone, &NorS)) == 2)
+		{
+		if (NorS == 'N')
+			{
+			projectionid = 32600 + utmzone;
+			}
+		else if (NorS == 'S')
+			{
+			projectionid = 32700 + utmzone;
+			}
+		else
+			{
+			projectionid = 32600 + utmzone;
+			}
+		modeltype = ModelTypeProjected;
+		sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
+		grid_projection_mode = MB_PROJECTION_PROJECTED;
+		sprintf(grid_projection_id, "epsg%d", projectionid);
+		}
+	else if ((nscan = sscanf(projection, "epsg%d", &projectionid)) == 1)
+		{
+		sprintf(projectionname, "epsg%d", projectionid);
+		modeltype = ModelTypeProjected;
+		grid_projection_mode = MB_PROJECTION_PROJECTED;
+		sprintf(grid_projection_id, "epsg%d", projectionid);
+		}
+	else
+		{
+		strcpy(projectionname, "Geographic WGS84");
+		modeltype = ModelTypeGeographic;
+		projectionid = GCS_WGS_84;
+		grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
+		sprintf(grid_projection_id, "epsg%d", projectionid);
+		}
+	if (argc > 0)
+		strncpy(program_name, argv[0], MB_PATH_MAXLINE);
+	else
+		strcpy(program_name, "\0");
+	right_now = time((time_t *)0);
+	strcpy(date,ctime(&right_now));
+        date[strlen(date)-1] = '\0';
+	if ((user_ptr = getenv("USER")) == NULL)
+		user_ptr = getenv("LOGNAME");
+	if (user_ptr != NULL)
+		strcpy(user,user_ptr);
+	else
+		strcpy(user, "unknown");
+	gethostname(host, MB_PATH_MAXLINE);
+	sprintf(remark,"\n\tProjection: %s\n\tGrid created by %s\n\tMB-system Version %s\n\tRun by <%s> on <%s> at <%s>",
+		projection,program_name,MB_VERSION,user,host,date);
+	
+	/* set grid labels and remark */
+	header = G->header;
+	strcpy(header->command, program_name); /* name of generating command */
+	strcpy(header->x_units, xlab);     /* units in x-direction */
+	strcpy(header->y_units, ylab);     /* units in y-direction */
+	strcpy(header->z_units, zlab);     /* grid value units */
+	strcpy(header->title, titl);      /* name of data set */
+	strncpy(header->remark, remark, GMT_GRID_REMARK_LEN160);
+
+	/* recopy grid data, reordering from internal convention to grd file convention */
+	if (status == MB_SUCCESS)
+		{
+		MB_MAKE_FNAN(NaN);
+		for (i=0;i<nx;i++)
+		for (j=0;j<ny;j++)
+			{
+			k = i * ny + j;
+			kk = (ny - 1 - j) * nx + i;
+			if (grid[k] == nodatavalue)
+				G->data[kk] = NaN;
+			else
+				{
+				G->data[kk] = grid[k];
+				if (first == MB_YES)
+					{
+					min = grid[k];
+					max = grid[k];
+					first = MB_NO;
+					}
+				else
+					{
+					min = MIN(min, grid[k]);
+					max = MAX(max, grid[k]);
+					}
+				}
+			}
+		}
+
+	/* print info */
+	if (verbose > 0)
+		{
+		fprintf(stderr,"\nGrid to be written:\n");
+		fprintf(stderr,"  Dimensions:     %d %d\n", header->nx, header->ny);
+		fprintf(stderr,"  Registration:   %d\n", header->registration);
+		if (modeltype == ModelTypeProjected)
+			{
+			fprintf(stderr,"  Projected Coordinate System Name: %s\n", projectionname);
+			fprintf(stderr,"  Projected Coordinate System ID:   %d\n", projectionid);
+			fprintf(stderr,"  Easting:    %f %f  %f\n",
+				header->wesn[0], header->wesn[1], header->inc[0]);
+			fprintf(stderr,"  Northing:   %f %f  %f\n",
+				header->wesn[2], header->wesn[3], header->inc[1]);
+			}
+		else
+			{
+			fprintf(stderr,"  Geographic Coordinate System Name: %s\n", projectionname);
+			fprintf(stderr,"  Geographic Coordinate System ID:   %d\n", projectionid);
+			fprintf(stderr,"  Longitude:  %f %f  %f\n",
+				header->wesn[0], header->wesn[1], header->inc[0]);
+			fprintf(stderr,"  Latitude:   %f %f  %f\n",
+				header->wesn[2], header->wesn[3], header->inc[1]);
+			}
+		fprintf(stderr,"  Grid Projection Mode:     %d\n", grid_projection_mode);
+		fprintf(stderr,"  Grid Projection ID:       %s\n", grid_projection_id);
+		fprintf(stderr,"  Data Extrema:             %f %f\n", header->z_min, header->z_max);
+		fprintf(stderr,"  Other Grid Parameters:\n");
+		fprintf(stderr,"    z_scale_factor:         %f\n", header->z_scale_factor);
+		fprintf(stderr,"    z_add_offset:           %f\n", header->z_add_offset);
+		fprintf(stderr,"    type:                   %d\n", header->type);
+		fprintf(stderr,"    bits:                   %d\n", header->bits);
+		fprintf(stderr,"    complex_mode:           %d\n", header->complex_mode);
+		fprintf(stderr,"    mx:                     %d\n", header->mx);
+		fprintf(stderr,"    my:                     %d\n", header->my);
+		fprintf(stderr,"    nm:                     %zu\n", header->nm);
+		fprintf(stderr,"    size:                   %zu\n", header->size);
+		fprintf(stderr,"    pad:                    %d %d %d %d\n", header->pad[0], header->pad[1], header->pad[2], header->pad[3]);
+		fprintf(stderr,"    data ptr:               %p\n", G->data);
+		}
+
+	/* write out the grid */
+	if (GMT_Write_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_ALL, NULL, grdfile, G) != 0)
+		{
+		status = MB_FAILURE;
+		*error = MB_ERROR_WRITE_FAIL;
+		}
+
+	/* Destroy GMT session */
+	if (GMT_Destroy_Session (API) != 0)
+		{
+		status = MB_FAILURE;
+		*error = MB_ERROR_WRITE_FAIL;
+		}
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:      %d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:     %d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_spline.c b/src/mbaux/mb_spline.c
index 606e9bb..ee75815 100644
--- a/src/mbaux/mb_spline.c
+++ b/src/mbaux/mb_spline.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_spline.c	10/11/00
- *    $Id: mb_spline.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_spline.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -26,25 +26,6 @@
  * Author:	D. W. Caress
  * Date:	October 11, 2000
  *
- * $Log: mb_spline.c,v $
- * Revision 5.3  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.2  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.1  2004/12/02 06:29:26  caress
- * Fixes while working to support Reson 7k data.
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.0  2000/10/11  21:49:27  caress
- * Initial revision - code derived from functions previously
- * found in mbmerge.c, mbtide.c, and mbprocess.c.
- *
- *
  */
 
 /* standard global include files */
@@ -55,8 +36,9 @@
 /* mbio include files */
 #include "mb_status.h"
 #include "mb_define.h"
+#include "mb_aux.h"
 
-static char rcs_id[]="$Id: mb_spline.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_spline.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------------*/
 int mb_spline_init(int verbose, double *x, double *y,
diff --git a/src/mbaux/mb_surface.c b/src/mbaux/mb_surface.c
index ccc9791..0716eea 100644
--- a/src/mbaux/mb_surface.c
+++ b/src/mbaux/mb_surface.c
@@ -1,9 +1,9 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_surface.c	5/2/94
- *    $Id: mb_surface.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_surface.c 2247 2015-05-29 21:28:28Z caress $
  *
  *    Inclusion in MB-System:
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -56,34 +56,6 @@
  * Author:	D. W. Caress
  * Date:	May 2, 1994
  *
- * $Log: mb_surface.c,v $
- * Revision 5.4  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.3  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.2  2005/03/25 04:09:53  caress
- * Problems with global variables in mb_surface.c stomping on similarly named global variables in some programs has been fixed.
- *
- * Revision 5.1  2003/04/29 20:27:48  caress
- * Fixed multiple definitions of "error".
- *
- * Revision 5.0  2003/03/22 03:10:36  caress
- * Reinserting this code into MB-System for first time in years.
- *
- * Revision 4.2  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.1  1994/06/04  02:02:01  caress
- * Fixed several bugs and made some stylistic changes to
- * the output.  Changed the data input bounds to be much
- * larger than the working grid bounds.
- *
- * Revision 4.0  1994/05/05  20:30:06  caress
- * First cut. This code derived from GMT program surface by
- * Walter Smith and Paul Wessel.
- *
  *
  */
 
@@ -179,30 +151,30 @@ static struct MB_SURFACE_BRIGGS *briggs;		/* Coefficients in Taylor series for L
 int mb_surface(int verbose, int ndat, float *xdat, float *ydat, float *zdat,
 		double xxmin, double xxmax, double yymin, double yymax, double xxinc, double yyinc,
 		double ttension, float *sgrid);
-void	set_coefficients();
-void	set_offset();
-void fill_in_forecast ();
+void	set_coefficients(void);
+void	set_offset(void);
+void fill_in_forecast (void);
 int compare_points (struct MB_SURFACE_DATA *point_1, struct MB_SURFACE_DATA *point_2);
-void smart_divide ();
-void set_index ();
-void find_nearest_point();
-void set_grid_parameters();
-void initialize_grid();
-void new_initialize_grid();
+void smart_divide (void);
+void set_index (void);
+void find_nearest_point(void);
+void set_grid_parameters(void);
+void initialize_grid(void);
+void new_initialize_grid(void);
 void read_data(int ndat, float *xdat, float *ydat, float *zdat);
 void get_output(float *sgrid);
 int	iterate(int mode);
-void check_errors ();
-int	remove_planar_trend();
-int	replace_planar_trend();
-int	throw_away_unusables();
-int	rescale_z_values();
+void check_errors (void);
+int	remove_planar_trend(void);
+int	replace_planar_trend(void);
+int	throw_away_unusables(void);
+int	rescale_z_values(void);
 void load_constraints (char *low, char *high);
 double	guess_surface_time(int nx, int ny);
 int	get_prime_factors(int n, int f[]);
 int	gcd_euclid(int a,int b);
 
-static char rcs_id[] = "$Id: mb_surface.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mb_surface.c 2247 2015-05-29 21:28:28Z caress $";
 
 int mb_surface(int verbose, int ndat, float *xdat, float *ydat, float *zdat,
 		double xxmin, double xxmax, double yymin, double yymax, double xxinc, double yyinc,
diff --git a/src/mbaux/mb_track.c b/src/mbaux/mb_track.c
index 1511e95..0f1a4c3 100644
--- a/src/mbaux/mb_track.c
+++ b/src/mbaux/mb_track.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_track.c	8/15/93
- *    $Id: mb_track.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_track.c 2229 2015-02-14 23:04:41Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -18,65 +18,6 @@
  * Author:	D. W. Caress
  * Date:	August, 1993
  *
- * $Log: mb_track.c,v $
- * Revision 5.5  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.4  2008/05/26 04:43:15  caress
- * Getting ready for release 5.1.1beta19.
- *
- * Revision 5.3  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.2  2005/03/25 04:10:52  caress
- * Control over the filename annotation orientation has been added and the orientation itself has been fixed.
- *
- * Revision 5.1  2004/12/18 01:32:50  caress
- * Added filename annotation.
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/10/11  00:54:20  caress
- * Converted to ANSI C
- *
- * Revision 4.7  2000/09/30  06:52:17  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  1998/10/04  04:18:07  caress
- * MB-System version 4.6beta
- *
- * Revision 4.5  1997/04/21  16:53:56  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/04/22  13:18:44  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1996/04/22  13:18:44  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1995/03/06  19:39:52  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  11:34:20  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  19:04:31  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * >> using unix second time base.
- *
- * Revision 4.0  1994/05/16  22:09:29  caress
- * First cut at new contouring scheme
- *
- * Revision 4.0  1994/03/01  20:50:45  caress
- * First cut at new version.
- *
- * Revision 3.1  1993/11/05  18:58:09  caress
- * Not sure if there are any changes.
- *
- * Revision 3.0  1993/08/26  00:59:59  caress
- * Initial version.
- *
  *
  */
 
@@ -97,7 +38,7 @@
 #define IOR 	-3
 #define EPS 0.0001
 
-static char rcs_id[]="$Id: mb_track.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_track.c 2229 2015-02-14 23:04:41Z caress $";
 
 /*--------------------------------------------------------------------------*/
 /* 	function mb_track plots the shiptrack of multibeam data. */
diff --git a/src/mbaux/mb_truecont.c b/src/mbaux/mb_truecont.c
index bd20477..e7b45a9 100644
--- a/src/mbaux/mb_truecont.c
+++ b/src/mbaux/mb_truecont.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_truecont.c	4/21/94
- *    $Id: mb_truecont.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_truecont.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -89,7 +89,7 @@ int get_hand_old(struct swath *data, int *hand,
 		int k, int i, int j, int d);
 int get_azimuth_old(struct swath *data, int iping, double *angle);
 
-static char rcs_id[]="$Id: mb_truecont.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_truecont.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------------*/
 /* 	function mb_contour_init initializes the memory required to
diff --git a/src/mbaux/mb_xgraphics.c b/src/mbaux/mb_xgraphics.c
index b33b381..3e1ead1 100644
--- a/src/mbaux/mb_xgraphics.c
+++ b/src/mbaux/mb_xgraphics.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	xgraphics.c	8/3/94
- *    $Id: mb_xgraphics.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_xgraphics.c 2252 2015-07-01 19:35:37Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,55 +23,6 @@
  * Author:	D. W. Caress
  * Date:	August 3, 1994
  *
- * $Log: xgraphics.c,v $
- * Revision 5.6  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.5  2007/10/08 05:48:26  caress
- * Added function prototypes.
- *
- * Revision 5.4  2006/01/24 19:17:13  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.3  2006/01/11 07:33:01  caress
- * Working towards 5.0.8
- *
- * Revision 5.2  2003/04/17 20:45:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2003/03/10 19:56:16  caress
- * Expanded the libraries ability to deal with various screen types.
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.6  2000/10/11  00:54:20  caress
- * Converted to ANSI C
- *
- * Revision 4.5  2000/09/30  06:54:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.4  1999/12/29  00:59:34  caress
- * Release 4.6.8
- *
- * Revision 4.3  1998/10/05  17:45:32  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  16:56:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/16  21:29:30  caress
- * Complete rewrite without uid file.
- *
- * Revision 4.1  1994/12/28  14:46:05  caress
- * Added support for TrueColor displays as per Peter Lemmond's mods.
- *
- * Revision 4.1  1994/12/28  14:46:05  caress
- * Added support for TrueColor displays as per Peter Lemmond's mods.
- *
- * Revision 4.0  1994/10/21  11:55:41  caress
- * Release V4.0
- *
  *
  */
 /*--------------------------------------------------------------------*/
@@ -86,6 +37,9 @@
 /* mbaux includes */
 #include "mb_xgraphics.h"
 
+/* id variable */
+static char svn_id[] = "$Id: mb_xgraphics.c 2252 2015-07-01 19:35:37Z caress $";
+
 /**********************************************************************
  *	XG_INIT
  *	- initializes plotting variables, the colortable, and the GC
@@ -194,7 +148,9 @@ DefaultVisual(graphic->dpy, DefaultScreen(graphic->dpy)));*/
 	if ((graphic->font_info = XLoadQueryFont(graphic->dpy, fontname))
 		== NULL)
 		{
-		printf("X Error: Cannot load font: %s\n",fontname);
+		fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", fontname);
+		fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
+		fprintf(stderr,"Program Terminated\n");
 		exit(-1);
 		}
 
diff --git a/src/mbaux/mb_xgraphics.h b/src/mbaux/mb_xgraphics.h
index f4288b1..546b0e6 100644
--- a/src/mbaux/mb_xgraphics.h
+++ b/src/mbaux/mb_xgraphics.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_aux.h	10/13/2009
- *    $Id: mb_xgraphics.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_xgraphics.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2009-2014 by
+ *    Copyright (c) 2009-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbaux/mb_zgrid.c b/src/mbaux/mb_zgrid.c
index 00cfbd8..057b6fb 100644
--- a/src/mbaux/mb_zgrid.c
+++ b/src/mbaux/mb_zgrid.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_zgrid.c	    4/25/95
- *    $Id: mb_zgrid.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_zgrid.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbedit/Makefile.am b/src/mbedit/Makefile.am
index 441187f..ab17523 100644
--- a/src/mbedit/Makefile.am
+++ b/src/mbedit/Makefile.am
@@ -4,23 +4,17 @@ AM_CFLAGS = ${libnetcdf_CFLAGS}
 
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
 	      ${libnetcdf_CPPFLAGS} \
-	      ${motif_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I at top_srcdir@/src/gsf
-endif
+	      ${libmotif_CPPFLAGS}
 
-AM_LDFLAGS = 
-
-if BUILD_GSF
-  AM_LDFLAGS += -L$(top_builddir)/src/gsf
-endif
+AM_LDFLAGS = -L$(top_builddir)/src/gsf
 
 LIBS = $(top_builddir)/src/mbio/libmbio.la \
        $(top_builddir)/src/mbaux/libmbaux.la \
        $(top_builddir)/src/mbaux/libmbxgr.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} \
+       ${libmotif_LIBS} \
        $(LIBM)
 
 mbedit_SOURCES = mbedit.c mbedit_bxutils.c mbedit_callbacks.c mbedit_creation.c mbedit_prog.c mbedit_creation.h mbedit.h
diff --git a/src/mbedit/Makefile.in b/src/mbedit/Makefile.in
index b05affd..2d1eb54 100644
--- a/src/mbedit/Makefile.in
+++ b/src/mbedit/Makefile.in
@@ -79,8 +79,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = mbedit$(EXEEXT)
- at BUILD_GSF_TRUE@am__append_1 = -I at top_srcdir@/src/gsf
- at BUILD_GSF_TRUE@am__append_2 = -L$(top_builddir)/src/gsf
 subdir = src/mbedit
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -195,8 +193,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -211,7 +207,7 @@ LIBS = $(top_builddir)/src/mbio/libmbio.la \
        $(top_builddir)/src/mbaux/libmbaux.la \
        $(top_builddir)/src/mbaux/libmbxgr.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} \
+       ${libmotif_LIBS} \
        $(LIBM)
 
 LIBTOOL = @LIBTOOL@
@@ -219,6 +215,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -282,19 +279,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -307,8 +311,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -323,9 +325,13 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	${libnetcdf_CPPFLAGS} ${motif_CPPFLAGS} $(am__append_1)
-AM_LDFLAGS = $(am__append_2)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
+	      ${libnetcdf_CPPFLAGS} \
+	      ${libmotif_CPPFLAGS}
+
+AM_LDFLAGS = -L$(top_builddir)/src/gsf
 mbedit_SOURCES = mbedit.c mbedit_bxutils.c mbedit_callbacks.c mbedit_creation.c mbedit_prog.c mbedit_creation.h mbedit.h
 all: all-am
 
diff --git a/src/mbedit/Makefile.template b/src/mbedit/Makefile.template
deleted file mode 100644
index c634d4f..0000000
--- a/src/mbedit/Makefile.template
+++ /dev/null
@@ -1,91 +0,0 @@
-#     The MB-system:	Makefile.template  8/2/94
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 1993-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbedit directory level
-# Author:	D. W. Caress
-# Date:		August 2, 1994
-#
-# $Log: Makefile.template,v $#
-#
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of Motif include files:
-MOTIFINCDIR = /usr/include/Xm
-MOTIFLIBS = -lXm -lXt -lX11
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -O2 -DSUN
-LFLAGS = -lm
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the executable and man page
-all: $(BINDIR)/mbedit
-
-### link the executable
-$(BINDIR)/mbedit: mbedit.o mbedit_prog.o \
-		$(LIBDIR)/libmbio.a \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbps.a \
-		$(LIBDIR)/libmbxgr.a \
-		mbedit_callbacks.o \
-		mbedit_creation.o mbedit_bxutils.o
-	$(CC) $(CFLAGS) mbedit.o mbedit_prog.o \
-		$(LIBDIR)/libmbio.a \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbps.a \
-		$(LIBDIR)/libmbxgr.a \
-		mbedit_callbacks.o \
-		mbedit_creation.o mbedit_bxutils.o \
-		$(MOTIFLIBS) $(LFLAGS) -o $(BINDIR)/mbedit
-
-### compile the source files
-mbedit.o: mbedit.c mbedit.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbedit.c
-mbedit_creation.o: mbedit_creation.c
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbedit_creation.c
-mbedit_bxutils.o: mbedit_bxutils.c
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbedit_bxutils.c
-mbedit_prog.o: mbedit_prog.c mbedit.h  ../mbio/mb_format.h \
-		../mbio/mb_io.h ../mbio/mb_status.h ../mbio/mb_define.h \
-                ../mbaux/mb_xgraphics.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -I$(MOTIFINCDIR) -c mbedit_prog.c
-mbedit_callbacks.o: mbedit_callbacks.c mbedit.h  ../mbio/mb_format.h \
-		../mbio/mb_io.h ../mbio/mb_status.h ../mbio/mb_define.h \
-                ../mbaux/mb_xgraphics.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -I$(MOTIFINCDIR) -I$(MOTIFINCDIR) -c mbedit_callbacks.c
-
-clean:
-	rm -f core *.o
diff --git a/src/mbedit/mbedit.c b/src/mbedit/mbedit.c
index 069f782..7101202 100644
--- a/src/mbedit/mbedit.c
+++ b/src/mbedit/mbedit.c
@@ -93,7 +93,7 @@ int main( int argc, char **argv)
      * Initialize Xt.
      */
 
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
 
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbedit/mbedit.h b/src/mbedit/mbedit.h
index 7a6ec29..cac1dc9 100644
--- a/src/mbedit/mbedit.h
+++ b/src/mbedit/mbedit.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbedit.h	10/14/2009
- *    $Id: mbedit.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbedit.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2009-2014 by
+ *    Copyright (c) 2009-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -380,11 +380,11 @@ int mbedit_action_filter_all(
 int mbedit_filter_ping(int iping);
 int mbedit_get_format(char *file, int *form);
 int mbedit_open_file(char *file, int form, int savemode);
-int mbedit_close_file();
+int mbedit_close_file(void);
 int mbedit_dump_data(int hold_size, int *ndumped, int *nbuffer);
 int mbedit_load_data(int buffer_size,
 		int *nloaded, int *nbuffer, int *ngood, int *icurrent);
-int mbedit_clear_screen();
+int mbedit_clear_screen(void);
 int mbedit_plot_all(
 		int	plwd,
 		int	exgr,
@@ -399,10 +399,10 @@ int mbedit_plot_all(
 int mbedit_plot_beam(int iping, int jbeam);
 int mbedit_plot_ping(int iping);
 int mbedit_plot_ping_label(int iping, int save);
-int mbedit_plot_info();
+int mbedit_plot_info(void);
 int mbedit_unplot_beam(int iping, int jbeam);
 int mbedit_unplot_ping(int iping);
-int mbedit_unplot_info();
+int mbedit_unplot_info(void);
 int mbedit_action_goto(
 		int	ttime_i[7],
 		int	hold_size,
@@ -427,11 +427,13 @@ int mbedit_tsminmax(int iping, int nping, int data_id, double *tsmin, double *ts
 int mbedit_xtrackslope(int iping, double *slope);
 
 void do_mbedit_init(int argc, char **argv);
-void do_editlistselection( Widget w, XtPointer client_data, XtPointer call_data);
 void do_parse_datalist( char *file, int form);
-int do_setup_data();
-void do_build_filelist();
-void do_get_filters();
+void do_editlistselection( Widget w, XtPointer client_data, XtPointer call_data);
+void do_filelist_remove( Widget w, XtPointer client_data, XtPointer call_data);
+void do_load_specific_file(int i_file);
+int do_setup_data(void);
+void do_build_filelist(void);
+void do_get_filters(void);
 void do_file_selection_cancel( Widget w, XtPointer client_data, XtPointer call_data);
 void do_expose( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mode_toggle( Widget w, XtPointer client_data, XtPointer call_data);
@@ -446,18 +448,23 @@ void do_scale_x( Widget w, XtPointer client_data, XtPointer call_data);
 int do_reset_scale_x(int pwidth, int maxx, int xntrvl, int yntrvl);
 void do_output_edit( Widget w, XtPointer client_data, XtPointer call_data);
 void do_output_browse( Widget w, XtPointer client_data, XtPointer call_data);
+void do_output_edit_filelist( Widget w, XtPointer client_data, XtPointer call_data);
+void do_output_browse_filelist( Widget w, XtPointer client_data, XtPointer call_data);
 void do_x_interval( Widget w, XtPointer client_data, XtPointer call_data);
 void do_y_interval( Widget w, XtPointer client_data, XtPointer call_data);
 void do_load(int save_mode);
+void do_load_ok( Widget w, XtPointer client_data, XtPointer call_data);
+void do_load_ok_with_save( Widget w, XtPointer client_data, XtPointer call_data);
 void do_load_check( Widget w, XtPointer client_data, XtPointer call_data);
-void do_load_specific_file(int i_file);
-void do_checkuseprevious( );
-void do_filebutton_on();
-void do_filebutton_off();
-void do_nextbutton_on();
-void do_nextbutton_off();
+void do_checkuseprevious(void);
+void do_filebutton_on(void);
+void do_filebutton_off(void);
+void do_nextbutton_on(void);
+void do_nextbutton_off(void);
+void do_end( Widget w, XtPointer client_data, XtPointer call_data);
 void do_forward( Widget w, XtPointer client_data, XtPointer call_data);
 void do_reverse( Widget w, XtPointer client_data, XtPointer call_data);
+void do_start( Widget w, XtPointer client_data, XtPointer call_data);
 void do_quit( Widget w, XtPointer client_data, XtPointer call_data);
 void do_event( Widget w, XtPointer client_data, XtPointer call_data);
 void do_flag_view( Widget w, XtPointer client_data, XtPointer call_data);
@@ -470,7 +477,9 @@ void do_view_mode( Widget w, XtPointer client_data, XtPointer call_data);
 void do_show_time( Widget w, XtPointer client_data, XtPointer call_data);
 void do_reverse_mouse( Widget w, XtPointer client_data, XtPointer call_data);
 void do_reverse_keys( Widget w, XtPointer client_data, XtPointer call_data);
+void do_show_flags( Widget w, XtPointer client_data, XtPointer call_data);
 void do_show_detects( Widget w, XtPointer client_data, XtPointer call_data);
+void do_show_pulsetypes( Widget w, XtPointer client_data, XtPointer call_data);
 void do_buffer_hold( Widget w, XtPointer client_data, XtPointer call_data);
 void do_buffer_size( Widget w, XtPointer client_data, XtPointer call_data);
 void do_done( Widget w, XtPointer client_data, XtPointer call_data);
@@ -481,15 +490,18 @@ void do_reset_filters( Widget w, XtPointer client_data, XtPointer call_data);
 void do_check_median_xtrack( Widget w, XtPointer client_data, XtPointer call_data);
 void do_check_median_ltrack( Widget w, XtPointer client_data, XtPointer call_data);
 int do_wait_until_viewed(XtAppContext app);
-int do_mbedit_settimer();
+int do_mbedit_settimer(void);
 int do_mbedit_workfunction(XtPointer client_data);
 int do_message_on(char *message);
-int do_message_off();
+int do_message_off(void);
 int do_error_dialog(char *s1, char *s2, char *s3);
 void set_label_string(Widget w, String str);
 void set_label_multiline_string(Widget w, String str);
 void get_text_string(Widget w, String str);
 
-XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
 
 /*--------------------------------------------------------------------*/
diff --git a/src/mbedit/mbedit_callbacks.c b/src/mbedit/mbedit_callbacks.c
index efd1b3d..40f2182 100644
--- a/src/mbedit/mbedit_callbacks.c
+++ b/src/mbedit/mbedit_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbedit_callbacks.c	3/28/97
- *    $Id: mbedit_callbacks.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -19,123 +19,6 @@
  * the Builder Xsessory package by ICS.  This file contains
  * the callbacks generated by BX.
  *
- * Author:	D. W. Caress
- * Date:	April 8, 1993
- * Date:	March 28, 1997  GUI recast
- *
- * $Log: mbedit_callbacks.c,v $
- * Revision 5.22  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.21  2008/07/19 07:28:06  caress
- * Fixed scaling for swath widths less than 6 m.
- *
- * Revision 5.20  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.19  2006/08/09 22:35:32  caress
- * A new edit mode called "grab" has been added to MBedit. In this
- * mode, the user drags a rectangle on the ping display. When the mouse
- * is released, all unflagged beams within that rectangle are flagged.
- *
- * Revision 5.18  2006/08/04 03:56:41  caress
- * Working towards 5.1.0 release.
- *
- * Revision 5.17  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.16  2006/02/08 16:57:36  caress
- * Added #ifdef to let user build mbedit to use orange instead of red.
- *
- * Revision 5.15  2006/01/24 19:12:42  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.14  2005/03/25 04:12:23  caress
- * MBedit now allows alongtrack and acrosstrack views as well as the traditional waterfall display of profiles.
- *
- * Revision 5.13  2004/12/02 06:31:02  caress
- * First cut at adding stacked views from along and across track.
- *
- * Revision 5.12  2004/05/21 23:26:04  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.11  2004/02/25 20:48:58  caress
- * Release 5.0.3
- *
- * Revision 5.10  2003/04/17 20:50:01  caress
- * Release 5.0.beta30
- *
- * Revision 5.9  2003/04/17 20:45:42  caress
- * Release 5.0.beta30
- *
- * Revision 5.8  2002/08/30 19:28:21  caress
- * Added time series style plots.
- *
- * Revision 5.7  2002/07/20 20:45:04  caress
- * Release 5.0.beta20
- *
- * Revision 5.6  2001/11/16 01:25:20  caress
- * Added info mode.
- *
- * Revision 5.5  2001/09/17  17:00:48  caress
- * Added local median filter, angle filter, time display toggle.
- *
- * Revision 5.4  2001/07/31  00:40:17  caress
- * Added flagging by beam number and acrosstrack distance.
- *
- * Revision 5.3  2001/07/20  00:30:32  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/06/30  17:39:31  caress
- * Release 5.0.beta02
- *
- * Revision 5.1  2001/01/22  07:40:13  caress
- * Version 5.0.0beta01
- *
- * Revision 5.0  2000/12/01  22:54:35  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:01:50  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  06:56:36  caress
- * Snapshot for Dale.
- * New version integrated with mbprocess.
- *
- * Revision 4.9  2000/09/08  00:29:20  caress
- * Revision of 7 September 2000.
- *
- * Revision 4.8  2000/03/16  00:35:40  caress
- * Added mode to output edit save file only.
- *
- * Revision 4.7  2000/01/25  01:46:20  caress
- * Altered handling of filenames.
- *
- * Revision 4.6  2000/01/20  00:05:38  caress
- * Added pick mode and two unflag buttons.
- *
- * Revision 4.5  1999/09/15  21:02:07  caress
- * Version label now set from mb_format.h
- *
- * Revision 4.4  1999/07/16  19:21:16  caress
- * Smaller window with new dialogs for Linux.
- *
- * Revision 4.3  1998/10/05 17:45:32  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/09/15  19:06:10  caress
- * Real Version 4.5
- *
- * Revision 4.1  1997/04/22  19:26:36  caress
- * Fixed startup mode.
- *
- * Revision 4.0  1997/04/21  16:57:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1997/04/16  21:31:04  caress
- * Complete rewrite without uid file.
- *
  *
  */
 /*
@@ -183,6 +66,10 @@
 #include "mb_xgraphics.h"
 #include "mbedit.h"
 
+#ifndef FIXED
+#define FIXED "fixed"
+#endif
+
 /*
  * Macros to make code look nicer between ANSI and K&R.
  */
@@ -212,17 +99,19 @@
 Widget		BxFindTopShell PROTOTYPE((Widget));
 WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
 
-void do_fileselection_list();
-
 /*--------------------------------------------------------------------*/
 
+/* id variables */
+static char svn_id[] = "$Id: mbedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
+static char program_name[] = "MBedit";
+
 /* additional widgets */
 Widget	fileSelectionList;
 Widget	fileSelectionText;
 
 /* global defines and variables */
 #define EV_MASK (ButtonPressMask | KeyPressMask | KeyReleaseMask | ExposureMask )
-#define xgfont "-misc-fixed-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
+#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
 
 /* Mode value defines */
 #define	MODE_TOGGLE	0
@@ -526,8 +415,14 @@ do_mbedit_init(int argc, char **argv)
 	     | GCLineWidth, &xgcv);
 
     /* Setup the font for just the "canvas" screen. */
-    fontStruct = XLoadQueryFont(theDisplay,
-	     "-misc-fixed-bold-r-normal-*-13-*-75-75-c-70-iso8859-1");
+    fontStruct = XLoadQueryFont(theDisplay, xgfont);
+    if (fontStruct == NULL)
+        {
+	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
+        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
+	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+	exit(-1);
+        }
     XSetFont(theDisplay,gc,fontStruct->fid);
 
     XSelectInput(theDisplay, can_xid, EV_MASK );
@@ -597,6 +492,7 @@ do_mbedit_init(int argc, char **argv)
 
     /* finally allow expose plots */
     expose_plot_ok = True;
+    
 }
 
 /*--------------------------------------------------------------------*/
@@ -2054,6 +1950,7 @@ do_event( Widget w, XtPointer client_data, XtPointer call_data)
     unsigned int mask_return;
     int doit;
     int	grab_mode;
+    time_t start_time_t;
 
     /* check for data file loaded at startup */
     if (startup_file)
@@ -2086,6 +1983,44 @@ do_event( Widget w, XtPointer client_data, XtPointer call_data)
       /* process events */
       switch (buffer[0])
 	    {
+	    case 'F':
+	    case 'f':
+                    if (key_g_down == 0)
+                        {
+                        status = mbedit_action_step(step,mplot_width,mexager,
+                                        mx_interval,my_interval,
+                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                        &nbuffer,&ngood,&icurrent,&mnplot);
+                        if (status == 0) XBell(theDisplay,100);
+                        }
+                    else
+                        {
+                        status = mbedit_action_step(nbuffer-icurrent-1,mplot_width,mexager,
+                                        mx_interval,my_interval,
+                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                        &nbuffer,&ngood,&icurrent,&mnplot);
+                        if (status == 0) XBell(theDisplay,100);
+                        }
+                    break;
+	    case 'V':
+	    case 'v':
+                    if (key_g_down == 0)
+                       {
+                           status = mbedit_action_step(-step,mplot_width,mexager,
+                                           mx_interval,my_interval,
+                                           mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                           &nbuffer,&ngood,&icurrent,&mnplot);
+                           if (status == 0) XBell(theDisplay,100);
+                       }
+                    else
+                       {
+                           status = mbedit_action_step(-icurrent,mplot_width,mexager,
+                                           mx_interval,my_interval,
+                                           mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                           &nbuffer,&ngood,&icurrent,&mnplot);
+                           if (status == 0) XBell(theDisplay,100);
+                       }
+ 		    break;
 	    case 'G':
 	    case 'g':
 		    key_g_down = 1;
@@ -2565,47 +2500,82 @@ do_event( Widget w, XtPointer client_data, XtPointer call_data)
 
 	    } /* end of left button events */
 
-	    /* If middle mouse button is pushed then scroll in reverse. */
-	    if(event->xbutton.button == 2)
+	/* If middle mouse button is pushed then scroll in reverse. */
+	if(event->xbutton.button == 2)
 	    {
-	    if (key_g_down == 0)
-	    	{
-		    status = mbedit_action_step(-step,mplot_width,mexager,
-				    mx_interval,my_interval,
-				    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-				    &nbuffer,&ngood,&icurrent,&mnplot);
-		    if (status == 0) XBell(theDisplay,100);
-		}
-	    else
-	    	{
-		    status = mbedit_action_step(-icurrent,mplot_width,mexager,
-				    mx_interval,my_interval,
-				    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-				    &nbuffer,&ngood,&icurrent,&mnplot);
-		    if (status == 0) XBell(theDisplay,100);
-		}
+            time(&start_time_t);
+	    doit = 1;
+	    while (doit)
+		{
+                if (doit == 1 || difftime(time(NULL), start_time_t) > 2.0)
+                    {
+                    if (key_g_down == 0)
+                        {
+                            status = mbedit_action_step(-step,mplot_width,mexager,
+                                            mx_interval,my_interval,
+                                            mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                            &nbuffer,&ngood,&icurrent,&mnplot);
+                            if (status == 0) XBell(theDisplay,100);
+                        }
+                    else
+                        {
+                            status = mbedit_action_step(-icurrent,mplot_width,mexager,
+                                            mx_interval,my_interval,
+                                            mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                            &nbuffer,&ngood,&icurrent,&mnplot);
+                            if (status == 0) XBell(theDisplay,100);
+                        }
+                    }
+
+		/* If a scroll button is still pressed then scroll again */
+		status = XQueryPointer(theDisplay,can_xid,
+                                        &root_return,&child_return,&root_x_return,
+                                        &root_y_return, &win_x, &win_y, &mask_return);
+		if (mask_return & 512)
+		    doit++;
+		else
+                    doit = 0;
+                }
 	    } /* end of middle button events */
 
-	    /* If right mouse button is pushed then scroll forward. */
-	  if ((event->xbutton.button == 3 && mode_reverse_mouse == MB_NO)
+	/* If right mouse button is pushed then scroll forward. */
+	if ((event->xbutton.button == 3 && mode_reverse_mouse == MB_NO)
 		|| (event->xbutton.button == 1 && mode_reverse_mouse == MB_YES))
 	    {
-	    if (key_g_down == 0)
-	    	{
-		    status = mbedit_action_step(step,mplot_width,mexager,
-				    mx_interval,my_interval,
-				    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-				    &nbuffer,&ngood,&icurrent,&mnplot);
-		    if (status == 0) XBell(theDisplay,100);
-		}
-	    else
-	    	{
-		    status = mbedit_action_step(nbuffer-icurrent-1,mplot_width,mexager,
-				    mx_interval,my_interval,
-				    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-				    &nbuffer,&ngood,&icurrent,&mnplot);
-		    if (status == 0) XBell(theDisplay,100);
-		}
+            time(&start_time_t);
+	    doit = 1;
+	    while (doit)
+		{
+                if (doit == 1 || difftime(time(NULL), start_time_t) > 2.0)
+                    {
+                    if (key_g_down == 0)
+                        {
+                        status = mbedit_action_step(step,mplot_width,mexager,
+                                        mx_interval,my_interval,
+                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                        &nbuffer,&ngood,&icurrent,&mnplot);
+                        if (status == 0) XBell(theDisplay,100);
+                        }
+                    else
+                        {
+                        status = mbedit_action_step(nbuffer-icurrent-1,mplot_width,mexager,
+                                        mx_interval,my_interval,
+                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
+                                        &nbuffer,&ngood,&icurrent,&mnplot);
+                        if (status == 0) XBell(theDisplay,100);
+                        }
+                    }
+
+		/* If a scroll button is still pressed then scroll again */
+		status = XQueryPointer(theDisplay,can_xid,
+                                        &root_return,&child_return,&root_x_return,
+                                        &root_y_return, &win_x, &win_y, &mask_return);
+		if ((mode_reverse_mouse == MB_YES && (mask_return & 256))
+                    || (mode_reverse_mouse == MB_NO && (mask_return & 1024)))
+		    doit++;
+		else
+                    doit = 0;
+               }
 	    } /* end of right button events */
       } /* end of button pressed events */
     } /* end of inputs from window */
diff --git a/src/mbedit/mbedit_creation.c b/src/mbedit/mbedit_creation.c
index 48245b1..95c3878 100644
--- a/src/mbedit/mbedit_creation.c
+++ b/src/mbedit/mbedit_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
@@ -322,7 +333,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 41); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_file = XmCreateCascadeButton(menuBar_file,
             (char *)"cascadeButton_file",
@@ -355,7 +366,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_file = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_file",
@@ -386,7 +397,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_filelist",
@@ -418,7 +429,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_end = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_end",
@@ -446,7 +457,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_start = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_start",
@@ -474,7 +485,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_flag_view = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_flag_view",
@@ -514,7 +525,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 48); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_view = XmCreateCascadeButton(menuBar_view,
             (char *)"cascadeButton_view",
@@ -547,7 +558,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_view_waterfall = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_view_waterfall",
@@ -571,7 +582,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_view_alongtrack = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_view_alongtrack",
@@ -595,7 +606,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_view_acrosstrack = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_view_acrosstrack",
@@ -627,7 +638,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_flagged_on = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_flagged_on",
@@ -659,7 +670,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_flags = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_flags",
@@ -684,7 +695,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_detects = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_detects",
@@ -709,7 +720,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_pulsetypes = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_pulsetypes",
@@ -741,7 +752,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_wideplot = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_wideplot",
@@ -766,7 +777,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_time = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_time",
@@ -790,7 +801,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_interval = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_interval",
@@ -814,7 +825,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_lon = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_lon",
@@ -838,7 +849,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_latitude = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_latitude",
@@ -863,7 +874,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_heading = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_heading",
@@ -887,7 +898,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_speed = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_speed",
@@ -911,7 +922,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_depth = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_depth",
@@ -935,7 +946,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_altitude = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_altitude",
@@ -959,7 +970,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_sonardepth = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_sonardepth",
@@ -983,7 +994,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_roll = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_roll",
@@ -1007,7 +1018,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_pitch = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_pitch",
@@ -1031,7 +1042,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_show_heave = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_show_heave",
@@ -1063,7 +1074,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_unflag_all = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_unflag_all",
@@ -1091,7 +1102,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_unflag_view = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_unflag_view",
@@ -1130,7 +1141,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_controls = XmCreateCascadeButton(menuBar_controls,
             (char *)"cascadeButton_controls",
@@ -1163,7 +1174,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_goto = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_goto",
@@ -1187,7 +1198,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_buffer = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_buffer",
@@ -1211,7 +1222,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_annotation = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_annotation",
@@ -1235,7 +1246,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filters = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_filters",
@@ -1267,7 +1278,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_reverse_keys = XmCreateToggleButton(pulldownMenu_controls,
             (char *)"toggleButton_reverse_keys",
@@ -1292,7 +1303,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_reverse_mouse = XmCreateToggleButton(pulldownMenu_controls,
             (char *)"toggleButton_reverse_mouse",
@@ -1324,7 +1335,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_about = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_about",
@@ -1352,7 +1363,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_next = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_next",
@@ -1380,7 +1391,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_done = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_done",
@@ -1408,7 +1419,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_forward = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_forward",
@@ -1436,7 +1447,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_reverse = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_reverse",
@@ -1464,7 +1475,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_quit = XmCreatePushButton(controls_mbedit,
             (char *)"pushButton_quit",
@@ -1492,7 +1503,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_scale_x_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_scale_x_label",
@@ -1521,7 +1532,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 260); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_scale_x = XmCreateScale(controls_mbedit,
         (char *)"slider_scale_x",
@@ -1543,7 +1554,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 60); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_scale_x_max_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_scale_x_max_label",
@@ -1570,7 +1581,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 90); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_scale_y_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_scale_y_label",
@@ -1600,7 +1611,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 260); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_scale_y = XmCreateScale(controls_mbedit,
         (char *)"slider_scale_y",
@@ -1622,7 +1633,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_scale_y_max_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_scale_y_max_label",
@@ -1649,7 +1660,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_number_pings_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_number_pings_label",
@@ -1678,7 +1689,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 290); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_number_pings = XmCreateScale(controls_mbedit,
         (char *)"slider_number_pings",
@@ -1700,7 +1711,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_num_pings_max_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_num_pings_max_label",
@@ -1727,7 +1738,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 90); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_number_step_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_number_step_label",
@@ -1756,7 +1767,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 290); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_number_step = XmCreateScale(controls_mbedit,
         (char *)"slider_number_step",
@@ -1778,7 +1789,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_number_max_step_label = XmCreateLabel(controls_mbedit,
             (char *)"slider_number_max_step_label",
@@ -1805,7 +1816,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_mode_label = XmCreateLabel(controls_mbedit,
             (char *)"setting_mode_label",
@@ -1846,7 +1857,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 75); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_mode_toggle_toggle = XmCreateToggleButton(setting_mode,
             (char *)"setting_mode_toggle_toggle",
@@ -1870,7 +1881,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_mode_toggle_pick = XmCreateToggleButton(setting_mode,
             (char *)"setting_mode_toggle_pick",
@@ -1894,7 +1905,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_mode_toggle_erase = XmCreateToggleButton(setting_mode,
             (char *)"setting_mode_toggle_erase",
@@ -1918,7 +1929,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_mode_toggle_restore = XmCreateToggleButton(setting_mode,
             (char *)"setting_mode_toggle_restore",
@@ -1944,7 +1955,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 62); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_mode_toggle_grab = XmCreateToggleButton(setting_mode,
             (char *)"setting_mode_toggle_grab",
@@ -1970,7 +1981,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 54); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_mode_toggle_info = XmCreateToggleButton(setting_mode,
             (char *)"setting_mode_toggle_info",
@@ -2054,7 +2065,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 430); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         textfield_format_label = XmCreateLabel(bulletinBoard_file,
             (char *)"textfield_format_label",
@@ -2077,7 +2088,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNy, 420); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textfield_format = XmCreateTextField(bulletinBoard_file,
         (char *)"textfield_format",
@@ -2096,7 +2107,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNx, 210); ac++;
         XtSetArg(args[ac], XmNy, 430); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_output_label = XmCreateLabel(bulletinBoard_file,
             (char *)"setting_output_label",
@@ -2137,7 +2148,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 116); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_output, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_output_toggle_edit = XmCreateToggleButton(setting_output,
             (char *)"setting_output_toggle_edit",
@@ -2161,7 +2172,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_output, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_output_toggle_browse = XmCreateToggleButton(setting_output,
             (char *)"setting_output_toggle_browse",
@@ -2205,7 +2216,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNx, 90); ac++;
     XtSetArg(args[ac], XmNy, 90); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textfield_day = XmCreateTextField(bulletinBoard_goto,
         (char *)"textfield_day",
@@ -2225,7 +2236,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 75); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         button_goto_cancel = XmCreatePushButton(bulletinBoard_goto,
             (char *)"button_goto_cancel",
@@ -2253,7 +2264,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 75); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         button_goto_apply = XmCreatePushButton(bulletinBoard_goto,
             (char *)"button_goto_apply",
@@ -2276,7 +2287,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNx, 90); ac++;
     XtSetArg(args[ac], XmNy, 210); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textfield_second = XmCreateTextField(bulletinBoard_goto,
         (char *)"textfield_second",
@@ -2290,7 +2301,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNx, 90); ac++;
     XtSetArg(args[ac], XmNy, 170); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textfield_minute = XmCreateTextField(bulletinBoard_goto,
         (char *)"textfield_minute",
@@ -2304,7 +2315,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNx, 90); ac++;
     XtSetArg(args[ac], XmNy, 130); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textfield_hour = XmCreateTextField(bulletinBoard_goto,
         (char *)"textfield_hour",
@@ -2318,7 +2329,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNx, 90); ac++;
     XtSetArg(args[ac], XmNy, 50); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textfield_month = XmCreateTextField(bulletinBoard_goto,
         (char *)"textfield_month",
@@ -2332,7 +2343,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNx, 90); ac++;
     XtSetArg(args[ac], XmNy, 10); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textfield_year = XmCreateTextField(bulletinBoard_goto,
         (char *)"textfield_year",
@@ -2352,7 +2363,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 210); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         textfield_second_label = XmCreateLabel(bulletinBoard_goto,
             (char *)"textfield_second_label",
@@ -2379,7 +2390,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 170); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         textfield_minute_label = XmCreateLabel(bulletinBoard_goto,
             (char *)"textfield_minute_label",
@@ -2406,7 +2417,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 130); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         textfield_hour_label = XmCreateLabel(bulletinBoard_goto,
             (char *)"textfield_hour_label",
@@ -2434,7 +2445,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 40); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         textfield_day_label = XmCreateLabel(bulletinBoard_goto,
             (char *)"textfield_day_label",
@@ -2461,7 +2472,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 50); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         textfield_month_label = XmCreateLabel(bulletinBoard_goto,
             (char *)"textfield_month_label",
@@ -2488,7 +2499,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         textfield_year_label = XmCreateLabel(bulletinBoard_goto,
             (char *)"textfield_year_label",
@@ -2533,7 +2544,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 260); ac++;
@@ -2571,7 +2582,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 190); ac++;
         XtSetArg(args[ac], XmNy, 410); ac++;
@@ -2599,7 +2610,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 240); ac++;
@@ -2626,7 +2637,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 250); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -2653,7 +2664,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 60); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -2680,7 +2691,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 120); ac++;
@@ -2707,7 +2718,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 160); ac++;
@@ -2734,7 +2745,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 90); ac++;
@@ -2761,7 +2772,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 190); ac++;
@@ -2799,7 +2810,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -2827,7 +2838,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 40); ac++;
@@ -2854,7 +2865,7 @@ Createwindow_mbedit(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -2911,7 +2922,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 360); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_pleasewait = XmCreateLabel(bulletinBoard_message,
             (char *)"label_pleasewait",
@@ -2940,7 +2951,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 480); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_message = XmCreateLabel(bulletinBoard_message,
             (char *)"label_message",
@@ -2991,7 +3002,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 410); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_editsave_one = XmCreateLabel(bulletinBoard_editsave,
             (char *)"label_editsave_one",
@@ -3019,7 +3030,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 410); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_editsave_two = XmCreateLabel(bulletinBoard_editsave,
             (char *)"label_editsave_two",
@@ -3046,7 +3057,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_editsave_no = XmCreatePushButton(bulletinBoard_editsave,
             (char *)"pushButton_editsave_no",
@@ -3074,7 +3085,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_editsave_yes = XmCreatePushButton(bulletinBoard_editsave,
             (char *)"pushButton_editsave_yes",
@@ -3125,7 +3136,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_two = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_two",
@@ -3153,7 +3164,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_one = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_one",
@@ -3181,7 +3192,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_three = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_three",
@@ -3208,7 +3219,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_error = XmCreatePushButton(bulletinBoard_error,
             (char *)"pushButton_error",
@@ -3256,7 +3267,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 67); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_buffer_dismiss = XmCreatePushButton(bulletinBoard_buffer,
             (char *)"pushButton_buffer_dismiss",
@@ -3285,7 +3296,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_buffer_hold_max_label = XmCreateLabel(bulletinBoard_buffer,
             (char *)"slider_buffer_hold_max_label",
@@ -3314,7 +3325,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 260); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_buffer, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_buffer_hold = XmCreateScale(bulletinBoard_buffer,
         (char *)"slider_buffer_hold",
@@ -3335,7 +3346,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 70); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_buffer_hold_label = XmCreateLabel(bulletinBoard_buffer,
             (char *)"slider_buffer_hold_label",
@@ -3363,7 +3374,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_buffer_size_max_label = XmCreateLabel(bulletinBoard_buffer,
             (char *)"slider_buffer_size_max_label",
@@ -3392,7 +3403,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 260); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_buffer, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_buffer_size = XmCreateScale(bulletinBoard_buffer,
         (char *)"slider_buffer_size",
@@ -3414,7 +3425,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 170); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_buffer_size_label = XmCreateLabel(bulletinBoard_buffer,
             (char *)"slider_buffer_size_label",
@@ -3474,7 +3485,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 67); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_annotation_dismiss = XmCreatePushButton(bulletinBoard_annotation,
             (char *)"pushButton_annotation_dismiss",
@@ -3502,7 +3513,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 15); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_y_max_interval_label = XmCreateLabel(bulletinBoard_annotation,
             (char *)"slider_y_max_interval_label",
@@ -3531,7 +3542,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 250); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_y_interval = XmCreateScale(bulletinBoard_annotation,
         (char *)"slider_y_interval",
@@ -3552,7 +3563,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 60); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_y_interval_label = XmCreateLabel(bulletinBoard_annotation,
             (char *)"slider_y_interval_label",
@@ -3580,7 +3591,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_x_max_interval_label = XmCreateLabel(bulletinBoard_annotation,
             (char *)"slider_x_max_interval_label",
@@ -3609,7 +3620,7 @@ Createwindow_mbedit(Widget parent)
     XtSetArg(args[ac], XmNwidth, 250); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_x_interval = XmCreateScale(bulletinBoard_annotation,
         (char *)"slider_x_interval",
@@ -3630,7 +3641,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_x_interval_label = XmCreateLabel(bulletinBoard_annotation,
             (char *)"slider_x_interval_label",
@@ -3720,7 +3731,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_median_local_ltrack = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_median_local_ltrack",
@@ -3754,7 +3765,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_median_local_xtrack = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_median_local_xtrack",
@@ -3800,7 +3811,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_cutangleend = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_cutangleend",
@@ -3834,7 +3845,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_cutanglestart = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_cutanglestart",
@@ -3862,7 +3873,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_filters_cutangle = XmCreateToggleButton(bulletinBoard_scrollfilters,
             (char *)"toggleButton_filters_cutangle",
@@ -3907,7 +3918,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_cutdistanceend = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_cutdistanceend",
@@ -3941,7 +3952,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_cutdistancestart = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_cutdistancestart",
@@ -3969,7 +3980,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_filters_cutdistance = XmCreateToggleButton(bulletinBoard_scrollfilters,
             (char *)"toggleButton_filters_cutdistance",
@@ -4012,7 +4023,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_cutbeamend = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_cutbeamend",
@@ -4044,7 +4055,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_cutbeamstart = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_cutbeamstart",
@@ -4072,7 +4083,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_filters_cutbeam = XmCreateToggleButton(bulletinBoard_scrollfilters,
             (char *)"toggleButton_filters_cutbeam",
@@ -4115,7 +4126,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_wrongside = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_wrongside",
@@ -4143,7 +4154,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_filters_wrongside = XmCreateToggleButton(bulletinBoard_scrollfilters,
             (char *)"toggleButton_filters_wrongside",
@@ -4176,7 +4187,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_filters_medianspike = XmCreateScale(bulletinBoard_scrollfilters,
             (char *)"scale_filters_medianspike",
@@ -4204,7 +4215,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_filters_medianspike = XmCreateToggleButton(bulletinBoard_scrollfilters,
             (char *)"toggleButton_filters_medianspike",
@@ -4231,7 +4242,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_filters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filters_reset = XmCreatePushButton(bulletinBoard_filters,
             (char *)"pushButton_filters_reset",
@@ -4259,7 +4270,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_filters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filters_apply = XmCreatePushButton(bulletinBoard_filters,
             (char *)"pushButton_filters_apply",
@@ -4287,7 +4298,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_filters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filters_dismiss = XmCreatePushButton(bulletinBoard_filters,
             (char *)"pushButton_filters_dismiss",
@@ -4350,7 +4361,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 104); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist_remove = XmCreatePushButton(form_filelist,
             (char *)"pushButton_filelist_remove",
@@ -4379,7 +4390,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist_edit = XmCreatePushButton(form_filelist,
             (char *)"pushButton_filelist_edit",
@@ -4407,7 +4418,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_output_label_filelist = XmCreateLabel(form_filelist,
             (char *)"setting_output_label_filelist",
@@ -4448,7 +4459,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 116); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_output_toggle_edit_filelist = XmCreateToggleButton(setting_output_filelist,
             (char *)"setting_output_toggle_edit_filelist",
@@ -4473,7 +4484,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNwidth, 116); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_output_toggle_browse_filelist = XmCreateToggleButton(setting_output_filelist,
             (char *)"setting_output_toggle_browse_filelist",
@@ -4502,7 +4513,7 @@ Createwindow_mbedit(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist_dismiss = XmCreatePushButton(form_filelist,
             (char *)"pushButton_filelist_dismiss",
@@ -4532,7 +4543,7 @@ Createwindow_mbedit(Widget parent)
 
     ac = 0;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(scrolledWindow_filelist, (char *)"-*-courier-*-r-*-*-*-90-*-*-*-*-iso8859-1",
+        BX_CONVERT(scrolledWindow_filelist, (char *)"-*-"MONO"-*-r-*-*-*-90-*-*-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     XtSetArg(args[ac], XmNselectionPolicy, XmSINGLE_SELECT); ac++;
     XtSetArg(args[ac], XmNwidth, 339); ac++;
diff --git a/src/mbedit/mbedit_prog.c b/src/mbedit/mbedit_prog.c
index c1d1658..0c1317d 100644
--- a/src/mbedit/mbedit_prog.c
+++ b/src/mbedit/mbedit_prog.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbedit.c	4/8/93
- *    $Id: mbedit_prog.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbedit_prog.c 2252 2015-07-01 19:35:37Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -26,291 +26,6 @@
  * Date:	March 28, 1997  GUI recast
  * Date:	September 19, 2000 (New version - no buffered i/o)
  *
- * $Log: mbedit_prog.c,v $
- * Revision 5.39  2008/07/19 07:28:06  caress
- * Fixed scaling for swath widths less than 6 m.
- *
- * Revision 5.38  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.37  2008/01/14 17:49:48  caress
- * Fixed problem with speed data.
- *
- * Revision 5.36  2007/10/08 07:20:21  caress
- * Fixed vertical scaling of large numbers of pings. Augmented zap box function.
- *
- * Revision 5.35  2007/05/14 06:30:29  caress
- * The acrosstrack view of MBedit now shows the real alongtrack
- * positions of the soundings.
- *
- * Revision 5.34  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.33  2006/08/09 22:35:33  caress
- * A new edit mode called "grab" has been added to MBedit. In this
- * mode, the user drags a rectangle on the ping display. When the mouse
- * is released, all unflagged beams within that rectangle are flagged.
- *
- * Revision 5.32  2006/08/04 03:56:41  caress
- * Working towards 5.1.0 release.
- *
- * Revision 5.31  2006/07/06 05:30:57  caress
- * Working more towards 5.1.0beta
- *
- * Revision 5.30  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.29  2006/01/24 19:12:42  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.28  2006/01/20 19:36:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.27  2006/01/06 18:25:45  caress
- * Working towards 5.0.8
- *
- * Revision 5.26  2005/11/04 22:51:11  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.25  2005/03/25 04:12:24  caress
- * MBedit now allows alongtrack and acrosstrack views as well as the traditional waterfall display of profiles.
- *
- * Revision 5.24  2004/12/02 06:31:02  caress
- * First cut at adding stacked views from along and across track.
- *
- * Revision 5.23  2004/05/21 23:26:04  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.22  2003/07/30 16:39:32  caress
- * Fixed ping nulling (shift-! key macro).
- * Augmented patience window.
- *
- * Revision 5.22  2003/07/28 05:19:34  caress
- * Fixed label_message.
- *
- * Revision 5.21  2003/07/26 17:58:52  caress
- * Changed beamflag code.
- *
- * Revision 5.20  2003/04/17 20:50:01  caress
- * Release 5.0.beta30
- *
- * Revision 5.19  2003/04/17 20:45:42  caress
- * Release 5.0.beta30
- *
- * Revision 5.18  2003/03/10 19:57:07  caress
- * Added mr1pr library.
- *
- * Revision 5.17  2003/01/15 20:50:40  caress
- * Release 5.0.beta28
- *
- * Revision 5.16  2002/10/02 23:53:44  caress
- * Release 5.0.beta24
- *
- * Revision 5.15  2002/09/19 00:35:53  caress
- * Release 5.0.beta23
- *
- * Revision 5.14  2002/08/30 19:28:21  caress
- * Added time series style plots.
- *
- * Revision 5.13  2002/07/20 20:45:04  caress
- * Release 5.0.beta20
- *
- * Revision 5.12  2002/05/30 21:33:02  caress
- * Release 5.0.beta18
- *
- * Revision 5.11  2002/05/29 23:36:28  caress
- * Release 5.0.beta18
- *
- * Revision 5.10  2002/05/02 03:53:45  caress
- * Release 5.0.beta17
- *
- * Revision 5.9  2001/11/16 01:25:20  caress
- * Added info mode.
- *
- * Revision 5.8  2001/09/17  17:00:48  caress
- * Added local median filter, angle filter, time display toggle.
- *
- * Revision 5.7  2001/07/31  00:40:17  caress
- * Added flagging by beam number and acrosstrack distance.
- *
- * Revision 5.6  2001/07/20  00:30:32  caress
- * Release 5.0.beta03
- *
- * Revision 5.5  2001/06/30 17:39:31  caress
- * Release 5.0.beta02
- *
- * Revision 5.4  2001/03/22  21:06:55  caress
- * Trying to make release 5.0.beta0
- *
- * Revision 5.3  2001/01/23  01:17:34  caress
- * Removed some unused variable declarations.
- *
- * Revision 5.2  2001/01/22  07:40:13  caress
- * Version 5.0.0beta01
- *
- * Revision 5.1  2000/12/10  20:29:13  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:54:35  caress
- * First cut at Version 5.0.
- *
- * Revision 4.32  2000/10/11  01:01:50  caress
- * Convert to ANSI C
- *
- * Revision 4.31  2000/10/03  21:49:04  caress
- * Fixed handling of buffer.
- *
- * Revision 4.30  2000/09/30  06:56:36  caress
- * Snapshot for Dale.
- * New version integrated with mbprocess.
- *
- * Revision 4.29  2000/09/08  00:29:20  caress
- * Revision of 7 September 2000.
- *
- * Revision 4.28  2000/03/16  00:35:40  caress
- * Added mode to output edit save file only.
- *
- * Revision 4.27  2000/01/26  03:02:05  caress
- * Fixed bug in making output filename.
- *
- * Revision 4.26  2000/01/25  01:46:20  caress
- * Altered handling of filenames and edit save files.
- *
- * Revision 4.25  2000/01/20  00:05:38  caress
- * Added pick mode and two unflag buttons.
- *
- * Revision 4.24  1999/02/12  21:19:30  caress
- * Fixed buffer size handling.
- *
- * Revision 4.23  1999/02/04  23:52:20  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.22  1998/12/17  22:56:00  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.21  1998/10/28  21:31:56  caress
- * Fixed handling of data with variable numbers of beams.
- *
- * Revision 4.20  1998/10/05  17:45:32  caress
- * MB-System version 4.6beta
- *
- * Revision 4.19  1997/10/03  18:32:07  caress
- * Fixed problem with sort call.
- *
- * Revision 4.18  1997/09/15  19:06:10  caress
- * Real Version 4.5
- *
- * Revision 4.17  1997/07/25  14:42:55  caress
- * Version 4.5beta2
- *
- * Revision 4.16  1997/04/29  15:50:50  caress
- * Fixed autoscaling in case of no good data.
- *
- * Revision 4.15  1997/04/22  19:26:36  caress
- * Fixed startup mode.
- *
- * Revision 4.14  1997/04/21  16:56:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.14  1997/04/16  21:29:30  caress
- * Complete rewrite without uid file.
- *
- * Revision 4.13  1996/07/31  18:40:14  caress
- * The program now checks if the format being opened supports
- * sidescan - if it does support sidescan the maximum buffer
- * size is 1000 rather than 5000.
- *
- * Revision 4.12  1996/04/22  13:20:55  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.11  1996/04/17  23:11:09  caress
- * Fixed bug that caused display to reset to beginning of buffer
- * at inconvenient times.
- *
- * Revision 4.10  1996/04/05  15:25:11  caress
- * Fixed GUI mode so done means quit for real. Also changed done and
- * quit handling in browse mode so that the program doesn't read the
- * entire data file before closing it.
- *
- * Revision 4.9  1996/02/12  17:09:35  caress
- * Added autoscaling of acrosstrack distance when files
- * are first read and added -G argument to force done
- * events to be treated as quit events when mbedit is
- * started up by a GUI.
- *
- * Revision 4.8  1996/01/26  21:22:00  caress
- * Version 4.3 distribution.
- *
- * Revision 4.7  1995/09/28  18:03:05  caress
- * Improved handling of .mbxxx file suffix convention.
- *
- * Revision 4.6  1995/09/18  22:42:44  caress
- * I must have changed something!?
- *
- * Revision 4.5  1995/05/12  17:29:16  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.4  1995/03/15  14:12:23  caress
- * Added macro for zeroing data and made it possible to
- * hold down keyboard flagging keys.
- *
- * Revision 4.3  1995/03/06  19:40:49  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1995/02/14  19:16:04  caress
- * Improved widget handling, uses swath width rather than plot scale,
- * now handles default values properly.
- *
- * Revision 4.1  1994/11/24  01:52:07  caress
- * Now centers profiles based on bathymetry median value
- * rather than mean.
- *
- * Revision 4.0  1994/10/21  11:55:41  caress
- * Release V4.0
- *
- * Revision 1.1  1994/07/14  21:21:54  brockda
- * Initial revision
- *
- * Revision 4.2  1994/04/12  00:46:38  caress
- * Changed call to mb_buffer_close in accordance with change
- * in mb_buffer source code.  The parameter list now includes
- * mbio_ptr.
- *
- * Revision 4.1  1994/03/12  01:49:07  caress
- * Added declarations of ctime and/or getenv for compatability
- * with SGI compilers.
- *
- * Revision 5.0  1994/04/29  08:35 RCM
- * First cut at OPENLOOK to MOTIF conversion.
- *
- * Revision 4.0  1994/03/05  23:54:35  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:51:47  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/03/01  00:19:16  caress
- * First cut at new version.
- *
- * Revision 3.4  1993/11/03  19:40:34  caress
- * Changed scaling:
- *    x-scale has larger maximum.
- *    y-scale widget now sets vertical exageration instead
- *      of y-scale.
- *
- * Revision 3.3  1993/08/30  19:03:20  caress
- * Added Go To option.  Also added Erase and Restore edit modes.
- *
- * Revision 3.2  1993/08/17  00:28:52  caress
- * Version current as of 16 August 1993.
- *
- * Revision 3.1  1993/05/14  23:28:56  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/22  18:49:44  dale
- * Initial version
  *
  */
 
@@ -428,7 +143,7 @@ struct mbedit_ping_struct
 	};
 
 /* id variables */
-static char rcs_id[] = "$Id: mbedit_prog.c 2175 2014-03-18 23:03:39Z caress $";
+static char svn_id[] = "$Id: mbedit_prog.c 2252 2015-07-01 19:35:37Z caress $";
 static char program_name[] = "MBedit";
 static char help_message[] =
 "MBedit is an interactive editor used to identify and flag\n\
@@ -708,7 +423,7 @@ int mbedit_init(int argc, char ** argv, int *startup_file)
 	if (verbose == 1 || help)
 		{
 		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
+		fprintf(stderr,"Version %s\n",svn_id);
 		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
 		}
 
@@ -716,7 +431,7 @@ int mbedit_init(int argc, char ** argv, int *startup_file)
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Version %s\n",svn_id);
 		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
 		fprintf(stderr,"dbg2  Control Parameters:\n");
 		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
diff --git a/src/mbeditviz/Makefile.am b/src/mbeditviz/Makefile.am
index 4ef92cc..80beef8 100644
--- a/src/mbeditviz/Makefile.am
+++ b/src/mbeditviz/Makefile.am
@@ -7,12 +7,10 @@ AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	-I${top_srcdir}/src/mbview \
 	-I${top_srcdir}/src/mr1pr \
 	-I${top_srcdir}/src/surf \
+	-I${top_srcdir}/src/gsf \
 	${libgmt_CPPFLAGS} \
 	${libnetcdf_CPPFLAGS} \
-	${motif_CPPFLAGS} ${GL_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I at top_srcdir@/src/gsf
-endif
+	${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
 
 AM_LDFLAGS = 
 
@@ -20,8 +18,7 @@ mbeditviz_SOURCES = mbeditviz_main.c mbeditviz_callbacks.c mbeditviz_prog.c mbed
 mbeditviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
 		  ${top_builddir}/src/mbaux/libmbaux.la \
 		  ${top_builddir}/src/mbaux/libmbxgr.la \
-		  ${top_builddir}/src/mbaux/libmbps.la \
 		  ${top_builddir}/src/mbview/libmbview.la \
 		  ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		  ${motif_LIBS} ${GL_LIBS} \
+		  ${libmotif_LIBS} ${libopengl_LIBS} \
 		  $(LIBM)
diff --git a/src/mbeditviz/Makefile.in b/src/mbeditviz/Makefile.in
index a8b5a67..4efd876 100644
--- a/src/mbeditviz/Makefile.in
+++ b/src/mbeditviz/Makefile.in
@@ -79,7 +79,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = mbeditviz$(EXEEXT)
- at BUILD_GSF_TRUE@am__append_1 = -I at top_srcdir@/src/gsf
 subdir = src/mbeditviz
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -104,7 +103,6 @@ am__DEPENDENCIES_1 =
 mbeditviz_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
 	${top_builddir}/src/mbaux/libmbaux.la \
 	${top_builddir}/src/mbaux/libmbxgr.la \
-	${top_builddir}/src/mbaux/libmbps.la \
 	${top_builddir}/src/mbview/libmbview.la $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
@@ -202,8 +200,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -220,6 +216,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -283,19 +280,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -308,8 +312,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -324,20 +326,24 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	-I${top_srcdir}/src/mbview -I${top_srcdir}/src/mr1pr \
-	-I${top_srcdir}/src/surf ${libgmt_CPPFLAGS} \
-	${libnetcdf_CPPFLAGS} ${motif_CPPFLAGS} ${GL_CPPFLAGS} \
-	$(am__append_1)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+	-I${top_srcdir}/src/mbaux \
+	-I${top_srcdir}/src/mbview \
+	-I${top_srcdir}/src/mr1pr \
+	-I${top_srcdir}/src/surf \
+	-I${top_srcdir}/src/gsf \
+	${libgmt_CPPFLAGS} \
+	${libnetcdf_CPPFLAGS} \
+	${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
+
 AM_LDFLAGS = 
 mbeditviz_SOURCES = mbeditviz_main.c mbeditviz_callbacks.c mbeditviz_prog.c mbeditviz_creation.c
 mbeditviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
 		  ${top_builddir}/src/mbaux/libmbaux.la \
 		  ${top_builddir}/src/mbaux/libmbxgr.la \
-		  ${top_builddir}/src/mbaux/libmbps.la \
 		  ${top_builddir}/src/mbview/libmbview.la \
 		  ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		  ${motif_LIBS} ${GL_LIBS} \
+		  ${libmotif_LIBS} ${libopengl_LIBS} \
 		  $(LIBM)
 
 all: all-am
diff --git a/src/mbeditviz/Makefile.template b/src/mbeditviz/Makefile.template
deleted file mode 100644
index d87019c..0000000
--- a/src/mbeditviz/Makefile.template
+++ /dev/null
@@ -1,110 +0,0 @@
-#     The MB-system:	Makefile.template  7/27/2003
-#	$Id: Makefile.template 2063 2013-05-22 00:05:57Z caress $
-#
-#     Copyright (c) 2003-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbeditviz directory level
-# Author:	D. W. Caress
-# Date:		August 24, 2013
-#
-# $Log: Makefile.template,v $
-#
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of GMT libraries, binaries, and include files:
-GMTLIBDIR = /sw/lib
-GMTINCDIR = /sw/include
-NETCDFINCDIR = /sw/include
-#
-# Locations of Motif include files and libraries:
-MOTIFINCDIR = /sw/include
-MOTIFLIBS = -L/sw/lib -L/usr/X11R6/lib -lXm -lXt -lX11
-#
-# Locations of OpenGL libraries:
-OPENGLLIBS = -lGLU -lGL
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -I/usr/include/X11R6 -DDARWIN -DGMT3_3
-LFLAGS = -lm -L/usr/local/netcdf/lib -lnetcdf
-ARCHIVE = ar rcv
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the executable and man page
-all: $(BINDIR)/mbeditviz
-
-### make the library
-
-### link the executables
-$(BINDIR)/mbeditviz: mbeditviz_main.o \
-		mbeditviz_callbacks.o \
-		mbeditviz_prog.o \
-		mbeditviz_creation.o \
-		$(LIBDIR)/libmbview.a \
-		$(LIBDIR)/libmbio.a \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbps.a \
-		$(LIBDIR)/libmbxgr.a \
-		$(GSFLIB) \
-		$(GMTLIBDIR)/libgmt.a \
-		$(GMTLIBDIR)/libpsl.a
-	$(CC) $(CFLAGS) mbeditviz_main.o \
-		mbeditviz_callbacks.o \
-		mbeditviz_prog.o \
-		mbeditviz_creation.o \
-		$(LIBDIR)/libmbview.a \
-		$(LIBDIR)/libmbio.a \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbxgr.a \
-		$(GSFLIB) \
-		$(GMTLIBDIR)/libgmt.a \
-		$(GMTLIBDIR)/libpsl.a \
-		$(OPENGLLIBS) $(MOTIFLIBS) $(LFLAGS) -o $(BINDIR)/mbeditviz
-
-### compile the source files
-mbeditviz_creation.o: mbeditviz_creation.c mbeditviz_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbview -I$(MOTIFINCDIR) -c mbeditviz_creation.c
-mbeditviz_main.o: mbeditviz_main.c mbeditviz.h ../mbview/mbview.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbview -I$(MOTIFINCDIR) -c mbeditviz_main.c
-mbeditviz_callbacks.o: mbeditviz_callbacks.c mbeditviz.h ../mbview/mbview.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbview -I$(MOTIFINCDIR) -I$(NETCDFINCDIR) -I$(GMTINCDIR) -c mbeditviz_callbacks.c
-mbeditviz_prog.o: mbeditviz_prog.c mbeditviz.h ../mbview/mbview.h ../mbio/mb_define.h \
-        ../mbio/mb_status.h ../mbio/mb_format.h ../mbaux/mb_aux.h
-	$(CC) $(CFLAGS)  -DMBEDITVIZ_DECLARE_GLOBALS -I../mbio -I../mbview -I../mbaux -I$(MOTIFINCDIR) -I$(NETCDFINCDIR) -I$(GMTINCDIR) -c mbeditviz_prog.c
-
-## copy the include files to the include file directory
-
-### copy the man page to the man page directory
-
-clean:
-	rm -f *.o
diff --git a/src/mbeditviz/mbeditviz.h b/src/mbeditviz/mbeditviz.h
index 7a67535..e50e24f 100644
--- a/src/mbeditviz/mbeditviz.h
+++ b/src/mbeditviz/mbeditviz.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbeditviz.h		4/27/2007
- *    $Id: mbeditviz.h 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mbeditviz.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -254,13 +254,13 @@ void do_mbeditviz_regrid( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbeditviz_updategrid( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbeditviz_changecellsize( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbeditviz_gridparameters( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_viewgrid();
+void do_mbeditviz_viewgrid(void);
 int do_mbeditviz_mbview_dismiss_notify(size_t instance);
 void do_mbeditviz_deleteselected( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbeditviz_changeoutputmode( Widget w, XtPointer client_data, XtPointer call_data);
 int do_mbeditviz_opendata(char *input_file_ptr, int format);
-void do_mbeditviz_update_gui( );
-void do_mbeditviz_update_filelist( );
+void do_mbeditviz_update_gui(void);
+void do_mbeditviz_update_filelist(void);
 void do_mbeditviz_pickonepoint_notify(size_t instance);
 void do_mbeditviz_picktwopoint_notify(size_t instance);
 void do_mbeditviz_pickarea_notify(size_t instance);
@@ -270,13 +270,13 @@ void do_mbeditviz_pickroute_notify(size_t instance);
 void do_mbeditviz_picknav_notify(size_t instance);
 void do_mbeditviz_regrid_notify( Widget w, XtPointer client_data, XtPointer call_data);
 int do_mbeditviz_message_on(char *message);
-int do_mbeditviz_message_off();
+int do_mbeditviz_message_off(void);
 int do_error_dialog(char *s1, char *s2, char *s3);
 void set_label_string(Widget w, String str);
 void set_label_multiline_string(Widget w, String str);
 void get_text_string(Widget w, String str);
-int do_wait_until_viewed();
-int do_mbeditviz_settimer();
+int do_wait_until_viewed(void);
+int do_mbeditviz_settimer(void);
 int do_mbeditviz_workfunction(XtPointer client_data);
 
 int mbeditviz_init(int argc,char **argv);
@@ -301,17 +301,17 @@ int mbeditviz_bin_weight(double foot_a, double foot_b, double scale,
 		    double pcx, double pcy, double dx, double dy,
 		    double *px, double *py,
 		    double *weight, int *use);
-int mbeditviz_get_grid_bounds();
-int mbeditviz_setup_grid();
-int mbeditviz_project_soundings();
-int mbeditviz_make_grid();
+int mbeditviz_get_grid_bounds(void);
+int mbeditviz_setup_grid(void);
+int mbeditviz_project_soundings(void);
+int mbeditviz_make_grid(void);
 int mbeditviz_grid_beam(struct mbev_file_struct *file, struct mbev_ping_struct *ping, int ibeam, int beam_ok, int apply_now);
-int mbeditviz_make_grid_simple();
-int mbeditviz_destroy_grid();
+int mbeditviz_make_grid_simple(void);
+int mbeditviz_destroy_grid(void);
 int mbeditviz_selectregion(size_t instance);
 int mbeditviz_selectarea(size_t instance);
 int mbeditviz_selectnav(size_t instance);
-void mbeditviz_mb3dsoundings_dismiss();
+void mbeditviz_mb3dsoundings_dismiss(void);
 void mbeditviz_mb3dsoundings_edit(int ifile, int iping, int ibeam, char beamflag, int flush);
 void mbeditviz_mb3dsoundings_info(int ifile, int iping, int ibeam, char *infostring);
 void mbeditviz_mb3dsoundings_bias(double rollbias, double pitchbias, double headingbias, double timelag);
@@ -319,6 +319,13 @@ void mbeditviz_mb3dsoundings_biasapply(double rollbias, double pitchbias, double
 void mbeditviz_mb3dsoundings_colorsoundings(int color);
 int mb3dsoundings_set_biasapply_notify(int verbose, void (biasapply_notify)(double, double, double, double), int *error);
 
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void BxExitCB(Widget w, XtPointer client, XtPointer call);
+void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
+
 /* end this include */
 #endif
 
diff --git a/src/mbeditviz/mbeditviz_callbacks.c b/src/mbeditviz/mbeditviz_callbacks.c
index 39b621b..a62771c 100644
--- a/src/mbeditviz/mbeditviz_callbacks.c
+++ b/src/mbeditviz/mbeditviz_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbeditviz_callbacks.c		4/27/2007
- *    $Id: mbeditviz_callbacks.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mbeditviz_callbacks.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -48,9 +48,9 @@
 #include <string.h>
 #include <ctype.h>
 #include <math.h>
-
-/* GMT include files */
-#include "gmt.h"
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 
 /* MBIO include files */
 #include "mb_status.h"
@@ -58,22 +58,6 @@
 #include "mb_format.h"
 #include "mbsys_singlebeam.h"
 
-/* get NaN detector */
-#if defined(isnanf)
-#define check_fnan(x) isnanf((x))
-#elif defined(isnan)
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNANF == 1
-#define check_fnan(x) isnanf(x)
-extern int isnanf(float x);
-#elif HAVE_ISNAN == 1
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNAND == 1
-#define check_fnan(x) isnand((double)(x))
-#else
-#define check_fnan(x) ((x) != (x))
-#endif
-
 /* mbview include file */
 #include "mbview.h"
 #include "mbeditviz.h"
@@ -97,29 +81,6 @@ static Cardinal ac;
 static Arg      args[256];
 static char	value_text[MB_PATH_MAXLINE];
 
-/* function prototypes */
-void do_mbeditviz_update_gui();
-void do_mbeditviz_fileSelectionBox( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data);
-void get_text_string(Widget w, String str);
-void set_label_multiline_string(Widget w, String str);
-int do_mbeditviz_mbview_dismiss_notify(size_t instance);
-void do_mbeditviz_viewgrid();
-void do_mbeditviz_pickonepoint_notify(size_t instance);
-void do_mbeditviz_picktwopoint_notify(size_t instance);
-void do_mbeditviz_pickarea_notify(size_t instance);
-void do_mbeditviz_pickregion_notify(size_t instance);
-void do_mbeditviz_picksite_notify(size_t instance);
-void do_mbeditviz_pickroute_notify(size_t instance);
-void do_mbeditviz_picknav_notify(size_t instance);
-void do_mbeditviz_regrid_notify( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_gridparameters( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_changecellsize( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_updategrid( Widget w, XtPointer client_data, XtPointer call_data);
-
-XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-
 /*
  * Motif required Headers
  */
@@ -523,6 +484,8 @@ do_mbeditviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPoin
 {
 	char function_name[] = "do_mbeditviz_fileSelectionBox_openswath";
 	XmAnyCallbackStruct *acs;
+    XmString	tmp0;
+	Boolean	argok;
 	acs = (XmAnyCallbackStruct*)call_data;
 
 	/* print input debug statements */
@@ -537,8 +500,6 @@ do_mbeditviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPoin
 
 if (mbev_verbose > 0)
 fprintf(stderr,"do_mbeditviz_fileSelectionBox_openswath\n");
-        XmString	tmp0;
-	Boolean	argok;
 
 	/* set title to open swath data */
 	ac = 0;
diff --git a/src/mbeditviz/mbeditviz_creation.c b/src/mbeditviz/mbeditviz_creation.c
index 38030c1..f79c9df 100644
--- a/src/mbeditviz/mbeditviz_creation.c
+++ b/src/mbeditviz/mbeditviz_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
@@ -203,7 +214,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 41); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_file = XmCreateCascadeButton(menuBar_mbeditviz,
             (char *)"cascadeButton_file",
@@ -236,7 +247,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_openswath = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_openswath",
@@ -268,7 +279,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_quit = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_quit",
@@ -301,7 +312,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 72); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_options = XmCreateCascadeButton(menuBar_mbeditviz,
             (char *)"cascadeButton_options",
@@ -334,7 +345,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_options, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_options, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_updategrid = XmCreatePushButton(pulldownMenu_options,
             (char *)"pushButton_updategrid",
@@ -367,7 +378,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 47); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_help = XmCreateCascadeButton(menuBar_mbeditviz,
             (char *)"cascadeButton_help",
@@ -400,7 +411,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_help, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_help, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_help_about = XmCreatePushButton(pulldownMenu_help,
             (char *)"pushButton_help_about",
@@ -442,7 +453,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 210); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_status = XmCreateLabel(form_mbeditviz,
             (char *)"label_status",
@@ -478,7 +489,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 196); ac++;
         XtSetArg(args[ac], XmNheight, 150); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_mbeditviz_status = XmCreateLabel(form_mbeditviz,
             (char *)"label_mbeditviz_status",
@@ -505,7 +516,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_programmode = XmCreateLabel(form_mbeditviz,
             (char *)"label_programmode",
@@ -542,7 +553,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 138); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_programmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_programmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_mode_edit = XmCreateToggleButton(radioBox_programmode,
             (char *)"toggleButton_mode_edit",
@@ -568,7 +579,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 138); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_programmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_programmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_mode_browse = XmCreateToggleButton(radioBox_programmode,
             (char *)"toggleButton_mode_browse",
@@ -595,7 +606,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 70); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_deleteselected = XmCreatePushButton(form_mbeditviz,
             (char *)"pushButton_deleteselected",
@@ -623,7 +634,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 70); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_viewselected = XmCreatePushButton(form_mbeditviz,
             (char *)"pushButton_viewselected",
@@ -652,7 +663,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 70); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_viewall = XmCreatePushButton(form_mbeditviz,
             (char *)"pushButton_viewall",
@@ -681,7 +692,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 435); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_filelist = XmCreateLabel(form_mbeditviz,
             (char *)"label_filelist",
@@ -710,7 +721,7 @@ CreatemainWindow_mbeditviz(Widget parent)
 
     ac = 0;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(scrolledWindow_mbeditviz, (char *)"-*-courier-*-r-*-*-*-90-*-*-*-*-iso8859-1",
+        BX_CONVERT(scrolledWindow_mbeditviz, (char *)"-*-"MONO"-*-r-*-*-*-90-*-*-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     XtSetArg(args[ac], XmNselectionPolicy, XmEXTENDED_SELECT); ac++;
     XtSetArg(args[ac], XmNwidth, 435); ac++;
@@ -751,7 +762,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-times-bold-r-*-*-*-120-*-*-*-*-iso88 [...]
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -779,7 +790,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=Tim [...]
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -806,7 +817,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=Tim [...]
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 70); ac++;
         XtSetArg(args[ac], XmNy, 340); ac++;
@@ -833,7 +844,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=Tim [...]
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 230); ac++;
         XtSetArg(args[ac], XmNy, 340); ac++;
@@ -871,7 +882,7 @@ CreatemainWindow_mbeditviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 120); ac++;
@@ -905,16 +916,16 @@ CreatemainWindow_mbeditviz(Widget parent)
     {
         XmString    tmp0;
 
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold24\"MBeditviz\":t\"\"#TimesBold18:t\"Swath Bathymetry Editing\"#TimesBold18:t\"and\"#TimesBold18\"Patch Test Tool\"",
+        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold24\"MBeditviz\":t\"\"#TimesBold18:t\"Swath Bathymetry Editing\"#TimesBold18:t\"and Patch Test Tool\"",
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 90); ac++;
+        XtSetArg(args[ac], XmNheight, 110); ac++;
         label_about_title = XmCreateLabel(bulletinBoard_about,
             (char *)"label_about_title",
             args,
@@ -940,7 +951,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_about_dismiss = XmCreatePushButton(bulletinBoard_about,
             (char *)"pushButton_about_dismiss",
@@ -991,7 +1002,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 350); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_mbeditviz_patience = XmCreateLabel(bulletinBoard_mbeditviz_message,
             (char *)"label_mbeditviz_patience",
@@ -1019,7 +1030,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 380); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_mbeditviz_message = XmCreateLabel(bulletinBoard_mbeditviz_message,
             (char *)"label_mbeditviz_message",
@@ -1078,7 +1089,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 116); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_openmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_openmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_openmodeedit = XmCreateToggleButton(radioBox_openmode,
             (char *)"toggleButton_openmodeedit",
@@ -1104,7 +1115,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 116); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_openmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_openmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_openmodebrowse = XmCreateToggleButton(radioBox_openmode,
             (char *)"toggleButton_openmodebrowse",
@@ -1131,7 +1142,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_open, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_open, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_outputmode = XmCreateLabel(form_open,
             (char *)"label_outputmode",
@@ -1152,7 +1163,7 @@ CreatemainWindow_mbeditviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 70); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_open, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_open, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     text_format = XmCreateText(form_open,
         (char *)"text_format",
@@ -1173,7 +1184,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 130); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_open, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_open, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_open_mbio = XmCreateLabel(form_open,
             (char *)"label_open_mbio",
@@ -1246,7 +1257,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 430); ac++;
         XtSetArg(args[ac], XmNheight, 61); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_cellsize = XmCreateScale(form_gridparameters,
             (char *)"scale_cellsize",
@@ -1276,7 +1287,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 432); ac++;
         XtSetArg(args[ac], XmNheight, 110); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_current = XmCreateLabel(form_gridparameters,
             (char *)"label_current",
@@ -1308,7 +1319,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 430); ac++;
         XtSetArg(args[ac], XmNheight, 70); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_implied = XmCreateLabel(form_gridparameters,
             (char *)"label_implied",
@@ -1335,7 +1346,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_gridparameters_dismiss = XmCreatePushButton(form_gridparameters,
             (char *)"pushButton_gridparameters_dismiss",
@@ -1363,7 +1374,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_gridparameters_apply = XmCreatePushButton(form_gridparameters,
             (char *)"pushButton_gridparameters_apply",
@@ -1428,7 +1439,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_two = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_two",
@@ -1456,7 +1467,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_one = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_one",
@@ -1484,7 +1495,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_three = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_three",
@@ -1511,7 +1522,7 @@ CreatemainWindow_mbeditviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_error = XmCreatePushButton(bulletinBoard_error,
             (char *)"pushButton_error",
diff --git a/src/mbeditviz/mbeditviz_main.c b/src/mbeditviz/mbeditviz_main.c
index 6141c40..9b4b493 100644
--- a/src/mbeditviz/mbeditviz_main.c
+++ b/src/mbeditviz/mbeditviz_main.c
@@ -2,9 +2,9 @@
 /* Begin user code block <abstract> */
 /*--------------------------------------------------------------------
  *    The MB-system:	mbeditviz_main.c		4/27/2007
- *    $Id: mbeditviz_main.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbeditviz_main.c 2250 2015-06-30 02:12:26Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -78,6 +78,11 @@ extern void BxExitCB(Widget, XtPointer, XtPointer);
 #include <stdio.h>
 #include <stdlib.h>
 
+/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
+#ifdef WIN32
+#	undef BOOL
+#endif
+
 /* MBIO include files */
 #include "mb_status.h"
 #include "mb_define.h"
@@ -156,7 +161,7 @@ int main( int argc, char **argv)
      * Initialize Xt.
      */
 
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
 
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbeditviz/mbeditviz_prog.c b/src/mbeditviz/mbeditviz_prog.c
index 03d2ca4..01e89c0 100644
--- a/src/mbeditviz/mbeditviz_prog.c
+++ b/src/mbeditviz/mbeditviz_prog.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbeditviz_prog.c		5/1/2007
- *    $Id: mbeditviz_prog.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mbeditviz_prog.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,52 +23,18 @@
  * Author:	D. W. Caress
  * Date:	May 1, 2007
  *
- * $Log: mbeditviz_prog.c,v $
- * Revision 5.9  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.8  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.7  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.6  2008/01/14 18:20:13  caress
- * Improved ability to identify raw vs processed data files regardless of source datalist.
- *
- * Revision 5.5  2007/11/16 17:26:56  caress
- * Progress on MBeditviz
- *
- * Revision 5.4  2007/10/17 20:35:05  caress
- * Release 5.1.1beta11
- *
- * Revision 5.3  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.2  2007/07/05 19:53:37  caress
- * Added sys/stat.h include.
- *
- * Revision 5.1  2007/07/03 17:35:54  caress
- * Working on MBeditviz.
- *
- * Revision 5.0  2007/06/17 23:25:57  caress
- * Added NBeditviz.
- *
- *
  */
 
 /* Standard includes */
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <string.h>
 #include <ctype.h>
 #include <math.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
-/* GMT include files */
-#include "gmt.h"
-
 /* MBIO include files */
 #include "mb_status.h"
 #include "mb_define.h"
@@ -86,7 +52,7 @@
 #include "mbeditviz.h"
 
 /* id variables */
-static char rcs_id[] = "$Id: mbeditviz_prog.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[] = "$Id: mbeditviz_prog.c 2227 2015-02-05 21:12:31Z caress $";
 static char program_name[] = "MBeditviz";
 static char help_message[] = "MBeditviz is a bathymetry editor and patch test tool.";
 static char usage_message[] = "mbeditviz [-H -T -V]";
diff --git a/src/mbgrdviz/Makefile.am b/src/mbgrdviz/Makefile.am
index 26cffa4..30bb1c8 100644
--- a/src/mbgrdviz/Makefile.am
+++ b/src/mbgrdviz/Makefile.am
@@ -7,11 +7,9 @@ AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
        -I${top_srcdir}/src/mbview \
        -I${top_srcdir}/src/mr1pr \
        -I${top_srcdir}/src/surf \
+	      -I${top_srcdir}/src/gsf \
        ${libgmt_CPPFLAGS} ${libnetcdf_CPPFLAGS} \
-       ${motif_CPPFLAGS} ${GL_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I${top_srcdir}/src/gsf
-endif
+       ${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
 
 AM_LDFLAGS =
 
@@ -19,9 +17,8 @@ mbgrdviz_SOURCES =  mbgrdviz_main.c mbgrdviz_callbacks.c  mbgrdviz_creation.c
 mbgrdviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
 		 ${top_builddir}/src/mbaux/libmbaux.la \
 		 ${top_builddir}/src/mbaux/libmbxgr.la \
-		 ${top_builddir}/src/mbaux/libmbps.la \
         	 ${top_builddir}/src/mbview/libmbview.la \
 		 ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		 ${motif_LIBS} ${GL_LIBS} \
+		 ${libmotif_LIBS} ${libopengl_LIBS} \
 		 $(LIBM)
 
diff --git a/src/mbgrdviz/Makefile.in b/src/mbgrdviz/Makefile.in
index 8c0c230..3d4cf42 100644
--- a/src/mbgrdviz/Makefile.in
+++ b/src/mbgrdviz/Makefile.in
@@ -79,7 +79,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = mbgrdviz$(EXEEXT)
- at BUILD_GSF_TRUE@am__append_1 = -I${top_srcdir}/src/gsf
 subdir = src/mbgrdviz
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -103,7 +102,6 @@ am__DEPENDENCIES_1 =
 mbgrdviz_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
 	${top_builddir}/src/mbaux/libmbaux.la \
 	${top_builddir}/src/mbaux/libmbxgr.la \
-	${top_builddir}/src/mbaux/libmbps.la \
 	${top_builddir}/src/mbview/libmbview.la $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
@@ -201,8 +199,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -219,6 +215,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -282,19 +279,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -307,8 +311,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -323,20 +325,23 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	-I${top_srcdir}/src/mbview -I${top_srcdir}/src/mr1pr \
-	-I${top_srcdir}/src/surf ${libgmt_CPPFLAGS} \
-	${libnetcdf_CPPFLAGS} ${motif_CPPFLAGS} ${GL_CPPFLAGS} \
-	$(am__append_1)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+       -I${top_srcdir}/src/mbaux \
+       -I${top_srcdir}/src/mbview \
+       -I${top_srcdir}/src/mr1pr \
+       -I${top_srcdir}/src/surf \
+	      -I${top_srcdir}/src/gsf \
+       ${libgmt_CPPFLAGS} ${libnetcdf_CPPFLAGS} \
+       ${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
+
 AM_LDFLAGS = 
 mbgrdviz_SOURCES = mbgrdviz_main.c mbgrdviz_callbacks.c  mbgrdviz_creation.c
 mbgrdviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
 		 ${top_builddir}/src/mbaux/libmbaux.la \
 		 ${top_builddir}/src/mbaux/libmbxgr.la \
-		 ${top_builddir}/src/mbaux/libmbps.la \
         	 ${top_builddir}/src/mbview/libmbview.la \
 		 ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		 ${motif_LIBS} ${GL_LIBS} \
+		 ${libmotif_LIBS} ${libopengl_LIBS} \
 		 $(LIBM)
 
 all: all-am
diff --git a/src/mbgrdviz/Makefile.template b/src/mbgrdviz/Makefile.template
deleted file mode 100644
index 0ccfb70..0000000
--- a/src/mbgrdviz/Makefile.template
+++ /dev/null
@@ -1,103 +0,0 @@
-#     The MB-system:	Makefile.template  7/27/2003
-#	$Id: Makefile.template 2063 2013-05-22 00:05:57Z caress $
-#
-#     Copyright (c) 2003-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbgrdviz directory level
-# Author:	D. W. Caress
-# Date:		August 24, 2013
-#
-# $Log: Makefile.template,v $
-#
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of GMT libraries, binaries, and include files:
-GMTLIBDIR = /sw/lib
-GMTINCDIR = /sw/include
-NETCDFINCDIR = /sw/include
-#
-# Locations of Motif include files and libraries:
-MOTIFINCDIR = /sw/include
-MOTIFLIBS = -L/sw/lib -L/usr/X11R6/lib -lXm -lXt -lX11
-#
-# Locations of OpenGL libraries:
-OPENGLLIBS = -lGLU -lGL
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -I/usr/include/X11R6 -DDARWIN -DGMT3_3
-LFLAGS = -lm -L/usr/local/netcdf/lib -lnetcdf
-ARCHIVE = ar rcv
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the executable and man page
-all: $(BINDIR)/mbgrdviz
-
-### make the library
-
-### link the executables
-$(BINDIR)/mbgrdviz: mbgrdviz_main.o \
-		mbgrdviz_callbacks.o \
-		mbgrdviz_creation.o \
-		$(LIBDIR)/libmbview.a \
-		$(LIBDIR)/libmbio.a \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbps.a \
-		$(LIBDIR)/libmbxgr.a \
-		$(GSFLIB) \
-		$(GMTLIBDIR)/libpsl.a
-	$(CC) $(CFLAGS) mbgrdviz_main.o \
-		mbgrdviz_callbacks.o \
-		mbgrdviz_creation.o \
-		$(LIBDIR)/libmbview.a \
-		$(LIBDIR)/libmbio.a \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libmbxgr.a \
-		$(GSFLIB) \
-		$(GMTLIBDIR)/libgmt.a \
-		$(GMTLIBDIR)/libpsl.a \
-		$(OPENGLLIBS) $(MOTIFLIBS) $(LFLAGS) -o $(BINDIR)/mbgrdviz
-
-### compile the source files
-mbgrdviz_creation.o: mbgrdviz_creation.c mbgrdviz_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbview -I$(MOTIFINCDIR) -c mbgrdviz_creation.c
-mbgrdviz_main.o: mbgrdviz_main.c ../mbview/mbview.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbview -I$(MOTIFINCDIR) -c mbgrdviz_main.c
-mbgrdviz_callbacks.o: mbgrdviz_callbacks.c ../mbview/mbview.h \
-	../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbview -I$(MOTIFINCDIR) -I$(NETCDFINCDIR) -I$(GMTINCDIR) -c mbgrdviz_callbacks.c
-
-## copy the include files to the include file directory
-
-### copy the man page to the man page directory
-
-clean:
-	rm -f *.o
diff --git a/src/mbgrdviz/mbgrdviz_callbacks.c b/src/mbgrdviz/mbgrdviz_callbacks.c
index fb646f9..29cac02 100644
--- a/src/mbgrdviz/mbgrdviz_callbacks.c
+++ b/src/mbgrdviz/mbgrdviz_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbgrdviz_callbacks.c		10/9/2002
- *    $Id: mbgrdviz_callbacks.c 2204 2014-09-06 02:34:58Z caress $
+ *    $Id: mbgrdviz_callbacks.c 2251 2015-07-01 01:02:06Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -31,38 +31,32 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <string.h>
 #include <ctype.h>
 #include <math.h>
-
-/* GMT include files */
-#include "gmt.h"
+#include <time.h>
 
 /* MBIO include files */
 #include "mb_status.h"
 #include "mb_define.h"
 #include "mb_format.h"
+#include "mb_aux.h"
 #include "mbsys_singlebeam.h"
 
-/* get NaN detector */
-#if defined(isnanf)
-#define check_fnan(x) isnanf((x))
-#elif defined(isnan)
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNANF == 1
-#define check_fnan(x) isnanf(x)
-extern int isnanf(float x);
-#elif HAVE_ISNAN == 1
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNAND == 1
-#define check_fnan(x) isnand((double)(x))
-#else
-#define check_fnan(x) ((x) != (x))
-#endif
-
 /* mbview include file */
 #include "mbview.h"
 
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* fileSelectionBox modes */
 #define MBGRDVIZ_OPENGRID		0
 #define MBGRDVIZ_OPENOVERLAY		1
@@ -124,7 +118,7 @@ static int	survey_color = MBV_COLOR_BLACK;
 static char	survey_name[MB_PATH_MAXLINE];
 
 /* id variables */
-static char rcs_id[] = "$Id: mbgrdviz_callbacks.c 2204 2014-09-06 02:34:58Z caress $";
+static char rcs_id[] = "$Id: mbgrdviz_callbacks.c 2251 2015-07-01 01:02:06Z caress $";
 static char program_name[] = "MBgrdviz";
 
 /* status variables */
@@ -141,7 +135,7 @@ static Widget	fileSelectionText;
 
 /* function prototypes */
 int do_mbgrdviz_init(int argc, char **argv, int verbosity);
-void do_mbgrdviz_sensitivity();
+void do_mbgrdviz_sensitivity(void);
 int do_mbgrdviz_dismiss_notify(size_t instance);
 void do_mbgrdviz_fileSelectionBox( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbgrdviz_fileSelectionBox_openoverlay( Widget w, XtPointer client_data, XtPointer call_data);
@@ -156,7 +150,12 @@ void do_mbgrdviz_fileSelectionBox_savewinfrogpts( Widget w, XtPointer client_dat
 void do_mbgrdviz_fileSelectionBox_savewinfrogwpt( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbgrdviz_fileSelectionBox_savedegdecmin( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbgrdviz_fileSelectionBox_savelnw( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbgrdviz_fileSelectionBox_saveprofile( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbgrdviz_fileSelectionBox_realtime( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbgrdviz_fileSelectionBox_savesite( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbgrdviz_openfile( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbgrdviz_close( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbgrdviz_quit( Widget w, XtPointer client_data, XtPointer call_data);
 int do_mbgrdviz_openprimary(char *input_file_ptr);
 int do_mbgrdviz_openoverlay(size_t instance, char *input_file_ptr);
 int do_mbgrdviz_opensite(size_t instance, char *input_file_ptr);
@@ -235,7 +234,13 @@ void do_mbgrdviz_realtimesetup_updaterate( Widget w, XtPointer client_data, XtPo
 void do_mbgrdviz_realtimesetup_path_test( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbgrdviz_realtimesetup_pathmode( Widget w, XtPointer client_data, XtPointer call_data);
 
-XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+void BxPopdownCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void BxExitCB(Widget w, XtPointer client, XtPointer call);
+void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
 
 /*
  * Motif required Headers
@@ -779,7 +784,7 @@ do_mbgrdviz_fileSelectionBox( Widget w, XtPointer client_data, XtPointer call_da
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -792,7 +797,7 @@ do_mbgrdviz_fileSelectionBox_openoverlay( Widget w, XtPointer client_data, XtPoi
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -823,7 +828,7 @@ do_mbgrdviz_fileSelectionBox_openoverlay( Widget w, XtPointer client_data, XtPoi
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_OPENOVERLAY * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -836,7 +841,7 @@ do_mbgrdviz_fileSelectionBox_opensite( Widget w, XtPointer client_data, XtPointe
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -867,7 +872,7 @@ do_mbgrdviz_fileSelectionBox_opensite( Widget w, XtPointer client_data, XtPointe
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_OPENSITE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -880,7 +885,7 @@ do_mbgrdviz_fileSelectionBox_openroute( Widget w, XtPointer client_data, XtPoint
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -911,7 +916,7 @@ do_mbgrdviz_fileSelectionBox_openroute( Widget w, XtPointer client_data, XtPoint
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_OPENROUTE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -924,7 +929,7 @@ do_mbgrdviz_fileSelectionBox_opennav( Widget w, XtPointer client_data, XtPointer
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -955,7 +960,7 @@ do_mbgrdviz_fileSelectionBox_opennav( Widget w, XtPointer client_data, XtPointer
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_OPENNAV * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -968,7 +973,7 @@ do_mbgrdviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPoint
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -999,7 +1004,7 @@ do_mbgrdviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPoint
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_OPENSWATH * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1012,7 +1017,7 @@ do_mbgrdviz_fileSelectionBox_openvector( Widget w, XtPointer client_data, XtPoin
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1043,7 +1048,7 @@ do_mbgrdviz_fileSelectionBox_openvector( Widget w, XtPointer client_data, XtPoin
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_OPENVECTOR * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1056,7 +1061,7 @@ do_mbgrdviz_fileSelectionBox_savesite( Widget w, XtPointer client_data, XtPointe
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1087,7 +1092,7 @@ do_mbgrdviz_fileSelectionBox_savesite( Widget w, XtPointer client_data, XtPointe
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVESITE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1100,7 +1105,7 @@ do_mbgrdviz_fileSelectionBox_saveroute( Widget w, XtPointer client_data, XtPoint
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1131,7 +1136,7 @@ do_mbgrdviz_fileSelectionBox_saveroute( Widget w, XtPointer client_data, XtPoint
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVEROUTE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1144,7 +1149,7 @@ do_mbgrdviz_fileSelectionBox_saverisiscript( Widget w, XtPointer client_data, Xt
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1175,7 +1180,7 @@ do_mbgrdviz_fileSelectionBox_saverisiscript( Widget w, XtPointer client_data, Xt
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVERISISCRIPT * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1188,7 +1193,7 @@ do_mbgrdviz_fileSelectionBox_savewinfrogpts( Widget w, XtPointer client_data, Xt
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1219,7 +1224,7 @@ do_mbgrdviz_fileSelectionBox_savewinfrogpts( Widget w, XtPointer client_data, Xt
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVEWINFROGPTS * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1232,7 +1237,7 @@ do_mbgrdviz_fileSelectionBox_savewinfrogwpt( Widget w, XtPointer client_data, Xt
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1263,7 +1268,7 @@ do_mbgrdviz_fileSelectionBox_savewinfrogwpt( Widget w, XtPointer client_data, Xt
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVEWINFROGWPT * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1276,7 +1281,7 @@ do_mbgrdviz_fileSelectionBox_savedegdecmin( Widget w, XtPointer client_data, XtP
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1307,7 +1312,7 @@ do_mbgrdviz_fileSelectionBox_savedegdecmin( Widget w, XtPointer client_data, XtP
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVEDEGDECMIN * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1320,7 +1325,7 @@ do_mbgrdviz_fileSelectionBox_savelnw( Widget w, XtPointer client_data, XtPointer
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1351,7 +1356,7 @@ do_mbgrdviz_fileSelectionBox_savelnw( Widget w, XtPointer client_data, XtPointer
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVELNW * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1364,7 +1369,7 @@ do_mbgrdviz_fileSelectionBox_saveprofile( Widget w, XtPointer client_data, XtPoi
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1395,7 +1400,7 @@ do_mbgrdviz_fileSelectionBox_saveprofile( Widget w, XtPointer client_data, XtPoi
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_SAVEPROFILE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1408,7 +1413,7 @@ do_mbgrdviz_fileSelectionBox_realtime( Widget w, XtPointer client_data, XtPointe
         Cardinal ac = 0;
         Arg      args[256];
 	size_t	instance;
-	int	actionid;
+	size_t	actionid;
         XmString	tmp0;
 	Boolean	argok;
 	XmAnyCallbackStruct *acs;
@@ -1439,7 +1444,7 @@ do_mbgrdviz_fileSelectionBox_realtime( Widget w, XtPointer client_data, XtPointe
                 				XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNpattern, tmp0); ac++;
 	actionid = MBGRDVIZ_REALTIME * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, actionid); ac++;
+	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
 	XtSetValues(fileSelectionBox, args, ac);
         XmStringFree((XmString)tmp0);
 
@@ -1468,8 +1473,14 @@ void
 do_mbgrdviz_quit( Widget w, XtPointer client_data, XtPointer call_data)
 {
 	char function_name[] = "do_mbgrdviz_quit";
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
+	int status = MB_SUCCESS;
+	XmAnyCallbackStruct *acs;
+	acs = (XmAnyCallbackStruct*)call_data;
+	
+	/* close any active mbview instances */
+	status = mbview_quit(verbose, &error);
+	
+	XtUnmanageChild(XtParent(mainWindow));
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -1532,8 +1543,8 @@ do_mbgrdviz_openfile( Widget w, XtPointer client_data, XtPointer call_data)
 {
 	char function_name[] = "do_mbgrdviz_openfile";
 	int	status = MB_SUCCESS;
-	int	actionid;
-	int	mode;
+	size_t	actionid;
+	size_t	mode;
 	size_t	instance;
 	char    *file_ptr;
         Cardinal ac = 0;
@@ -1551,6 +1562,26 @@ do_mbgrdviz_openfile( Widget w, XtPointer client_data, XtPointer call_data)
 		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
 		}
 
+	/* read the input file name */
+	XmStringGetLtoR(acs->value, XmSTRING_DEFAULT_CHARSET,
+			&file_ptr);
+	if (strlen(file_ptr) <= 0 && file_ptr != NULL)
+		{
+		XtFree(file_ptr);
+		file_ptr = NULL;
+		}
+
+	/* print debug statements */
+	if (verbose >= 4)
+		{
+		fprintf(stderr,"\ndbg4  Extracted input file name from call_data:\n");
+		fprintf(stderr,"dbg4       call_data:           %p\n",call_data);
+		fprintf(stderr,"dbg4       acs:                 %p\n",acs);
+		fprintf(stderr,"dbg4       acs->value:          %p\n",acs->value);
+		fprintf(stderr,"dbg4       file_ptr:            %p\n",file_ptr);
+		fprintf(stderr,"dbg4       file_ptr:            %s\n",file_ptr);
+		}
+
     	/* figure out what kind of file is to be opened */
 
 	ac = 0;
@@ -1563,13 +1594,13 @@ do_mbgrdviz_openfile( Widget w, XtPointer client_data, XtPointer call_data)
 	else
 		instance = 0;
 
-	/* read the input file name */
-	XmStringGetLtoR(acs->value, XmSTRING_DEFAULT_CHARSET,
-			&file_ptr);
-	if (strlen(file_ptr) <= 0 && file_ptr != NULL)
+	/* print debug statements */
+	if (verbose >= 4)
 		{
-		XtFree(file_ptr);
-		file_ptr = NULL;
+		fprintf(stderr,"\ndbg4  Extracted user data from widget fileSelectionBox:\n");
+		fprintf(stderr,"dbg4       fileSelectionBox:    %p\n",fileSelectionBox);
+		fprintf(stderr,"dbg4       actionid:            %zu\n",actionid);
+		fprintf(stderr,"dbg4       mode:                %zu\n",mode);
 		}
 
 	/* open primary grid */
@@ -1811,7 +1842,11 @@ int do_mbgrdviz_openprimary(char *input_file_ptr)
 		/* get button name */
 		if (input_file_ptr != NULL)
 			{
+#ifdef WIN32
+			button_name_ptr = strrchr(input_file_ptr, '/');		/* This one should work for gcc as well */
+#else
 			button_name_ptr = (char *) rindex(input_file_ptr, '/');
+#endif
 			if (button_name_ptr == NULL)
 				button_name_ptr = input_file_ptr;
 			else
@@ -1851,7 +1886,7 @@ int do_mbgrdviz_openprimary(char *input_file_ptr)
 		/* read in the grd file */
 		if (status == MB_SUCCESS
 			&& input_file_ptr != NULL)
-		status = do_mbgrdviz_readgrd(instance, input_file_ptr,
+		status = mb_read_gmt_grd(verbose, input_file_ptr,
 			&mbv_primary_grid_projection_mode,
 			mbv_primary_grid_projection_id,
 			&mbv_primary_nodatavalue,
@@ -1866,7 +1901,10 @@ int do_mbgrdviz_openprimary(char *input_file_ptr)
 			&mbv_primary_ymax,
 			&mbv_primary_dx,
 			&mbv_primary_dy,
-			&mbv_primary_data);
+			&mbv_primary_data,
+                        NULL,
+                        NULL,
+                        &error);
 
 		else if (status == MB_SUCCESS)
 		status = do_mbgrdviz_opentest(instance,
@@ -2249,7 +2287,7 @@ int do_mbgrdviz_openoverlay(size_t instance, char *input_file_ptr)
 		/* read in the grd file */
 		if (status == MB_SUCCESS
 			&& input_file_ptr != NULL)
-		status = do_mbgrdviz_readgrd(instance, input_file_ptr,
+		status = mb_read_gmt_grd(verbose, input_file_ptr,
 			&mbv_secondary_grid_projection_mode,
 			mbv_secondary_grid_projection_id,
 			&mbv_secondary_nodatavalue,
@@ -2264,7 +2302,10 @@ int do_mbgrdviz_openoverlay(size_t instance, char *input_file_ptr)
 			&mbv_secondary_ymax,
 			&mbv_secondary_dx,
 			&mbv_secondary_dy,
-			&mbv_secondary_data);
+			&mbv_secondary_data,
+                        NULL,
+                        NULL,
+                        &error);
 
 		else if (status == MB_SUCCESS)
 		status = do_mbgrdviz_opentest(instance,
@@ -4987,342 +5028,6 @@ fprintf(stderr,"    Skipping %s because of 0 nav points read\n",name);
 }
 /*---------------------------------------------------------------------------------------*/
 
-int do_mbgrdviz_readgrd(size_t instance, char *grdfile,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data)
-{
-	char function_name[] = "do_mbgrdviz_readgrd";
-	int	status = MB_SUCCESS;
-	struct GRD_HEADER header;
-	int	modeltype;
-	int	projectionid;
-        char    projectionname[MB_PATH_MAXLINE];
-	int	off;
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
-#else
-	int	pad[4];
-#endif
-	int	nscan;
-	int	utmzone;
-	char	NorS;
-	float	*rawdata;
-	float	*usedata;
-	int	i,j,k,kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       grdfile:         %s\n",grdfile);
-		}
-
-	/* do required initialization */
-/*	GMT_begin (pargc, pargv);
-	GMT_put_history(pargc, pargv);
-	GMT_get_common_args (projection, xmin, xmax, ymin, ymax);*/
-	project_info.degree[0] = 0;
-	project_info.degree[1] = 0;
-	GMT_program = program_name;
-	GMT_grd_init (&header, 1, pargv, FALSE);
-	GMT_io_init ();
-	GMT_grdio_init ();
-	GMT_make_fnan (GMT_f_NaN);
-	GMT_make_dnan (GMT_d_NaN);
-
-	/* read input grd file header */
-	if (GMT_read_grd_info (grdfile, &header))
-	    {
-	    error = MB_ERROR_OPEN_FAIL;
-	    fprintf(stderr,"\nUnable to open grd file: %s\n",
-		    grdfile);
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-	    		program_name);
-	    exit(error);
-	    }
-
-	/* try to get projection from the grd file remark */
-	if (strncmp(&(header.remark[2]), "Projection: ", 12) == 0)
-		{
-		if ((nscan = sscanf(&(header.remark[2]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
-			{
-			if (NorS == 'N')
-				{
-				projectionid = 32600 + utmzone;
-				}
-			else /* if (NorS == 'S') */
-				{
-				projectionid = 32700 + utmzone;
-				}
-			modeltype = ModelTypeProjected;
-			sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
-			*grid_projection_mode = MBV_PROJECTION_PROJECTED;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-
-			project_info.degree[0] = FALSE;
-			}
-		else if ((nscan = sscanf(&(header.remark[2]), "Projection: epsg%d", &projectionid)) == 1)
-			{
-			sprintf(projectionname, "epsg%d", projectionid);
-			modeltype = ModelTypeProjected;
-			*grid_projection_mode = MBV_PROJECTION_PROJECTED;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-
-			project_info.degree[0] = FALSE;
-			}
-		else if ((nscan = sscanf(&(header.remark[2]), "Projection: %s", projectionname)) == 1)
-			{
-			if (strncmp(projectionname, "Geographic", 10) == 0)
-				{
-				strcpy(projectionname, "Geographic WGS84");
-				modeltype = ModelTypeGeographic;
-				projectionid = GCS_WGS_84;
-				*grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-
-				project_info.degree[0] = TRUE;
-				GMT_io.in_col_type[0] = GMT_IS_LON;
-				GMT_io.in_col_type[1] = GMT_IS_LAT;
-				}
-			else
-				{
-				modeltype = ModelTypeProjected;
-				*grid_projection_mode = MBV_PROJECTION_PROJECTED;
-				strcpy(grid_projection_id, projectionname);
-
-				project_info.degree[0] = FALSE;
-				}
-			}
-		else
-			{
-			strcpy(projectionname, "Geographic WGS84");
-			modeltype = ModelTypeGeographic;
-			projectionid = GCS_WGS_84;
-			*grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-
-			project_info.degree[0] = TRUE;
-			GMT_io.in_col_type[0] = GMT_IS_LON;
-			GMT_io.in_col_type[1] = GMT_IS_LAT;
-			}
-		}
-	else if (strncmp(&(header.remark[0]), "Projection: ", 12) == 0)
-		{
-		if ((nscan = sscanf(&(header.remark[0]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
-			{
-			if (NorS == 'N')
-				{
-				projectionid = 32600 + utmzone;
-				}
-			else /* if (NorS == 'S') */
-				{
-				projectionid = 32700 + utmzone;
-				}
-			modeltype = ModelTypeProjected;
-			sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
-			*grid_projection_mode = MBV_PROJECTION_PROJECTED;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-
-			project_info.degree[0] = FALSE;
-			}
-		else if ((nscan = sscanf(&(header.remark[0]), "Projection: epsg%d", &projectionid)) == 1)
-			{
-			sprintf(projectionname, "epsg%d", projectionid);
-			modeltype = ModelTypeProjected;
-			*grid_projection_mode = MBV_PROJECTION_PROJECTED;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-
-			project_info.degree[0] = FALSE;
-			}
-		else if ((nscan = sscanf(&(header.remark[0]), "Projection: %s", projectionname)) == 1)
-			{
-			if (strncmp(projectionname, "Geographic", 10) == 0)
-				{
-				strcpy(projectionname, "Geographic WGS84");
-				modeltype = ModelTypeGeographic;
-				projectionid = GCS_WGS_84;
-				*grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-
-				project_info.degree[0] = TRUE;
-				GMT_io.in_col_type[0] = GMT_IS_LON;
-				GMT_io.in_col_type[1] = GMT_IS_LAT;
-				}
-			else
-				{
-				modeltype = ModelTypeProjected;
-				*grid_projection_mode = MBV_PROJECTION_PROJECTED;
-				strcpy(grid_projection_id, projectionname);
-
-				project_info.degree[0] = FALSE;
-				}
-			}
-		else
-			{
-			strcpy(projectionname, "Geographic WGS84");
-			modeltype = ModelTypeGeographic;
-			projectionid = GCS_WGS_84;
-			*grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-
-			project_info.degree[0] = TRUE;
-			GMT_io.in_col_type[0] = GMT_IS_LON;
-			GMT_io.in_col_type[1] = GMT_IS_LAT;
-			}
-		}
-	else
-		{
-		strcpy(projectionname, "Geographic WGS84");
-		modeltype = ModelTypeGeographic;
-		projectionid = GCS_WGS_84;
-		*grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-		sprintf(grid_projection_id, "epsg%d", projectionid);
-
-		project_info.degree[0] = TRUE;
-		GMT_io.in_col_type[0] = GMT_IS_LON;
-		GMT_io.in_col_type[1] = GMT_IS_LAT;
-		}
-
-	/* set up internal arrays */
-    	*nodatavalue = MIN(MBV_DEFAULT_NODATA, header.z_min - 10 * (header.z_max - header.z_min));
-    	*nxy = header.nx * header.ny;
-    	*nx = header.nx;
-    	*ny = header.ny;
-    	*xmin = header.x_min;
-    	*xmax = header.x_max;
-    	*ymin = header.y_min;
-    	*ymax = header.y_max;
-    	*dx = header.x_inc;
-    	*dy = header.y_inc;
-    	*min = header.z_min;
-    	*max = header.z_max;
-
-    	status = mb_mallocd(verbose,__FILE__,__LINE__, sizeof(float) * (*nxy),
-    				(void **)&rawdata,&error);
-    	if (status == MB_SUCCESS)
-            {
-            status = mb_mallocd(verbose,__FILE__,__LINE__, sizeof(float) * (*nxy),
-    				(void **)&usedata,&error);
-            *data = usedata;
-            }
-	else
-	    {
-	    fprintf(stderr,"\nUnable to allocate memory to store data from grd file: %s\n",
-		    grdfile);
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		    program_name);
-	    exit(error);
-	    }
-
-	/* Determine the wesn to be used to read the grdfile */
-	off = (header.node_offset) ? 0 : 1;
-	GMT_map_setup (*xmin, *xmax, *ymin, *ymax);
-#ifdef GMT_MINOR_VERSION
-	GMT_grd_setregion (&header, xmin,  xmax, ymin, ymax, BCR_BILINEAR);
-#else
-	GMT_grd_setregion (&header, xmin,  xmax, ymin, ymax);
-#endif
-
-	/* read the grid */
-	pad[0] = 0;
-	pad[1] = 0;
-	pad[2] = 0;
-	pad[3] = 0;
-	if (GMT_read_grd (grdfile, &header, rawdata,
-			    *xmin, *xmax, *ymin, *ymax,
-			    pad, FALSE))
-	    {
-	    error = MB_ERROR_OPEN_FAIL;
-	    fprintf(stderr,"\nUnable to read grd file: %s\n",
-		    grdfile);
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		    program_name);
-	    exit(error);
-	    }
-
-	/* free GMT memory */
-	GMT_free ((void *)GMT_io.skip_if_NaN);
-	GMT_free ((void *)GMT_io.in_col_type);
-	GMT_free ((void *)GMT_io.out_col_type);
-
-	/* reorder grid to internal convention */
-	for (i=0;i<*nx;i++)
-	for (j=0;j<*ny;j++)
-		{
-		k = i * *ny + j;
-		kk = (*ny - 1 - j) * *nx + i;
-		if (check_fnan(rawdata[kk]))
-			usedata[k] = *nodatavalue;
-		else
-			usedata[k] = rawdata[kk];
-		}
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&rawdata, &error);
-
-	/* print debug info */
-	if (verbose > 0)
-	    {
-	    fprintf(stderr,"Grid read:\n");
-	    fprintf(stderr,"  Dimensions: %d %d\n", header.nx, header.ny);
-	    if (modeltype == ModelTypeProjected)
-	    	{
-		fprintf(stderr,"  Projected Coordinate System Name: %s\n", projectionname);
-		fprintf(stderr,"  Projected Coordinate System ID:   %d\n", projectionid);
-	    	fprintf(stderr,"  Easting:    %f %f  %f\n",
-		  	header.x_min, header.x_max, header.x_inc);
-	    	fprintf(stderr,"  Northing:   %f %f  %f\n",
-		  	header.y_min, header.y_max, header.y_inc);
-		}
-	    else
-		{
-		fprintf(stderr,"  Geographic Coordinate System Name: %s\n", projectionname);
-		fprintf(stderr,"  Geographic Coordinate System ID:   %d\n", projectionid);
-	    	fprintf(stderr,"  Longitude:  %f %f  %f\n",
-		  	header.x_min, header.x_max, header.x_inc);
-	    	fprintf(stderr,"  Latitude:   %f %f  %f\n",
-		  	header.y_min, header.y_max, header.y_inc);
-		}
-	    fprintf(stderr,"  Internal Grid Projection Mode:         %d\n",
-	    			*grid_projection_mode);
-	    fprintf(stderr,"  Internal Grid Projection ID:           %s\n",
-	    			grid_projection_id);
-
-	    fprintf(stderr,"Data Read:\n");
-	    fprintf(stderr,"  grid_projection_mode:     %d\n", *grid_projection_mode);
-	    fprintf(stderr,"  grid_projection_id:       %s\n", grid_projection_id);
-	    fprintf(stderr,"  nodatavalue:              %f\n", *nodatavalue);
-	    fprintf(stderr,"  nx:                       %d\n", *nx);
-	    fprintf(stderr,"  ny:                       %d\n", *ny);
-	    fprintf(stderr,"  min:                      %f\n", *min);
-	    fprintf(stderr,"  max:                      %f\n", *max);
-	    fprintf(stderr,"  xmin:                     %f\n", *xmin);
-	    fprintf(stderr,"  xmax:                     %f\n", *xmax);
-	    fprintf(stderr,"  ymin:                     %f\n", *ymin);
-	    fprintf(stderr,"  ymax:                     %f\n", *ymax);
-	    fprintf(stderr,"  dx:                       %f\n", *dx);
-	    fprintf(stderr,"  dy:                       %f\n", *dy);
-	    fprintf(stderr,"  data:                     %p\n", *data);
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
 int do_mbgrdviz_opentest(size_t instance,
 			double	factor1,
 			double	factor2,
diff --git a/src/mbgrdviz/mbgrdviz_creation.c b/src/mbgrdviz/mbgrdviz_creation.c
index d0a815c..07a8a56 100644
--- a/src/mbgrdviz/mbgrdviz_creation.c
+++ b/src/mbgrdviz/mbgrdviz_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
@@ -229,7 +240,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 41); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_file = XmCreateCascadeButton(menuBar_mbgrdviz,
             (char *)"cascadeButton_file",
@@ -262,7 +273,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_file_openprimary = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_file_openprimary",
@@ -293,7 +304,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_opensite = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_opensite",
@@ -317,7 +328,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_openroute = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_openroute",
@@ -341,7 +352,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_opennav = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_opennav",
@@ -365,7 +376,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_openswath = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_openswath",
@@ -389,7 +400,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_openvector = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_openvector",
@@ -413,7 +424,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_savesite = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_savesite",
@@ -437,7 +448,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_saveroute = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_saveroute",
@@ -468,7 +479,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_quit = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_quit",
@@ -501,7 +512,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 47); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_help = XmCreateCascadeButton(menuBar_mbgrdviz,
             (char *)"cascadeButton_help",
@@ -534,7 +545,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_help, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_help, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_help_about = XmCreatePushButton(pulldownMenu_help,
             (char *)"pushButton_help_about",
@@ -567,7 +578,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 76); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_realtime = XmCreateCascadeButton(menuBar_mbgrdviz,
             (char *)"cascadeButton_realtime",
@@ -601,7 +612,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNsensitive, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtime_setup = XmCreatePushButton(pulldownMenu_realtime,
             (char *)"pushButton_realtime_setup",
@@ -626,7 +637,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNsensitive, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtime_start = XmCreatePushButton(pulldownMenu_realtime,
             (char *)"pushButton_realtime_start",
@@ -651,7 +662,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNsensitive, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtime_stop = XmCreatePushButton(pulldownMenu_realtime,
             (char *)"pushButton_realtime_stop",
@@ -676,7 +687,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNsensitive, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtime_pause = XmCreatePushButton(pulldownMenu_realtime,
             (char *)"pushButton_realtime_pause",
@@ -701,7 +712,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNsensitive, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtime_resume = XmCreatePushButton(pulldownMenu_realtime,
             (char *)"pushButton_realtime_resume",
@@ -751,7 +762,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -779,7 +790,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -806,7 +817,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 70); ac++;
         XtSetArg(args[ac], XmNy, 340); ac++;
@@ -833,7 +844,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 230); ac++;
         XtSetArg(args[ac], XmNy, 340); ac++;
@@ -871,7 +882,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 120); ac++;
@@ -909,7 +920,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -940,7 +951,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_about_dismiss = XmCreatePushButton(bulletinBoard_about,
             (char *)"pushButton_about_dismiss",
@@ -1040,7 +1051,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 220); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_interleaving = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_interleaving",
@@ -1078,7 +1089,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_interleaving, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_interleaving, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_interleaving = XmCreateTextField(spinBox_arearoute_interleaving,
         (char *)"spinText_arearoute_interleaving",
@@ -1092,7 +1103,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textField_arearoute_name = XmCreateTextField(bulletinBoard_arearoute,
         (char *)"textField_arearoute_name",
@@ -1114,7 +1125,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_name = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_name",
@@ -1152,7 +1163,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_color, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_color, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_color = XmCreateTextField(spinBox_arearoute_color,
         (char *)"spinText_arearoute_color",
@@ -1173,7 +1184,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_color = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_color",
@@ -1201,7 +1212,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_crosslines = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_crosslines",
@@ -1236,7 +1247,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_crosslines, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_crosslines, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_crosslines = XmCreateTextField(spinBox_arearoute_crosslines,
         (char *)"spinText_arearoute_crosslines",
@@ -1258,7 +1269,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_depth = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_depth",
@@ -1286,7 +1297,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_altitude = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_altitude",
@@ -1320,7 +1331,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_altitude, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_altitude, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_altitude = XmCreateTextField(spinBox_arearoute_altitude,
         (char *)"spinText_arearoute_altitude",
@@ -1349,7 +1360,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_depth, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_depth, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_depth = XmCreateTextField(spinBox_arearoute_depth,
         (char *)"spinText_arearoute_depth",
@@ -1381,7 +1392,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_direction, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_direction, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_direction = XmCreateTextField(spinBox_arearoute_direction,
         (char *)"spinText_arearoute_direction",
@@ -1402,7 +1413,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_direction = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_direction",
@@ -1436,7 +1447,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_swathwidth, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_swathwidth, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_swathwidth = XmCreateTextField(spinBox_arearoute_swathwidth,
         (char *)"spinText_arearoute_swathwidth",
@@ -1458,7 +1469,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_swathwidth = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_swathwidth",
@@ -1486,7 +1497,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_platform = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_platform",
@@ -1524,7 +1535,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_platform, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_platform, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_platform = XmCreateTextField(spinBox_arearoute_platform,
         (char *)"spinText_arearoute_platform",
@@ -1552,7 +1563,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_linespacing, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_linespacing, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_linespacing = XmCreateTextField(spinBox_arearoute_linespacing,
         (char *)"spinText_arearoute_linespacing",
@@ -1574,7 +1585,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 220); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_crosslinesfirstlast = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_crosslinesfirstlast",
@@ -1612,7 +1623,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_crosslinesfirstlast, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_crosslinesfirstlast, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_crosslinesfirstlast = XmCreateTextField(spinBox_arearoute_crosslinesfirstlast,
         (char *)"spinText_arearoute_crosslinesfirstlast",
@@ -1638,7 +1649,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 440); ac++;
         XtSetArg(args[ac], XmNheight, 140); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_info = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_info",
@@ -1676,7 +1687,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 200); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_linecontrol, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_arearoute_linecontrol, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_arearoute_linecontrol = XmCreateTextField(spinBox_arearoute_linecontrol,
         (char *)"spinText_arearoute_linecontrol",
@@ -1697,7 +1708,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_linecontrol = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_linecontrol",
@@ -1725,7 +1736,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_arearoute_linespacing = XmCreateLabel(bulletinBoard_arearoute,
             (char *)"label_arearoute_linespacing",
@@ -1752,7 +1763,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_arearoute_ok = XmCreatePushButton(bulletinBoard_arearoute,
             (char *)"pushButton_arearoute_ok",
@@ -1780,7 +1791,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_arearoute_dismiss = XmCreatePushButton(bulletinBoard_arearoute,
             (char *)"pushButton_arearoute_dismiss",
@@ -1833,7 +1844,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 480); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_realtimesetup_teststatus = XmCreateLabel(form_realtime_setup,
             (char *)"label_realtimesetup_teststatus",
@@ -1871,7 +1882,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 231); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_realtimesetup_recent = XmCreateToggleButton(radioBox_realtimesetup_pathmode,
             (char *)"toggleButton_realtimesetup_recent",
@@ -1898,7 +1909,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 231); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_realtimesetup_pointer = XmCreateToggleButton(radioBox_realtimesetup_pathmode,
             (char *)"toggleButton_realtimesetup_pointer",
@@ -1936,7 +1947,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 52); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtimesetup_dismiss = XmCreatePushButton(form_realtime_setup,
             (char *)"pushButton_realtimesetup_dismiss",
@@ -1982,7 +1993,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 410); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_realtimesetup_icon, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(spinBox_realtimesetup_icon, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     spinText_realtimesetup_icon = XmCreateTextField(spinBox_realtimesetup_icon,
         (char *)"spinText_realtimesetup_icon",
@@ -2002,7 +2013,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 480); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_realtime_setup_icon = XmCreateLabel(form_realtime_setup,
             (char *)"label_realtime_setup_icon",
@@ -2029,7 +2040,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 92); ac++;
         XtSetArg(args[ac], XmNheight, 52); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtimesetup_pathbrowse = XmCreatePushButton(form_realtime_setup,
             (char *)"pushButton_realtimesetup_pathbrowse",
@@ -2057,7 +2068,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 92); ac++;
         XtSetArg(args[ac], XmNheight, 52); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_realtimesetup_pathtest = XmCreatePushButton(form_realtime_setup,
             (char *)"pushButton_realtimesetup_pathtest",
@@ -2101,7 +2112,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 476); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_realtimesetup_update = XmCreateScale(form_realtime_setup,
             (char *)"scale_realtimesetup_update",
@@ -2130,7 +2141,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 476); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_realtimesetup_update = XmCreateLabel(form_realtime_setup,
             (char *)"label_realtimesetup_update",
@@ -2162,7 +2173,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNwidth, 476); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textField_realtimesetup_path = XmCreateTextField(form_realtime_setup,
         (char *)"textField_realtimesetup_path",
@@ -2183,7 +2194,7 @@ CreatemainWindow_mbgrdviz(Widget parent)
         XtSetArg(args[ac], XmNwidth, 471); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_realtimesetup_path = XmCreateLabel(form_realtime_setup,
             (char *)"label_realtimesetup_path",
@@ -2430,8 +2441,6 @@ CreatemainWindow_mbgrdviz(Widget parent)
     XtSetArg(args[ac], XmNmenuHelpWidget, cascadeButton_help); ac++;
     XtSetValues(menuBar_mbgrdviz, args, ac);
 
-
-
     /* Begin user code block <end_CreatemainWindow_mbgrdviz> */
     /* End user code block <end_CreatemainWindow_mbgrdviz> */
     return( mainWindow_mbgrdviz );
diff --git a/src/mbgrdviz/mbgrdviz_main.c b/src/mbgrdviz/mbgrdviz_main.c
index a5d0fbb..7741a61 100644
--- a/src/mbgrdviz/mbgrdviz_main.c
+++ b/src/mbgrdviz/mbgrdviz_main.c
@@ -2,9 +2,9 @@
 /* Begin user code block <abstract> */
 /*--------------------------------------------------------------------
  *    The MB-system:	mbgrdviz_main.c		10/9/2002
- *    $Id: mbgrdviz_main.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbgrdviz_main.c 2250 2015-06-30 02:12:26Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -80,6 +80,11 @@ extern void BxExitCB(Widget, XtPointer, XtPointer);
 #include <stdlib.h>
 #include <unistd.h>
 
+/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
+#ifdef WIN32
+#	undef BOOL
+#endif
+
 /* MBIO include files */
 #include "mb_status.h"
 #include "mb_define.h"
@@ -176,7 +181,7 @@ void do_mbgrdviz_realtimesetup_updaterate( Widget w, XtPointer client_data, XtPo
 void do_mbgrdviz_realtimesetup_path_test( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbgrdviz_realtimesetup_pathmode( Widget w, XtPointer client_data, XtPointer call_data);
 
-static char rcs_id[] = "$Id: mbgrdviz_main.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbgrdviz_main.c 2250 2015-06-30 02:12:26Z caress $";
 static char program_name[] = "MBgrdviz";
 static char help_message[] =  "MBgrdviz provides simple interactive 2D/3Dvizualization of GMT grids.";
 static char usage_message[] = "mbgrdviz [-Igrdfile -T -V -H]";
@@ -250,6 +255,8 @@ int main( int argc, char **argv)
 	int	ifileflag = 0;
 	int	jfileflag = 0;
 	int	testflag = 0;
+	//sessionShellWidgetClass widget_class;
+	//widget_class.core_class.class_inited = NULL;
 
 	/* process argument list */
 	while ((c = getopt(argc, argv, "VvHhI:i:J:j:Tt")) != -1)
@@ -318,7 +325,7 @@ int main( int argc, char **argv)
      * Initialize Xt.
      */
 
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
 
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbio/Makefile.am b/src/mbio/Makefile.am
index b8c8779..dc6dd74 100644
--- a/src/mbio/Makefile.am
+++ b/src/mbio/Makefile.am
@@ -17,6 +17,7 @@ include_HEADERS = mb_config.h \
         mbsys_singlebeam.h mbsys_xse.h \
         mbsys_hs10.h \
         mbsys_atlas.h mbsys_surf.h \
+	mbsys_gsf.h mbf_gsfgenmb.h \
         mbsys_reson8k.h \
         mbsys_netcdf.h mbsys_navnetcdf.h \
         mbsys_reson7k.h mbsys_jstar.h \
@@ -44,14 +45,12 @@ include_HEADERS = mb_config.h \
         mbf_omghdcsj.h mbf_mgd77dat.h \
         mbf_mbarirov.h mbf_mbarrov2.h \
         mbf_mbpronav.h mbf_xtfr8101.h
-if BUILD_GSF
-  include_HEADERS += mbsys_gsf.h mbf_gsfgenmb.h
-endif
 
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
 
 AM_CPPFLAGS = -I at top_srcdir@/src/bsio \
 	-I at top_srcdir@/src/surf \
+	-I at top_srcdir@/src/gsf \
 	${libgmt_CPPFLAGS} \
 	${libnetcdf_CPPFLAGS}
 if BUILD_PROJ
@@ -59,9 +58,6 @@ if BUILD_PROJ
 else
   AM_CPPFLAGS += ${libproj_CPPFLAGS}
 endif
-if BUILD_GSF
-  AM_CPPFLAGS += -I at top_srcdir@/src/gsf
-endif
 
 libmbio_la_LDFLAGS = -no-undefined -version-info 0:0:0
 
@@ -77,7 +73,7 @@ libmbio_la_SOURCES = \
                 mb_process.c mb_esf.c \
                 mb_get.c mb_get_all.c mb_read.c \
                 mb_put_all.c mb_put_comment.c \
-                mb_buffer.c \
+                mb_buffer.c mb_platform.c \
                 mb_read_ping.c mb_write_ping.c \
                 mb_access.c mb_segy.c mb_rt.c \
                 mbsys_sb.c mbsys_hsds.c \
@@ -92,6 +88,7 @@ libmbio_la_SOURCES = \
                 mbsys_singlebeam.c mbsys_xse.c \
                 mbsys_hs10.c mbsys_atlas.c \
                 mbsys_surf.c mbsys_reson8k.c \
+		mbsys_gsf.c mbr_gsfgenmb.c \
                 mbsys_netcdf.c mbsys_navnetcdf.c \
                 mbsys_reson7k.c mbsys_jstar.c \
                 mbsys_image83p.c mbsys_hysweep.c \
@@ -136,16 +133,11 @@ libmbio_la_SOURCES = \
                 mbr_swplssxp.c mbr_3ddepthp.c \
 		mbr_wasspenl.c mbr_mgd77txt.c \
 		mbr_mgd77tab.c mbr_photgram.c
-if BUILD_GSF
-  libmbio_la_SOURCES += mbsys_gsf.c mbr_gsfgenmb.c
-endif
 
 libmbio_la_LIBADD = $(top_builddir)/src/bsio/libmbbsio.la \
                    $(top_builddir)/src/surf/libmbsapi.la \
+		   $(top_builddir)/src/gsf/libmbgsf.la \
 		   ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${XDR_LIB}
-if BUILD_GSF
-  libmbio_la_LIBADD += $(top_builddir)/src/gsf/libmbgsf.la
-endif
 
 nodist_libmbio_la_SOURCES = projections.h
 
diff --git a/src/mbio/Makefile.in b/src/mbio/Makefile.in
index 4873903..2f5fd43 100644
--- a/src/mbio/Makefile.in
+++ b/src/mbio/Makefile.in
@@ -79,16 +79,12 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
- at BUILD_GSF_TRUE@am__append_1 = mbsys_gsf.h mbf_gsfgenmb.h
- at BUILD_PROJ_TRUE@am__append_2 = -I at top_srcdir@/src/proj
- at BUILD_PROJ_FALSE@am__append_3 = ${libproj_CPPFLAGS}
- at BUILD_GSF_TRUE@am__append_4 = -I at top_srcdir@/src/gsf
- at BUILD_GSF_TRUE@am__append_5 = mbsys_gsf.c mbr_gsfgenmb.c
- at BUILD_GSF_TRUE@am__append_6 = $(top_builddir)/src/gsf/libmbgsf.la
+ at BUILD_PROJ_TRUE@am__append_1 = -I at top_srcdir@/src/proj
+ at BUILD_PROJ_FALSE@am__append_2 = ${libproj_CPPFLAGS}
 subdir = src/mbio
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(srcdir)/mb_config.h.in $(top_srcdir)/depcomp \
-	$(am__include_HEADERS_DIST)
+	$(include_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -131,52 +127,17 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libmbio_la_DEPENDENCIES = $(top_builddir)/src/bsio/libmbbsio.la \
-	$(top_builddir)/src/surf/libmbsapi.la $(am__DEPENDENCIES_1) \
+	$(top_builddir)/src/surf/libmbsapi.la \
+	$(top_builddir)/src/gsf/libmbgsf.la $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__append_6)
-am__libmbio_la_SOURCES_DIST = mb_format.c mb_error.c mb_swap.c \
-	mb_compare.c mb_navint.c mb_read_init.c mb_write_init.c \
-	mb_close.c mb_fileio.c mb_mem.c mb_coor_scale.c \
-	mb_check_info.c mb_time.c mb_angle.c mb_absorption.c mb_proj.c \
-	mb_get_value.c mb_defaults.c mb_process.c mb_esf.c mb_get.c \
-	mb_get_all.c mb_read.c mb_put_all.c mb_put_comment.c \
-	mb_buffer.c mb_read_ping.c mb_write_ping.c mb_access.c \
-	mb_segy.c mb_rt.c mbsys_sb.c mbsys_hsds.c mbsys_sb2100.c \
-	mbsys_simrad.c mbsys_simrad2.c mbsys_simrad3.c mbsys_mr1.c \
-	mbsys_mr1b.c mbsys_mr1v2001.c mbsys_ldeoih.c mbsys_reson.c \
-	mbsys_elac.c mbsys_elacmk2.c mbsys_sb2000.c mbsys_hsmd.c \
-	mbsys_dsl.c mbsys_mstiff.c mbsys_oic.c mbsys_hdcs.c \
-	mbsys_singlebeam.c mbsys_xse.c mbsys_hs10.c mbsys_atlas.c \
-	mbsys_surf.c mbsys_reson8k.c mbsys_netcdf.c mbsys_navnetcdf.c \
-	mbsys_reson7k.c mbsys_jstar.c mbsys_image83p.c mbsys_hysweep.c \
-	mbsys_benthos.c mbsys_swathplus.c mbsys_3datdepthlidar.c \
-	mbsys_wassp.c mbsys_stereopair.c mbr_sbsiomrg.c mbr_sbsiocen.c \
-	mbr_sbsiolsi.c mbr_sburicen.c mbr_sburivax.c mbr_sbifremr.c \
-	mbr_hsatlraw.c mbr_hsldedmb.c mbr_hsuricen.c mbr_hsurivax.c \
-	mbr_hsldeoih.c mbr_hsunknwn.c mbr_sb2100rw.c mbr_sb2100bi.c \
-	mbr_emoldraw.c mbr_em12darw.c mbr_em12ifrm.c mbr_em300raw.c \
-	mbr_em300mba.c mbr_em710raw.c mbr_em710mba.c mbr_mr1prhig.c \
-	mbr_mr1aldeo.c mbr_mr1bldeo.c mbr_mr1prvr2.c mbr_mbldeoih.c \
-	mbr_cbat9001.c mbr_cbat8101.c mbr_hypc8101.c mbr_bchrtunb.c \
-	mbr_elmk2unb.c mbr_bchrxunb.c mbr_l3xseraw.c mbr_sbsioswb.c \
-	mbr_sb2000sb.c mbr_sb2000ss.c mbr_hsmdaraw.c mbr_hsmdldih.c \
-	mbr_dsl120pf.c mbr_dsl120sf.c mbr_mstiffss.c mbr_oicgeoda.c \
-	mbr_oicmbari.c mbr_omghdcsj.c mbr_mgd77dat.c mbr_asciixyz.c \
-	mbr_hydrob93.c mbr_mbarirov.c mbr_mbarrov2.c mbr_mbpronav.c \
-	mbr_hs10jams.c mbr_hsds2raw.c mbr_hsds2lam.c mbr_xtfr8101.c \
-	mbr_mbnetcdf.c mbr_nvnetcdf.c mbr_samesurf.c mbr_reson7kr.c \
-	mbr_edgjstar.c mbr_segysegy.c mbr_image83p.c mbr_imagemba.c \
-	mbr_hir2rnav.c mbr_hysweep1.c mbr_xtfb1624.c mbr_swplssxi.c \
-	mbr_swplssxp.c mbr_3ddepthp.c mbr_wasspenl.c mbr_mgd77txt.c \
-	mbr_mgd77tab.c mbr_photgram.c mbsys_gsf.c mbr_gsfgenmb.c
- at BUILD_GSF_TRUE@am__objects_1 = mbsys_gsf.lo mbr_gsfgenmb.lo
+	$(am__DEPENDENCIES_1)
 am_libmbio_la_OBJECTS = mb_format.lo mb_error.lo mb_swap.lo \
 	mb_compare.lo mb_navint.lo mb_read_init.lo mb_write_init.lo \
 	mb_close.lo mb_fileio.lo mb_mem.lo mb_coor_scale.lo \
 	mb_check_info.lo mb_time.lo mb_angle.lo mb_absorption.lo \
 	mb_proj.lo mb_get_value.lo mb_defaults.lo mb_process.lo \
 	mb_esf.lo mb_get.lo mb_get_all.lo mb_read.lo mb_put_all.lo \
-	mb_put_comment.lo mb_buffer.lo mb_read_ping.lo \
+	mb_put_comment.lo mb_buffer.lo mb_platform.lo mb_read_ping.lo \
 	mb_write_ping.lo mb_access.lo mb_segy.lo mb_rt.lo mbsys_sb.lo \
 	mbsys_hsds.lo mbsys_sb2100.lo mbsys_simrad.lo mbsys_simrad2.lo \
 	mbsys_simrad3.lo mbsys_mr1.lo mbsys_mr1b.lo mbsys_mr1v2001.lo \
@@ -184,34 +145,35 @@ am_libmbio_la_OBJECTS = mb_format.lo mb_error.lo mb_swap.lo \
 	mbsys_sb2000.lo mbsys_hsmd.lo mbsys_dsl.lo mbsys_mstiff.lo \
 	mbsys_oic.lo mbsys_hdcs.lo mbsys_singlebeam.lo mbsys_xse.lo \
 	mbsys_hs10.lo mbsys_atlas.lo mbsys_surf.lo mbsys_reson8k.lo \
-	mbsys_netcdf.lo mbsys_navnetcdf.lo mbsys_reson7k.lo \
-	mbsys_jstar.lo mbsys_image83p.lo mbsys_hysweep.lo \
-	mbsys_benthos.lo mbsys_swathplus.lo mbsys_3datdepthlidar.lo \
-	mbsys_wassp.lo mbsys_stereopair.lo mbr_sbsiomrg.lo \
-	mbr_sbsiocen.lo mbr_sbsiolsi.lo mbr_sburicen.lo \
-	mbr_sburivax.lo mbr_sbifremr.lo mbr_hsatlraw.lo \
-	mbr_hsldedmb.lo mbr_hsuricen.lo mbr_hsurivax.lo \
-	mbr_hsldeoih.lo mbr_hsunknwn.lo mbr_sb2100rw.lo \
-	mbr_sb2100bi.lo mbr_emoldraw.lo mbr_em12darw.lo \
-	mbr_em12ifrm.lo mbr_em300raw.lo mbr_em300mba.lo \
-	mbr_em710raw.lo mbr_em710mba.lo mbr_mr1prhig.lo \
-	mbr_mr1aldeo.lo mbr_mr1bldeo.lo mbr_mr1prvr2.lo \
-	mbr_mbldeoih.lo mbr_cbat9001.lo mbr_cbat8101.lo \
-	mbr_hypc8101.lo mbr_bchrtunb.lo mbr_elmk2unb.lo \
-	mbr_bchrxunb.lo mbr_l3xseraw.lo mbr_sbsioswb.lo \
-	mbr_sb2000sb.lo mbr_sb2000ss.lo mbr_hsmdaraw.lo \
-	mbr_hsmdldih.lo mbr_dsl120pf.lo mbr_dsl120sf.lo \
-	mbr_mstiffss.lo mbr_oicgeoda.lo mbr_oicmbari.lo \
-	mbr_omghdcsj.lo mbr_mgd77dat.lo mbr_asciixyz.lo \
-	mbr_hydrob93.lo mbr_mbarirov.lo mbr_mbarrov2.lo \
-	mbr_mbpronav.lo mbr_hs10jams.lo mbr_hsds2raw.lo \
-	mbr_hsds2lam.lo mbr_xtfr8101.lo mbr_mbnetcdf.lo \
-	mbr_nvnetcdf.lo mbr_samesurf.lo mbr_reson7kr.lo \
-	mbr_edgjstar.lo mbr_segysegy.lo mbr_image83p.lo \
-	mbr_imagemba.lo mbr_hir2rnav.lo mbr_hysweep1.lo \
-	mbr_xtfb1624.lo mbr_swplssxi.lo mbr_swplssxp.lo \
-	mbr_3ddepthp.lo mbr_wasspenl.lo mbr_mgd77txt.lo \
-	mbr_mgd77tab.lo mbr_photgram.lo $(am__objects_1)
+	mbsys_gsf.lo mbr_gsfgenmb.lo mbsys_netcdf.lo \
+	mbsys_navnetcdf.lo mbsys_reson7k.lo mbsys_jstar.lo \
+	mbsys_image83p.lo mbsys_hysweep.lo mbsys_benthos.lo \
+	mbsys_swathplus.lo mbsys_3datdepthlidar.lo mbsys_wassp.lo \
+	mbsys_stereopair.lo mbr_sbsiomrg.lo mbr_sbsiocen.lo \
+	mbr_sbsiolsi.lo mbr_sburicen.lo mbr_sburivax.lo \
+	mbr_sbifremr.lo mbr_hsatlraw.lo mbr_hsldedmb.lo \
+	mbr_hsuricen.lo mbr_hsurivax.lo mbr_hsldeoih.lo \
+	mbr_hsunknwn.lo mbr_sb2100rw.lo mbr_sb2100bi.lo \
+	mbr_emoldraw.lo mbr_em12darw.lo mbr_em12ifrm.lo \
+	mbr_em300raw.lo mbr_em300mba.lo mbr_em710raw.lo \
+	mbr_em710mba.lo mbr_mr1prhig.lo mbr_mr1aldeo.lo \
+	mbr_mr1bldeo.lo mbr_mr1prvr2.lo mbr_mbldeoih.lo \
+	mbr_cbat9001.lo mbr_cbat8101.lo mbr_hypc8101.lo \
+	mbr_bchrtunb.lo mbr_elmk2unb.lo mbr_bchrxunb.lo \
+	mbr_l3xseraw.lo mbr_sbsioswb.lo mbr_sb2000sb.lo \
+	mbr_sb2000ss.lo mbr_hsmdaraw.lo mbr_hsmdldih.lo \
+	mbr_dsl120pf.lo mbr_dsl120sf.lo mbr_mstiffss.lo \
+	mbr_oicgeoda.lo mbr_oicmbari.lo mbr_omghdcsj.lo \
+	mbr_mgd77dat.lo mbr_asciixyz.lo mbr_hydrob93.lo \
+	mbr_mbarirov.lo mbr_mbarrov2.lo mbr_mbpronav.lo \
+	mbr_hs10jams.lo mbr_hsds2raw.lo mbr_hsds2lam.lo \
+	mbr_xtfr8101.lo mbr_mbnetcdf.lo mbr_nvnetcdf.lo \
+	mbr_samesurf.lo mbr_reson7kr.lo mbr_edgjstar.lo \
+	mbr_segysegy.lo mbr_image83p.lo mbr_imagemba.lo \
+	mbr_hir2rnav.lo mbr_hysweep1.lo mbr_xtfb1624.lo \
+	mbr_swplssxi.lo mbr_swplssxp.lo mbr_3ddepthp.lo \
+	mbr_wasspenl.lo mbr_mgd77txt.lo mbr_mgd77tab.lo \
+	mbr_photgram.lo
 nodist_libmbio_la_OBJECTS =
 libmbio_la_OBJECTS = $(am_libmbio_la_OBJECTS) \
 	$(nodist_libmbio_la_OBJECTS)
@@ -257,33 +219,12 @@ am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
 SOURCES = $(libmbio_la_SOURCES) $(nodist_libmbio_la_SOURCES)
-DIST_SOURCES = $(am__libmbio_la_SOURCES_DIST)
+DIST_SOURCES = $(libmbio_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-am__include_HEADERS_DIST = mb_config.h mb_format.h mb_status.h mb_io.h \
-	mb_swap.h mb_define.h mb_process.h mb_segy.h mb_info.h \
-	mbsys_sb.h mbsys_hsds.h mbsys_sb2100.h mbsys_simrad.h \
-	mbsys_simrad2.h mbsys_simrad3.h mbsys_mr1.h mbsys_mr1b.h \
-	mbsys_mr1v2001.h mbsys_ldeoih.h mbsys_reson.h mbsys_sb2000.h \
-	mbsys_hsmd.h mbsys_dsl.h mbsys_mstiff.h mbsys_oic.h \
-	mbsys_hdcs.h mbsys_singlebeam.h mbsys_xse.h mbsys_hs10.h \
-	mbsys_atlas.h mbsys_surf.h mbsys_reson8k.h mbsys_netcdf.h \
-	mbsys_navnetcdf.h mbsys_reson7k.h mbsys_jstar.h \
-	mbsys_image83p.h mbsys_hysweep.h mbsys_benthos.h \
-	mbsys_swathplus.h mbsys_3datdepthlidar.h mbsys_wassp.h \
-	mbsys_stereopair.h mbf_sbsiomrg.h mbf_sbsiocen.h \
-	mbf_sbsiolsi.h mbf_sburicen.h mbf_sbifremr.h mbf_hsatlraw.h \
-	mbf_hsldedmb.h mbf_hsuricen.h mbf_hsldeoih.h mbf_sb2100rw.h \
-	mbf_em12darw.h mbf_em12ifrm.h mbf_mr1prhig.h mbf_mr1aldeo.h \
-	mbf_mr1bldeo.h mbf_cbat9001.h mbf_cbat8101.h mbf_hypc8101.h \
-	mbf_bchrtunb.h mbf_elmk2unb.h mbf_bchrxunb.h mbf_sbsioswb.h \
-	mbf_hsmdaraw.h mbf_hsmdldih.h mbf_dsl120pf.h mbf_dsl120sf.h \
-	mbf_mstiffss.h mbf_oicgeoda.h mbf_oicmbari.h mbf_omghdcsj.h \
-	mbf_mgd77dat.h mbf_mbarirov.h mbf_mbarrov2.h mbf_mbpronav.h \
-	mbf_xtfr8101.h mbsys_gsf.h mbf_gsfgenmb.h
 HEADERS = $(include_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
 	$(LISP)mb_config.h.in
@@ -334,8 +275,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -352,6 +291,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -415,19 +355,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -440,8 +387,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -456,70 +401,135 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 lib_LTLIBRARIES = libmbio.la
-include_HEADERS = mb_config.h mb_format.h mb_status.h mb_io.h \
-	mb_swap.h mb_define.h mb_process.h mb_segy.h mb_info.h \
-	mbsys_sb.h mbsys_hsds.h mbsys_sb2100.h mbsys_simrad.h \
-	mbsys_simrad2.h mbsys_simrad3.h mbsys_mr1.h mbsys_mr1b.h \
-	mbsys_mr1v2001.h mbsys_ldeoih.h mbsys_reson.h mbsys_sb2000.h \
-	mbsys_hsmd.h mbsys_dsl.h mbsys_mstiff.h mbsys_oic.h \
-	mbsys_hdcs.h mbsys_singlebeam.h mbsys_xse.h mbsys_hs10.h \
-	mbsys_atlas.h mbsys_surf.h mbsys_reson8k.h mbsys_netcdf.h \
-	mbsys_navnetcdf.h mbsys_reson7k.h mbsys_jstar.h \
-	mbsys_image83p.h mbsys_hysweep.h mbsys_benthos.h \
-	mbsys_swathplus.h mbsys_3datdepthlidar.h mbsys_wassp.h \
-	mbsys_stereopair.h mbf_sbsiomrg.h mbf_sbsiocen.h \
-	mbf_sbsiolsi.h mbf_sburicen.h mbf_sbifremr.h mbf_hsatlraw.h \
-	mbf_hsldedmb.h mbf_hsuricen.h mbf_hsldeoih.h mbf_sb2100rw.h \
-	mbf_em12darw.h mbf_em12ifrm.h mbf_mr1prhig.h mbf_mr1aldeo.h \
-	mbf_mr1bldeo.h mbf_cbat9001.h mbf_cbat8101.h mbf_hypc8101.h \
-	mbf_bchrtunb.h mbf_elmk2unb.h mbf_bchrxunb.h mbf_sbsioswb.h \
-	mbf_hsmdaraw.h mbf_hsmdldih.h mbf_dsl120pf.h mbf_dsl120sf.h \
-	mbf_mstiffss.h mbf_oicgeoda.h mbf_oicmbari.h mbf_omghdcsj.h \
-	mbf_mgd77dat.h mbf_mbarirov.h mbf_mbarrov2.h mbf_mbpronav.h \
-	mbf_xtfr8101.h $(am__append_1)
+include_HEADERS = mb_config.h \
+        mb_format.h mb_status.h \
+        mb_io.h mb_swap.h \
+        mb_define.h mb_process.h \
+        mb_segy.h mb_info.h \
+        mbsys_sb.h mbsys_hsds.h \
+        mbsys_sb2100.h mbsys_simrad.h \
+        mbsys_simrad2.h mbsys_simrad3.h \
+        mbsys_mr1.h mbsys_mr1b.h mbsys_mr1v2001.h \
+        mbsys_ldeoih.h \
+        mbsys_reson.h mbsys_sb2000.h \
+        mbsys_hsmd.h mbsys_dsl.h \
+        mbsys_mstiff.h \
+        mbsys_oic.h mbsys_hdcs.h \
+        mbsys_singlebeam.h mbsys_xse.h \
+        mbsys_hs10.h \
+        mbsys_atlas.h mbsys_surf.h \
+	mbsys_gsf.h mbf_gsfgenmb.h \
+        mbsys_reson8k.h \
+        mbsys_netcdf.h mbsys_navnetcdf.h \
+        mbsys_reson7k.h mbsys_jstar.h \
+        mbsys_image83p.h mbsys_hysweep.h \
+        mbsys_benthos.h mbsys_swathplus.h \
+	mbsys_3datdepthlidar.h mbsys_wassp.h \
+	mbsys_stereopair.h \
+        mbf_sbsiomrg.h mbf_sbsiocen.h \
+        mbf_sbsiolsi.h mbf_sburicen.h \
+        mbf_sbifremr.h mbf_hsatlraw.h \
+        mbf_hsldedmb.h mbf_hsuricen.h \
+        mbf_hsldeoih.h \
+        mbf_sb2100rw.h \
+        mbf_em12darw.h mbf_em12ifrm.h \
+        mbf_mr1prhig.h mbf_mr1aldeo.h \
+        mbf_mr1bldeo.h mbf_cbat9001.h \
+        mbf_cbat8101.h mbf_hypc8101.h \
+        mbf_bchrtunb.h mbf_elmk2unb.h \
+        mbf_bchrxunb.h \
+        mbf_sbsioswb.h \
+        mbf_hsmdaraw.h mbf_hsmdldih.h \
+        mbf_dsl120pf.h mbf_dsl120sf.h \
+        mbf_mstiffss.h \
+        mbf_oicgeoda.h mbf_oicmbari.h \
+        mbf_omghdcsj.h mbf_mgd77dat.h \
+        mbf_mbarirov.h mbf_mbarrov2.h \
+        mbf_mbpronav.h mbf_xtfr8101.h
+
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
 AM_CPPFLAGS = -I at top_srcdir@/src/bsio -I at top_srcdir@/src/surf \
-	${libgmt_CPPFLAGS} ${libnetcdf_CPPFLAGS} $(am__append_2) \
-	$(am__append_3) $(am__append_4)
+	-I at top_srcdir@/src/gsf ${libgmt_CPPFLAGS} \
+	${libnetcdf_CPPFLAGS} $(am__append_1) $(am__append_2)
 libmbio_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbio_la_SOURCES = mb_format.c mb_error.c mb_swap.c mb_compare.c \
-	mb_navint.c mb_read_init.c mb_write_init.c mb_close.c \
-	mb_fileio.c mb_mem.c mb_coor_scale.c mb_check_info.c mb_time.c \
-	mb_angle.c mb_absorption.c mb_proj.c mb_get_value.c \
-	mb_defaults.c mb_process.c mb_esf.c mb_get.c mb_get_all.c \
-	mb_read.c mb_put_all.c mb_put_comment.c mb_buffer.c \
-	mb_read_ping.c mb_write_ping.c mb_access.c mb_segy.c mb_rt.c \
-	mbsys_sb.c mbsys_hsds.c mbsys_sb2100.c mbsys_simrad.c \
-	mbsys_simrad2.c mbsys_simrad3.c mbsys_mr1.c mbsys_mr1b.c \
-	mbsys_mr1v2001.c mbsys_ldeoih.c mbsys_reson.c mbsys_elac.c \
-	mbsys_elacmk2.c mbsys_sb2000.c mbsys_hsmd.c mbsys_dsl.c \
-	mbsys_mstiff.c mbsys_oic.c mbsys_hdcs.c mbsys_singlebeam.c \
-	mbsys_xse.c mbsys_hs10.c mbsys_atlas.c mbsys_surf.c \
-	mbsys_reson8k.c mbsys_netcdf.c mbsys_navnetcdf.c \
-	mbsys_reson7k.c mbsys_jstar.c mbsys_image83p.c mbsys_hysweep.c \
-	mbsys_benthos.c mbsys_swathplus.c mbsys_3datdepthlidar.c \
-	mbsys_wassp.c mbsys_stereopair.c mbr_sbsiomrg.c mbr_sbsiocen.c \
-	mbr_sbsiolsi.c mbr_sburicen.c mbr_sburivax.c mbr_sbifremr.c \
-	mbr_hsatlraw.c mbr_hsldedmb.c mbr_hsuricen.c mbr_hsurivax.c \
-	mbr_hsldeoih.c mbr_hsunknwn.c mbr_sb2100rw.c mbr_sb2100bi.c \
-	mbr_emoldraw.c mbr_em12darw.c mbr_em12ifrm.c mbr_em300raw.c \
-	mbr_em300mba.c mbr_em710raw.c mbr_em710mba.c mbr_mr1prhig.c \
-	mbr_mr1aldeo.c mbr_mr1bldeo.c mbr_mr1prvr2.c mbr_mbldeoih.c \
-	mbr_cbat9001.c mbr_cbat8101.c mbr_hypc8101.c mbr_bchrtunb.c \
-	mbr_elmk2unb.c mbr_bchrxunb.c mbr_l3xseraw.c mbr_sbsioswb.c \
-	mbr_sb2000sb.c mbr_sb2000ss.c mbr_hsmdaraw.c mbr_hsmdldih.c \
-	mbr_dsl120pf.c mbr_dsl120sf.c mbr_mstiffss.c mbr_oicgeoda.c \
-	mbr_oicmbari.c mbr_omghdcsj.c mbr_mgd77dat.c mbr_asciixyz.c \
-	mbr_hydrob93.c mbr_mbarirov.c mbr_mbarrov2.c mbr_mbpronav.c \
-	mbr_hs10jams.c mbr_hsds2raw.c mbr_hsds2lam.c mbr_xtfr8101.c \
-	mbr_mbnetcdf.c mbr_nvnetcdf.c mbr_samesurf.c mbr_reson7kr.c \
-	mbr_edgjstar.c mbr_segysegy.c mbr_image83p.c mbr_imagemba.c \
-	mbr_hir2rnav.c mbr_hysweep1.c mbr_xtfb1624.c mbr_swplssxi.c \
-	mbr_swplssxp.c mbr_3ddepthp.c mbr_wasspenl.c mbr_mgd77txt.c \
-	mbr_mgd77tab.c mbr_photgram.c $(am__append_5)
+libmbio_la_SOURCES = \
+		mb_format.c mb_error.c \
+                mb_swap.c mb_compare.c mb_navint.c \
+                mb_read_init.c mb_write_init.c mb_close.c \
+                mb_fileio.c mb_mem.c \
+                mb_coor_scale.c mb_check_info.c \
+                mb_time.c mb_angle.c \
+                mb_absorption.c mb_proj.c \
+                mb_get_value.c mb_defaults.c \
+                mb_process.c mb_esf.c \
+                mb_get.c mb_get_all.c mb_read.c \
+                mb_put_all.c mb_put_comment.c \
+                mb_buffer.c mb_platform.c \
+                mb_read_ping.c mb_write_ping.c \
+                mb_access.c mb_segy.c mb_rt.c \
+                mbsys_sb.c mbsys_hsds.c \
+                mbsys_sb2100.c mbsys_simrad.c \
+                mbsys_simrad2.c mbsys_simrad3.c \
+                mbsys_mr1.c mbsys_mr1b.c mbsys_mr1v2001.c \
+                mbsys_ldeoih.c mbsys_reson.c \
+                mbsys_elac.c mbsys_elacmk2.c \
+                mbsys_sb2000.c mbsys_hsmd.c mbsys_dsl.c \
+                mbsys_mstiff.c \
+                mbsys_oic.c mbsys_hdcs.c \
+                mbsys_singlebeam.c mbsys_xse.c \
+                mbsys_hs10.c mbsys_atlas.c \
+                mbsys_surf.c mbsys_reson8k.c \
+		mbsys_gsf.c mbr_gsfgenmb.c \
+                mbsys_netcdf.c mbsys_navnetcdf.c \
+                mbsys_reson7k.c mbsys_jstar.c \
+                mbsys_image83p.c mbsys_hysweep.c \
+                mbsys_benthos.c mbsys_swathplus.c \
+		mbsys_3datdepthlidar.c mbsys_wassp.c \
+		mbsys_stereopair.c \
+                mbr_sbsiomrg.c mbr_sbsiocen.c \
+                mbr_sbsiolsi.c mbr_sburicen.c \
+                mbr_sburivax.c mbr_sbifremr.c \
+                mbr_hsatlraw.c mbr_hsldedmb.c \
+                mbr_hsuricen.c mbr_hsurivax.c \
+                mbr_hsldeoih.c mbr_hsunknwn.c \
+                mbr_sb2100rw.c mbr_sb2100bi.c \
+                mbr_emoldraw.c mbr_em12darw.c \
+                mbr_em12ifrm.c \
+                mbr_em300raw.c mbr_em300mba.c \
+                mbr_em710raw.c mbr_em710mba.c \
+                mbr_mr1prhig.c mbr_mr1aldeo.c \
+                mbr_mr1bldeo.c mbr_mr1prvr2.c \
+                mbr_mbldeoih.c mbr_cbat9001.c \
+                mbr_cbat8101.c mbr_hypc8101.c \
+                mbr_bchrtunb.c mbr_elmk2unb.c \
+                mbr_bchrxunb.c mbr_l3xseraw.c \
+                mbr_sbsioswb.c \
+                mbr_sb2000sb.c mbr_sb2000ss.c \
+                mbr_hsmdaraw.c mbr_hsmdldih.c \
+                mbr_dsl120pf.c mbr_dsl120sf.c \
+                mbr_mstiffss.c \
+                mbr_oicgeoda.c mbr_oicmbari.c \
+                mbr_omghdcsj.c mbr_mgd77dat.c \
+                mbr_asciixyz.c mbr_hydrob93.c \
+                mbr_mbarirov.c mbr_mbarrov2.c \
+                mbr_mbpronav.c mbr_hs10jams.c \
+                mbr_hsds2raw.c mbr_hsds2lam.c \
+                mbr_xtfr8101.c \
+                mbr_mbnetcdf.c mbr_nvnetcdf.c \
+                mbr_samesurf.c mbr_reson7kr.c \
+                mbr_edgjstar.c mbr_segysegy.c \
+                mbr_image83p.c mbr_imagemba.c \
+                mbr_hir2rnav.c mbr_hysweep1.c \
+                mbr_xtfb1624.c mbr_swplssxi.c \
+                mbr_swplssxp.c mbr_3ddepthp.c \
+		mbr_wasspenl.c mbr_mgd77txt.c \
+		mbr_mgd77tab.c mbr_photgram.c
+
 libmbio_la_LIBADD = $(top_builddir)/src/bsio/libmbbsio.la \
-	$(top_builddir)/src/surf/libmbsapi.la ${libgmt_LIBS} \
-	${libnetcdf_LIBS} ${libproj_LIBS} ${XDR_LIB} $(am__append_6)
+                   $(top_builddir)/src/surf/libmbsapi.la \
+		   $(top_builddir)/src/gsf/libmbgsf.la \
+		   ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${XDR_LIB}
+
 nodist_libmbio_la_SOURCES = projections.h
 BUILT_SOURCES = projections.h
 CLEANFILES = projections.h
@@ -637,6 +647,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_get_value.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_mem.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_navint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_platform.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_process.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_proj.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_put_all.Plo at am__quote@
diff --git a/src/mbio/Makefile.template b/src/mbio/Makefile.template
deleted file mode 100644
index d5bf7ba..0000000
--- a/src/mbio/Makefile.template
+++ /dev/null
@@ -1,824 +0,0 @@
-#     The MB-system:	Makefile.template  5/23/94
-#	$Id: Makefile.template 2215 2014-11-29 22:21:19Z caress $
-#
-#     Copyright (c) 1993-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbio directory level
-# Author:	D. W. Caress
-# Date:		May 23, 1994
-#
-# $Log: Makefile.template,v $
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# PROJ4 projection definitions
-PROJECTIONS = /usr/local/mbsystem/share/Projections.dat
-#
-# Netcdf include directory
-NETCDFINCDIR = /usr/local/netcdf/include
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -O2
-ARCHIVE = ar rcv
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFINCDIR  = $(INCDIR)
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJINCDIR  = $(INCDIR)
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the mbio library, man page, and associated include files
-all:	$(INCDIR)/mb_config.h $(INCDIR)/mb_config2.h \
-	$(INCDIR)/mb_format.h $(INCDIR)/mb_status.h \
-	$(INCDIR)/mb_io.h $(INCDIR)/mb_swap.h \
-	$(INCDIR)/mb_define.h $(INCDIR)/mb_process.h \
-	$(INCDIR)/mb_segy.h $(INCDIR)/mb_info.h \
-	$(INCDIR)/mbsys_sb.h $(INCDIR)/mbsys_hsds.h \
-	$(INCDIR)/mbsys_sb2100.h $(INCDIR)/mbsys_simrad.h \
-	$(INCDIR)/mbsys_simrad2.h $(INCDIR)/mbsys_simrad3.h \
-	$(INCDIR)/mbsys_mr1.h $(INCDIR)/mbsys_mr1b.h \
-	$(INCDIR)/mbsys_mr1v2001.h $(INCDIR)/mbsys_ldeoih.h \
-	$(INCDIR)/mbsys_reson.h $(INCDIR)/mbsys_sb2000.h \
-	$(INCDIR)/mbsys_hsmd.h $(INCDIR)/mbsys_dsl.h \
-	$(INCDIR)/mbsys_gsf.h $(INCDIR)/mbsys_mstiff.h \
-	$(INCDIR)/mbsys_oic.h $(INCDIR)/mbsys_hdcs.h \
-	$(INCDIR)/mbsys_singlebeam.h $(INCDIR)/mbsys_xse.h \
-	$(INCDIR)/mbsys_hs10.h \
-	$(INCDIR)/mbsys_atlas.h $(INCDIR)/mbsys_surf.h \
-	$(INCDIR)/mbsys_reson8k.h \
-	$(INCDIR)/mbsys_netcdf.h $(INCDIR)/mbsys_navnetcdf.h \
-	$(INCDIR)/mbsys_reson7k.h $(INCDIR)/mbsys_jstar.h \
-	$(INCDIR)/mbsys_image83p.h $(INCDIR)/mbsys_hysweep.h \
-	$(INCDIR)/mbsys_benthos.h $(INCDIR)/mbsys_swathplus.h \
-	$(INCDIR)/mbsys_3datdepthlidar.h $(INCDIR)/mbsys_wassp.h \
-	$(INCDIR)/mbsys_stereopair.h \
-	$(INCDIR)/mbf_sbsiomrg.h $(INCDIR)/mbf_sbsiocen.h \
-	$(INCDIR)/mbf_sbsiolsi.h $(INCDIR)/mbf_sburicen.h \
-	$(INCDIR)/mbf_sbifremr.h $(INCDIR)/mbf_hsatlraw.h \
-	$(INCDIR)/mbf_hsldedmb.h $(INCDIR)/mbf_hsuricen.h \
-	$(INCDIR)/mbf_hsldeoih.h \
-	$(INCDIR)/mbf_sb2100rw.h \
-	$(INCDIR)/mbf_em12darw.h $(INCDIR)/mbf_em12ifrm.h \
-	$(INCDIR)/mbf_mr1prhig.h $(INCDIR)/mbf_mr1aldeo.h \
-	$(INCDIR)/mbf_mr1bldeo.h $(INCDIR)/mbf_cbat9001.h \
-	$(INCDIR)/mbf_cbat8101.h $(INCDIR)/mbf_hypc8101.h \
-	$(INCDIR)/mbf_bchrtunb.h $(INCDIR)/mbf_elmk2unb.h \
-	$(INCDIR)/mbf_bchrxunb.h \
-	$(INCDIR)/mbf_sbsioswb.h \
-	$(INCDIR)/mbf_hsmdaraw.h $(INCDIR)/mbf_hsmdldih.h \
-	$(INCDIR)/mbf_dsl120pf.h $(INCDIR)/mbf_dsl120sf.h \
-	$(INCDIR)/mbf_gsfgenmb.h $(INCDIR)/mbf_mstiffss.h \
-	$(INCDIR)/mbf_oicgeoda.h $(INCDIR)/mbf_oicmbari.h \
-	$(INCDIR)/mbf_omghdcsj.h $(INCDIR)/mbf_mgd77dat.h \
-	$(INCDIR)/mbf_mbarirov.h $(INCDIR)/mbf_mbarrov2.h \
-	$(INCDIR)/mbf_mbpronav.h $(INCDIR)/mbf_xtfr8101.h \
-	$(LIBDIR)/libmbio.a
-
-### make clean removes the object files
-clean:
-	rm -f *.o mb_config2.h
-
-### put together the static library
-$(LIBDIR)/libmbio.a:	mb_format.o mb_error.o \
-		mb_swap.o mb_compare.o mb_navint.o \
-		mb_read_init.o mb_write_init.o mb_close.o \
-		mb_fileio.o mb_mem.o \
-		mb_coor_scale.o mb_check_info.o \
-		mb_time.o mb_angle.o \
-		mb_absorption.o mb_proj.o \
-		mb_get_value.o mb_defaults.o \
-		mb_process.o mb_esf.o \
-		mb_get.o mb_get_all.o mb_read.o \
-		mb_put_all.o mb_put_comment.o \
-		mb_buffer.o \
-		mb_read_ping.o mb_write_ping.o \
-		mb_access.o mb_segy.o mb_rt.o\
-		mbsys_sb.o mbsys_hsds.o \
-		mbsys_sb2100.o mbsys_simrad.o \
-		mbsys_simrad2.o mbsys_simrad3.o \
-		mbsys_mr1.o mbsys_mr1b.o mbsys_mr1v2001.o \
-		mbsys_ldeoih.o mbsys_reson.o \
-		mbsys_elac.o mbsys_elacmk2.o \
-		mbsys_sb2000.o mbsys_hsmd.o mbsys_dsl.o \
-		mbsys_gsf.o mbsys_mstiff.o \
-		mbsys_oic.o mbsys_hdcs.o \
-		mbsys_singlebeam.o mbsys_xse.o \
-		mbsys_hs10.o  mbsys_atlas.o \
-		mbsys_surf.o mbsys_reson8k.o \
-		mbsys_netcdf.o mbsys_navnetcdf.o  \
-		mbsys_reson7k.o mbsys_jstar.o \
-		mbsys_image83p.o mbsys_hysweep.o \
-		mbsys_benthos.o mbsys_swathplus.o \
-		mbsys_3datdepthlidar.o mbsys_wassp.o \
-		mbsys_stereopair.o \
-		mbr_sbsiomrg.o mbr_sbsiocen.o \
-		mbr_sbsiolsi.o mbr_sburicen.o \
-		mbr_sburivax.o mbr_sbifremr.o \
-		mbr_hsatlraw.o mbr_hsldedmb.o \
-		mbr_hsuricen.o mbr_hsurivax.o \
-		mbr_hsldeoih.o mbr_hsunknwn.o \
-		mbr_sb2100rw.o mbr_sb2100bi.o \
-		mbr_emoldraw.o mbr_em12darw.o \
-		mbr_em12ifrm.o \
-		mbr_em300raw.o mbr_em300mba.o \
-		mbr_em710raw.o mbr_em710mba.o \
-		mbr_mr1prhig.o mbr_mr1aldeo.o \
-		mbr_mr1bldeo.o mbr_mr1prvr2.o \
-		mbr_mbldeoih.o mbr_cbat9001.o \
-		mbr_cbat8101.o mbr_hypc8101.o \
-		mbr_bchrtunb.o mbr_elmk2unb.o \
-		mbr_bchrxunb.o mbr_l3xseraw.o \
-		mbr_sbsioswb.o \
-		mbr_sb2000sb.o mbr_sb2000ss.o \
-		mbr_hsmdaraw.o mbr_hsmdldih.o \
-		mbr_dsl120pf.o mbr_dsl120sf.o \
-		mbr_gsfgenmb.o mbr_mstiffss.o \
-		mbr_oicgeoda.o mbr_oicmbari.o \
-		mbr_omghdcsj.o mbr_mgd77dat.o \
-		mbr_asciixyz.o mbr_hydrob93.o \
-		mbr_mbarirov.o mbr_mbarrov2.o \
-		mbr_mbpronav.o mbr_hs10jams.o \
-		mbr_hsds2raw.o mbr_hsds2lam.o \
- 		mbr_xtfr8101.o \
-		mbr_mbnetcdf.o mbr_nvnetcdf.o \
-		mbr_samesurf.o mbr_reson7kr.o \
-		mbr_edgjstar.o mbr_segysegy.o \
-		mbr_image83p.o mbr_imagemba.o \
-		mbr_hir2rnav.o mbr_hysweep1.o \
-		mbr_xtfb1624.o \
-                mbr_swplssxi.o mbr_swplssxp.o \
-		mbr_3ddepthp.o mbr_wasspenl.o \
-		mbr_mgd77txt.o  mbr_mgd77tab.o \
-		mbr_photgram.o
-	$(ARCHIVE) $(LIBDIR)/libmbio.a \
-		mb_format.o mb_error.o \
-		mb_swap.o mb_compare.o mb_navint.o \
-		mb_read_init.o mb_write_init.o mb_close.o \
-		mb_fileio.o mb_mem.o \
-		mb_coor_scale.o mb_check_info.o\
-		mb_time.o mb_angle.o \
-		mb_absorption.o mb_proj.o \
-		mb_get_value.o mb_defaults.o \
-		mb_process.o mb_esf.o \
-		mb_get.o mb_get_all.o mb_read.o \
-		mb_put_all.o mb_put_comment.o \
-		mb_buffer.o \
-		mb_read_ping.o mb_write_ping.o \
-		mb_access.o mb_segy.o mb_rt.o \
-		mbsys_sb.o mbsys_hsds.o \
-		mbsys_sb2100.o mbsys_simrad.o \
-		mbsys_simrad2.o mbsys_simrad3.o \
-		mbsys_mr1.o mbsys_mr1b.o mbsys_mr1v2001.o \
-		mbsys_ldeoih.o mbsys_reson.o \
-		mbsys_elac.o mbsys_elacmk2.o \
-		mbsys_sb2000.o mbsys_hsmd.o mbsys_dsl.o \
-		mbsys_gsf.o mbsys_mstiff.o \
-		mbsys_oic.o mbsys_hdcs.o \
-		mbsys_singlebeam.o mbsys_xse.o \
-		mbsys_hs10.o mbsys_atlas.o \
-		mbsys_surf.o mbsys_reson8k.o \
-		mbsys_netcdf.o mbsys_navnetcdf.o \
-		mbsys_reson7k.o mbsys_jstar.o \
-		mbsys_image83p.o mbsys_hysweep.o \
-		mbsys_benthos.o mbsys_swathplus.o \
-		mbsys_3datdepthlidar.o mbsys_wassp.o \
-		mbsys_stereopair.o \
-		mbr_sbsiomrg.o mbr_sbsiocen.o \
-		mbr_sbsiolsi.o mbr_sburicen.o \
-		mbr_sburivax.o mbr_sbifremr.o \
-		mbr_hsatlraw.o mbr_hsldedmb.o \
-		mbr_hsuricen.o mbr_hsurivax.o \
-		mbr_hsldeoih.o mbr_hsunknwn.o \
-		mbr_sb2100rw.o mbr_sb2100bi.o \
-		mbr_emoldraw.o mbr_em12darw.o \
-		mbr_em12ifrm.o \
-		mbr_em300raw.o mbr_em300mba.o \
-		mbr_em710raw.o mbr_em710mba.o \
-		mbr_mr1prhig.o mbr_mr1aldeo.o \
-		mbr_mr1bldeo.o mbr_mr1prvr2.o \
-		mbr_mbldeoih.o mbr_cbat9001.o \
-		mbr_cbat8101.o mbr_hypc8101.o \
-		mbr_bchrtunb.o mbr_elmk2unb.o \
-		mbr_bchrxunb.o mbr_l3xseraw.o \
-		mbr_sbsioswb.o \
-		mbr_sb2000sb.o mbr_sb2000ss.o \
-		mbr_hsmdaraw.o mbr_hsmdldih.o \
-		mbr_dsl120pf.o mbr_dsl120sf.o \
-		mbr_gsfgenmb.o mbr_mstiffss.o \
-		mbr_oicgeoda.o mbr_oicmbari.o \
-		mbr_omghdcsj.o mbr_mgd77dat.o \
-		mbr_asciixyz.o mbr_hydrob93.o \
-		mbr_mbarirov.o mbr_mbarrov2.o \
-		mbr_mbpronav.o mbr_hs10jams.o \
-		mbr_hsds2raw.o mbr_hsds2lam.o \
- 		mbr_xtfr8101.o \
-		mbr_mbnetcdf.o mbr_nvnetcdf.o \
-		mbr_samesurf.o mbr_reson7kr.o \
-		mbr_edgjstar.o mbr_segysegy.o \
-		mbr_image83p.o mbr_imagemba.o \
-		mbr_hir2rnav.o mbr_hysweep1.o \
-		mbr_xtfb1624.o \
-                mbr_swplssxi.o mbr_swplssxp.o \
-		mbr_3ddepthp.o mbr_wasspenl.o \
-		mbr_mgd77txt.o mbr_mgd77tab.o \
-		mbr_photgram.o
-	ranlib $(LIBDIR)/libmbio.a
-
-### compile the source files
-mb_format.o:	mb_format.c mb_format.h mb_status.h mb_config2.h mb_define.h mb_io.h
-	$(CC) -c $(CFLAGS) mb_format.c
-mb_error.o:	mb_error.c mb_format.h mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_error.c
-mb_swap.o:	mb_swap.c mb_swap.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_swap.c
-mb_compare.o:	mb_compare.c mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_compare.c
-mb_navint.o:	mb_navint.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_navint.c
-mb_read_init.o:	mb_read_init.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) -I$(GSFINCDIR) -I$(NETCDFINCDIR) mb_read_init.c
-mb_write_init.o:	mb_write_init.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) -I$(GSFINCDIR) -I$(NETCDFINCDIR) mb_write_init.c
-mb_close.o:	mb_close.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) -I$(GSFINCDIR) -I$(NETCDFINCDIR) mb_close.c
-mb_fileio.o:	mb_fileio.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_fileio.c
-mb_mem.o:	mb_mem.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_mem.c
-mb_coor_scale.o:	mb_coor_scale.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_coor_scale.c
-mb_check_info.o:	mb_check_info.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_check_info.c
-mb_time.o:	mb_time.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_time.c
-mb_angle.o:	mb_angle.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_angle.c
-mb_absorption.o:	mb_absorption.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_absorption.c
-mb_proj.o:	mb_proj.c mb_status.h mb_config2.h mb_define.h $(PROJINCDIR)/proj_api.h Makefile.template
-	echo "	char *projectionfile = "'"$(PROJECTIONS)"'";" > projections.h
-	$(CC) -c $(CFLAGS) -I$(PROJINCDIR) mb_proj.c
-mb_get_value.o:	mb_get_value.c mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_get_value.c
-mb_defaults.o:	mb_defaults.c mb_status.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_defaults.c
-mb_process.o:	mb_process.c mb_status.h mb_config2.h mb_define.h mb_io.h mb_process.h
-	$(CC) -c $(CFLAGS) mb_process.c
-mb_esf.o:	mb_esf.c mb_status.h mb_config2.h mb_define.h mb_io.h mb_process.h
-	$(CC) -c $(CFLAGS) mb_esf.c
-mb_get.o:	mb_get.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_get.c
-mb_get_all.o:	mb_get_all.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_get_all.c
-mb_read.o:	mb_read.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_read.c
-mb_put_all.o:	mb_put_all.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_put_all.c
-mb_put_comment.o:	mb_put_comment.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_put_comment.c
-mb_buffer.o:	mb_buffer.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_buffer.c
-mb_read_ping.o:	mb_read_ping.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_read_ping.c
-mb_write_ping.o:	mb_write_ping.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_write_ping.c
-mb_access.o:	mb_access.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h mb_segy.h
-	$(CC) -c $(CFLAGS) mb_access.c
-mb_segy.o:	mb_segy.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h mb_segy.h
-	$(CC) -c $(CFLAGS) mb_segy.c
-mb_rt.o:	mb_rt.c mb_format.h mb_status.h mb_io.h mb_config2.h mb_define.h
-	$(CC) -c $(CFLAGS) mb_rt.c
-mbsys_sb.o:	mbsys_sb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_sb.h
-	$(CC) -c $(CFLAGS) mbsys_sb.c
-mbsys_hsds.o:	mbsys_hsds.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_hsds.h
-	$(CC) -c $(CFLAGS) mbsys_hsds.c
-mbsys_sb2100.o:	mbsys_sb2100.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_sb2100.h
-	$(CC) -c $(CFLAGS) mbsys_sb2100.c
-mbsys_simrad.o:	mbsys_simrad.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_simrad.h
-	$(CC) -c $(CFLAGS) mbsys_simrad.c
-mbsys_simrad2.o: mbsys_simrad2.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_simrad2.h
-	$(CC) -c $(CFLAGS) mbsys_simrad2.c
-mbsys_simrad3.o: mbsys_simrad3.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_simrad3.h
-	$(CC) -c $(CFLAGS) mbsys_simrad3.c
-mbsys_mr1.o:	mbsys_mr1.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_mr1.h
-	$(CC) -c $(CFLAGS) mbsys_mr1.c
-mbsys_mr1b.o:	mbsys_mr1b.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_mr1b.h
-	$(CC) -c $(CFLAGS) mbsys_mr1b.c
-mbsys_mr1v2001.o:	mbsys_mr1v2001.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_mr1v2001.h \
-		../bsio/mbbs.h ../bsio/mbbs_defines.h ../bsio/mbbs_mem.h
-	$(CC) -c $(CFLAGS) -I../bsio mbsys_mr1v2001.c
-mbsys_ldeoih.o:	mbsys_ldeoih.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_ldeoih.h
-	$(CC) -c $(CFLAGS) mbsys_ldeoih.c
-mbsys_reson.o:	mbsys_reson.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_reson.h
-	$(CC) -c $(CFLAGS) mbsys_reson.c
-mbsys_elac.o:	mbsys_elac.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_elac.h
-	$(CC) -c $(CFLAGS) mbsys_elac.c
-mbsys_elacmk2.o:	mbsys_elacmk2.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_elacmk2.h
-	$(CC) -c $(CFLAGS) mbsys_elacmk2.c
-mbsys_sb2000.o:	mbsys_sb2000.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_sb2000.h
-	$(CC) -c $(CFLAGS) mbsys_sb2000.c
-mbsys_hsmd.o:	mbsys_hsmd.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_hsmd.h
-	$(CC) -c $(CFLAGS) mbsys_hsmd.c
-mbsys_dsl.o:	mbsys_dsl.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_dsl.h
-	$(CC) -c $(CFLAGS) mbsys_dsl.c
-mbsys_gsf.o:	mbsys_gsf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_gsf.h \
-		$(GSFINCDIR)/gsf.h $(GSFINCDIR)/gsf_ft.h $(GSFINCDIR)/gsf_enc.h
-	$(CC) -c $(CFLAGS) -I$(GSFINCDIR) mbsys_gsf.c
-mbsys_mstiff.o:	mbsys_mstiff.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_mstiff.h
-	$(CC) -c $(CFLAGS) mbsys_mstiff.c
-mbsys_oic.o:	mbsys_oic.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_oic.h
-	$(CC) -c $(CFLAGS) mbsys_oic.c
-mbsys_hdcs.o:	mbsys_hdcs.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_hdcs.h
-	$(CC) -c $(CFLAGS) mbsys_hdcs.c
-mbsys_singlebeam.o:	mbsys_singlebeam.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) mbsys_singlebeam.c
-mbsys_xse.o:	mbsys_xse.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_xse.h
-	$(CC) -c $(CFLAGS) mbsys_xse.c
-mbsys_hs10.o:	mbsys_hs10.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_hs10.h
-	$(CC) -c $(CFLAGS) mbsys_hs10.c
-mbsys_atlas.o:	mbsys_atlas.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_atlas.h
-	$(CC) -c $(CFLAGS) mbsys_atlas.c
-mbsys_surf.o:	mbsys_surf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_surf.h
-	$(CC) -c $(CFLAGS) mbsys_surf.c
-mbsys_reson8k.o:	mbsys_reson8k.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_reson8k.h
-	$(CC) -c $(CFLAGS) mbsys_reson8k.c
-mbsys_netcdf.o:	mbsys_netcdf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_netcdf.h
-	$(CC) -c $(CFLAGS) mbsys_netcdf.c
-mbsys_navnetcdf.o:	mbsys_navnetcdf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_navnetcdf.h
-	$(CC) -c $(CFLAGS) mbsys_navnetcdf.c
-mbsys_reson7k.o:	mbsys_reson7k.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_reson7k.h mb_segy.h
-	$(CC) -c $(CFLAGS) mbsys_reson7k.c
-mbsys_jstar.o:	mbsys_jstar.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_jstar.h mb_segy.h
-	$(CC) -c $(CFLAGS) mbsys_jstar.c
-mbsys_image83p.o:	mbsys_image83p.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_image83p.h mb_segy.h
-	$(CC) -c $(CFLAGS) mbsys_image83p.c
-mbsys_hysweep.o:	mbsys_hysweep.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_hysweep.h mb_segy.h
-	$(CC) -c $(CFLAGS) mbsys_hysweep.c
-mbsys_benthos.o:	mbsys_benthos.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_benthos.h
-	$(CC) -c $(CFLAGS) mbsys_benthos.c
-mbsys_swathplus.o:	mbsys_swathplus.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_swathplus.h
-	$(CC) -c $(CFLAGS) mbsys_swathplus.c
-mbsys_3datdepthlidar.o:	mbsys_3datdepthlidar.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_3datdepthlidar.h
-	$(CC) -c $(CFLAGS) mbsys_3datdepthlidar.c
-mbsys_wassp.o:	mbsys_wassp.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_wassp.h
-	$(CC) -c $(CFLAGS) mbsys_wassp.c
-mbsys_stereopair.o:	mbsys_stereopair.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mbsys_stereopair.h
-	$(CC) -c $(CFLAGS) mbsys_stereopair.c
-mbr_sbsiomrg.o:	mbr_sbsiomrg.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb.h mbf_sbsiomrg.h
-	$(CC) -c $(CFLAGS) mbr_sbsiomrg.c
-mbr_sbsiocen.o: mbr_sbsiocen.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb.h mbf_sbsiocen.h
-	$(CC) -c $(CFLAGS) mbr_sbsiocen.c
-mbr_sbsiolsi.o: mbr_sbsiolsi.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb.h mbf_sbsiolsi.h
-	$(CC) -c $(CFLAGS) mbr_sbsiolsi.c
-mbr_sburicen.o: mbr_sburicen.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb.h mbf_sburicen.h
-	$(CC) -c $(CFLAGS) mbr_sburicen.c
-mbr_sburivax.o: mbr_sburivax.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb.h mbf_sburicen.h
-	$(CC) -c $(CFLAGS) mbr_sburivax.c
-mbr_sbifremr.o: mbr_sbifremr.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb.h mbf_sbifremr.h
-	$(CC) -c $(CFLAGS) mbr_sbifremr.c
-mbr_hsatlraw.o: mbr_hsatlraw.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hsds.h mbf_hsatlraw.h
-	$(CC) -c $(CFLAGS) mbr_hsatlraw.c
-mbr_hsldedmb.o: mbr_hsldedmb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hsds.h mbf_hsldedmb.h
-	$(CC) -c $(CFLAGS) mbr_hsldedmb.c
-mbr_hsuricen.o: mbr_hsuricen.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hsds.h mbf_hsuricen.h
-	$(CC) -c $(CFLAGS) mbr_hsuricen.c
-mbr_hsurivax.o: mbr_hsurivax.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hsds.h mbf_hsuricen.h
-	$(CC) -c $(CFLAGS) mbr_hsurivax.c
-mbr_hsldeoih.o: mbr_hsldeoih.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hsds.h mbf_hsldeoih.h
-	$(CC) -c $(CFLAGS) mbr_hsldeoih.c
-mbr_hsunknwn.o: mbr_hsunknwn.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hsds.h
-	$(CC) -c $(CFLAGS) mbr_hsunknwn.c
-mbr_sb2100rw.o: mbr_sb2100rw.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_sb2100rw.h mbsys_sb2100.h
-	$(CC) -c $(CFLAGS) mbr_sb2100rw.c
-mbr_sb2100bi.o: mbr_sb2100bi.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb2100.h
-	$(CC) -c $(CFLAGS) mbr_sb2100bi.c
-mbr_emoldraw.o: mbr_emoldraw.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_simrad.h
-	$(CC) -c $(CFLAGS) mbr_emoldraw.c
-mbr_em12darw.o: mbr_em12darw.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_em12darw.h mbsys_simrad.h
-	$(CC) -c $(CFLAGS) mbr_em12darw.c
-mbr_em12ifrm.o: mbr_em12ifrm.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_em12ifrm.h mbsys_simrad.h
-	$(CC) -c $(CFLAGS) mbr_em12ifrm.c
-mbr_em300raw.o: mbr_em300raw.c mb_status.h mb_format.h mb_io.h  mb_config2.h mb_define.h mb_swap.h mbsys_simrad2.h
-	$(CC) -c $(CFLAGS) mbr_em300raw.c
-mbr_em300mba.o: mbr_em300mba.c mb_status.h mb_format.h mb_io.h  mb_config2.h mb_define.h mb_swap.h mbsys_simrad2.h
-	$(CC) -c $(CFLAGS) mbr_em300mba.c
-mbr_em710raw.o: mbr_em710raw.c mb_status.h mb_format.h mb_io.h  mb_config2.h mb_define.h mb_swap.h mbsys_simrad3.h
-	$(CC) -c $(CFLAGS) mbr_em710raw.c
-mbr_em710mba.o: mbr_em710mba.c mb_status.h mb_format.h mb_io.h  mb_config2.h mb_define.h mb_swap.h mbsys_simrad3.h
-	$(CC) -c $(CFLAGS) mbr_em710mba.c
-mbr_mr1prhig.o: mbr_mr1prhig.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mr1prhig.h mbsys_mr1.h
-	$(CC) -c $(CFLAGS) mbr_mr1prhig.c
-mbr_mr1aldeo.o: mbr_mr1aldeo.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mr1aldeo.h mbsys_mr1.h
-	$(CC) -c $(CFLAGS) mbr_mr1aldeo.c
-mbr_mr1bldeo.o: mbr_mr1bldeo.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mr1bldeo.h mbsys_mr1b.h
-	$(CC) -c $(CFLAGS) mbr_mr1bldeo.c
-mbr_mr1prvr2.o: mbr_mr1prvr2.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_mr1v2001.h \
-		../bsio/mbbs.h ../bsio/mbbs_defines.h ../bsio/mbbs_mem.h
-	$(CC) -c $(CFLAGS) -I../bsio mbr_mr1prvr2.c
-mbr_mbldeoih.o: mbr_mbldeoih.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_ldeoih.h
-	$(CC) -c $(CFLAGS) mbr_mbldeoih.c
-mbr_cbat9001.o: mbr_cbat9001.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_cbat9001.h mbsys_reson.h
-	$(CC) -c $(CFLAGS) mbr_cbat9001.c
-mbr_cbat8101.o: mbr_cbat8101.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_cbat8101.h mbsys_reson.h
-	$(CC) -c $(CFLAGS) mbr_cbat8101.c
-mbr_hypc8101.o: mbr_hypc8101.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_hypc8101.h mbsys_reson.h
-	$(CC) -c $(CFLAGS) mbr_hypc8101.c
-mbr_bchrtunb.o: mbr_bchrtunb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_bchrtunb.h mbsys_elac.h
-	$(CC) -c $(CFLAGS) mbr_bchrtunb.c
-mbr_elmk2unb.o: mbr_elmk2unb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_elmk2unb.h mbsys_elacmk2.h
-	$(CC) -c $(CFLAGS) mbr_elmk2unb.c
-mbr_bchrxunb.o: mbr_bchrxunb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_bchrxunb.h mbsys_elac.h
-	$(CC) -c $(CFLAGS) mbr_bchrxunb.c
-mbr_l3xseraw.o: mbr_l3xseraw.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_xse.h
-	$(CC) -c $(CFLAGS) mbr_l3xseraw.c
-mbr_sbsioswb.o: mbr_sbsioswb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_sbsioswb.h mbsys_sb.h
-	$(CC) -c $(CFLAGS) mbr_sbsioswb.c
-mbr_sb2000sb.o: mbr_sb2000sb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb2000.h
-	$(CC) -c $(CFLAGS) mbr_sb2000sb.c
-mbr_sb2000ss.o: mbr_sb2000ss.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_sb2000.h
-	$(CC) -c $(CFLAGS) mbr_sb2000ss.c
-mbr_hsmdaraw.o: mbr_hsmdaraw.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_hsmdaraw.h mbsys_hsmd.h
-	$(CC) -c $(CFLAGS) mbr_hsmdaraw.c
-mbr_hsmdldih.o: mbr_hsmdldih.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_hsmdldih.h mbsys_hsmd.h
-	$(CC) -c $(CFLAGS) mbr_hsmdldih.c
-mbr_dsl120pf.o: mbr_dsl120pf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_dsl120pf.h mbsys_dsl.h
-	$(CC) -c $(CFLAGS) mbr_dsl120pf.c
-mbr_dsl120sf.o: mbr_dsl120sf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_dsl120sf.h mbsys_dsl.h
-	$(CC) -c $(CFLAGS) mbr_dsl120sf.c
-mbr_gsfgenmb.o: mbr_gsfgenmb.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_gsfgenmb.h mbsys_gsf.h \
-		$(GSFINCDIR)/gsf.h $(GSFINCDIR)/gsf_ft.h $(GSFINCDIR)/gsf_enc.h
-	$(CC) -c $(CFLAGS) -I$(GSFINCDIR)  mbr_gsfgenmb.c
-mbr_mstiffss.o: mbr_mstiffss.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mstiffss.h mbsys_mstiff.h
-	$(CC) -c $(CFLAGS) mbr_mstiffss.c
-mbr_oicgeoda.o: mbr_oicgeoda.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_oicgeoda.h mbsys_oic.h
-	$(CC) -c $(CFLAGS) mbr_oicgeoda.c
-mbr_oicmbari.o: mbr_oicmbari.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_oicmbari.h mbsys_oic.h
-	$(CC) -c $(CFLAGS) mbr_oicmbari.c
-mbr_omghdcsj.o: mbr_omghdcsj.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_omghdcsj.h mbsys_hdcs.h
-	$(CC) -c $(CFLAGS) mbr_omghdcsj.c
-mbr_mgd77dat.o: mbr_mgd77dat.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mgd77dat.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) mbr_mgd77dat.c
-mbr_asciixyz.o: mbr_asciixyz.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) mbr_asciixyz.c
-mbr_hydrob93.o: mbr_hydrob93.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) mbr_hydrob93.c
-mbr_mbarirov.o: mbr_mbarirov.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mbarirov.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) mbr_mbarirov.c
-mbr_mbarrov2.o: mbr_mbarrov2.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mbarrov2.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) mbr_mbarrov2.c
-mbr_mbpronav.o: mbr_mbpronav.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_mbpronav.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) mbr_mbpronav.c
-mbr_hs10jams.o: mbr_hs10jams.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hs10.h
-	$(CC) -c $(CFLAGS) mbr_hs10jams.c
-mbr_hsds2raw.o: mbr_hsds2raw.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_atlas.h
-	$(CC) -c $(CFLAGS) mbr_hsds2raw.c
-mbr_hsds2lam.o: mbr_hsds2lam.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_atlas.h
-	$(CC) -c $(CFLAGS) mbr_hsds2lam.c
-mbr_xtfr8101.o: mbr_xtfr8101.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbf_xtfr8101.h mbsys_reson.h
-	$(CC) -c $(CFLAGS) mbr_xtfr8101.c
-mbr_mbnetcdf.o: mbr_mbnetcdf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_netcdf.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_mbnetcdf.c
-mbr_nvnetcdf.o: mbr_nvnetcdf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_navnetcdf.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_nvnetcdf.c
-mbr_samesurf.o: mbr_samesurf.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_surf.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_samesurf.c
-mbr_reson7kr.o: mbr_reson7kr.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_reson7k.h mb_segy.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_reson7kr.c
-mbr_edgjstar.o: mbr_edgjstar.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_jstar.h mb_segy.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_edgjstar.c
-mbr_segysegy.o: mbr_segysegy.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_singlebeam.h mb_segy.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_segysegy.c
-mbr_image83p.o: mbr_image83p.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_image83p.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_image83p.c
-mbr_imagemba.o: mbr_imagemba.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_image83p.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_imagemba.c
-mbr_hir2rnav.o: mbr_hir2rnav.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_singlebeam.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_hir2rnav.c
-mbr_hysweep1.o: mbr_hysweep1.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_hysweep.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_hysweep1.c
-mbr_xtfb1624.o: mbr_xtfb1624.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_benthos.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_xtfb1624.c
-mbr_swplssxi.o: mbr_swplssxi.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_swathplus.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_swplssxi.c
-mbr_swplssxp.o: mbr_swplssxp.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_swathplus.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_swplssxp.c
-mbr_3ddepthp.o: mbr_3ddepthp.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_3datdepthlidar.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_3ddepthp.c
-mbr_wasspenl.o: mbr_wasspenl.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_3datdepthlidar.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_wasspenl.c
-mbr_mgd77txt.o: mbr_mgd77txt.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_3datdepthlidar.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_mgd77txt.c
-mbr_mgd77tab.o: mbr_mgd77tab.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_3datdepthlidar.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_mgd77tab.c
-mbr_photgram.o: mbr_photgram.c mb_status.h mb_format.h mb_io.h mb_config2.h mb_define.h mb_swap.h mbsys_stereopair.h
-	$(CC) -c $(CFLAGS) -I$(NETCDFINCDIR) mbr_photgram.c
-
-### copy the include files to the include file directory
-$(INCDIR)/mb_config.h:	mb_config.h
-	cp mb_config.h $(INCDIR)/mb_config.h
-	chmod 664 $(INCDIR)/mb_config.h
-mb_config2.h:	mb_config.h Makefile
-	echo "/* MB-System configuration file mb_config2.h to be included by mb_define.h */" > mb_config2.h
-	echo "/*  when MB-System is built using install_makefiles */" >> mb_config2.h
-	grep "#define VERSION" mb_config.h >> mb_config2.h
-	echo "/* */" >> mb_config2.h
-	echo "/*  Define XDR includes according to OS */" >> mb_config2.h
-	echo "#ifdef IRIX" >> mb_config2.h
-	echo "#include <rpc/rpc.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef IRIX64" >> mb_config2.h
-	echo "#include <rpc/rpc.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef SOLARIS" >> mb_config2.h
-	echo "#include <rpc/rpc.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef LINUX" >> mb_config2.h
-	echo "#include <rpc/rpc.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef LYNX" >> mb_config2.h
-	echo "#include <rpc/rpc.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef SUN" >> mb_config2.h
-	echo "#include <rpc/xdr.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef HPUX" >> mb_config2.h
-	echo "#include <rpc/rpc.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef DARWIN" >> mb_config2.h
-	echo "#include <rpc/types.h>" >> mb_config2.h
-	echo "#include <rpc/xdr.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef CYGWIN" >> mb_config2.h
-	echo "#include <rpc/types.h>" >> mb_config2.h
-	echo "#include <rpc/xdr.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo "#ifdef OTHER" >> mb_config2.h
-	echo "#include <rpc/types.h>" >> mb_config2.h
-	echo "#include <rpc/xdr.h>" >> mb_config2.h
-	echo "#endif" >> mb_config2.h
-	echo " " >> mb_config2.h
-$(INCDIR)/mb_config2.h:	mb_config2.h
-	cp mb_config2.h $(INCDIR)/mb_config2.h
-	chmod 664 $(INCDIR)/mb_config2.h
-$(INCDIR)/mb_format.h:	mb_format.h
-	cp mb_format.h $(INCDIR)/mb_format.h
-	chmod 664 $(INCDIR)/mb_format.h
-$(INCDIR)/mb_status.h:	mb_status.h
-	cp mb_status.h $(INCDIR)/mb_status.h
-	chmod 664 $(INCDIR)/mb_status.h
-$(INCDIR)/mb_io.h:	mb_io.h
-	cp mb_io.h $(INCDIR)/mb_io.h
-	chmod 664 $(INCDIR)/mb_io.h
-$(INCDIR)/mb_swap.h:	mb_swap.h
-	cp mb_swap.h $(INCDIR)/mb_swap.h
-	chmod 664 $(INCDIR)/mb_swap.h
-$(INCDIR)/mb_define.h:	mb_define.h
-	cp mb_define.h $(INCDIR)/mb_define.h
-	chmod 664 $(INCDIR)/mb_define.h
-$(INCDIR)/mb_process.h:	mb_process.h
-	cp mb_process.h $(INCDIR)/mb_process.h
-	chmod 664 $(INCDIR)/mb_process.h
-$(INCDIR)/mb_segy.h:	mb_segy.h
-	cp mb_segy.h $(INCDIR)/mb_segy.h
-	chmod 664 $(INCDIR)/mb_segy.h
-$(INCDIR)/mb_info.h:	mb_info.h
-	cp mb_info.h $(INCDIR)/mb_info.h
-	chmod 664 $(INCDIR)/mb_info.h
-$(INCDIR)/mbsys_sb.h:	mbsys_sb.h
-	cp mbsys_sb.h $(INCDIR)/mbsys_sb.h
-	chmod 664 $(INCDIR)/mbsys_sb.h
-$(INCDIR)/mbsys_hsds.h:	mbsys_hsds.h
-	cp mbsys_hsds.h $(INCDIR)/mbsys_hsds.h
-	chmod 664 $(INCDIR)/mbsys_hsds.h
-$(INCDIR)/mbsys_sb2100.h:	mbsys_sb2100.h
-	cp mbsys_sb2100.h $(INCDIR)/mbsys_sb2100.h
-	chmod 664 $(INCDIR)/mbsys_sb2100.h
-$(INCDIR)/mbsys_simrad.h:	mbsys_simrad.h
-	cp mbsys_simrad.h $(INCDIR)/mbsys_simrad.h
-	chmod 664 $(INCDIR)/mbsys_simrad.h
-$(INCDIR)/mbsys_simrad2.h:	mbsys_simrad2.h
-	cp mbsys_simrad2.h $(INCDIR)/mbsys_simrad2.h
-	chmod 664 $(INCDIR)/mbsys_simrad2.h
-$(INCDIR)/mbsys_simrad3.h:	mbsys_simrad3.h
-	cp mbsys_simrad3.h $(INCDIR)/mbsys_simrad3.h
-	chmod 664 $(INCDIR)/mbsys_simrad3.h
-$(INCDIR)/mbsys_mr1.h:	mbsys_mr1.h
-	cp mbsys_mr1.h $(INCDIR)/mbsys_mr1.h
-	chmod 664 $(INCDIR)/mbsys_mr1.h
-$(INCDIR)/mbsys_mr1b.h:	mbsys_mr1b.h
-	cp mbsys_mr1b.h $(INCDIR)/mbsys_mr1b.h
-	chmod 664 $(INCDIR)/mbsys_mr1b.h
-$(INCDIR)/mbsys_mr1v2001.h:	mbsys_mr1v2001.h
-	cp mbsys_mr1v2001.h $(INCDIR)/mbsys_mr1v2001.h
-	chmod 664 $(INCDIR)/mbsys_mr1v2001.h
-$(INCDIR)/mbsys_ldeoih.h:	mbsys_ldeoih.h
-	cp mbsys_ldeoih.h $(INCDIR)/mbsys_ldeoih.h
-	chmod 664 $(INCDIR)/mbsys_ldeoih.h
-$(INCDIR)/mbsys_reson.h:	mbsys_reson.h
-	cp mbsys_reson.h $(INCDIR)/mbsys_reson.h
-	chmod 664 $(INCDIR)/mbsys_reson.h
-$(INCDIR)/mbsys_elac.h:	mbsys_elac.h
-	cp mbsys_elac.h $(INCDIR)/mbsys_elac.h
-	chmod 664 $(INCDIR)/mbsys_elac.h
-$(INCDIR)/mbsys_elacmk2.h:	mbsys_elacmk2.h
-	cp mbsys_elacmk2.h $(INCDIR)/mbsys_elacmk2.h
-	chmod 664 $(INCDIR)/mbsys_elacmk2.h
-$(INCDIR)/mbsys_sb2000.h:	mbsys_sb2000.h
-	cp mbsys_sb2000.h $(INCDIR)/mbsys_sb2000.h
-	chmod 664 $(INCDIR)/mbsys_sb2000.h
-$(INCDIR)/mbsys_hsmd.h:	mbsys_hsmd.h
-	cp mbsys_hsmd.h $(INCDIR)/mbsys_hsmd.h
-	chmod 664 $(INCDIR)/mbsys_hsmd.h
-$(INCDIR)/mbsys_dsl.h:	mbsys_dsl.h
-	cp mbsys_dsl.h $(INCDIR)/mbsys_dsl.h
-	chmod 664 $(INCDIR)/mbsys_dsl.h
-$(INCDIR)/mbsys_gsf.h:	mbsys_gsf.h
-	cp mbsys_gsf.h $(INCDIR)/mbsys_gsf.h
-	chmod 664 $(INCDIR)/mbsys_gsf.h
-$(INCDIR)/mbsys_mstiff.h:	mbsys_mstiff.h
-	cp mbsys_mstiff.h $(INCDIR)/mbsys_mstiff.h
-	chmod 664 $(INCDIR)/mbsys_mstiff.h
-$(INCDIR)/mbsys_oic.h:	mbsys_oic.h
-	cp mbsys_oic.h $(INCDIR)/mbsys_oic.h
-	chmod 664 $(INCDIR)/mbsys_oic.h
-$(INCDIR)/mbsys_hdcs.h:	mbsys_hdcs.h
-	cp mbsys_hdcs.h $(INCDIR)/mbsys_hdcs.h
-	chmod 664 $(INCDIR)/mbsys_hdcs.h
-$(INCDIR)/mbsys_singlebeam.h:	mbsys_singlebeam.h
-	cp mbsys_singlebeam.h $(INCDIR)/mbsys_singlebeam.h
-	chmod 664 $(INCDIR)/mbsys_singlebeam.h
-$(INCDIR)/mbsys_xse.h:	mbsys_xse.h
-	cp mbsys_xse.h $(INCDIR)/mbsys_xse.h
-	chmod 664 $(INCDIR)/mbsys_xse.h
-$(INCDIR)/mbsys_hs10.h:	mbsys_hs10.h
-	cp mbsys_hs10.h $(INCDIR)/mbsys_hs10.h
-	chmod 664 $(INCDIR)/mbsys_hs10.h
-$(INCDIR)/mbsys_reson8k.h:	mbsys_reson8k.h
-	cp mbsys_reson8k.h $(INCDIR)/mbsys_reson8k.h
-	chmod 664 $(INCDIR)/mbsys_reson8k.h
-$(INCDIR)/mbsys_netcdf.h:	mbsys_netcdf.h
-	cp mbsys_netcdf.h $(INCDIR)/mbsys_netcdf.h
-	chmod 664 $(INCDIR)/mbsys_netcdf.h
-$(INCDIR)/mbsys_navnetcdf.h:	mbsys_navnetcdf.h
-	cp mbsys_navnetcdf.h $(INCDIR)/mbsys_navnetcdf.h
-	chmod 664 $(INCDIR)/mbsys_navnetcdf.h
-$(INCDIR)/mbsys_atlas.h:	mbsys_atlas.h
-	cp mbsys_atlas.h $(INCDIR)/mbsys_atlas.h
-	chmod 664 $(INCDIR)/mbsys_atlas.h
-$(INCDIR)/mbsys_surf.h:	mbsys_surf.h
-	cp mbsys_surf.h $(INCDIR)/mbsys_surf.h
-	chmod 664 $(INCDIR)/mbsys_surf.h
-$(INCDIR)/mbsys_reson7k.h:	mbsys_reson7k.h
-	cp mbsys_reson7k.h $(INCDIR)/mbsys_reson7k.h
-	chmod 664 $(INCDIR)/mbsys_reson7k.h
-$(INCDIR)/mbsys_jstar.h:	mbsys_jstar.h
-	cp mbsys_jstar.h $(INCDIR)/mbsys_jstar.h
-	chmod 664 $(INCDIR)/mbsys_jstar.h
-$(INCDIR)/mbsys_image83p.h:	mbsys_image83p.h
-	cp mbsys_image83p.h $(INCDIR)/mbsys_image83p.h
-	chmod 664 $(INCDIR)/mbsys_image83p.h
-$(INCDIR)/mbsys_hysweep.h:	mbsys_hysweep.h
-	cp mbsys_hysweep.h $(INCDIR)/mbsys_hysweep.h
-	chmod 664 $(INCDIR)/mbsys_hysweep.h
-$(INCDIR)/mbsys_benthos.h:	mbsys_benthos.h
-	cp mbsys_benthos.h $(INCDIR)/mbsys_benthos.h
-	chmod 664 $(INCDIR)/mbsys_benthos.h
-$(INCDIR)/mbsys_swathplus.h:	mbsys_swathplus.h
-	cp mbsys_swathplus.h $(INCDIR)/mbsys_swathplus.h
-	chmod 664 $(INCDIR)/mbsys_swathplus.h
-$(INCDIR)/mbsys_3datdepthlidar.h:	mbsys_3datdepthlidar.h
-	cp mbsys_3datdepthlidar.h $(INCDIR)/mbsys_3datdepthlidar.h
-	chmod 664 $(INCDIR)/mbsys_3datdepthlidar.h
-$(INCDIR)/mbsys_wassp.h:	mbsys_wassp.h
-	cp mbsys_wassp.h $(INCDIR)/mbsys_wassp.h
-	chmod 664 $(INCDIR)/mbsys_wassp.h
-$(INCDIR)/mbsys_stereopair.h:	mbsys_stereopair.h
-	cp mbsys_stereopair.h $(INCDIR)/mbsys_stereopair.h
-	chmod 664 $(INCDIR)/mbsys_stereopair.h
-$(INCDIR)/mbf_sbsiomrg.h:	mbf_sbsiomrg.h
-	cp mbf_sbsiomrg.h $(INCDIR)/mbf_sbsiomrg.h
-	chmod 664 $(INCDIR)/mbf_sbsiomrg.h
-$(INCDIR)/mbf_sbsiocen.h:	mbf_sbsiocen.h
-	cp mbf_sbsiocen.h $(INCDIR)/mbf_sbsiocen.h
-	chmod 664 $(INCDIR)/mbf_sbsiocen.h
-$(INCDIR)/mbf_sbsiolsi.h:	mbf_sbsiolsi.h
-	cp mbf_sbsiolsi.h $(INCDIR)/mbf_sbsiolsi.h
-	chmod 664 $(INCDIR)/mbf_sbsiolsi.h
-$(INCDIR)/mbf_sburicen.h:	mbf_sburicen.h
-	cp mbf_sburicen.h $(INCDIR)/mbf_sburicen.h
-	chmod 664 $(INCDIR)/mbf_sburicen.h
-$(INCDIR)/mbf_sbifremr.h:	mbf_sbifremr.h
-	cp mbf_sbifremr.h $(INCDIR)/mbf_sbifremr.h
-	chmod 664 $(INCDIR)/mbf_sbifremr.h
-$(INCDIR)/mbf_hsatlraw.h:	mbf_hsatlraw.h
-	cp mbf_hsatlraw.h $(INCDIR)/mbf_hsatlraw.h
-	chmod 664 $(INCDIR)/mbf_hsatlraw.h
-$(INCDIR)/mbf_hsldedmb.h:	mbf_hsldedmb.h
-	cp mbf_hsldedmb.h $(INCDIR)/mbf_hsldedmb.h
-	chmod 664 $(INCDIR)/mbf_hsldedmb.h
-$(INCDIR)/mbf_hsuricen.h:	mbf_hsuricen.h
-	cp mbf_hsuricen.h $(INCDIR)/mbf_hsuricen.h
-	chmod 664 $(INCDIR)/mbf_hsuricen.h
-$(INCDIR)/mbf_hsldeoih.h:	mbf_hsldeoih.h
-	cp mbf_hsldeoih.h $(INCDIR)/mbf_hsldeoih.h
-	chmod 664 $(INCDIR)/mbf_hsldeoih.h
-$(INCDIR)/mbf_sb2100rw.h:	mbf_sb2100rw.h
-	cp mbf_sb2100rw.h $(INCDIR)/mbf_sb2100rw.h
-	chmod 664 $(INCDIR)/mbf_sb2100rw.h
-$(INCDIR)/mbf_em12darw.h:	mbf_em12darw.h
-	cp mbf_em12darw.h $(INCDIR)/mbf_em12darw.h
-	chmod 664 $(INCDIR)/mbf_em12darw.h
-$(INCDIR)/mbf_em12ifrm.h:	mbf_em12ifrm.h
-	cp mbf_em12ifrm.h $(INCDIR)/mbf_em12ifrm.h
-	chmod 664 $(INCDIR)/mbf_em12ifrm.h
-$(INCDIR)/mbf_mr1prhig.h:	mbf_mr1prhig.h
-	cp mbf_mr1prhig.h $(INCDIR)/mbf_mr1prhig.h
-	chmod 664 $(INCDIR)/mbf_mr1prhig.h
-$(INCDIR)/mbf_mr1aldeo.h:	mbf_mr1aldeo.h
-	cp mbf_mr1aldeo.h $(INCDIR)/mbf_mr1aldeo.h
-	chmod 664 $(INCDIR)/mbf_mr1aldeo.h
-$(INCDIR)/mbf_mr1bldeo.h:	mbf_mr1bldeo.h
-	cp mbf_mr1bldeo.h $(INCDIR)/mbf_mr1bldeo.h
-	chmod 664 $(INCDIR)/mbf_mr1bldeo.h
-$(INCDIR)/mbf_cbat9001.h:	mbf_cbat9001.h
-	cp mbf_cbat9001.h $(INCDIR)/mbf_cbat9001.h
-	chmod 664 $(INCDIR)/mbf_cbat9001.h
-$(INCDIR)/mbf_cbat8101.h:	mbf_cbat8101.h
-	cp mbf_cbat8101.h $(INCDIR)/mbf_cbat8101.h
-	chmod 664 $(INCDIR)/mbf_cbat8101.h
-$(INCDIR)/mbf_hypc8101.h:	mbf_hypc8101.h
-	cp mbf_hypc8101.h $(INCDIR)/mbf_hypc8101.h
-	chmod 664 $(INCDIR)/mbf_hypc8101.h
-$(INCDIR)/mbf_bchrtunb.h:	mbf_bchrtunb.h
-	cp mbf_bchrtunb.h $(INCDIR)/mbf_bchrtunb.h
-	chmod 664 $(INCDIR)/mbf_bchrtunb.h
-$(INCDIR)/mbf_elmk2unb.h:	mbf_elmk2unb.h
-	cp mbf_elmk2unb.h $(INCDIR)/mbf_elmk2unb.h
-	chmod 664 $(INCDIR)/mbf_elmk2unb.h
-$(INCDIR)/mbf_bchrxunb.h:	mbf_bchrxunb.h
-	cp mbf_bchrxunb.h $(INCDIR)/mbf_bchrxunb.h
-	chmod 664 $(INCDIR)/mbf_bchrxunb.h
-$(INCDIR)/mbf_sbsioswb.h:	mbf_sbsioswb.h
-	cp mbf_sbsioswb.h $(INCDIR)/mbf_sbsioswb.h
-	chmod 664 $(INCDIR)/mbf_sbsioswb.h
-$(INCDIR)/mbf_hsmdaraw.h:	mbf_hsmdaraw.h
-	cp mbf_hsmdaraw.h $(INCDIR)/mbf_hsmdaraw.h
-	chmod 664 $(INCDIR)/mbf_hsmdaraw.h
-$(INCDIR)/mbf_hsmdldih.h:	mbf_hsmdldih.h
-	cp mbf_hsmdldih.h $(INCDIR)/mbf_hsmdldih.h
-	chmod 664 $(INCDIR)/mbf_hsmdldih.h
-$(INCDIR)/mbf_dsl120pf.h:	mbf_dsl120pf.h
-	cp mbf_dsl120pf.h $(INCDIR)/mbf_dsl120pf.h
-	chmod 664 $(INCDIR)/mbf_dsl120pf.h
-$(INCDIR)/mbf_dsl120sf.h:	mbf_dsl120sf.h
-	cp mbf_dsl120sf.h $(INCDIR)/mbf_dsl120sf.h
-	chmod 664 $(INCDIR)/mbf_dsl120sf.h
-$(INCDIR)/mbf_gsfgenmb.h:	mbf_gsfgenmb.h
-	cp mbf_gsfgenmb.h $(INCDIR)/mbf_gsfgenmb.h
-	chmod 664 $(INCDIR)/mbf_gsfgenmb.h
-$(INCDIR)/mbf_mstiffss.h:	mbf_mstiffss.h
-	cp mbf_mstiffss.h $(INCDIR)/mbf_mstiffss.h
-	chmod 664 $(INCDIR)/mbf_mstiffss.h
-$(INCDIR)/mbf_oicgeoda.h:	mbf_oicgeoda.h
-	cp mbf_oicgeoda.h $(INCDIR)/mbf_oicgeoda.h
-	chmod 664 $(INCDIR)/mbf_oicgeoda.h
-$(INCDIR)/mbf_oicmbari.h:	mbf_oicmbari.h
-	cp mbf_oicmbari.h $(INCDIR)/mbf_oicmbari.h
-	chmod 664 $(INCDIR)/mbf_oicmbari.h
-$(INCDIR)/mbf_omghdcsj.h:	mbf_omghdcsj.h
-	cp mbf_omghdcsj.h $(INCDIR)/mbf_omghdcsj.h
-	chmod 664 $(INCDIR)/mbf_omghdcsj.h
-$(INCDIR)/mbf_mgd77dat.h:	mbf_mgd77dat.h
-	cp mbf_mgd77dat.h $(INCDIR)/mbf_mgd77dat.h
-	chmod 664 $(INCDIR)/mbf_mgd77dat.h
-$(INCDIR)/mbf_mbarirov.h:	mbf_mbarirov.h
-	cp mbf_mbarirov.h $(INCDIR)/mbf_mbarirov.h
-	chmod 664 $(INCDIR)/mbf_mbarirov.h
-$(INCDIR)/mbf_mbarrov2.h:	mbf_mbarrov2.h
-	cp mbf_mbarrov2.h $(INCDIR)/mbf_mbarrov2.h
-	chmod 664 $(INCDIR)/mbf_mbarrov2.h
-$(INCDIR)/mbf_mbpronav.h:	mbf_mbpronav.h
-	cp mbf_mbpronav.h $(INCDIR)/mbf_mbpronav.h
-	chmod 664 $(INCDIR)/mbf_mbpronav.h
-$(INCDIR)/mbf_xtfr8101.h:	mbf_xtfr8101.h
-	cp mbf_xtfr8101.h $(INCDIR)/mbf_xtfr8101.h
-	chmod 664 $(INCDIR)/mbf_xtfr8101.h
diff --git a/src/mbio/mb_absorption.c b/src/mbio/mb_absorption.c
index 1dd6936..107a193 100644
--- a/src/mbio/mb_absorption.c
+++ b/src/mbio/mb_absorption.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_absorption.c		2/10/2008
- *    $Id: mb_absorption.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_absorption.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mb_access.c b/src/mbio/mb_access.c
index 2845b70..7d6aabe 100644
--- a/src/mbio/mb_access.c
+++ b/src/mbio/mb_access.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_access.c	11/1/00
- *    $Id: mb_access.c 2215 2014-11-29 22:21:19Z caress $
-
- *    Copyright (c) 2000-2014 by
+ *    $Id: mb_access.c 2250 2015-06-30 02:12:26Z caress $
+ *
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,6 +23,8 @@
 
 /* standard include files */
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <math.h>
 #include <string.h>
 
@@ -33,7 +35,7 @@
 #include "mb_define.h"
 #include "mb_segy.h"
 
-static char rcs_id[]="$Id: mb_access.c 2215 2014-11-29 22:21:19Z caress $";
+static char svn_id[]="$Id: mb_access.c 2250 2015-06-30 02:12:26Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_alloc(int verbose, void *mbio_ptr,
@@ -47,7 +49,7 @@ int mb_alloc(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
@@ -72,7 +74,7 @@ int mb_alloc(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -95,7 +97,7 @@ int mb_deall(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
@@ -121,7 +123,7 @@ int mb_deall(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -143,7 +145,7 @@ int mb_get_store(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
@@ -159,7 +161,7 @@ int mb_get_store(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -182,7 +184,7 @@ int mb_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -209,7 +211,7 @@ int mb_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
@@ -235,7 +237,7 @@ int mb_pingnumber(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -262,7 +264,7 @@ int mb_pingnumber(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -285,7 +287,7 @@ int mb_segynumber(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -314,7 +316,7 @@ int mb_segynumber(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       line:       %d\n",*line);
 		fprintf(stderr,"dbg2       shot:       %d\n",*shot);
@@ -339,7 +341,7 @@ int mb_beamwidths(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:           %p\n",(void *)mbio_ptr);
@@ -358,7 +360,7 @@ int mb_beamwidths(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       beamwidth_xtrack: %f\n",*beamwidth_xtrack);
 		fprintf(stderr,"dbg2       beamwidth_ltrack: %f\n",*beamwidth_ltrack);
@@ -382,7 +384,7 @@ int mb_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -484,7 +486,7 @@ int mb_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -507,7 +509,7 @@ int mb_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -535,7 +537,7 @@ int mb_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -561,7 +563,7 @@ int mb_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
 		fprintf(stderr,"dbg2       mbio_ptr:      %p\n",(void *)mbio_ptr);
@@ -600,7 +602,7 @@ int mb_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:         %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -631,7 +633,7 @@ int mb_extract(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -703,7 +705,7 @@ int mb_extract(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		}
@@ -780,7 +782,7 @@ int mb_insert(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
@@ -877,7 +879,7 @@ int mb_insert(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:             %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -904,7 +906,7 @@ int mb_extract_nav(int verbose, void *mbio_ptr, void *store_ptr, int *kind,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -973,7 +975,7 @@ int mb_extract_nav(int verbose, void *mbio_ptr, void *store_ptr, int *kind,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
@@ -1019,7 +1021,7 @@ int mb_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1144,7 +1146,7 @@ int mb_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		fprintf(stderr,"dbg2       n:          %d\n",*n);
@@ -1187,7 +1189,7 @@ int mb_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:        %p\n",(void *)mbio_ptr);
@@ -1245,7 +1247,7 @@ int mb_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -1269,7 +1271,7 @@ int mb_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1296,7 +1298,7 @@ int mb_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
 		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
@@ -1322,7 +1324,7 @@ int mb_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
@@ -1351,7 +1353,7 @@ int mb_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:             %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -1377,7 +1379,7 @@ int mb_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1404,7 +1406,7 @@ int mb_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
 		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
@@ -1433,7 +1435,7 @@ int mb_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
@@ -1463,7 +1465,7 @@ int mb_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:             %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -1659,7 +1661,7 @@ int mb_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1689,7 +1691,7 @@ int mb_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		}
@@ -1727,7 +1729,7 @@ int mb_detects(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1754,7 +1756,7 @@ int mb_detects(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		}
@@ -1788,7 +1790,7 @@ int mb_pulses(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1815,7 +1817,7 @@ int mb_pulses(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		}
@@ -1849,7 +1851,7 @@ int mb_gains(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1876,7 +1878,7 @@ int mb_gains(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		}
@@ -1909,7 +1911,7 @@ int mb_gains(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1937,7 +1939,7 @@ int mb_gains(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
 		fprintf(stderr,"dbg2       sample_interval:   %lf\n",*sample_interval);
@@ -1967,7 +1969,7 @@ int mb_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1998,7 +2000,7 @@ int mb_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
 		fprintf(stderr,"dbg2       sidescan_type:     %d\n",*sidescan_type);
@@ -2037,7 +2039,7 @@ int mb_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
@@ -2081,7 +2083,7 @@ int mb_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:             %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -2107,7 +2109,7 @@ int mb_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
@@ -2138,7 +2140,7 @@ int mb_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
 		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
@@ -2232,7 +2234,7 @@ int mb_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
@@ -2264,7 +2266,7 @@ int mb_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       sampleformat:   %d\n",*sampleformat);
 		fprintf(stderr,"dbg2       kind:           %d\n",*kind);
@@ -2364,7 +2366,7 @@ int mb_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
@@ -2459,7 +2461,7 @@ int mb_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:             %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -2484,7 +2486,7 @@ int mb_ctd(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -2514,7 +2516,7 @@ int mb_ctd(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		}
@@ -2557,7 +2559,7 @@ int mb_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -2587,7 +2589,7 @@ int mb_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
 		}
@@ -2630,7 +2632,7 @@ int mb_copyrecord(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
@@ -2658,7 +2660,7 @@ int mb_copyrecord(int verbose, void *mbio_ptr,
 	if (verbose >= 2)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
diff --git a/src/mbio/mb_angle.c b/src/mbio/mb_angle.c
index c494b39..df42037 100644
--- a/src/mbio/mb_angle.c
+++ b/src/mbio/mb_angle.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_angle.c	1/21/93
- *    $Id: mb_angle.c 2208 2014-10-29 08:18:46Z caress $
+ *    $Id: mb_angle.c 2249 2015-06-26 19:26:09Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -179,47 +179,6 @@
  * Author:	D. W. Caress
  * Date:	December 30, 1998
  *
- * $Log: mb_angle.c,v $
- * Revision 5.9  2009/02/06 19:12:43  caress
- * Fixed description in mb_angle.c and angle extraction in mb_simrad3.c
- *
- * Revision 5.8  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.7  2006/12/15 21:35:31  caress
- * Fixed longstanding bug in coordinate translation code. Previously, the application of roll and pitch angles was done in the wrong order (pitch first). The errors due to this bug only became significant with large pitch values. The rotations are now done properly.
- *
- * Revision 5.6  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.1  2002/04/06 02:43:39  caress
- * Release 5.0.beta16
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.1  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/01/01  23:38:01  caress
- * MB-System version 4.6beta6
- *
  *
  */
 
@@ -231,7 +190,7 @@
 #include "mb_status.h"
 #include "mb_define.h"
 
-static char rcs_id[]="$Id: mb_angle.c 2208 2014-10-29 08:18:46Z caress $";
+static char rcs_id[]="$Id: mb_angle.c 2249 2015-06-26 19:26:09Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_takeoff_to_rollpitch(int verbose,
@@ -662,7 +621,7 @@ int mb_beaudoin(int verbose,
 	mb_beaudoin_unrotate(verbose, txMount, datt, &txGeo, error);
     
 	if (verbose >= 4)
-		printf ("dbg4      TX array x %f y %f z %f in geographic reference frame\n", txGeo.x, txGeo.y, txGeo.z);
+		fprintf(stderr, "dbg4      TX array x %f y %f z %f in geographic reference frame\n", txGeo.x, txGeo.y, txGeo.z);
     
 	rxIdeal.x = 0.0;
 	rxIdeal.y = 1.0;
@@ -681,7 +640,7 @@ int mb_beaudoin(int verbose,
 	mb_beaudoin_unrotate(verbose, rxMount, datt, &rxGeo, error);
     
 	if (verbose >= 4)
-		printf ("dbg4     RX array x %f y %f z %f in geographic reference frame\n", rxGeo.x, rxGeo.y, rxGeo.z);
+		fprintf(stderr, "dbg4     RX array x %f y %f z %f in geographic reference frame\n", rxGeo.x, rxGeo.y, rxGeo.z);
     
 	/* Have to negate it so signs work out...(was 90 - acos(...) before)  */
 	/* acos of dotproduct of rxGeo and txGeo yields angle from between vectors */
@@ -691,18 +650,29 @@ int mb_beaudoin(int verbose,
 	rxGeo.z * txGeo.z) * 180.0 / M_PI - 90.0;
     
 	if (verbose >= 4)
-		printf ("dbg4     TX/RX are non-orthogonal by %f degrees\n", non_ortho);
+		fprintf(stderr, "dbg4     TX/RX are non-orthogonal by %f degrees\n", non_ortho);
       
 	y1 = sin (-rx_steer * DTR) / cos (non_ortho * DTR);
 	y2 = sin (tx_steer * DTR) * tan (non_ortho * DTR);
 	radial = sqrt ((y1 + y2) * (y1 + y2) + sin (tx_steer * DTR) * sin (tx_steer * DTR));
       
-	if (verbose >= 4)
-	      printf("dbg4     Got y1, y2, radial: %lf %lf %lf\n",y1, y2, radial);
-      
-	beamVectRel.x = sin (tx_steer * DTR);
-	beamVectRel.y = y1 + y2;
-	beamVectRel.z = sqrt (1.0 - radial * radial);
+	if (radial <= 1.0)
+		{
+		beamVectRel.x = sin (tx_steer * DTR);
+		beamVectRel.y = y1 + y2;
+		beamVectRel.z = sqrt (1.0 - radial * radial);
+		}
+	else
+		{
+		beamVectRel.x = sin (tx_steer * DTR);
+		beamVectRel.y = sqrt(1.0 - beamVectRel.x * beamVectRel.x);
+		beamVectRel.z = 0.0;
+		}
+	      
+	//if (verbose >= 4)
+	if (radial > 1.0)
+	      fprintf(stderr, "dbg4     Got y1, y2, radial: %lf %lf %lf     beamVectRel:%f %f %f\n",
+		      y1, y2, radial, beamVectRel.x, beamVectRel.y, beamVectRel.z);
       
 	/* Build ortho-normal basis */
 	xPrime = txGeo;
@@ -720,9 +690,9 @@ int mb_beaudoin(int verbose,
       
 	if (verbose >= 4)
 		{
-		printf ("dbg4     x': %f, %f, %f\n", xPrime.x, xPrime.y, xPrime.z);
-		printf ("dbg4     y': %f, %f, %f\n", yPrime.x, yPrime.y, yPrime.z);
-		printf ("dbg4     z': %f, %f, %f\n", zPrime.x, zPrime.y, zPrime.z);
+		fprintf(stderr, "dbg4     x': %f, %f, %f\n", xPrime.x, xPrime.y, xPrime.z);
+		fprintf(stderr, "dbg4     y': %f, %f, %f\n", yPrime.x, yPrime.y, yPrime.z);
+		fprintf(stderr, "dbg4     z': %f, %f, %f\n", zPrime.x, zPrime.y, zPrime.z);
 		}
       
 	/* Columns of equivalent rotation matrix are coordinates of */
@@ -735,9 +705,9 @@ int mb_beaudoin(int verbose,
       
 	if (verbose >= 4)
 		{
-		printf ("dbg4     Beam vector is %f %f %f in transducer reference frame\n",
+		fprintf(stderr, "dbg4     Beam vector is %f %f %f in transducer reference frame\n",
 			beamVectRel.x, beamVectRel.y, beamVectRel.z);
-		printf ("dbg4     Beam vector is %f %f %f in geographic reference frame\n",
+		fprintf(stderr, "dbg4     Beam vector is %f %f %f in geographic reference frame\n",
 			beamVectGeo.x, beamVectGeo.y, beamVectGeo.z);
 		}
       
@@ -761,7 +731,7 @@ int mb_beaudoin(int verbose,
 		* 180.0 / M_PI;
       
 	if (verbose >= 4)
-	      printf("dbg4     Got beam azimuth (re: ship's heading) and depression %.2f %.2f\n",
+	      fprintf(stderr, "dbg4     Got beam azimuth (re: ship's heading) and depression %.2f %.2f\n",
 		     *beamAzimuth, *beamDepression);
 
 	/* assume success */
diff --git a/src/mbio/mb_buffer.c b/src/mbio/mb_buffer.c
index 33a8ed3..6252700 100644
--- a/src/mbio/mb_buffer.c
+++ b/src/mbio/mb_buffer.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_buffer.c	2/25/93
- *    $Id: mb_buffer.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_buffer.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -185,7 +185,7 @@
 #include "mb_io.h"
 #include "mb_define.h"
 
-static char rcs_id[]="$Id: mb_buffer.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_buffer.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_buffer_init(int verbose, void **buff_ptr, int *error)
diff --git a/src/mbio/mb_check_info.c b/src/mbio/mb_check_info.c
index 7af0071..13a93e6 100644
--- a/src/mbio/mb_check_info.c
+++ b/src/mbio/mb_check_info.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_check_info.c	1/25/93
- *    $Id: mb_check_info.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_check_info.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -130,7 +130,7 @@
 #include "mb_format.h"
 #include "mb_info.h"
 
-static char rcs_id[]="$Id: mb_check_info.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_check_info.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_check_info(int verbose, char *file, int lonflip, double bounds[4], int *file_in_bounds, int *error)
diff --git a/src/mbio/mb_close.c b/src/mbio/mb_close.c
index 8efd14b..f643c7a 100644
--- a/src/mbio/mb_close.c
+++ b/src/mbio/mb_close.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_close.c	1/25/93
- *	$Id: mb_close.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mb_close.c 2224 2015-02-04 19:14:05Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -19,108 +19,6 @@
  * Author:	D. W. Caress
  * Date:	January 25, 1993
  *
- * $Log: mb_close.c,v $
- * Revision 5.13  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.12  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.11  2006/01/11 07:37:29  caress
- * Working towards 5.0.8
- *
- * Revision 5.10  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2003/11/24 19:25:02  caress
- * Implementing changes by Reinhard Holtkamp to better support SURF data.
- *
- * Revision 5.8  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.4  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.3  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.2  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/06/29 22:48:04  caress
- * Added support for HSDS2RAW
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1997/04/17  18:51:12  caress
- * Added LINUX ifdef.
- *
- * Revision 4.8  1996/08/26  17:24:56  caress
- * Release 4.4 revision.
- *
- * Revision 4.7  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1995/03/22  19:14:25  caress
- * Added #ifdef's for HPUX.
- *
- * Revision 4.5  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/01/25  17:13:46  caress
- * Added ifdef for SOLARIS.
- *
- * Revision 4.3  1994/11/24  01:53:22  caress
- * Some fixes related to MR1 data.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/05  23:55:38  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/20  03:19:25  caress
- * First cut at new version.  Added support for
- * sidescan and amplitude data.
- *
- * Revision 3.3  1993/05/15  14:35:27  caress
- * fixed rcs_id message
- *
- * Revision 3.2  1993/05/14  22:32:19  sohara
- * fixed rcs id message
- *
- * Revision 3.1  1993/05/14  22:18:32  sohara
- * fixed rcs_id messages
- *
  */
 
 /* standard include files */
@@ -135,12 +33,10 @@
 #include "mb_io.h"
 #include "mb_segy.h"
 #include "../surf/mb_sapi.h"
-#ifdef WITH_GSF
-#  include "gsf.h"
-#endif
+#include "gsf.h"
 #include "netcdf.h"
 
-static	char	rcs_id[]="$Id: mb_close.c 2175 2014-03-18 23:03:39Z caress $";
+static	char	rcs_id[]="$Id: mb_close.c 2224 2015-02-04 19:14:05Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_close(int verbose, void **mbio_ptr, int *error)
@@ -201,13 +97,11 @@ int mb_close(int verbose, void **mbio_ptr, int *error)
 	    status = mb_fileio_close(verbose, *mbio_ptr, error);
 	    }
 
-#ifdef WITH_GSF
 	/* else if gsf then use gsfClose */
 	else if (mb_io_ptr->filetype == MB_FILETYPE_GSF)
 	    {
 	    gsfClose((int) mb_io_ptr->gsfid);
 	    }
-#endif
 
 	/* else if netcdf then use nc_close */
 	else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF)
diff --git a/src/mbio/mb_compare.c b/src/mbio/mb_compare.c
index f1a2620..115c1c8 100644
--- a/src/mbio/mb_compare.c
+++ b/src/mbio/mb_compare.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_compare.c	11/19/98
- *    $Id: mb_compare.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_compare.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mb_config.h.in b/src/mbio/mb_config.h
similarity index 65%
copy from src/mbio/mb_config.h.in
copy to src/mbio/mb_config.h
index 9278cfc..8d113a0 100644
--- a/src/mbio/mb_config.h.in
+++ b/src/mbio/mb_config.h
@@ -1,110 +1,95 @@
+/* src/mbio/mb_config.h.  Generated from mb_config.h.in by configure.  */
 /* src/mbio/mb_config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Machine is littleendian, (Byteswapping on) */
-#undef BYTESWAPPED
+#define BYTESWAPPED 1
 
 /* Machine is bigendian, (Byteswapping off) */
-#undef ENDIAN_BIG
+/* #undef ENDIAN_BIG */
 
 /* Turned on OpenGL define in config */
-#undef GOT_GL
-
-/* Turned on Motif define in config */
-#undef GOT_MOTIF
+#define GOT_GL 1
 
 /* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <GL/glu.h> header file. */
-#undef HAVE_GL_GLU_H
-
-/* Define to 1 if you have the <GL/glx.h> header file. */
-#undef HAVE_GL_GLX_H
-
-/* Define to 1 if you have the <GL/gl.h> header file. */
-#undef HAVE_GL_GL_H
+#define HAVE_DLFCN_H 1
 
 /* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
+#define HAVE_INTTYPES_H 1
 
 /* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
+#define HAVE_LIBM 1
 
 /* Define to 1 if you have the `ws2_32' library (-lws2_32). */
-#undef HAVE_LIBWS2_32
+/* #undef HAVE_LIBWS2_32 */
 
 /* Have malloc.h */
-#undef HAVE_MALLOC_H
+/* #undef HAVE_MALLOC_H */
 
 /* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+#define HAVE_MEMORY_H 1
 
 /* Define to 1 if you have the <rpc/rpc.h> header file. */
-#undef HAVE_RPC_RPC_H
+#define HAVE_RPC_RPC_H 1
 
 /* Define to 1 if you have the <rpc/types.h> header file. */
-#undef HAVE_RPC_TYPES_H
+#define HAVE_RPC_TYPES_H 1
 
 /* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
+#define HAVE_STDINT_H 1
 
 /* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
+#define HAVE_STDLIB_H 1
 
 /* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+#define HAVE_STRINGS_H 1
 
 /* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+#define HAVE_STRING_H 1
 
 /* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
+#define HAVE_SYS_STAT_H 1
 
 /* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
+#define HAVE_SYS_TYPES_H 1
 
 /* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
+#define HAVE_UNISTD_H 1
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#undef LT_OBJDIR
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
 
 /* Name of package */
-#undef PACKAGE
+#define PACKAGE "mbsystem"
 
 /* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
+#define PACKAGE_BUGREPORT "http://listserver.mbari.org/sympa/arc/mbsystem"
 
 /* Define to the full name of this package. */
-#undef PACKAGE_NAME
+#define PACKAGE_NAME "mbsystem"
 
 /* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
+#define PACKAGE_STRING "mbsystem 5.5.2252"
 
 /* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
+#define PACKAGE_TARNAME "mbsystem"
 
 /* Define to the home page for this package. */
-#undef PACKAGE_URL
+#define PACKAGE_URL "http://www.mbari.org/data/mbsystem/"
 
 /* Define to the version of this package. */
-#undef PACKAGE_VERSION
+#define PACKAGE_VERSION "5.5.2252"
 
 /* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
+#define STDC_HEADERS 1
 
 /* Version number of package */
-#undef VERSION
+#define VERSION "5.5.2252"
 
 /* Set VERSION_DATE define in mb_config.h */
-#undef VERSION_DATE
+#define VERSION_DATE "1 July 2015"
 
 /* Turned on WIN32 define in config */
-#undef WIN32
-
-/* Build with GSF */
-#undef WITH_GSF
+/* #undef WIN32 */
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
@@ -114,10 +99,10 @@
 # endif
 #else
 # ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
 # endif
 #endif
 
 /* Define to the type of a signed integer type of width exactly 8 bits if such
    a type exists and the standard includes do not define it. */
-#undef int8_t
+/* #undef int8_t */
diff --git a/src/mbio/mb_config.h.in b/src/mbio/mb_config.h.in
index 9278cfc..0f8cef9 100644
--- a/src/mbio/mb_config.h.in
+++ b/src/mbio/mb_config.h.in
@@ -9,21 +9,9 @@
 /* Turned on OpenGL define in config */
 #undef GOT_GL
 
-/* Turned on Motif define in config */
-#undef GOT_MOTIF
-
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
-/* Define to 1 if you have the <GL/glu.h> header file. */
-#undef HAVE_GL_GLU_H
-
-/* Define to 1 if you have the <GL/glx.h> header file. */
-#undef HAVE_GL_GLX_H
-
-/* Define to 1 if you have the <GL/gl.h> header file. */
-#undef HAVE_GL_GL_H
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
@@ -66,8 +54,7 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
 #undef LT_OBJDIR
 
 /* Name of package */
@@ -103,9 +90,6 @@
 /* Turned on WIN32 define in config */
 #undef WIN32
 
-/* Build with GSF */
-#undef WITH_GSF
-
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
 #if defined AC_APPLE_UNIVERSAL_BUILD
diff --git a/src/mbio/mb_coor_scale.c b/src/mbio/mb_coor_scale.c
index 9edc5ea..2925871 100644
--- a/src/mbio/mb_coor_scale.c
+++ b/src/mbio/mb_coor_scale.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_coor_scale.c	1/21/93
- *    $Id: mb_coor_scale.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_coor_scale.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -112,7 +112,7 @@
 #define C6 1.175
 #define C7 0.0023
 
-static char rcs_id[]="$Id: mb_coor_scale.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_coor_scale.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_coor_scale(int verbose, double latitude,
diff --git a/src/mbio/mb_defaults.c b/src/mbio/mb_defaults.c
index eeecbcd..cafdc80 100644
--- a/src/mbio/mb_defaults.c
+++ b/src/mbio/mb_defaults.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_defaults.c	10/7/94
- *    $Id: mb_defaults.c 2204 2014-09-06 02:34:58Z caress $
+ *    $Id: mb_defaults.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -117,7 +117,7 @@
 #include "mb_status.h"
 #include "mb_define.h"
 
-static char rcs_id[]="$Id: mb_defaults.c 2204 2014-09-06 02:34:58Z caress $";
+static char rcs_id[]="$Id: mb_defaults.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_defaults(int verbose, int *format, int *pings,
@@ -586,6 +586,14 @@ int mb_uselockfiles(int verbose, int *uselockfiles)
 	/* successful no matter what happens */
 	status = MB_SUCCESS;
 
+#ifdef WIN32
+	/* It would crash because the lock file is attempted to be created with the new "wx"
+	   that VC12 does not know and we don't have any use for this anyway.
+	*/
+	*uselockfiles = 0;
+	return(status);
+#endif
+
 	/* set system default values */
 	*uselockfiles = 1;
 
diff --git a/src/mbio/mb_define.h b/src/mbio/mb_define.h
index 155da01..9dd0dd6 100644
--- a/src/mbio/mb_define.h
+++ b/src/mbio/mb_define.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_define.h	4/21/96
- *    $Id: mb_define.h 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_define.h 2250 2015-06-30 02:12:26Z caress $
  *
- *    Copyright (c) 1996-2014 by
+ *    Copyright (c) 1996-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -27,11 +27,7 @@
 #ifndef MB_DEFINE_DEF
 #define MB_DEFINE_DEF
 
-#ifdef HAVE_CONFIG_H
 #include "mb_config.h"
-#else
-#include "mb_config2.h"
-#endif
 
 /* include for mb_s_char types */
 #if HAVE_STDINT_H
@@ -69,12 +65,15 @@
 #	ifndef isnan
 #		define isnan(x) _isnan(x)
 #	endif
+#	ifndef inline
+#		define inline __inline
+#	endif
 #endif
 
 /* MB-system version id */
 #define	MB_VERSION	VERSION
 #define	MB_BUILD_DATE	VERSION_DATE
-#define	MB_SVN		"$Id: mb_define.h 2215 2014-11-29 22:21:19Z caress $"
+#define	MB_SVN		"$Id: mb_define.h 2250 2015-06-30 02:12:26Z caress $"
 
 /* type definitions of signed and unsigned char */
 typedef unsigned char	mb_u_char;
@@ -183,6 +182,22 @@ typedef char mb_longname[MB_LONGNAME_LENGTH];
 #define	ROUND(X)	X < 0.0 ? ceil(X - 0.5) : floor(X + 0.5)
 #endif
 
+/* NaN defines */
+#ifdef NO_IEEE
+#define MB_MAKE_FNAN(x) (x = FLT_MAX)
+#define MB_MAKE_DNAN(x) (x = DBL_MAX)
+#define MB_IS_FNAN(x) ((x) == FLT_MAX)
+#define MB_IS_DNAN(x) ((x) == DBL_MAX)
+#else
+#define MB_MAKE_FNAN(x) (x = (float) NAN)
+#define MB_MAKE_DNAN(x) (x = NAN)
+#define MB_IS_FNAN isnan
+#define MB_IS_DNAN isnan
+#endif
+
+/* default grid no data value define */
+#define	MB_DEFAULT_GRID_NODATA		-9999999.9
+
 /* safe square root define - sets argument to zero if negative */
 #define SAFESQRT(X) sqrt(MAX(0.0, X))
 
@@ -479,6 +494,49 @@ int mb_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
 int mb_copyrecord(int verbose, void *mbio_ptr,
 		void *store_ptr, void *copy_ptr, int *error);
 
+int mb_platform_init(int verbose, int type, char *name, char *organization,
+		int source_swathbathymetry, int source_position,
+		int source_depth, int source_heave, int source_heading,
+		int source_rollpitch, 
+		void **platform_ptr, int *error);
+int mb_platform_add_sensor(int verbose, void **platform_ptr,
+		int type, mb_longname model,
+		mb_longname manufacturer,
+		mb_longname serialnumber,
+		int capability, int special_capability,
+		int num_offsets, int num_time_latency,
+		int *error);
+int mb_platform_add_sensor_offset(int verbose, void **platform_ptr,
+		int isensor, int ioffset,
+		int time_latency_mode,
+		double time_latency_static,
+		int num_time_latency,
+		double *time_latency_time_d,
+		double *time_latency_value,
+		int position_offset_mode,
+		double position_offset_x,
+		double position_offset_y,
+		double position_offset_z,   
+		int attitude_offset_mode,
+		double attitude_offset_azimuth,
+		double attitude_offset_roll,
+		double attitude_offset_pitch,
+		int *error);
+int mb_platform_deall(int verbose, void **platform_ptr, int *error);
+int mb_platform_read(int verbose, char *platform_file, void **platform_ptr, int *error);
+int mb_platform_write(int verbose, char *platform_file, void **platform_ptr, int *error);
+int mb_platform_lever(int verbose, void **platform_ptr,
+                int targetsensor, int targetsensoroffset,
+		double heading, double roll, double pitch,
+		double *lever_x, double *lever_y, double *lever_z,
+                int *error);
+int mb_platform_position(int verbose, void **platform_ptr,
+                int targetsensor, int targetsensoroffset,
+		double navlon, double navlat, double sensordepth,
+		double heading, double roll, double pitch,
+		double *targetlon, double *targetlat, double *targetz,
+                int *error);
+
 int mb_buffer_init(int verbose, void **buff_ptr, int *error);
 int mb_buffer_close(int verbose, void **buff_ptr, void *mbio_ptr,
 		int *error);
@@ -623,7 +681,7 @@ int mb_loadtimeshiftdata(int verbose, char *merge_timeshift_file, int merge_time
                 double **merge_timeshift_time_d, double **merge_timeshift_timeshift,
                 int *error);
 
-int mb_swap_check();
+int mb_swap_check(void);
 int mb_get_double(double *, char *, int);
 int mb_get_int(int *, char *, int);
 int mb_get_binary_short(int, void *, void *);
@@ -724,6 +782,12 @@ int mb_proj_inverse(int verbose,
 		double easting, double northing,
 		double *lon, double *lat,
 		int *error);
+int mb_proj_transform(int verbose,
+		void *pjsrcptr,
+		void *pjdstptr,
+		int npoint,
+		double *x, double *y, double *z,
+		int *error);
 
 int mb_swap_check();
 int mb_swap_float(float *a);
diff --git a/src/mbio/mb_error.c b/src/mbio/mb_error.c
index 902c611..bd2ffba 100644
--- a/src/mbio/mb_error.c
+++ b/src/mbio/mb_error.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_error.c	2/2/93
- *    $Id: mb_error.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_error.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -100,7 +100,7 @@
 #include "mb_define.h"
 #include "mb_io.h"
 
-static char rcs_id[]="$Id: mb_error.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_error.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_error(int verbose, int error, char **message)
diff --git a/src/mbio/mb_esf.c b/src/mbio/mb_esf.c
index 3da7334..104ad06 100644
--- a/src/mbio/mb_esf.c
+++ b/src/mbio/mb_esf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_esf.c	4/10/2003
- *    $Id: mb_esf.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_esf.c 2241 2015-05-12 21:00:35Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -19,50 +19,6 @@
  * Author:	D. W. Caress
  * Date:	April 10, 2003
  *
- * $Log: mb_esf.c,v $
- * Revision 5.13  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.12  2007/07/03 17:33:07  caress
- * A couple of debug statements added.
- *
- * Revision 5.11  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.10  2006/01/24 19:11:17  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.9  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.8  2005/04/07 04:24:33  caress
- * 5.0.7 Release.
- *
- * Revision 5.7  2005/03/26 22:05:18  caress
- * Release 5.0.7.
- *
- * Revision 5.6  2004/12/02 06:33:30  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.5  2004/04/27 01:46:12  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.4  2004/02/24 22:29:02  caress
- * Fixed errors in handling Simrad datagrams and edit save files on byteswapped machines (e.g. Intel or AMD processors).
- *
- * Revision 5.3  2003/07/30 16:19:20  caress
- * Changes during iSSP meeting July 2003.
- *
- * Revision 5.2  2003/07/27 21:58:57  caress
- * Added mb_mergesort function for 5.0.0
- *
- * Revision 5.1  2003/07/26 17:59:32  caress
- * Changed beamflag handling code.
- *
- * Revision 5.0  2003/04/16 16:45:50  caress
- * Initial Version.
- *
- *
  *
  */
 
@@ -86,7 +42,7 @@ void mb_mergesort_setup(mb_u_char *list1, mb_u_char *list2, size_t n, size_t siz
 void mb_mergesort_insertionsort(mb_u_char *a, size_t n, size_t size,
 	int (*cmp)(const void *, const void *));
 
-static char rcs_id[]="$Id: mb_esf.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mb_esf.c 2241 2015-05-12 21:00:35Z caress $";
 
 /*--------------------------------------------------------------------*/
 /* 	function mb_esf_check checks for an existing esf file. */
@@ -309,19 +265,19 @@ int mb_esf_open(int verbose, char *esffile,
 			}
 
 		    /* open and read the old edit file */
-		    if (status == MB_SUCCESS
-	    		&& esf->nedit > 0
-			&& (esffp = fopen(esffile,"rw")) == NULL)
+#ifdef WIN32
+		    strcpy(fmode,"r+b");
+#else
+		    strcpy(fmode,"rw");
+#endif
+		    if (status == MB_SUCCESS && esf->nedit > 0 && (esffp = fopen(esffile,fmode)) == NULL)
 			{
-			fprintf(stderr, "\nnedit:%d\n",
-			    esf->nedit);
+			fprintf(stderr, "\nnedit:%d\n", esf->nedit);
 			esf->nedit = 0;
 			*error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr, "\nUnable to open edit save file %s\n",
-			    esffile);
+			fprintf(stderr, "\nUnable to open edit save file %s\n", esffile);
 			}
-		    else if (status == MB_SUCCESS
-	    		&& esf->nedit > 0)
+		    else if (status == MB_SUCCESS && esf->nedit > 0)
 			{
 			/* reset message */
 			if (verbose > 0)
diff --git a/src/mbio/mb_fileio.c b/src/mbio/mb_fileio.c
index e29c878..3c5e4a3 100644
--- a/src/mbio/mb_fileio.c
+++ b/src/mbio/mb_fileio.c
@@ -2,7 +2,7 @@
  *    The MB-system:	mb_fileio.c	5/23/2012
  *    $Id:  $
  *
- *    Copyright (c) 2012-2014 by
+ *    Copyright (c) 2012-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -68,7 +68,7 @@ int mb_fileio_open(int verbose, void *mbio_ptr, int *error)
 	/* open the file for reading */
 	if (mb_io_ptr->filemode == MB_FILEMODE_READ)
 		{
-		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "r")) == NULL)
+		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "rb")) == NULL)
 			 {
 			 *error = MB_ERROR_OPEN_FAIL;
 			 status = MB_FAILURE;
diff --git a/src/mbio/mb_format.c b/src/mbio/mb_format.c
index 4506c28..b83c0a2 100644
--- a/src/mbio/mb_format.c
+++ b/src/mbio/mb_format.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_format.c	2/18/94
- *    $Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -55,7 +55,14 @@ static int format_alias_table[] =
 	71,	/* MBF_MBLDEOIH */
 	};
 
-static char rcs_id[]="$Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $";
+/* local prototypes not found in mb_define.h */
+int mb_datalist_readorg(int verbose,
+		void *datalist,
+		char *path, int *format, double *weight,
+		int *error);
+int cvt_to_nix_path(char *path);
+
+static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_format_register(int verbose,
@@ -298,12 +305,10 @@ int mb_format_register(int verbose,
 		{
 		status = mbr_register_dsl120sf(verbose, mbio_ptr, error);
 		}
-#ifdef WITH_GSF
 	else if (*format == MBF_GSFGENMB)
 		{
 		status = mbr_register_gsfgenmb(verbose, mbio_ptr, error);
 		}
-#endif
 	else if (*format == MBF_MSTIFFSS)
 		{
 		status = mbr_register_mstiffss(verbose, mbio_ptr, error);
@@ -1058,7 +1063,6 @@ int mb_format_info(int verbose,
 			beamwidth_xtrack, beamwidth_ltrack,
 			error);
 		}
-#ifdef WITH_GSF
 	else if (*format == MBF_GSFGENMB)
 		{
 		status = mbr_info_gsfgenmb(verbose, system,
@@ -1070,7 +1074,6 @@ int mb_format_info(int verbose,
 			beamwidth_xtrack, beamwidth_ltrack,
 			error);
 		}
-#endif
 	else if (*format == MBF_MSTIFFSS)
 		{
 		status = mbr_info_mstiffss(verbose, system,
@@ -1594,7 +1597,7 @@ int mb_format(int verbose, int *format, int *error)
 /*--------------------------------------------------------------------*/
 int mb_format_system(int verbose, int *format, int *system, int *error)
 {
-  static char rcs_id[]="$Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $";
+  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
 	char	*function_name = "mb_format_system";
 	int	status;
 
@@ -1664,7 +1667,7 @@ int mb_format_dimensions(int verbose, int *format,
 		int *beams_bath_max, int *beams_amp_max, int *pixels_ss_max,
 		int *error)
 {
-  static char rcs_id[]="$Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $";
+  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
 	char	*function_name = "mb_format_dimensions";
 	int	status;
 
@@ -1733,7 +1736,7 @@ int mb_format_dimensions(int verbose, int *format,
 /*--------------------------------------------------------------------*/
 int mb_format_description(int verbose, int *format, char *description, int *error)
 {
-  static char rcs_id[]="$Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $";
+  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
 	char	*function_name = "mb_format_description";
 	int	status;
 
@@ -1799,7 +1802,7 @@ int mb_format_flags(int verbose, int *format,
 		int *variable_beams, int *traveltime, int *beam_flagging,
 		int *error)
 {
-  static char rcs_id[]="$Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $";
+  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
 	char	*function_name = "mb_format_flags";
 	int	status;
 
@@ -1872,7 +1875,7 @@ int mb_format_source(int verbose, int *format,
 		int *vru_source, int *svp_source,
 		int *error)
 {
-  static char rcs_id[]="$Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $";
+  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
 	char	*function_name = "mb_format_source";
 	int	status;
 
@@ -1943,7 +1946,7 @@ int mb_format_beamwidth(int verbose, int *format,
 		double *beamwidth_xtrack, double *beamwidth_ltrack,
 		int *error)
 {
-  static char rcs_id[]="$Id: mb_format.c 2215 2014-11-29 22:21:19Z caress $";
+  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
 	char	*function_name = "mb_format_beamwidth";
 	int	status;
 
@@ -3254,7 +3257,6 @@ int mb_get_format(int verbose, char *filename, char *fileroot,
 		}
 	    }
 
-#ifdef WITH_GSF
 	/* look for a CARIS GSF export *.gsf format convention */
 	if (found == MB_NO)
 	    {
@@ -3279,9 +3281,7 @@ int mb_get_format(int verbose, char *filename, char *fileroot,
 		found = MB_YES;
 		}
 	    }
-#endif
 
-#ifdef WITH_GSF
 	/* look for a SAIC GSF *.d0X format convention */
 	if (found == MB_NO)
 	    {
@@ -3304,7 +3304,6 @@ int mb_get_format(int verbose, char *filename, char *fileroot,
 		found = MB_YES;
 		}
 	    }
-#endif
 
 	/* look for a Reson 7K multibeam *.s7k format convention */
 	if (found == MB_NO)
@@ -3508,6 +3507,29 @@ int mb_get_format(int verbose, char *filename, char *fileroot,
 		}
 	    }
 
+	/* look for a WASSP *.nwsf file format convention*/
+	if (found == MB_NO)
+	    {
+	    if (strlen(filename) >= 6)
+		i = strlen(filename) - 5;
+	    else
+		i = 0;
+	    if ((suffix = strstr(&filename[i],".nwsf")) != NULL)
+		suffix_len = 5;
+	    else
+		suffix_len = 0;
+	    if (suffix_len == 5)
+		{
+		if (fileroot != NULL)
+		    {
+		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
+		    fileroot[strlen(filename)-suffix_len] = '\0';
+		    }
+		*format = MBF_WASSPENL;
+		found = MB_YES;
+		}
+	    }
+
 	/* finally check for parameter file */
 	sprintf(parfile, "%s.par", filename);
 	if (stat(parfile, &statbuf) == 0)
@@ -3805,7 +3827,7 @@ int mb_datalist_readorg(int verbose,
 		int *error)
 {
 	/* local variables */
-	char	*function_name = "mb_datalist_read";
+	char	*function_name = "mb_datalist_readorg";
 	int	status = MB_SUCCESS;
 	struct mb_datalist_struct *datalist_ptr;
 	struct mb_datalist_struct *datalist2_ptr;
@@ -4210,6 +4232,8 @@ int mb_datalist_read2(int verbose,
 						istart = 2;
 						processedspecified = MB_YES;
 						}
+					else
+						istart = 0;
 					}
 				else
 					istart = 0;
@@ -4432,6 +4456,25 @@ int mb_datalist_read2(int verbose,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
+int cvt_to_nix_path(char *path)
+{
+	/* Replace back slashes by slashes and trim first two chars in paths like "C:/path" */
+	size_t k, len = strlen(path);
+	
+	if (len == 0) return(0);
+	for (k = 0; k < len; k++)
+		if (path[k] == '\\') path[k] = '/';
+
+	if (path[1] == ':')
+		{
+		for (k = 0; k < len - 2; k++)
+			path[k] = path[k + 2];
+		path[len - 2] = '\0';	/* Make sure it's null terminated */
+		}
+
+	return(0);
+}
+/*--------------------------------------------------------------------*/
 int mb_get_relative_path(int verbose,
 		char *path,
 		char *ipwd,
@@ -4440,8 +4483,8 @@ int mb_get_relative_path(int verbose,
 	/* local variables */
 	char	*function_name = "mb_get_relative_path";
 	int	status = MB_SUCCESS;
-	char	relativepath[MB_PATH_MAXLINE];
-	char	pwd[MB_PATH_MAXLINE];
+	char	relativepath[MB_PATH_MAXLINE] = {""};
+	char	pwd[MB_PATH_MAXLINE] = {""};
 	int	pathlen;
 	int	pwdlen;
 	int	same, isame, ndiff;
@@ -4464,11 +4507,25 @@ int mb_get_relative_path(int verbose,
 	pathlen = strlen(path);
 	pwdlen = strlen(ipwd);
 
+#ifdef WIN32
+	/* The approximation here is to try to make a Windows path like a unix one and expect that
+	   the same algorithm still applies. Off course, there probably many ways this can go wrong
+	   because we trim the first 2 chars in strings like C:\blabla and don't put it back. But
+	   test have shown that it was maybe not necessary.
+	*/
+	cvt_to_nix_path(path);
+	cvt_to_nix_path(ipwd);
+#endif
+
 	/* if path doesn't start with '/' not an absolute path */
 	if (pathlen > 0 && path[0] != '/' )
 	    {
 	    strncpy(relativepath,path,MB_PATH_MAXLINE);
 	    bufptr = getcwd(path, MB_PATH_MAXLINE);
+#ifdef WIN32
+		cvt_to_nix_path(path);
+		cvt_to_nix_path(bufptr);
+#endif
 	    if (bufptr == NULL || strlen(path) + pathlen + 1 >= MB_PATH_MAXLINE)
 	        {
 	        strcpy(path,relativepath);
@@ -4490,6 +4547,10 @@ int mb_get_relative_path(int verbose,
 	else
 	    {
 	    bufptr = getcwd(pwd, MB_PATH_MAXLINE);
+#ifdef WIN32
+		cvt_to_nix_path(pwd);
+		cvt_to_nix_path(bufptr);
+#endif
 	    if (bufptr == NULL || strlen(pwd) + pwdlen + 1 >= MB_PATH_MAXLINE)
 	        {
 	        strncpy(pwd,ipwd,MB_PATH_MAXLINE);
@@ -4614,6 +4675,11 @@ int mb_get_shortest_path(int verbose,
 		fprintf(stderr,"dbg2       path:          %s\n",path);
 		}
 
+#ifdef WIN32
+	/* No path hammerings here. Too dangerous */
+	//return(status);
+#endif
+
 	/* loop until no changes are made */
 	done = MB_NO;
 	while (done == MB_NO)
diff --git a/src/mbio/mb_format.h b/src/mbio/mb_format.h
index 117a96e..845faf3 100644
--- a/src/mbio/mb_format.h
+++ b/src/mbio/mb_format.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_format.h	1/19/93
- *    $Id: mb_format.h 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_format.h 2224 2015-02-04 19:14:05Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -31,7 +31,7 @@
 #define MB_FORMAT_DEF
 
 /* define date of last format update */
-#define	MB_FORMAT_UPDATEDATE	"$Id: mb_format.h 2215 2014-11-29 22:21:19Z caress $ $Revision: $"
+#define	MB_FORMAT_UPDATEDATE	"$Id: mb_format.h 2224 2015-02-04 19:14:05Z caress $ $Revision: $"
 
 /* Supported swath sonar systems */
 #define	MB_SYS_NONE		0
@@ -379,9 +379,7 @@ int mbr_register_hsmdaraw(int verbose, void *mbio_ptr, int *error);
 int mbr_register_hsmdldih(int verbose, void *mbio_ptr, int *error);
 int mbr_register_dsl120pf(int verbose, void *mbio_ptr, int *error);
 int mbr_register_dsl120sf(int verbose, void *mbio_ptr, int *error);
-#ifdef WITH_GSF
 int mbr_register_gsfgenmb(int verbose, void *mbio_ptr, int *error);
-#endif
 int mbr_register_mstiffss(int verbose, void *mbio_ptr, int *error);
 int mbr_register_edgjstar(int verbose, void *mbio_ptr, int *error);
 int mbr_register_edgjstr2(int verbose, void *mbio_ptr, int *error);
@@ -1317,7 +1315,6 @@ int mbr_info_dsl120sf(int verbose,
 			double *beamwidth_xtrack,
 			double *beamwidth_ltrack,
 			int *error);
-#ifdef WITH_GSF
 int mbr_info_gsfgenmb(int verbose,
 			int *system,
 			int *beams_bath_max,
@@ -1338,7 +1335,6 @@ int mbr_info_gsfgenmb(int verbose,
 			double *beamwidth_xtrack,
 			double *beamwidth_ltrack,
 			int *error);
-#endif
 int mbr_info_mstiffss(int verbose,
 			int *system,
 			int *beams_bath_max,
diff --git a/src/mbio/mb_get.c b/src/mbio/mb_get.c
index 33e45e8..b7a56ae 100644
--- a/src/mbio/mb_get.c
+++ b/src/mbio/mb_get.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_get.c	1/26/93
- *    $Id: mb_get.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_get.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -128,7 +128,7 @@
 #include "mb_io.h"
 #include "mb_define.h"
 
-static char rcs_id[]="$Id: mb_get.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_get.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_get(int verbose, void *mbio_ptr, int *kind, int *pings,
diff --git a/src/mbio/mb_get_all.c b/src/mbio/mb_get_all.c
index e716f14..7885937 100644
--- a/src/mbio/mb_get_all.c
+++ b/src/mbio/mb_get_all.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_get_all.c	1/26/93
- *    $Id: mb_get_all.c 2196 2014-07-14 05:52:06Z caress $
+ *    $Id: mb_get_all.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -132,7 +132,7 @@
 #include "mb_io.h"
 #include "mb_define.h"
 
-static char rcs_id[]="$Id: mb_get_all.c 2196 2014-07-14 05:52:06Z caress $";
+static char rcs_id[]="$Id: mb_get_all.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_get_all(int verbose, void *mbio_ptr, void **store_ptr, int *kind,
diff --git a/src/mbio/mb_get_value.c b/src/mbio/mb_get_value.c
index bc2b683..bacba47 100644
--- a/src/mbio/mb_get_value.c
+++ b/src/mbio/mb_get_value.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_get_value.c	2/15/93
- *    $Id: mb_get_value.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_get_value.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -109,7 +109,7 @@
 /* maximum line length in characters */
 #define MB_GET_VALUE_MAXLINE 200
 
-/* static char rcs_id[]="$Id: mb_get_value.c 2175 2014-03-18 23:03:39Z caress $"; */
+/* static char rcs_id[]="$Id: mb_get_value.c 2227 2015-02-05 21:12:31Z caress $"; */
 char	tmp[MB_GET_VALUE_MAXLINE];
 
 /*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_info.h b/src/mbio/mb_info.h
index 928eb89..bebcab6 100644
--- a/src/mbio/mb_info.h
+++ b/src/mbio/mb_info.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_info.h			8/21/2006
- *    $Id: mb_info.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_info.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2006-2014 by
+ *    Copyright (c) 2006-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mb_io.h b/src/mbio/mb_io.h
index 7759404..e793035 100644
--- a/src/mbio/mb_io.h
+++ b/src/mbio/mb_io.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_io.h	1/19/93
- *    $Id: mb_io.h 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_io.h 2249 2015-06-26 19:26:09Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -31,13 +31,19 @@
 #include "mb_status.h"
         
 /* survey platform definition structures */
-struct mb_sensor_offsets
+#define MB_SENSOR_TIME_LATENCY_NONE                     0
+#define MB_SENSOR_TIME_LATENCY_STATIC                   1
+#define MB_SENSOR_TIME_LATENCY_MODEL                    2
+#define MB_SENSOR_POSITION_OFFSET_NONE                  0
+#define MB_SENSOR_POSITION_OFFSET_STATIC                1
+#define MB_SENSOR_ATTITUDE_OFFSET_NONE                   0
+#define MB_SENSOR_ATTITUDE_OFFSET_STATIC                 1
+struct mb_sensor_offset_struct
         {
-        
         int     time_latency_mode;
         double  time_latency_static;
-        int     time_latency_n;
-        int     time_latency_nalloc;
+        int     num_time_latency;
+        int     num_time_latency_alloc;
         double  *time_latency_time_d;
         double  *time_latency_value;
         
@@ -46,14 +52,13 @@ struct mb_sensor_offsets
         double  position_offset_y;
         double  position_offset_z;
         
-        int     angular_offset_mode;
-        double  angular_offset_azimuth;
-        double  angular_offset_roll;
-        double  angular_offset_pitch;
-        
+        int     attitude_offset_mode;
+        double  attitude_offset_azimuth;
+        double  attitude_offset_roll;
+        double  attitude_offset_pitch;
         };
 
-#define MB_SENSOR_TYPE_SONAR_NONE                       0
+#define MB_SENSOR_TYPE_NONE                             0
 #define MB_SENSOR_TYPE_SONAR_ECHOSOUNDER                1
 #define MB_SENSOR_TYPE_SONAR_MULTIECHOSOUNDER           2
 #define MB_SENSOR_TYPE_SONAR_SIDESCAN                   3
@@ -69,21 +74,21 @@ struct mb_sensor_offsets
 #define MB_SENSOR_TYPE_COMPASS                          61
 #define MB_SENSOR_TYPE_VRU                              71
 #define MB_SENSOR_TYPE_IMU                              81
+#define MB_SENSOR_TYPE_INS                              82
 #define MB_SENSOR_TYPE_CTD                              91
+#define MB_SENSOR_TYPE_PRESSURE                         92
 #define MB_SENSOR_TYPE_SOUNDSPEED                       101
-struct mb_sensor
+struct mb_sensor_struct
         {
         int     type;
-        int     sensor_class;
-        mb_longname sensor_model;
-        mb_longname sensor_manufacturer;
-        mb_longname sensor_serialnumber;
+        mb_longname model;
+        mb_longname manufacturer;
+        mb_longname serialnumber;
         int     capability;
         int     special_capability;
-        
         int     num_offsets;
         int     num_offsets_alloc;
-        struct mb_sensor_offsets    *offsets;
+        struct mb_sensor_offset_struct *offsets;
         
         };
         
@@ -94,15 +99,22 @@ struct mb_sensor
 #define MB_PLATFORM_AUV                 4
 #define MB_PLATFORM_AIRPLANE            5
 #define MB_PLATFORM_SATELLITE           6
-struct mb_platform
+struct mb_platform_struct
         {
         int             type;
         mb_longname     name;
         mb_longname     organization;
         
+        int             source_swathbathymetry;
+        int             source_position;
+        int             source_depth;
+        int             source_heave;
+        int             source_heading;
+        int             source_rollpitch;
+        
         int             num_sensors;
         int             num_sensors_alloc;
-        struct mb_sensor       *sensors;
+        struct mb_sensor_struct *sensors;
         };
 
 struct mb_io_ping_struct
diff --git a/src/mbio/mb_mem.c b/src/mbio/mb_mem.c
index 5fbb3b3..373f433 100644
--- a/src/mbio/mb_mem.c
+++ b/src/mbio/mb_mem.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_mem.c	3/1/93
- *    $Id: mb_mem.c 2219 2014-12-11 21:22:25Z caress $
+ *    $Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -21,101 +21,6 @@
  * Author:	D. W. Caress
  * Date:	March 1, 1993
  *
- * $Log: mb_mem.c,v $
- * Revision 5.11  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.10  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.9  2006/01/24 19:11:17  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.8  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2004/12/18 01:34:43  caress
- * Working towards release 5.0.6.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2003/04/16 16:47:41  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/11/12 07:25:23  caress
- * Added mb_memory_clear() call.
- *
- * Revision 5.3  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.9  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.8  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1994/10/28  03:52:18  caress
- * Got rid of realloc call - will try this again later. Will
- * just use malloc for now.
- *
- * Revision 4.5  1994/10/28  03:52:18  caress
- * Got rid of realloc call - will try this again later. Will
- * just use malloc for now.
- *
- * Revision 4.3  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/03/23  22:19:33  caress
- * Previous versions of mb_malloc returned an error if the
- * pointer returned by malloc() was NULL, even if the size
- * requested was zero.  This was ok on Suns running BSD, which
- * return pointer values even for zero sized objects, but on
- * IBM machines malloc() returns NULL for zero sized objects.
- * The function mb_malloc now returns a NULL pointer and no error
- * if the requested size is zero.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  04:03:53  caress
- * First cut at new version.  No changes.
- *
- * Revision 3.2  1993/05/15  14:37:45  caress
- * fixed rcs_id message
- *
- * Revision 3.1  1993/05/14  22:27:48  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  16:03:04  dale
- * Initial version
- *
- *
  */
 
 /* standard include files */
@@ -142,7 +47,7 @@ static int	mb_alloc_overflow = MB_NO;
 /* Local debug define */
 /* #define MB_MEM_DEBUG 1 */
 
-static char rcs_id[]="$Id: mb_mem.c 2219 2014-12-11 21:22:25Z caress $";
+static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_mem_debug_on(int verbose, int *error)
@@ -158,7 +63,7 @@ int mb_mem_debug_on(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		}
@@ -178,7 +83,7 @@ int mb_mem_debug_on(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -203,7 +108,7 @@ int mb_mem_debug_off(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		}
@@ -223,7 +128,7 @@ int mb_mem_debug_off(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -245,7 +150,7 @@ int mb_malloc(int verbose, size_t size, void **ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       size:       %zu\n",size);
@@ -317,7 +222,7 @@ int mb_malloc(int verbose, size_t size, void **ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -340,7 +245,7 @@ int mb_mallocd(int verbose, const char *sourcefile, int sourceline,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       sourcefile: %s\n",sourcefile);
@@ -416,7 +321,7 @@ int mb_mallocd(int verbose, const char *sourcefile, int sourceline,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -439,7 +344,7 @@ int mb_realloc(int verbose, size_t size, void **ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       size:       %zu\n",size);
@@ -543,7 +448,7 @@ int mb_realloc(int verbose, size_t size, void **ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return value:\n");
 		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -567,7 +472,7 @@ int mb_reallocd(int verbose, const char *sourcefile, int sourceline,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       sourcefile: %s\n",sourcefile);
@@ -679,7 +584,7 @@ int mb_reallocd(int verbose, const char *sourcefile, int sourceline,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return value:\n");
 		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -704,7 +609,7 @@ int mb_free(int verbose, void **ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
@@ -777,7 +682,7 @@ int mb_free(int verbose, void **ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return value:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -801,7 +706,7 @@ int mb_freed(int verbose, const char *sourcefile, int sourceline, void **ptr, in
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       sourcefile: %s\n",sourcefile);
@@ -876,7 +781,7 @@ int mb_freed(int verbose, const char *sourcefile, int sourceline, void **ptr, in
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return value:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -897,7 +802,7 @@ int mb_memory_clear(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		}
@@ -932,7 +837,7 @@ int mb_memory_clear(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return value:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -954,7 +859,7 @@ int mb_memory_status(int verbose, int *nalloc, int *nallocmax,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		}
@@ -975,7 +880,7 @@ int mb_memory_status(int verbose, int *nalloc, int *nallocmax,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return value:\n");
 		fprintf(stderr,"dbg2       nalloc:     %d\n",*nalloc);
 		fprintf(stderr,"dbg2       nallocmax:  %d\n",*nallocmax);
@@ -1000,7 +905,7 @@ int mb_memory_list(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		}
@@ -1029,7 +934,7 @@ int mb_memory_list(int verbose, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return value:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -1043,7 +948,7 @@ int mb_memory_list(int verbose, int *error)
 int mb_register_array(int verbose, void *mbio_ptr,
 		int type, size_t size, void **handle, int *error)
 {
-	static char rcs_id[]="$Id: mb_mem.c 2219 2014-12-11 21:22:25Z caress $";
+	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
 	char	*function_name = "mb_register_array";
 	int	status = MB_SUCCESS;
 	struct mb_io_struct *mb_io_ptr;
@@ -1054,7 +959,7 @@ int mb_register_array(int verbose, void *mbio_ptr,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1133,7 +1038,7 @@ mb_io_ptr->regarray_size[mb_io_ptr->n_regarray-1]);*/
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       *handle:    %p\n",(void *)*handle);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -1148,7 +1053,7 @@ mb_io_ptr->regarray_size[mb_io_ptr->n_regarray-1]);*/
 int mb_update_arrays(int verbose, void *mbio_ptr,
 		int nbath, int namp, int nss, int *error)
 {
-	static char rcs_id[]="$Id: mb_mem.c 2219 2014-12-11 21:22:25Z caress $";
+	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
 	char	*function_name = "mb_update_arrays";
 	int	status = MB_SUCCESS;
 	struct mb_io_struct *mb_io_ptr;
@@ -1159,7 +1064,7 @@ int mb_update_arrays(int verbose, void *mbio_ptr,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1344,13 +1249,13 @@ int mb_update_arrays(int verbose, void *mbio_ptr,
 		if (nss < 1024)
 			{
 			mb_io_ptr->pixels_ss_alloc = (nss / 256) * 256;
-			if (namp % 256 > 0)
+			if (nss % 256 > 0)
 				mb_io_ptr->pixels_ss_alloc += 256;
 			}
 		else
 			{
 			mb_io_ptr->pixels_ss_alloc = (nss / 1024) * 1024;
-			if (namp % 1024 > 0)
+			if (nss % 1024 > 0)
 				mb_io_ptr->pixels_ss_alloc += 1024;
 			}
 
@@ -1454,7 +1359,7 @@ int mb_update_arrays(int verbose, void *mbio_ptr,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -1482,7 +1387,7 @@ int mb_update_arrays(int verbose, void *mbio_ptr,
 int mb_update_arrayptr(int verbose, void *mbio_ptr,
 		void **handle, int *error)
 {
-	static char rcs_id[]="$Id: mb_mem.c 2219 2014-12-11 21:22:25Z caress $";
+	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
 	char	*function_name = "mb_update_arrayptr";
 	int	status = MB_SUCCESS;
 	struct mb_io_struct *mb_io_ptr;
@@ -1493,7 +1398,7 @@ int mb_update_arrayptr(int verbose, void *mbio_ptr,
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       handle:     %p\n",(void *)handle);
@@ -1521,7 +1426,7 @@ fprintf(stderr,"\n");*/
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       *handle:    %p\n",(void *)*handle);
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
@@ -1535,7 +1440,7 @@ fprintf(stderr,"\n");*/
 /*--------------------------------------------------------------------*/
 int mb_list_arrays(int verbose, void *mbio_ptr, int *error)
 {
-	static char rcs_id[]="$Id: mb_mem.c 2219 2014-12-11 21:22:25Z caress $";
+	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
 	char	*function_name = "mb_list_arrays";
 	int	status = MB_SUCCESS;
 	struct mb_io_struct *mb_io_ptr;
@@ -1545,7 +1450,7 @@ int mb_list_arrays(int verbose, void *mbio_ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
@@ -1567,7 +1472,7 @@ int mb_list_arrays(int verbose, void *mbio_ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
@@ -1580,7 +1485,7 @@ int mb_list_arrays(int verbose, void *mbio_ptr, int *error)
 /*--------------------------------------------------------------------*/
 int mb_deall_ioarrays(int verbose, void *mbio_ptr, int *error)
 {
-	static char rcs_id[]="$Id: mb_mem.c 2219 2014-12-11 21:22:25Z caress $";
+	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
 	char	*function_name = "mb_deall_ioarrays";
 	int	status = MB_SUCCESS;
 	struct mb_io_struct *mb_io_ptr;
@@ -1590,7 +1495,7 @@ int mb_deall_ioarrays(int verbose, void *mbio_ptr, int *error)
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Input arguments:\n");
 		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
 		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
@@ -1655,7 +1560,7 @@ mb_io_ptr->regarray_ptr[mb_io_ptr->n_regarray-1]);*/
 	if (verbose >= 2 || mb_mem_debug)
 		{
 		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
 		fprintf(stderr,"dbg2  Return values:\n");
 		fprintf(stderr,"dbg2       error:      %d\n",*error);
 		fprintf(stderr,"dbg2  Return status:\n");
diff --git a/src/mbio/mb_navint.c b/src/mbio/mb_navint.c
index 3e1df5e..bb99a51 100644
--- a/src/mbio/mb_navint.c
+++ b/src/mbio/mb_navint.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_time.c	10/30/2000
- *    $Id: mb_navint.c 2185 2014-05-11 06:34:36Z caress $
+ *    $Id: mb_navint.c 2230 2015-02-19 00:39:00Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -20,52 +20,6 @@
  * Date:	October 30, 2000
  *
  * $Log: mb_navint.c,v $
- * Revision 5.14  2008/09/27 03:27:10  caress
- * Working towards release 5.1.1beta24
- *
- * Revision 5.13  2006/03/14 01:41:52  caress
- * Improved debug messages.
- *
- * Revision 5.12  2005/06/15 15:17:51  caress
- * Added some useful debug statements.
- *
- * Revision 5.11  2005/03/25 04:31:23  caress
- * Minor changes to code comments.
- *
- * Revision 5.10  2004/07/15 19:25:04  caress
- * Progress in supporting Reson 7k data.
- *
- * Revision 5.9  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.8  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.7  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.5  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.4  2001/10/12 21:08:37  caress
- * Added interpolation of attitude data.
- *
- * Revision 5.3  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.2  2001-07-19 17:31:11-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/06/08 21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- *
  *
  */
 
@@ -81,13 +35,13 @@
 #include "mb_io.h"
 #include "mb_process.h"
 
-/*  #define MB_NAVINT_DEBUG 1
-    #define MB_ATTINT_DEBUG 1
-    #define MB_HEDINT_DEBUG 1
-    #define MB_DEPINT_DEBUG 1
-    #define MB_ALTINT_DEBUG 1 */
+//    #define MB_NAVINT_DEBUG 1
+//    #define MB_ATTINT_DEBUG 1
+//    #define MB_HEDINT_DEBUG 1
+//    #define MB_DEPINT_DEBUG 1
+//    #define MB_ALTINT_DEBUG 1
 
-static char rcs_id[]="$Id: mb_navint.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[]="$Id: mb_navint.c 2230 2015-02-19 00:39:00Z caress $";
 
 /*--------------------------------------------------------------------*/
 /* 	function mb_navint_add adds a nav fix to the internal
diff --git a/src/mbio/mb_platform.c b/src/mbio/mb_platform.c
new file mode 100644
index 0000000..0df50bd
--- /dev/null
+++ b/src/mbio/mb_platform.c
@@ -0,0 +1,1415 @@
+/*--------------------------------------------------------------------
+ *    The MB-system:	mb_platform.c	11/1/00
+ *    $Id: mb_platform.c 2250 2015-06-30 02:12:26Z caress $
+ *
+ *    Copyright (c) 2015-2015 by
+ *    David W. Caress (caress at mbari.org)
+ *      Monterey Bay Aquarium Research Institute
+ *      Moss Landing, CA 95039
+ *    and Dale N. Chayes (dale at ldeo.columbia.edu)
+ *      Lamont-Doherty Earth Observatory
+ *      Palisades, NY 10964
+ *
+ *    See README file for copying and redistribution conditions.
+ *--------------------------------------------------------------------*/
+/*
+ * This source file includes the functions used to read and write
+ * platform definition files.
+ * The structures used to store platform, sensor, and offset information
+ * are defined in mb_io.h
+ *
+ * Author:	D. W. Caress
+ * Date:	June 26, 2015
+ *
+ */
+
+/* standard include files */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <math.h>
+#include <string.h>
+
+/* mbio include files */
+#include "mb_status.h"
+#include "mb_format.h"
+#include "mb_io.h"
+#include "mb_define.h"
+#include "mb_segy.h"
+
+static char svn_id[]="$Id: mb_platform.c 2250 2015-06-30 02:12:26Z caress $";
+
+/*--------------------------------------------------------------------*/
+int mb_platform_init(int verbose, int type, char *name, char *organization,
+			int source_swathbathymetry, int source_position,
+			int source_depth, int source_heave, int source_heading,
+			int source_rollpitch, 
+			void **platform_ptr, int *error)
+{
+	char	*function_name = "mb_platform_init";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:                  %d\n", verbose);
+		fprintf(stderr,"dbg2       type:		     %d\n", type);
+		fprintf(stderr,"dbg2       name:		     %s\n", name);
+		fprintf(stderr,"dbg2       organization:	     %s\n", organization);
+		fprintf(stderr,"dbg2       source_swathbathymetry:   %d\n", source_swathbathymetry);
+		fprintf(stderr,"dbg2       source_position:	     %d\n", source_position);
+		fprintf(stderr,"dbg2       source_depth:	     %d\n", source_depth);
+		fprintf(stderr,"dbg2       source_heave:	     %d\n", source_heave);
+		fprintf(stderr,"dbg2       source_heading:	     %d\n", source_heading);
+		fprintf(stderr,"dbg2       source_rollpitch:	     %d\n", source_rollpitch);
+		fprintf(stderr,"dbg2       platform_ptr:             %p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:            %p\n", *platform_ptr);
+		}
+
+	/* allocate memory for platform descriptor structure if needed */
+	if (*platform_ptr == NULL)
+		{
+		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_platform_struct),
+				(void **) platform_ptr, error);
+		if (status == MB_SUCCESS)
+			{
+			memset(*platform_ptr, 0, sizeof(struct mb_platform_struct));
+			}
+		}
+		
+	/* get platform structure */
+	platform = (struct mb_platform_struct *) *platform_ptr;
+	
+	/* set values */
+	platform->type = type;
+	if (name != NULL)
+		strcpy(platform->name, name);
+	else
+		memset(platform->name, 0, sizeof(mb_longname));
+	if (organization != NULL)
+		strcpy(platform->organization, organization);
+	else
+		memset(platform->name, 0, sizeof(mb_longname));
+	platform->source_swathbathymetry = source_swathbathymetry;
+	platform->source_position = source_position;
+	platform->source_depth = source_depth;
+	platform->source_heave = source_heave;
+	platform->source_heading = source_heading;
+	platform->source_rollpitch = source_rollpitch;
+	platform->num_sensors = 0;
+	
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       platform_ptr:		     %p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
+		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
+		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
+		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
+		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
+		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
+		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
+		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
+		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
+		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
+		fprintf(stderr,"dbg2       error:			     %d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			     %d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+int mb_platform_add_sensor(int verbose, void **platform_ptr,
+			           int type, mb_longname model,
+				   mb_longname manufacturer,
+				   mb_longname serialnumber,
+				   int capability, int special_capability,
+				   int num_offsets, int num_time_latency,
+				   int *error)
+{
+	char	*function_name = "mb_platform_add_sensor";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+	struct mb_sensor_struct *sensor;
+	struct mb_sensor_offset_struct *offset;
+	int	isensor;
+	int	ioffset;
+	char	*message = NULL;
+	size_t	size;
+	int	i, j, k;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:              %d\n", verbose);
+		fprintf(stderr,"dbg2       platform_ptr:         %p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:        %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       type:                 %d\n", type);
+		fprintf(stderr,"dbg2       model:                %s\n", model);
+		fprintf(stderr,"dbg2       manufacturer:         %s\n", manufacturer);
+		fprintf(stderr,"dbg2       serialnumber:         %s\n", serialnumber);
+		fprintf(stderr,"dbg2       capability:           %d\n", capability);
+		fprintf(stderr,"dbg2       special_capability:   %d\n", special_capability);
+		fprintf(stderr,"dbg2       num_offsets:          %d\n", num_offsets);
+		fprintf(stderr,"dbg2       num_time_latency:     %d\n", num_time_latency);
+		}
+
+	/* allocate memory for platform descriptor structure if needed */
+	if (*platform_ptr == NULL)
+		{
+		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_platform_struct),
+				(void **) platform_ptr, error);
+		if (status == MB_SUCCESS)
+			{
+			memset(*platform_ptr, 0, sizeof(struct mb_platform_struct));
+			}
+		}
+		
+	/* get platform structure */
+	platform = (struct mb_platform_struct *) *platform_ptr;
+	
+	/* allocate memory for sensor if needed */
+	platform->num_sensors++;
+	if (platform->num_sensors > platform->num_sensors_alloc)
+		{
+		size = platform->num_sensors * sizeof(struct mb_sensor_struct);
+		status = mb_reallocd(verbose,__FILE__, __LINE__,
+					size, (void **) &platform->sensors, error);
+		if (status == MB_SUCCESS)
+			{
+			memset(&platform->sensors[platform->num_sensors_alloc],
+			       0, (platform->num_sensors - platform->num_sensors_alloc) * sizeof(struct mb_sensor_struct));
+			platform->num_sensors_alloc = platform->num_sensors;
+			}
+		else
+			{
+			mb_error(verbose,*error,&message);
+			fprintf(stderr,"\nMBIO Error allocating sensor structures:\n%s\n",message);
+			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+			exit(*error);
+			}
+		}
+		
+	/* allocate memory for offsets if needed */
+	isensor = platform->num_sensors - 1;
+	sensor = &platform->sensors[isensor];
+	sensor->num_offsets = num_offsets;
+	if (sensor->num_offsets > sensor->num_offsets_alloc)
+		{
+		size = sensor->num_offsets * sizeof(struct mb_sensor_offset_struct);
+		status = mb_reallocd(verbose,__FILE__, __LINE__,
+					size, (void **) &sensor->offsets, error);
+		if (status == MB_SUCCESS)
+			{
+			memset(sensor->offsets, 0, size);
+			sensor->num_offsets_alloc = sensor->num_offsets;
+			}
+		else
+			{
+			mb_error(verbose,*error,&message);
+			fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
+			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+			exit(*error);
+			}
+		}
+		
+	/* allocate memory for time latency model if needed */
+	if (num_time_latency > 0)
+		{
+		for (ioffset=0;ioffset<sensor->num_offsets;ioffset++)
+			{
+			offset = &sensor->offsets[ioffset];
+			
+			size = num_time_latency * sizeof(double);
+			status = mb_reallocd(verbose,__FILE__, __LINE__,
+						size, (void **) &offset->time_latency_time_d, error);
+			if (status == MB_SUCCESS)
+			status = mb_reallocd(verbose,__FILE__, __LINE__,
+						size, (void **) &offset->time_latency_value, error);
+			if (status == MB_SUCCESS)
+				{
+				memset(offset->time_latency_time_d, 0, size);
+				memset(offset->time_latency_value, 0, size);
+				offset->num_time_latency_alloc = num_time_latency;
+				}
+			else
+				{
+				mb_error(verbose,*error,&message);
+				fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
+				fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+				exit(*error);
+				}
+			}
+		}
+	
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
+		}
+	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
+		{
+		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
+		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
+		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
+		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
+		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
+		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
+		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
+		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
+		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
+		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
+		for (i=0;i<platform->num_sensors;i++)
+			{
+			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
+			for (j=0;j<platform->sensors[i].num_offsets;j++)
+				{
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
+				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
+					{
+					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
+						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
+					}
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
+				}
+			}
+		}
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"dbg2       error:			%d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			%d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+int mb_platform_add_sensor_offset(int verbose, void **platform_ptr,
+					int isensor, int ioffset,
+					int time_latency_mode,
+					double time_latency_static,
+					int num_time_latency,
+					double *time_latency_time_d,
+					double *time_latency_value,
+					int position_offset_mode,
+					double position_offset_x,
+					double position_offset_y,
+					double position_offset_z,   
+					int attitude_offset_mode,
+					double attitude_offset_azimuth,
+					double attitude_offset_roll,
+					double attitude_offset_pitch,
+					int *error)
+{
+	char	*function_name = "mb_platform_add_sensor_offset";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+	struct mb_sensor_struct *sensor;
+	struct mb_sensor_offset_struct *offset;
+	char	*message = NULL;
+	size_t	size;
+	int	i, j, k;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
+		fprintf(stderr,"dbg2       platform_ptr:            %p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:           %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       isensor:                 %d\n", isensor);
+		fprintf(stderr,"dbg2       ioffset:                 %d\n", ioffset);
+		fprintf(stderr,"dbg2       time_latency_mode:	    %d\n", time_latency_mode);
+		fprintf(stderr,"dbg2       time_latency_static:	    %f\n", time_latency_static);
+		fprintf(stderr,"dbg2       num_time_latency:        %d\n", num_time_latency);
+		for (k=0;k<num_time_latency;k++)
+			{
+			fprintf(stderr,"dbg2       time_latency[%2d]:       %16.6f %8.6f\n", 
+				k, time_latency_time_d[k],time_latency_value[k]);
+			}
+		fprintf(stderr,"dbg2       position_offset_mode:    %d\n", position_offset_mode);
+		fprintf(stderr,"dbg2       position_offset_x:       %f\n", position_offset_x);
+		fprintf(stderr,"dbg2       position_offset_y:	    %f\n", position_offset_y);
+		fprintf(stderr,"dbg2       position_offset_z:	    %f\n", position_offset_z);
+		fprintf(stderr,"dbg2       attitude_offset_mode:    %d\n", attitude_offset_mode);
+		fprintf(stderr,"dbg2       attitude_offset_azimuth: %f\n", attitude_offset_azimuth);
+		fprintf(stderr,"dbg2       attitude_offset_roll:    %f\n", attitude_offset_roll);
+		fprintf(stderr,"dbg2       attitude_offset_pitch:   %f\n", attitude_offset_pitch);
+		}
+
+	/* get platform and sensor structures */
+	platform = (struct mb_platform_struct *) *platform_ptr;
+	sensor = &platform->sensors[isensor];
+		
+	/* allocate memory for offsets if needed */
+	if (ioffset > sensor->num_offsets - 1)
+		sensor->num_offsets = ioffset + 1;
+	if (sensor->num_offsets > sensor->num_offsets_alloc)
+		{
+		size = sensor->num_offsets * sizeof(struct mb_sensor_offset_struct);
+		status = mb_reallocd(verbose,__FILE__, __LINE__,
+					size, (void **) &sensor->offsets, error);
+		if (status == MB_SUCCESS)
+			{
+			memset(sensor->offsets, 0, size);
+			sensor->num_offsets_alloc = sensor->num_offsets;
+			}
+		else
+			{
+			mb_error(verbose,*error,&message);
+			fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
+			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+			exit(*error);
+			}
+		}
+
+	/* get offset structure */
+	offset = &sensor->offsets[ioffset];
+		
+	/* allocate memory for time latency model if needed */
+	if (num_time_latency > 0)
+		{
+		size = num_time_latency * sizeof(double);
+		status = mb_reallocd(verbose,__FILE__, __LINE__,
+					size, (void **) &offset->time_latency_time_d, error);
+		if (status == MB_SUCCESS)
+		status = mb_reallocd(verbose,__FILE__, __LINE__,
+					size, (void **) &offset->time_latency_value, error);
+		if (status == MB_SUCCESS)
+			{
+			memset(offset->time_latency_time_d, 0, size);
+			memset(offset->time_latency_value, 0, size);
+			offset->num_time_latency_alloc = num_time_latency;
+			}
+		else
+			{
+			mb_error(verbose,*error,&message);
+			fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
+			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+			exit(*error);
+			}
+		}
+
+	/* set offset values */
+	offset->time_latency_mode = time_latency_mode;
+	offset->time_latency_static = time_latency_static;
+	offset->num_time_latency = num_time_latency;
+	for (k=0;k<offset->num_time_latency;k++)
+		{
+		offset->time_latency_time_d[k] = time_latency_time_d[k];
+		offset->time_latency_value[k] = time_latency_value[k];
+		}
+	offset->position_offset_mode = position_offset_mode;
+	offset->position_offset_x = position_offset_x;
+	offset->position_offset_y = position_offset_y;
+	offset->position_offset_z = position_offset_z;
+	offset->attitude_offset_mode = attitude_offset_mode;
+	offset->attitude_offset_azimuth = attitude_offset_azimuth;
+	offset->attitude_offset_roll = attitude_offset_roll;
+	offset->attitude_offset_pitch = attitude_offset_pitch;
+	
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
+		}
+	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
+		{
+		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
+		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
+		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
+		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
+		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
+		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
+		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
+		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
+		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
+		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
+		for (i=0;i<platform->num_sensors;i++)
+			{
+			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
+			for (j=0;j<platform->sensors[i].num_offsets;j++)
+				{
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
+				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
+					{
+					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
+						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
+					}
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
+				}
+			}
+		}
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"dbg2       error:			%d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			%d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+	
+int mb_platform_deall(int verbose, void **platform_ptr, int *error)
+{
+	char	*function_name = "mb_platform_deall";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+	struct mb_sensor_struct *sensor;
+	struct mb_sensor_offset_struct *offset;
+	int	isensor;
+	int	ioffset;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
+		fprintf(stderr,"dbg2       platform_ptr:      %p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:     %p\n", *platform_ptr);
+		}
+
+	/* free memory for platform descriptor structure if needed */
+	if (*platform_ptr != NULL)
+		{
+		/* get platform structure */
+		platform = (struct mb_platform_struct *) *platform_ptr;
+		
+		/* loop over all sensors */
+		for (isensor=0;isensor<platform->num_sensors_alloc;isensor++)
+			{
+			sensor = (struct mb_sensor_struct *) &platform->sensors[isensor];
+			
+			/* free all offsets */
+			if (sensor->num_offsets_alloc > 0
+				&& sensor->offsets != NULL)
+				{
+				/* free any time latency model */
+				for (ioffset=0;ioffset<sensor->num_offsets;ioffset++)
+					{
+					offset = (struct mb_sensor_offset_struct *) &sensor->offsets[ioffset];
+					if (offset->num_time_latency_alloc > 0)
+						{
+						status = mb_freed(verbose,__FILE__, __LINE__,
+							(void **) &offset->time_latency_time_d, error);
+						status = mb_freed(verbose,__FILE__, __LINE__,
+							(void **) &offset->time_latency_value, error);
+						offset->num_time_latency_alloc = 0;
+						}
+					}
+				
+				status = mb_freed(verbose,__FILE__, __LINE__,
+						(void **) &sensor->offsets, error);
+				sensor->num_offsets_alloc = 0;
+				}
+			}
+
+		/* free all offsets */
+		if (platform->num_sensors_alloc > 0
+			&& platform->sensors != NULL)
+			{
+			status = mb_freed(verbose,__FILE__, __LINE__,
+					(void **) &platform->sensors, error);
+			}
+			
+		/* free platform structure */
+		status = mb_freed(verbose,__FILE__, __LINE__,
+				(void **) platform_ptr, error);
+		}
+	
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       error:			%d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			%d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+	
+/*--------------------------------------------------------------------*/
+
+int mb_platform_read(int verbose, char *platform_file, void **platform_ptr, int *error)
+{
+	char	*function_name = "mb_platform_read";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+	size_t	size;
+	FILE	*fp;
+	char	buffer[MB_PATH_MAXLINE], dummy[MB_PATH_MAXLINE], *result, *message;
+	int	ivalue;
+	double	dvalue, dvalue2, dvalue3;
+	char	svalue[MB_PATH_MAXLINE];
+	int 	len;
+	int	isensor, ioffset;
+	int	i, j, k;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
+		fprintf(stderr,"dbg2       platform_file:     %s\n", platform_file);
+		fprintf(stderr,"dbg2       platform_ptr:      %p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:     %p\n", *platform_ptr);
+		}
+
+	/* allocate memory for platform descriptor structure if needed */
+	if (*platform_ptr == NULL)
+		{
+		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_platform_struct),
+				(void **) platform_ptr, error);
+		if (status == MB_SUCCESS)
+			{
+			memset(*platform_ptr, 0, sizeof(struct mb_platform_struct));
+			}
+		}
+		
+	/* get platform structure */
+	platform = (struct mb_platform_struct *) *platform_ptr;
+		
+	/* open and read platform file */
+	if ((fp = fopen(platform_file, "r")) != NULL)
+		{
+		while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
+			{
+			if (buffer[0] != '#')
+				{
+				len = strlen(buffer);
+				if (len > 0)
+					{
+					if (buffer[len-1] == '\n')
+						buffer[len-1] = '\0';
+					if (buffer[len-2] == '\r')
+						buffer[len-2] = '\0';
+					}
+	    
+				/* general parameters */
+				if (strncmp(buffer, "PLATFORM_TYPE", 13) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->type);
+					}
+				else if (strncmp(buffer, "PLATFORM_NAME", 13) == 0)
+					{
+					sscanf(buffer, "%s %s", dummy, platform->name);
+					}
+				else if (strncmp(buffer, "PLATFORM_ORGANIZATION", 21) == 0)
+					{
+					sscanf(buffer, "%s %s", dummy, platform->organization);
+					}
+				else if (strncmp(buffer, "SOURCE_SWATHBATHYMETRY", 15) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->source_swathbathymetry);
+					}
+				else if (strncmp(buffer, "SOURCE_POSITION", 15) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->source_position);
+					}
+				else if (strncmp(buffer, "SOURCE_DEPTH", 12) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->source_depth);
+					}
+				else if (strncmp(buffer, "SOURCE_HEAVE", 12) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->source_heave);
+					}
+				else if (strncmp(buffer, "SOURCE_HEADING", 14) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->source_heading);
+					}
+				else if (strncmp(buffer, "SOURCE_ROLLPITCH", 16) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->source_rollpitch);
+					}
+				else if (strncmp(buffer, "PLATFORM_NUM_SENSORS", 20) == 0)
+					{
+					sscanf(buffer, "%s %d", dummy, &platform->num_sensors);
+					if (platform->num_sensors > platform->num_sensors_alloc)
+						{
+						size = platform->num_sensors * sizeof(struct mb_sensor_struct);
+						status = mb_mallocd(verbose,__FILE__, __LINE__,
+									size, (void **) &platform->sensors, error);
+						if (status == MB_SUCCESS)
+							{
+							memset(platform->sensors, 0, size);
+							platform->num_sensors_alloc = platform->num_sensors;
+							}
+						else
+							{
+							mb_error(verbose,*error,&message);
+							fprintf(stderr,"\nMBIO Error allocating sensor structures:\n%s\n",message);
+							fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+							exit(*error);
+							}
+						}
+					}
+	
+				else if (strncmp(buffer, "SENSOR_TYPE", 11) == 0)
+					{
+					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
+					if (isensor >= 0 && isensor < platform->num_sensors)
+						platform->sensors[isensor].type = ivalue;
+					}
+				else if (strncmp(buffer, "SENSOR_MODEL", 12) == 0)
+					{
+					sscanf(buffer, "%s %d %s", dummy, &isensor, svalue);
+					if (isensor >= 0 && isensor < platform->num_sensors)
+						strcpy(platform->sensors[isensor].model, svalue);
+					}
+				else if (strncmp(buffer, "SENSOR_MANUFACTURER", 19) == 0)
+					{
+					sscanf(buffer, "%s %d %s", dummy, &isensor, svalue);
+					if (isensor >= 0 && isensor < platform->num_sensors)
+						strcpy(platform->sensors[isensor].manufacturer, svalue);
+					}
+				else if (strncmp(buffer, "SENSOR_SERIALNUMBER", 19) == 0)
+					{
+					sscanf(buffer, "%s %d %s", dummy, &isensor, svalue);
+					if (isensor >= 0 && isensor < platform->num_sensors)
+						strcpy(platform->sensors[isensor].serialnumber, svalue);
+					}
+				else if (strncmp(buffer, "SENSOR_CAPABILITY", 17) == 0)
+					{
+					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
+					if (isensor >= 0 && isensor < platform->num_sensors)
+						platform->sensors[isensor].capability = ivalue;
+					}
+				else if (strncmp(buffer, "SENSOR_SPECIAL_CAPABILITY", 25) == 0)
+					{
+					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
+					if (isensor >= 0 && isensor < platform->num_sensors)
+						platform->sensors[isensor].special_capability = ivalue;
+					}
+				else if (strncmp(buffer, "SENSOR_NUM_OFFSETS", 17) == 0)
+					{
+					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
+					if (isensor >= 0 && isensor < platform->num_sensors)
+						platform->sensors[isensor].num_offsets = ivalue;
+					if (platform->sensors[isensor].num_offsets > platform->sensors[isensor].num_offsets_alloc)
+						{
+						size = platform->sensors[isensor].num_offsets * sizeof(struct mb_sensor_offset_struct);
+						status = mb_mallocd(verbose,__FILE__, __LINE__,
+									size, (void **) &platform->sensors[isensor].offsets, error);
+						if (status == MB_SUCCESS)
+							{
+							memset(platform->sensors[isensor].offsets, 0, size);
+							platform->sensors[isensor].num_offsets_alloc = platform->sensors[isensor].num_offsets;
+							}
+						else
+							{
+							mb_error(verbose,*error,&message);
+							fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
+							fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+							exit(*error);
+							}
+						}
+					}
+	
+				else if (strncmp(buffer, "OFFSET_TIME_LATENCY_STATIC", 26) == 0)
+					{
+					sscanf(buffer, "%s %d %d %lf", dummy, &isensor, &ioffset, &dvalue);
+					if (isensor >= 0 && isensor < platform->num_sensors
+					    && ioffset >= 0 && ioffset < platform->sensors[isensor].num_offsets)
+						{
+						platform->sensors[isensor].offsets[ioffset].time_latency_static = dvalue;
+						platform->sensors[isensor].offsets[ioffset].time_latency_mode = MB_SENSOR_TIME_LATENCY_STATIC;
+						}
+					}
+				else if (strncmp(buffer, "OFFSET_TIME_LATENCY_MODEL", 26) == 0)
+					{
+					sscanf(buffer, "%s %d %d %d", dummy, &isensor, &ioffset, &ivalue);
+					if (isensor >= 0 && isensor < platform->num_sensors
+					    && ioffset >= 0 && ioffset < platform->sensors[isensor].num_offsets)
+						{
+						platform->sensors[isensor].offsets[ioffset].num_time_latency = ivalue;
+						platform->sensors[isensor].offsets[ioffset].time_latency_mode = MB_SENSOR_TIME_LATENCY_MODEL;
+						if (platform->sensors[isensor].offsets[ioffset].num_time_latency
+						    < platform->sensors[isensor].offsets[ioffset].num_time_latency_alloc)
+							{
+							size = platform->sensors[isensor].offsets[ioffset].num_time_latency * sizeof(double);
+							status = mb_mallocd(verbose,__FILE__, __LINE__, size,
+										(void **) &platform->sensors[isensor].offsets[ioffset].time_latency_time_d,
+										error);
+							status = mb_mallocd(verbose,__FILE__, __LINE__, size,
+										(void **) &platform->sensors[isensor].offsets[ioffset].time_latency_value,
+										error);
+							if (status == MB_SUCCESS)
+								{
+								memset(platform->sensors[isensor].offsets[ioffset].time_latency_time_d, 0, size);
+								memset(platform->sensors[isensor].offsets[ioffset].time_latency_value, 0, size);
+								platform->sensors[isensor].offsets[ioffset].num_time_latency_alloc
+									= platform->sensors[isensor].offsets[ioffset].num_time_latency;
+								}
+							else
+								{
+								mb_error(verbose,*error,&message);
+								fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
+								fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+								exit(*error);
+								}
+							
+							}
+									
+						/* read the time latency model */
+						for (i=0;i<platform->sensors[isensor].offsets[ioffset].num_time_latency;i++)
+							{
+							if ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
+								{
+								sscanf(buffer, "%lf %lf",
+									&platform->sensors[isensor].offsets[ioffset].time_latency_time_d[i],
+									&platform->sensors[isensor].offsets[ioffset].time_latency_value[i]);
+								}
+							else
+								{
+								status = MB_FAILURE;
+								*error = MB_ERROR_EOF;
+								mb_error(verbose,*error,&message);
+								fprintf(stderr,"\nMBIO Error parsing sensor offset time latency model:\n%s\n",message);
+								fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
+								exit(*error);
+								}
+							}
+						}
+					}
+	
+				else if (strncmp(buffer, "OFFSET_POSITION", 15) == 0)
+					{
+					sscanf(buffer, "%s %d %d %lf %lf %lf", dummy, &isensor, &ioffset, &dvalue, &dvalue2, &dvalue3);
+					platform->sensors[isensor].offsets[ioffset].position_offset_x = dvalue;
+					platform->sensors[isensor].offsets[ioffset].position_offset_y = dvalue2;
+					platform->sensors[isensor].offsets[ioffset].position_offset_z = dvalue3;
+					platform->sensors[isensor].offsets[ioffset].position_offset_mode = MB_SENSOR_POSITION_OFFSET_STATIC;
+					}
+				else if (strncmp(buffer, "OFFSET_ATTITUDE", 15) == 0)
+					{
+					sscanf(buffer, "%s %d %d %lf %lf %lf", dummy, &isensor, &ioffset, &dvalue, &dvalue2, &dvalue3);
+					platform->sensors[isensor].offsets[ioffset].attitude_offset_azimuth = dvalue;
+					platform->sensors[isensor].offsets[ioffset].attitude_offset_roll = dvalue2;
+					platform->sensors[isensor].offsets[ioffset].attitude_offset_pitch = dvalue3;
+					platform->sensors[isensor].offsets[ioffset].attitude_offset_mode = MB_SENSOR_ATTITUDE_OFFSET_STATIC;
+					}
+				}
+			}
+			
+		/* close the file */
+		fclose(fp);
+		}
+
+	/* failure opening */
+	else
+		{
+		*error = MB_ERROR_OPEN_FAIL;
+		status = MB_FAILURE;
+		}
+	
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
+		}
+	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
+		{
+		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
+		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
+		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
+		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
+		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
+		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
+		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
+		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
+		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
+		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
+		for (i=0;i<platform->num_sensors;i++)
+			{
+			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
+			for (j=0;j<platform->sensors[i].num_offsets;j++)
+				{
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
+				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
+					{
+					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
+						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
+					}
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
+				}
+			}
+		}
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"dbg2       error:			%d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			%d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+int mb_platform_write(int verbose, char *platform_file, void **platform_ptr, int *error)
+{
+	char	*function_name = "mb_platform_write";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+	time_t	right_now;
+	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
+	FILE 	*fp;
+	int	isensor, ioffset;
+	int	i, j, k;
+		
+	/* get platform structure */
+	platform = (struct mb_platform_struct *) *platform_ptr;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
+		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:		%p\n", *platform_ptr);
+		}
+	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
+		{
+		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
+		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
+		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
+		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
+		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
+		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
+		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
+		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
+		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
+		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
+		for (i=0;i<platform->num_sensors;i++)
+			{
+			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
+			for (j=0;j<platform->sensors[i].num_offsets;j++)
+				{
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
+				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
+					{
+					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
+						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
+					}
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
+				}
+			}
+		}
+		
+	/* open and read platform file */
+	if ((fp = fopen(platform_file, "w")) != NULL)
+		{
+		right_now = time((time_t *)0);
+		strcpy(date,ctime(&right_now));
+                date[strlen(date)-1] = '\0';
+		if ((user_ptr = getenv("USER")) == NULL)
+			user_ptr = getenv("LOGNAME");
+		if (user_ptr != NULL)
+			strcpy(user,user_ptr);
+		else
+			strcpy(user, "unknown");
+		gethostname(host,MB_PATH_MAXLINE);
+		fprintf(fp, "## MB-System Platform Definition File\n");
+		fprintf(fp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
+		fprintf(fp,"SOURCE_VERSION\t%s\n",svn_id);
+		fprintf(fp,"FILE_VERSION\t1.00\n");
+		fprintf(fp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
+		
+		
+		fprintf(stderr, "PLATFORM_TYPE\t%d\n", platform->type);
+		fprintf(stderr, "PLATFORM_NAME\t%s\n", platform->name);
+		fprintf(stderr, "PLATFORM_ORGANIZATION\t%s\n", platform->organization);
+		fprintf(stderr, "SOURCE_SWATHBATHYMETRY\t%d\n", platform->source_swathbathymetry);
+		fprintf(stderr, "SOURCE_POSITION\t%d\n", platform->source_position);
+		fprintf(stderr, "SOURCE_DEPTH\t%d\n", platform->source_depth);
+		fprintf(stderr, "SOURCE_HEAVE\t%d\n", platform->source_heave);
+		fprintf(stderr, "SOURCE_HEADING\t%d\n", platform->source_heading);
+		fprintf(stderr, "SOURCE_ROLLPITCH\t%d\n", platform->source_rollpitch);
+		fprintf(stderr, "PLATFORM_NUM_SENSORS\t%d\n", platform->num_sensors);
+		for (isensor=0;isensor<platform->num_sensors;isensor++)
+			{
+			fprintf(stderr, "SENSOR_TYPE\t%d\t%d\n", isensor, platform->sensors[i].type);
+			fprintf(stderr, "SENSOR_MODEL\t%d\t%s\n", isensor, platform->sensors[i].model);
+			fprintf(stderr, "SENSOR_MANUFACTURER\t%d\t%s\n", isensor, platform->sensors[i].manufacturer);
+			fprintf(stderr, "SENSOR_SERIALNUMBER\t%d\t%s\n", isensor, platform->sensors[i].serialnumber);
+			fprintf(stderr, "SENSOR_CAPABILITY\t%d\t%d\n", isensor, platform->sensors[i].capability);
+			fprintf(stderr, "SENSOR_SPECIAL_CAPABILITY\t%d\t%d\n", isensor, platform->sensors[i].special_capability);
+			fprintf(stderr, "SENSOR_NUM_OFFSETS\t%d\t%d\n", isensor, platform->sensors[i].num_offsets);
+			for (ioffset=0;ioffset<platform->sensors[isensor].num_offsets;ioffset++)
+				{
+				if (platform->sensors[isensor].offsets[ioffset].time_latency_mode
+					== MB_SENSOR_TIME_LATENCY_STATIC)
+					{
+					fprintf(stderr, "OFFSET_TIME_LATENCY_STATIC\t%d\t%d %f\n",
+							isensor, ioffset, platform->sensors[isensor].offsets[ioffset].time_latency_static);
+					}
+				else if (platform->sensors[isensor].offsets[ioffset].time_latency_mode
+					== MB_SENSOR_TIME_LATENCY_MODEL)
+					{
+					fprintf(stderr, "OFFSET_TIME_LATENCY_MODEL\t%d\t%d\t%d\n",
+							isensor, ioffset, platform->sensors[isensor].offsets[ioffset].num_time_latency);
+					for (i=0;i<platform->sensors[isensor].offsets[ioffset].num_time_latency;i++)
+						{
+						fprintf(stdout, "%f\t%f",
+								platform->sensors[isensor].offsets[ioffset].time_latency_time_d[i],
+								platform->sensors[isensor].offsets[ioffset].time_latency_value[i]);
+						
+						}
+					}
+				if (platform->sensors[isensor].offsets[ioffset].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
+					{
+					fprintf(stderr, "OFFSET_POSITION\t%d\t%d\t%lf\t%lf\t%lf\n", isensor, ioffset, 
+						platform->sensors[isensor].offsets[ioffset].position_offset_x,
+						platform->sensors[isensor].offsets[ioffset].position_offset_y,
+						platform->sensors[isensor].offsets[ioffset].position_offset_z);
+					}
+				if (platform->sensors[isensor].offsets[ioffset].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+					{
+					fprintf(stderr, "OFFSET_ATTITUDE\t%d\t%d\t%lf\t%lf\t%lf\n", isensor, ioffset, 
+						platform->sensors[isensor].offsets[ioffset].attitude_offset_azimuth,
+						platform->sensors[isensor].offsets[ioffset].attitude_offset_roll,
+						platform->sensors[isensor].offsets[ioffset].attitude_offset_pitch);
+					}
+				}
+			}
+			
+		/* close the file */
+		fclose(fp);
+		}
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:			%d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			%d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+int mb_platform_lever(int verbose, void **platform_ptr,
+                      int targetsensor, int targetsensoroffset,
+		      double heading, double roll, double pitch,
+		      double *lever_x, double *lever_y, double *lever_z,
+                      int *error)
+{
+	char	*function_name = "mb_platform_lever";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+	struct mb_sensor_struct *sensor_target = NULL;
+	struct mb_sensor_struct *sensor_swathbathymetry = NULL;
+	struct mb_sensor_struct *sensor_rollpitch = NULL;
+	struct mb_sensor_struct *sensor_heading = NULL;
+	struct mb_sensor_struct *sensor_position = NULL;
+	struct mb_sensor_struct *sensor_depth = NULL;
+	double	xx, yy, zz;
+	double	croll, cpitch, cheading;
+	double	headingx, headingy;
+	int	i, j, k;
+		
+        /* reset error */
+        *error = MB_ERROR_NO_ERROR;
+
+	/* get platform structure */
+	platform = (struct mb_platform_struct *) *platform_ptr;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
+		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:		%p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       targetsensor:		%d\n", targetsensor);
+		fprintf(stderr,"dbg2       targetsensoroffset:		%d\n", targetsensoroffset);
+		fprintf(stderr,"dbg2       heading:		        %f\n", heading);
+		fprintf(stderr,"dbg2       roll:		        %f\n", roll);
+		fprintf(stderr,"dbg2       pitch:		        %f\n", pitch);
+		}
+	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
+		{
+		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
+		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
+		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
+		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
+		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
+		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
+		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
+		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
+		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
+		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
+		for (i=0;i<platform->num_sensors;i++)
+			{
+			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
+			for (j=0;j<platform->sensors[i].num_offsets;j++)
+				{
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
+				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
+					{
+					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
+						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
+					}
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
+				}
+			}
+		}
+        
+        /* check that all sensor id's are sensible for this platform */
+        if (targetsensor < 0 || targetsensor >= platform->num_sensors
+                || platform->source_swathbathymetry < 0 || platform->source_swathbathymetry >= platform->num_sensors
+                || platform->source_rollpitch < 0 || platform->source_rollpitch >= platform->num_sensors
+                || platform->source_heading < 0 || platform->source_heading >= platform->num_sensors
+                || platform->source_position < 0 || platform->source_position >= platform->num_sensors
+                || platform->source_depth < 0 || platform->source_depth >= platform->num_sensors)
+                {
+                status = MB_FAILURE;
+                *error = MB_ERROR_BAD_PARAMETER;
+                }
+        
+        /* else proceed */
+        else
+                {
+                /* get sensor structures */
+                sensor_target = &platform->sensors[targetsensor];
+                sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
+                sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
+                sensor_heading = &platform->sensors[platform->source_heading];
+                sensor_position = &platform->sensors[platform->source_position];
+                sensor_depth = &platform->sensors[platform->source_depth];
+                
+                /* start with zero lever */
+                *lever_x = 0.0;
+                *lever_y = 0.0;
+                *lever_z = 0.0;
+                
+                /* apply change in z due to offset between the depth sensor and the target sensor
+			using roll and pitch values corrected for the offsets between the
+			attitude sensor and the target sensor */
+		xx = 0.0;
+		yy = 0.0;
+		zz = 0.0;
+		cheading = heading;
+		croll = roll;
+		cpitch = pitch;
+		if (sensor_target->offsets[targetsensoroffset].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
+			{
+			xx += sensor_target->offsets[targetsensoroffset].position_offset_x;
+			yy += sensor_target->offsets[targetsensoroffset].position_offset_y;
+			zz += sensor_target->offsets[targetsensoroffset].position_offset_z;
+			}
+		if (sensor_depth->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
+			{
+			xx -= sensor_depth->offsets[0].position_offset_x;
+			yy -= sensor_depth->offsets[0].position_offset_y;
+			zz -= sensor_depth->offsets[0].position_offset_z;
+			}
+		if (sensor_target->offsets[targetsensoroffset].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+			{
+			cheading += sensor_target->offsets[targetsensoroffset].attitude_offset_azimuth;
+			croll += sensor_target->offsets[targetsensoroffset].attitude_offset_roll;
+			cpitch += sensor_target->offsets[targetsensoroffset].attitude_offset_pitch;
+			}
+		if (sensor_rollpitch->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+			{
+			cheading -= sensor_rollpitch->offsets[0].attitude_offset_azimuth;
+			croll -= sensor_rollpitch->offsets[0].attitude_offset_roll;
+			cpitch -= sensor_rollpitch->offsets[0].attitude_offset_pitch;
+			}
+		*lever_z = sin(DTR * croll) * xx
+				- sin(DTR * cpitch) * yy
+				+ cos(DTR * cpitch) * zz;
+                
+                /* apply change in x and y due to offset between the position sensor and the target sensor
+			using heading corrected for the offset between the heading sensor and the target sensor */
+		xx = 0.0;
+		yy = 0.0;
+		zz = 0.0;
+		cheading = heading;
+		croll = roll;
+		cpitch = pitch;
+		if (sensor_target->offsets[targetsensoroffset].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
+			{
+			xx += sensor_target->offsets[targetsensoroffset].position_offset_x;
+			yy += sensor_target->offsets[targetsensoroffset].position_offset_y;
+			zz += sensor_target->offsets[targetsensoroffset].position_offset_z;
+			}
+		if (sensor_position->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
+			{
+			xx -= sensor_depth->offsets[0].position_offset_x;
+			yy -= sensor_depth->offsets[0].position_offset_y;
+			zz -= sensor_depth->offsets[0].position_offset_z;
+			}
+		if (sensor_target->offsets[targetsensoroffset].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+			{
+			cheading += sensor_target->offsets[targetsensoroffset].attitude_offset_azimuth;
+			croll += sensor_target->offsets[targetsensoroffset].attitude_offset_roll;
+			cpitch += sensor_target->offsets[targetsensoroffset].attitude_offset_pitch;
+			}
+		if (sensor_heading->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+			{
+			cheading -= sensor_heading->offsets[0].attitude_offset_azimuth;
+			croll -= sensor_heading->offsets[0].attitude_offset_roll;
+			cpitch -= sensor_heading->offsets[0].attitude_offset_pitch;
+			}
+		headingx = sin(DTR * cheading);
+		headingy = cos(DTR * cheading);	
+		*lever_x = headingy * xx + headingx * yy;
+		*lever_y = -headingx * xx + headingy * yy;
+                }
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       lever_x:		        %f\n", *lever_x);
+		fprintf(stderr,"dbg2       lever_y:		        %f\n", *lever_y);
+		fprintf(stderr,"dbg2       lever_z:		        %f\n", *lever_z);
+		fprintf(stderr,"dbg2       error:			%d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			%d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+int mb_platform_position(int verbose, void **platform_ptr,
+                      int targetsensor, int targetsensoroffset,
+		      double navlon, double navlat, double sensordepth,
+		      double heading, double roll, double pitch,
+		      double *targetlon, double *targetlat, double *targetz,
+                      int *error)
+{
+	char	*function_name = "mb_platform_position";
+	int	status = MB_SUCCESS;
+	struct mb_platform_struct *platform;
+	double	mtodeglon, mtodeglat;
+	double	lever_x, lever_y, lever_z;
+	int	i, j, k;
+		
+	/* get platform structure */
+	platform = (struct mb_platform_struct *) *platform_ptr;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
+		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
+		fprintf(stderr,"dbg2       *platform_ptr:		%p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       targetsensor:		%d\n", targetsensor);
+		fprintf(stderr,"dbg2       targetsensoroffset:		%d\n", targetsensoroffset);
+		fprintf(stderr,"dbg2       navlon:		        %f\n", navlon);
+		fprintf(stderr,"dbg2       navlat:		        %f\n", navlat);
+		fprintf(stderr,"dbg2       sensordepth:		        %f\n", sensordepth);
+		fprintf(stderr,"dbg2       heading:		        %f\n", heading);
+		fprintf(stderr,"dbg2       roll:		        %f\n", roll);
+		fprintf(stderr,"dbg2       pitch:		        %f\n", pitch);
+		}
+	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
+		{
+		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
+		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
+		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
+		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
+		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
+		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
+		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
+		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
+		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
+		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
+		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
+		for (i=0;i<platform->num_sensors;i++)
+			{
+			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
+			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
+			for (j=0;j<platform->sensors[i].num_offsets;j++)
+				{
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
+				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
+					{
+					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
+						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
+					}
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
+				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
+				}
+			}
+		}
+
+	/* call mb_platform lever to get relative lever offsets */
+	status = mb_platform_lever(verbose, platform_ptr,
+                      targetsensor, targetsensoroffset,
+		      heading, roll, pitch,
+		      &lever_x, &lever_y, &lever_z,
+                      error);
+	
+	/* get local translation between lon lat degrees and meters */
+	mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
+	
+	/* calculate absolute position and depth for target sensor */
+	*targetlon = navlon + lever_x * mtodeglon;
+	*targetlat = navlat + lever_y * mtodeglat;
+	*targetz = sensordepth + lever_z;
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       targetlon:		        %f\n", *targetlon);
+		fprintf(stderr,"dbg2       targetlat:		        %f\n", *targetlat);
+		fprintf(stderr,"dbg2       targetz:		        %f\n", *targetz);
+		fprintf(stderr,"dbg2       error:			%d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:			%d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_process.c b/src/mbio/mb_process.c
index 87dcbf7..f375bba 100644
--- a/src/mbio/mb_process.c
+++ b/src/mbio/mb_process.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_process.c	9/11/00
- *    $Id: mb_process.c 2183 2014-04-16 19:54:45Z caress $
+ *    $Id: mb_process.c 2241 2015-05-12 21:00:35Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -21,141 +21,6 @@
  * Author:	D. W. Caress
  * Date:	September 11, 2000
  *
- * $Log: mb_process.c,v $
- * Revision 5.40  2009/03/09 16:58:31  caress
- * Release 5.1.2beta01
- *
- * Revision 5.39  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.38  2008/09/11 20:11:52  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.37  2008/05/26 04:43:15  caress
- * Getting ready for release 5.1.1beta19.
- *
- * Revision 5.36  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.35  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.34  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.33  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.32  2005/03/25 04:16:41  caress
- * Added sonar depth merging to mbprocess.
- *
- * Revision 5.31  2005/02/08 22:37:38  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.30  2004/12/18 01:34:43  caress
- * Working towards release 5.0.6.
- *
- * Revision 5.29  2004/12/02 06:33:30  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.28  2004/10/06 19:04:24  caress
- * Release 5.0.5 update.
- *
- * Revision 5.27  2004/09/16 01:11:48  caress
- * Fixed how esf file path is determined.
- *
- * Revision 5.26  2003/04/18 00:35:42  caress
- * Added capability to look for svp files with lookforfiles=2.
- *
- * Revision 5.25  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.24  2003/04/16 16:47:41  caress
- * Release 5.0.beta30
- *
- * Revision 5.23  2002/09/07 04:48:34  caress
- * Added slope mode option to mb_process.
- *
- * Revision 5.22  2002/07/25 19:09:04  caress
- * Release 5.0.beta21
- *
- * Revision 5.21  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.20  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.19  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.18  2002/04/06 02:43:39  caress
- * Release 5.0.beta16
- *
- * Revision 5.17  2001/12/20 21:03:18  caress
- * Release 5.0.beta11
- *
- * Revision 5.16  2001/12/18  04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.15  2001/11/16  01:30:02  caress
- * Fixed handling of paths.
- *
- * Revision 5.14  2001/11/04  00:14:41  caress
- * Fixed handling of angle_mode
- *
- * Revision 5.13  2001/10/19 19:41:09  caress
- * Now uses relative paths.
- *
- * Revision 5.12  2001/10/19  00:54:37  caress
- * Now tries to use relative paths.
- *
- * Revision 5.11  2001/09/17  23:22:51  caress
- * Fixed metadata support.
- *
- * Revision 5.10  2001/08/10  22:41:19  dcaress
- * Release 5.0.beta07
- *
-\ * Revision 5.9  2001-08-03 18:00:02-07  caress
- * Added cut by speed.
- *
- * Revision 5.8  2001/07/31  00:40:52  caress
- * Added data cutting capability.
- *
- * Revision 5.7  2001/07/27  19:07:16  caress
- * Added data cutting.
- *
- * Revision 5.6  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.5  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.4  2001/06/03  06:54:56  caress
- * Improved handling of lever calculation.
- *
- * Revision 5.3  2001/06/01  00:14:06  caress
- * Added support for metadata insertion.
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.1  2000/10/03  21:46:59  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  2000/09/30  06:28:42  caress
- * Snapshot for Dale.
- *
- *
- *
  */
 
 /* standard include files */
@@ -174,7 +39,7 @@
 #include "mb_format.h"
 #include "mb_process.h"
 
-static char rcs_id[]="$Id: mb_process.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[]="$Id: mb_process.c 2241 2015-05-12 21:00:35Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_pr_checkstatus(int verbose, char *file,
@@ -534,11 +399,14 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 		{
 		if (buffer[0] != '#')
 		    {
-		    if (strlen(buffer) > 0)
-			    {
-			    if (buffer[strlen(buffer)-1] == '\n')
-				    buffer[strlen(buffer)-1] = '\0';
-			    }
+		    len = strlen(buffer);
+		    if (len > 0)
+			{
+			if (buffer[len-1] == '\n')
+			    buffer[len-1] = '\0';
+			if (buffer[len-2] == '\r')
+			    buffer[len-2] = '\0';
+			}
 
 		    /* general parameters */
 		    if (strncmp(buffer, "EXPLICIT", 8) == 0)
@@ -1225,7 +1093,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 
 	/* Now make input file global if local */
 	process->mbp_ifile_specified = MB_YES;
-	if (file[0] != '/')
+	if (file[0] != '/' && file[1] != ':')
 	    {
 	    bufptr = getcwd(process->mbp_ifile, MB_PATH_MAXLINE);
 	    strcat(process->mbp_ifile, "/");
@@ -1243,7 +1111,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	    }
 
 	/* Make output file global if local */
-	if (process->mbp_ofile[0] != '/')
+	if (process->mbp_ofile[0] != '/' && process->mbp_ofile[1] != ':')
 	    {
 	    lastslash = strrchr(process->mbp_ifile, '/');
 	    if (lastslash != NULL)
@@ -1440,7 +1308,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset navadj file */
 	if (len > 1
 	    && strlen(process->mbp_navadjfile) > 1
-	    && process->mbp_navadjfile[0] != '/')
+	    && process->mbp_navadjfile[0] != '/' && process->mbp_navadjfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_navadjfile);
 	    strncpy(process->mbp_navadjfile, process->mbp_ifile, len);
@@ -1451,7 +1319,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset nav file */
 	if (len > 1
 	    && strlen(process->mbp_navfile) > 1
-	    && process->mbp_navfile[0] != '/')
+	    && process->mbp_navfile[0] != '/' && process->mbp_navfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_navfile);
 	    strncpy(process->mbp_navfile, process->mbp_ifile, len);
@@ -1462,7 +1330,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset attitude file */
 	if (len > 1
 	    && strlen(process->mbp_attitudefile) > 1
-	    && process->mbp_attitudefile[0] != '/')
+	    && process->mbp_attitudefile[0] != '/' && process->mbp_attitudefile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_attitudefile);
 	    strncpy(process->mbp_attitudefile, process->mbp_ifile, len);
@@ -1473,7 +1341,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset sonardepth file */
 	if (len > 1
 	    && strlen(process->mbp_sonardepthfile) > 1
-	    && process->mbp_sonardepthfile[0] != '/')
+	    && process->mbp_sonardepthfile[0] != '/' && process->mbp_sonardepthfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_sonardepthfile);
 	    strncpy(process->mbp_sonardepthfile, process->mbp_ifile, len);
@@ -1484,7 +1352,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset svp file */
 	if (len > 1
 	    && strlen(process->mbp_svpfile) > 1
-	    && process->mbp_svpfile[0] != '/')
+	    && process->mbp_svpfile[0] != '/' && process->mbp_svpfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_svpfile);
 	    strncpy(process->mbp_svpfile, process->mbp_ifile, len);
@@ -1495,7 +1363,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset edit file */
 	if (len > 1
 	    && strlen(process->mbp_editfile) > 1
-	    && process->mbp_editfile[0] != '/')
+	    && process->mbp_editfile[0] != '/' && process->mbp_editfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_editfile);
 	    strncpy(process->mbp_editfile, process->mbp_ifile, len);
@@ -1506,7 +1374,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset static file */
 	if (len > 1
 	    && strlen(process->mbp_staticfile) > 1
-	    && process->mbp_staticfile[0] != '/')
+	    && process->mbp_staticfile[0] != '/' && process->mbp_staticfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_staticfile);
 	    strncpy(process->mbp_staticfile, process->mbp_ifile, len);
@@ -1517,7 +1385,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset tide file */
 	if (len > 1
 	    && strlen(process->mbp_tidefile) > 1
-	    && process->mbp_tidefile[0] != '/')
+	    && process->mbp_tidefile[0] != '/' && process->mbp_tidefile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_tidefile);
 	    strncpy(process->mbp_tidefile, process->mbp_ifile, len);
@@ -1528,7 +1396,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset amplitude correction file */
 	if (len > 1
 	    && strlen(process->mbp_ampcorrfile) > 1
-	    && process->mbp_ampcorrfile[0] != '/')
+	    && process->mbp_ampcorrfile[0] != '/' && process->mbp_ampcorrfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_ampcorrfile);
 	    strncpy(process->mbp_ampcorrfile, process->mbp_ifile, len);
@@ -1539,7 +1407,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset sidescan correction file */
 	if (len > 1
 	    && strlen(process->mbp_sscorrfile) > 1
-	    && process->mbp_sscorrfile[0] != '/')
+	    && process->mbp_sscorrfile[0] != '/' && process->mbp_sscorrfile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_sscorrfile);
 	    strncpy(process->mbp_sscorrfile, process->mbp_ifile, len);
@@ -1550,7 +1418,7 @@ int mb_pr_readpar(int verbose, char *file, int lookforfiles,
 	/* reset mbp_ampsscorr_topo file */
 	if (len > 1
 	    && strlen(process->mbp_ampsscorr_topofile) > 1
-	    && process->mbp_ampsscorr_topofile[0] != '/')
+	    && process->mbp_ampsscorr_topofile[0] != '/' && process->mbp_ampsscorr_topofile[1] != ':')
 	    {
 	    strcpy(dummy, process->mbp_ampsscorr_topofile);
 	    strncpy(process->mbp_ampsscorr_topofile, process->mbp_ifile, len);
diff --git a/src/mbio/mb_process.h b/src/mbio/mb_process.h
index f839ed0..8bb3ce3 100644
--- a/src/mbio/mb_process.h
+++ b/src/mbio/mb_process.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_process.h	9/11/00
- *    $Id: mb_process.h 2210 2014-11-10 19:53:01Z caress $
+ *    $Id: mb_process.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -560,100 +560,6 @@
  * Date:	September 11, 2000
  * Updated:	August 4, 2009 (R/V Zephyr, Cleft Segment, Juan de Fuca Ridge)
  *
- * $Log: mb_process.h,v $
- * Revision 5.29  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.28  2008/09/11 20:11:52  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.27  2008/05/26 04:43:15  caress
- * Getting ready for release 5.1.1beta19.
- *
- * Revision 5.26  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.25  2007/05/14 06:25:47  caress
- * Added support for vertical as well as lateral adjustments from mbnavadjust.
- *
- * Revision 5.24  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.23  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.22  2005/03/25 04:16:41  caress
- * Added sonar depth merging to mbprocess.
- *
- * Revision 5.21  2004/12/02 06:33:31  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.20  2004/10/06 19:04:24  caress
- * Release 5.0.5 update.
- *
- * Revision 5.19  2004/05/21 23:46:22  caress
- * Progress supporting Reson 7k data, including support for extracing subbottom profiler data.
- *
- * Revision 5.18  2003/07/26 17:59:32  caress
- * Changed beamflag handling code.
- *
- * Revision 5.17  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.16  2003/04/16 16:47:41  caress
- * Release 5.0.beta30
- *
- * Revision 5.15  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.14  2002/09/07 04:48:34  caress
- * Added slope mode option to mb_process.
- *
- * Revision 5.13  2002/07/25 19:09:04  caress
- * Release 5.0.beta21
- *
- * Revision 5.12  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.11  2002/04/06 02:43:39  caress
- * Release 5.0.beta16
- *
- * Revision 5.10  2001/12/18 04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.9  2001/08/10  22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.8  2001-08-03 18:00:02-07  caress
- * Added cut by speed.
- *
- * Revision 5.7  2001/08/02  01:49:25  caress
- * Added mb_pr_ function prototypes.
- *
- * Revision 5.6  2001/07/31  00:40:52  caress
- * Added data cutting capability.
- *
- * Revision 5.5  2001/07/27  19:07:16  caress
- * Added data cutting.
- *
- * Revision 5.4  2001/06/03 06:54:56  caress
- * Improved handling of lever calculation.
- *
- * Revision 5.3  2001/06/01  00:14:06  caress
- * Added support for metadata insertion.
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.0  2000/09/30  06:28:42  caress
- * Snapshot for Dale.
- *
  *
  */
 
@@ -1327,6 +1233,13 @@ int mb_pr_set_bathyslope(int verbose,
 			int *nslopes, double *slopes, double *slopeacrosstrack,
 			double *depthsmooth,
 			int *error);
+int mb_pr_set_bathyslopenew(int verbose,
+                        int nsmooth,
+                        int nbath, char *beamflag, double *bath, double *bathacrosstrack,
+                        int *ndepths, double *depths, double *depthacrosstrack,
+                        int *nslopes, double *slopes, double *slopeacrosstrack,
+                        double *depthsmooth,
+                        int *error);
 int mb_pr_get_bathyslope(int verbose,
 			int ndepths, double *depths, double *depthacrosstrack,
 			int nslopes, double *slopes, double *slopeacrosstrack,
diff --git a/src/mbio/mb_proj.c b/src/mbio/mb_proj.c
index 540ef99..16fce30 100644
--- a/src/mbio/mb_proj.c
+++ b/src/mbio/mb_proj.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_proj.c	7/16/2002
- *    $Id: mb_proj.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_proj.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -32,33 +32,6 @@
  * Author:	D. W. Caress
  * Date:	July 16, 2002
  *
- * $Log: mb_proj.c,v $
- * Revision 5.7  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.6  2007/05/14 06:20:09  caress
- * Added more useful error message for inability to open the projection database.
- *
- * Revision 5.5  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.4  2004/02/24 22:17:05  caress
- * Added mb_proj_transform() function.
- *
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2002/08/02 01:01:10  caress
- * 5.0.beta22
- *
- * Revision 5.0  2002/07/20 20:41:59  caress
- * Initial Revision
- * l
- *
- *
  *
  */
 
@@ -73,7 +46,7 @@
 #include "proj_api.h"
 #include "projections.h"
 
-static char rcs_id[]="$Id: mb_proj.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_proj.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_proj_init(int verbose,
diff --git a/src/mbio/mb_put_all.c b/src/mbio/mb_put_all.c
index d0106dc..700f849 100644
--- a/src/mbio/mb_put_all.c
+++ b/src/mbio/mb_put_all.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_put_all.c	2/4/93
- *    $Id: mb_put_all.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_put_all.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -128,7 +128,7 @@ int mb_put_all(int verbose, void *mbio_ptr, void *store_ptr,
 		double *ss, double *ssacrosstrack, double *ssalongtrack,
 		char *comment, int *error)
 {
-  static char rcs_id[]="$Id: mb_put_all.c 2175 2014-03-18 23:03:39Z caress $";
+  static char rcs_id[]="$Id: mb_put_all.c 2227 2015-02-05 21:12:31Z caress $";
 	char	*function_name = "mb_put_all";
 	int	status = MB_SUCCESS;
 	struct mb_io_struct *mb_io_ptr;
diff --git a/src/mbio/mb_put_comment.c b/src/mbio/mb_put_comment.c
index e9681fd..2750f3b 100644
--- a/src/mbio/mb_put_comment.c
+++ b/src/mbio/mb_put_comment.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_put_comment.c	7/15/97
- *    $Id: mb_put_comment.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_put_comment.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mb_read.c b/src/mbio/mb_read.c
index e5a9186..66c8549 100644
--- a/src/mbio/mb_read.c
+++ b/src/mbio/mb_read.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_read.c	2/20/93
- *    $Id: mb_read.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_read.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -149,7 +149,7 @@
 #include "mb_io.h"
 #include "mb_define.h"
 
-static char rcs_id[]="$Id: mb_read.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_read.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_read(int verbose, void *mbio_ptr,
diff --git a/src/mbio/mb_read_init.c b/src/mbio/mb_read_init.c
index 89ee86a..bc96da3 100644
--- a/src/mbio/mb_read_init.c
+++ b/src/mbio/mb_read_init.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_read_init.c	1/25/93
- *    $Id: mb_read_init.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_read_init.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -19,182 +19,6 @@
  * Author:	D. W. Caress
  * Date:	January 25, 1993
  *
- * $Log: mb_read_init.c,v $
- * Revision 5.27  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.26  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.25  2008/10/17 07:30:22  caress
- * Added format 26 supporting Hydrosweep DS data used by SOPAC.
- *
- * Revision 5.24  2008/09/20 00:57:40  caress
- * Release 5.1.1beta23
- *
- * Revision 5.23  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.22  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.21  2007/05/14 06:22:01  caress
- * Changed fopen in rw mode to fopen in r mode.
- *
- * Revision 5.20  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.19  2006/01/11 07:37:29  caress
- * Working towards 5.0.8
- *
- * Revision 5.18  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.17  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.16  2004/07/15 19:25:04  caress
- * Progress in supporting Reson 7k data.
- *
- * Revision 5.15  2004/04/27 01:46:13  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.14  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.13  2003/02/27 04:33:33  caress
- * Fixed handling of SURF format data.
- *
- * Revision 5.12  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.11  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.10  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.9  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.8  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.7  2002/01/24 02:30:58  caress
- * Added DARWIN.
- *
- * Revision 5.6  2001/10/12  21:08:37  caress
- * Added interpolation of attitude data.
- *
- * Revision 5.5  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.4  2001/06/29 22:48:04  caress
- * Added support for HSDS2RAW
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.16  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.15  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.14  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.13  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.12  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.11  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.11  1997/04/17  18:48:52  caress
- * Added LINUX ifdef.
- *
- * Revision 4.10  1996/08/26  17:24:56  caress
- * Release 4.4 revision.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1995/11/02  19:48:51  caress
- * Fixed error handling.
- *
- * Revision 4.6  1995/03/22  19:14:25  caress
- * Added #ifdef's for HPUX.
- *
- * Revision 4.5  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/01/25  17:13:46  caress
- * Added ifdef for SOLARIS.
- *
- * Revision 4.3  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/04/21  21:02:39  caress
- * Fixed bug so file open errors are passed back to calling function.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.8  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.7  1994/03/03  03:15:16  caress
- * Fixed a minor bug.
- *
- * Revision 4.6  1994/02/20  03:15:01  caress
- * Fixed error line 336.
- *
- * Revision 4.5  1994/02/20  02:08:54  caress
- * Fixed closing debug statements.
- *
- * Revision 4.4  1994/02/20  02:03:18  caress
- * Removed spurious line of code.
- *
- * Revision 4.3  1994/02/20  02:00:53  caress
- * Added tabs in front of some variable definitions.
- *
- * Revision 4.2  1994/02/18  21:21:15  caress
- * Added amp_num array.
- *
- * Revision 4.1  1994/02/18  20:38:07  caress
- * Changed some of the variables missed in the previous cut.
- *
- * Revision 4.0  1994/02/18  18:41:34  caress
- * First cut at new version.  Added sidescan and associated
- * changes.  Added indirect format id's.
- *
- * Revision 3.1  1993/05/14  22:38:32  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  18:45:53  dale
- * Initial version
- *
- *
  */
 
 /* standard include files */
@@ -210,12 +34,10 @@
 #include "mb_define.h"
 #include "../surf/mb_sapi.h"
 #include "mb_segy.h"
-#ifdef WITH_GSF
-#  include "gsf.h"
-#endif
+#include "gsf.h"
 #include "netcdf.h"
 
-static char rcs_id[]="$Id: mb_read_init.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_read_init.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_read_init(int verbose, char *file,
@@ -340,11 +162,7 @@ int mb_read_init(int verbose, char *file,
 	mb_io_ptr->file3_pos = 0;
 	mb_io_ptr->file3_bytes = 0;
 	mb_io_ptr->ncid = 0;
-#ifdef WITH_GSF
 	mb_io_ptr->gsfid = 0;
-#else
-        /* TODO: possibly set to -666 */
-#endif
 	mb_io_ptr->xdrs = NULL;
 	mb_io_ptr->xdrs2 = NULL;
 	mb_io_ptr->xdrs3 = NULL;
@@ -539,7 +357,7 @@ int mb_read_init(int verbose, char *file,
 	    if (strncmp(file,stdin_string,5) == 0)
 		mb_io_ptr->mbfp = stdin;
 	    else
-		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "r")) == NULL)
+		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "rb")) == NULL)
 		    {
 		    *error = MB_ERROR_OPEN_FAIL;
 		    status = MB_FAILURE;
@@ -549,7 +367,7 @@ int mb_read_init(int verbose, char *file,
 	    if (status == MB_SUCCESS
 		&& mb_io_ptr->numfile >= 2)
 		{
-		if ((mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "r")) == NULL)
+		if ((mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "rb")) == NULL)
 		    {
 		    *error = MB_ERROR_OPEN_FAIL;
 		    status = MB_FAILURE;
@@ -563,14 +381,14 @@ int mb_read_init(int verbose, char *file,
 		if ((fstat = stat(mb_io_ptr->file2, &file_status)) == 0
 		    && (file_status.st_mode & S_IFMT) != S_IFDIR
 		    && file_status.st_size > 0)
-			mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "r");
+			mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "rb");
 		}
 
 	    /* open the third file if required */
 	    if (status == MB_SUCCESS
 		&& mb_io_ptr->numfile >= 3)
 		{
-		if ((mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "r")) == NULL)
+		if ((mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "rb")) == NULL)
 		    {
 		    *error = MB_ERROR_OPEN_FAIL;
 		    status = MB_FAILURE;
@@ -584,7 +402,7 @@ int mb_read_init(int verbose, char *file,
 		if ((fstat = stat(mb_io_ptr->file2, &file_status)) == 0
 		    && (file_status.st_mode & S_IFMT) != S_IFDIR
 		    && file_status.st_size > 0)
-			mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "r");
+			mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "rb");
 		}
 
 	    /* if needed, initialize XDR stream */
@@ -652,7 +470,6 @@ int mb_read_init(int verbose, char *file,
 	    status = mb_fileio_open(verbose, *mbio_ptr, error);
 	    }
 
-#ifdef WITH_GSF
 	/* else handle gsf files to be opened with gsflib */
 	else if (mb_io_ptr->filetype == MB_FILETYPE_GSF)
 	    {
@@ -670,9 +487,6 @@ int mb_read_init(int verbose, char *file,
 		*error = MB_ERROR_OPEN_FAIL;
 		}
 	    }
-#else
-        /* TODO: should issue an error */
-#endif
 
 	/* else handle netcdf files to be opened with libnetcdf */
 	else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF)
diff --git a/src/mbio/mb_read_ping.c b/src/mbio/mb_read_ping.c
index c5c6248..1c96ef7 100644
--- a/src/mbio/mb_read_ping.c
+++ b/src/mbio/mb_read_ping.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_read_ping.c	2/3/93
- *    $Id: mb_read_ping.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_read_ping.c 2227 2015-02-05 21:12:31Z caress $
 
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -38,7 +38,7 @@
 /*--------------------------------------------------------------------*/
 int mb_read_ping(int verbose, void *mbio_ptr, void *store_ptr, int *kind, int *error)
 {
-  static char rcs_id[]="$Id: mb_read_ping.c 2215 2014-11-29 22:21:19Z caress $";
+  static char rcs_id[]="$Id: mb_read_ping.c 2227 2015-02-05 21:12:31Z caress $";
 	char	*function_name = "mb_read_ping";
 	int	status;
 	struct mb_io_struct *mb_io_ptr;
diff --git a/src/mbio/mb_rt.c b/src/mbio/mb_rt.c
index db14bbf..a198f59 100644
--- a/src/mbio/mb_rt.c
+++ b/src/mbio/mb_rt.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_rt.c	11/14/94
- *    $Id: mb_rt.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_rt.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -142,7 +142,7 @@ int mb_rt_plot_circular(int verbose, int *error);
 int mb_rt_line(int verbose, int *error);
 int mb_rt_vertical(int verbose, int *error);
 
-static char rcs_id[]="$Id: mb_rt.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_rt.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------------*/
 int mb_rt_init(int verbose, int number_node,
diff --git a/src/mbio/mb_segy.c b/src/mbio/mb_segy.c
index 07532d1..0655ea7 100644
--- a/src/mbio/mb_segy.c
+++ b/src/mbio/mb_segy.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_segy.c	5/25/2004
- *    $Id: mb_segy.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_segy.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -61,7 +61,7 @@
 #include "mb_segy.h"
 #include "mb_swap.h"
 
-static char rcs_id[]="$Id: mb_segy.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_segy.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 /* 	function mb_segy_read_init opens an existing segy file for
diff --git a/src/mbio/mb_segy.h b/src/mbio/mb_segy.h
index 93a6033..5b1406a 100644
--- a/src/mbio/mb_segy.h
+++ b/src/mbio/mb_segy.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_io.h	1/19/93
- *    $Id: mb_segy.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_segy.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mb_status.h b/src/mbio/mb_status.h
index 8fb9f73..94062c5 100644
--- a/src/mbio/mb_status.h
+++ b/src/mbio/mb_status.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbio_status.h	2/1/93
- *    $Id: mb_status.h 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mb_status.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mb_swap.c b/src/mbio/mb_swap.c
index 3506710..2cc61f3 100644
--- a/src/mbio/mb_swap.c
+++ b/src/mbio/mb_swap.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_swap.c	7/6/94
- *    $Id: mb_swap.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_swap.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -27,62 +27,6 @@
  * Author:	D. W. Caress
  * Date:	July 6, 1994
  *
- * $Log: mb_swap.c,v $
- * Revision 5.7  2008/08/12 05:31:54  caress
- * Fixed swapping of 8 byte values. Fix suggested by Jeremy Robst of NERC.
- *
- * Revision 5.6  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.5  2006/02/12 04:28:09  caress
- * For 5.0.9.
- *
- * Revision 5.4  2006/01/06 18:27:18  caress
- * Working towards 5.0.8
- *
- * Revision 5.3  2004/11/06 03:55:15  caress
- * Working to support the Reson 7k format.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.6  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.5  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.4  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.3  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.0  1994/07/29  18:58:22  caress
- * Initial Revision
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- *
  *
  */
 
@@ -95,7 +39,7 @@
 #include "mb_swap.h"
 #include "mb_define.h"
 
-/* static	char	rcs_id[]="$Id: mb_swap.c 2175 2014-03-18 23:03:39Z caress $"; */
+/* static	char	rcs_id[]="$Id: mb_swap.c 2247 2015-05-29 21:28:28Z caress $"; */
 
 /*--------------------------------------------------------------------*/
 /* function mb_swap_check determines if the cpu is byteswapped */
diff --git a/src/mbio/mb_swap.h b/src/mbio/mb_swap.h
index 8084d76..4c33b8b 100644
--- a/src/mbio/mb_swap.h
+++ b/src/mbio/mb_swap.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_swap.h	6/21/94
- *    $Id: mb_swap.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_swap.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mb_time.c b/src/mbio/mb_time.c
index 2f66a28..2dcd63e 100644
--- a/src/mbio/mb_time.c
+++ b/src/mbio/mb_time.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_time.c	1/21/93
- *    $Id: mb_time.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_time.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -121,7 +121,7 @@
 #define SECINMINUTE     60.0
 #define IMININHOUR 60
 int	yday[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
-static char rcs_id[]="$Id: mb_time.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_time.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 /* 	function mb_get_time returns the number of seconds from
diff --git a/src/mbio/mb_write_init.c b/src/mbio/mb_write_init.c
index 2d69bb5..fa47e41 100644
--- a/src/mbio/mb_write_init.c
+++ b/src/mbio/mb_write_init.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_write_init.c	1/25/93
- *    $Id: mb_write_init.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb_write_init.c 2224 2015-02-04 19:14:05Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -19,158 +19,6 @@
  * Author:	D. W. Caress
  * Date:	January 25, 1993
  *
- * $Log: mb_write_init.c,v $
- * Revision 5.24  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.23  2008/10/17 07:30:22  caress
- * Added format 26 supporting Hydrosweep DS data used by SOPAC.
- *
- * Revision 5.22  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.21  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.20  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.19  2006/01/11 07:37:29  caress
- * Working towards 5.0.8
- *
- * Revision 5.18  2006/01/06 18:27:18  caress
- * Working towards 5.0.8
- *
- * Revision 5.17  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.16  2004/07/15 19:25:03  caress
- * Progress in supporting Reson 7k data.
- *
- * Revision 5.15  2004/04/27 01:46:11  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.14  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.13  2003/02/27 04:33:33  caress
- * Fixed handling of SURF format data.
- *
- * Revision 5.12  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.11  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.10  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.9  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.8  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.7  2002/01/24 02:30:58  caress
- * Added DARWIN.
- *
- * Revision 5.6  2001/10/12 21:08:37  caress
- * Added interpolation of attitude data.
- *
- * Revision 5.5  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.4  2001/06/29 22:48:04  caress
- * Added support for HSDS2RAW
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.16  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.15  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.14  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.13  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.12  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.11  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.11  1997/04/17  18:48:52  caress
- * Added LINUX ifdef.
- *
- * Revision 4.10  1996/08/26  17:24:56  caress
- * Release 4.4 revision.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1995/11/02  19:48:51  caress
- * Fixed error handling.
- *
- * Revision 4.6  1995/03/22  19:14:25  caress
- * Added #ifdef's for HPUX.
- *
- * Revision 4.5  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/01/25  17:13:46  caress
- * Added ifdef for SOLARIS.
- *
- * Revision 4.3  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/04/21  21:02:39  caress
- * Fixed bug so file open errors are passed back to calling function.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.3  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.2  1994/02/22  23:50:09  caress
- * Added some debug messages.
- *
- * Revision 4.1  1994/02/20  03:16:28  caress
- * Fixed errors lines 98 and 283.
- *
- * Revision 4.0  1994/02/20  02:09:29  caress
- * First cut at new version. Includes new handling of
- * sidescan and amplitude data.
- *
- * Revision 3.1  1993/05/14  22:45:27  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  19:08:53  dale
- * Initial version
- *
- *
  */
 
 /* standard include files */
@@ -185,13 +33,10 @@
 #include "mb_define.h"
 #include "mb_segy.h"
 #include "../surf/mb_sapi.h"
-#ifdef WITH_GSF
-#  include "gsf.h"
-#endif
-/* #include "../gsf/gsf.h" */
+#include "gsf.h"
 #include "netcdf.h"
 
-static char rcs_id[]="$Id: mb_write_init.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_write_init.c 2224 2015-02-04 19:14:05Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_write_init(int verbose,
@@ -284,9 +129,7 @@ int mb_write_init(int verbose,
 	mb_io_ptr->file3_pos = 0;
 	mb_io_ptr->file3_bytes = 0;
 	mb_io_ptr->ncid = 0;
-#ifdef WITH_GSF
 	mb_io_ptr->gsfid = 0;
-#endif
 	mb_io_ptr->xdrs = NULL;
 	mb_io_ptr->xdrs2 = NULL;
 	mb_io_ptr->xdrs3 = NULL;
@@ -578,7 +421,6 @@ int mb_write_init(int verbose,
 	    status = mb_fileio_open(verbose, *mbio_ptr, error);
 	    }
 
-#ifdef WITH_GSF
 	/* else handle gsf files to be opened with gsflib */
 	else if (mb_io_ptr->filetype == MB_FILETYPE_GSF)
 	    {
@@ -596,9 +438,7 @@ int mb_write_init(int verbose,
 		*error = MB_ERROR_OPEN_FAIL;
 		}
 	    }
-#else
-        /* TODO: issue an error with gsf files? */
-#endif
+
 	/* else handle netcdf files to be opened with libnetcdf */
 	else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF)
 	    {
diff --git a/src/mbio/mb_write_ping.c b/src/mbio/mb_write_ping.c
index c0aa668..a1e8d8d 100644
--- a/src/mbio/mb_write_ping.c
+++ b/src/mbio/mb_write_ping.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_write_ping.c	2/3/93
- *	$Id: mb_write_ping.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mb_write_ping.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -136,7 +136,7 @@
 #include "mb_io.h"
 #include "mb_define.h"
 
-static char rcs_id[]="$Id: mb_write_ping.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mb_write_ping.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mb_write_ping(int verbose, void *mbio_ptr, void *store_ptr, int *error)
diff --git a/src/mbio/mbf_bchrtunb.h b/src/mbio/mbf_bchrtunb.h
index 046cf6b..8388143 100644
--- a/src/mbio/mbf_bchrtunb.h
+++ b/src/mbio/mbf_bchrtunb.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_bchrtunb.h	8/21/94
- *	$Id: mbf_bchrtunb.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_bchrtunb.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_bchrxunb.h b/src/mbio/mbf_bchrxunb.h
index 424c46f..fa5fa2c 100644
--- a/src/mbio/mbf_bchrxunb.h
+++ b/src/mbio/mbf_bchrxunb.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_bchrxunb.h	8/29/97
- *	$Id: mbf_bchrxunb.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_bchrxunb.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_cbat8101.h b/src/mbio/mbf_cbat8101.h
index d4e0ab0..32c2f78 100644
--- a/src/mbio/mbf_cbat8101.h
+++ b/src/mbio/mbf_cbat8101.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_cbat8101.h	8/21/94
- *	$Id: mbf_cbat8101.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_cbat8101.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_cbat9001.h b/src/mbio/mbf_cbat9001.h
index 5943d1d..fdbbfa8 100644
--- a/src/mbio/mbf_cbat9001.h
+++ b/src/mbio/mbf_cbat9001.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_cbat9001.h	8/21/94
- *	$Id: mbf_cbat9001.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_cbat9001.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_dsl120pf.h b/src/mbio/mbf_dsl120pf.h
index f66fb7d..75924bb 100644
--- a/src/mbio/mbf_dsl120pf.h
+++ b/src/mbio/mbf_dsl120pf.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_dsl120pf.h	8/5/96
- *	$Id: mbf_dsl120pf.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_dsl120pf.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_dsl120sf.h b/src/mbio/mbf_dsl120sf.h
index 92e755c..9838857 100644
--- a/src/mbio/mbf_dsl120sf.h
+++ b/src/mbio/mbf_dsl120sf.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_dsl120sf.h	8/9/96
- *	$Id: mbf_dsl120sf.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_dsl120sf.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_elmk2unb.h b/src/mbio/mbf_elmk2unb.h
index 8418571..be0fa48 100644
--- a/src/mbio/mbf_elmk2unb.h
+++ b/src/mbio/mbf_elmk2unb.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_elmk2unb.h	6/6/97
- *	$Id: mbf_elmk2unb.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_elmk2unb.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_em12darw.h b/src/mbio/mbf_em12darw.h
index a52a1c8..1bf2dfd 100644
--- a/src/mbio/mbf_em12darw.h
+++ b/src/mbio/mbf_em12darw.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_em12darw.h	1/20/93
- *	$Id: mbf_em12darw.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_em12darw.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_em12ifrm.h b/src/mbio/mbf_em12ifrm.h
index 0dd7a47..b29d41e 100644
--- a/src/mbio/mbf_em12ifrm.h
+++ b/src/mbio/mbf_em12ifrm.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_em12ifrm.h	12/5/00
- *	$Id: mbf_em12ifrm.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_em12ifrm.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_gsfgenmb.h b/src/mbio/mbf_gsfgenmb.h
index daa929e..20f3345 100644
--- a/src/mbio/mbf_gsfgenmb.h
+++ b/src/mbio/mbf_gsfgenmb.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_gsfgenmb.h	2/27/98
- *	$Id: mbf_gsfgenmb.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_gsfgenmb.h 2226 2015-02-05 20:38:55Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -18,31 +18,6 @@
  *
  * Author:	D. W. Caress
  * Date:	February 27, 1998
- * $Log: mbf_gsfgenmb.h,v $
- * Revision 5.3  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1998/10/05  19:16:02  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  18:32:27  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
  *
  */
 /*
diff --git a/src/mbio/mbf_hs10jams.h b/src/mbio/mbf_hs10jams.h
index b235846..5b4d9d7 100644
--- a/src/mbio/mbf_hs10jams.h
+++ b/src/mbio/mbf_hs10jams.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_hs10jams.h	12/4/00
- *	$Id: mbf_hs10jams.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_hs10jams.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_hsatlraw.h b/src/mbio/mbf_hsatlraw.h
index 3d978c7..d14ab5b 100644
--- a/src/mbio/mbf_hsatlraw.h
+++ b/src/mbio/mbf_hsatlraw.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_hsatlraw.h	1/20/93
- *	$Id: mbf_hsatlraw.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_hsatlraw.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_hsldedmb.h b/src/mbio/mbf_hsldedmb.h
index cab4c0f..138602a 100644
--- a/src/mbio/mbf_hsldedmb.h
+++ b/src/mbio/mbf_hsldedmb.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_hsldedmb.h	1/20/93
- *	$Id: mbf_hsldedmb.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_hsldedmb.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_hsldeoih.h b/src/mbio/mbf_hsldeoih.h
index 4bc7a5b..b9d52e6 100644
--- a/src/mbio/mbf_hsldeoih.h
+++ b/src/mbio/mbf_hsldeoih.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_hsldeoih.h	3/11/93
- *	$Id: mbf_hsldeoih.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_hsldeoih.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_hsmdaraw.h b/src/mbio/mbf_hsmdaraw.h
index adb5b6d..ab779df 100644
--- a/src/mbio/mbf_hsmdaraw.h
+++ b/src/mbio/mbf_hsmdaraw.h
@@ -2,7 +2,7 @@
  *    The MB-system:	mbf_hsmdaraw.h	8/11/95
  *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbf_hsmdaraw.h,v 5.2 2003/04/17 21:05:23 caress Exp $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_hsmdldih.h b/src/mbio/mbf_hsmdldih.h
index 2c010e0..4eb0bf3 100644
--- a/src/mbio/mbf_hsmdldih.h
+++ b/src/mbio/mbf_hsmdldih.h
@@ -2,7 +2,7 @@
  *    The MB-system:	mbf_hsmdldih.h	9/26/95
  *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbf_hsmdldih.h,v 5.3 2003/04/17 21:05:23 caress Exp $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_hsuricen.h b/src/mbio/mbf_hsuricen.h
index 3fc9f5f..907de52 100644
--- a/src/mbio/mbf_hsuricen.h
+++ b/src/mbio/mbf_hsuricen.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_hsuricen.h	1/20/93
- *	$Id: mbf_hsuricen.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_hsuricen.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_hypc8101.h b/src/mbio/mbf_hypc8101.h
index d9099cb..b1968f8 100644
--- a/src/mbio/mbf_hypc8101.h
+++ b/src/mbio/mbf_hypc8101.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_hypc8101.h	8/21/94
- *	$Id: mbf_hypc8101.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_hypc8101.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_mbarirov.h b/src/mbio/mbf_mbarirov.h
index 025b757..2cff0c8 100644
--- a/src/mbio/mbf_mbarirov.h
+++ b/src/mbio/mbf_mbarirov.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mbarirov.h	5/20/99
- *	$Id: mbf_mbarirov.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mbarirov.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_mbarrov2.h b/src/mbio/mbf_mbarrov2.h
index e975c5f..c6ce99b 100644
--- a/src/mbio/mbf_mbarrov2.h
+++ b/src/mbio/mbf_mbarrov2.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mbarrov2.h	10/3/2006
- *	$Id: mbf_mbarrov2.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mbarrov2.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_mbpronav.h b/src/mbio/mbf_mbpronav.h
index cc9bed6..8fab7f1 100644
--- a/src/mbio/mbf_mbpronav.h
+++ b/src/mbio/mbf_mbpronav.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mbpronav.h	5/20/99
- *	$Id: mbf_mbpronav.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mbpronav.h 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -19,27 +19,6 @@
  * Author:	D. W. Caress
  * Date:	May 20, 1999
  *
- * $Log: mbf_mbpronav.h,v $
- * Revision 5.3  2006/10/05 18:58:28  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/10/21  22:39:24  caress
- * Added MBPRONAV format.
- *
- *
- *
  */
 /*
  * Notes on the MBF_MBPRONAV data format:
@@ -67,7 +46,7 @@ struct mbf_mbpronav_struct
 	/* navigation */
 	double	longitude;
 	double	latitude;
-        double  heading;
+	double  heading;
 	double  speed;
 	double  sonardepth;
 	double  roll;
diff --git a/src/mbio/mbf_mgd77dat.h b/src/mbio/mbf_mgd77dat.h
index a3d84a1..252679a 100644
--- a/src/mbio/mbf_mgd77dat.h
+++ b/src/mbio/mbf_mgd77dat.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mgd77dat.h	5/19/99
- *	$Id: mbf_mgd77dat.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mgd77dat.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_mr1aldeo.h b/src/mbio/mbf_mr1aldeo.h
index 197f14f..c698120 100644
--- a/src/mbio/mbf_mr1aldeo.h
+++ b/src/mbio/mbf_mr1aldeo.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mr1aldeo.h	3/3/94
- *	$Id: mbf_mr1aldeo.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mr1aldeo.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_mr1bldeo.h b/src/mbio/mbf_mr1bldeo.h
index 7ddf7a7..63508db 100644
--- a/src/mbio/mbf_mr1bldeo.h
+++ b/src/mbio/mbf_mr1bldeo.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mr1bldeo.h	3/3/94
- *	$Id: mbf_mr1bldeo.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mr1bldeo.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_mr1prhig.h b/src/mbio/mbf_mr1prhig.h
index d96a850..8c6ac64 100644
--- a/src/mbio/mbf_mr1prhig.h
+++ b/src/mbio/mbf_mr1prhig.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mr1prhig.h	3/3/94
- *	$Id: mbf_mr1prhig.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mr1prhig.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_mstiffss.h b/src/mbio/mbf_mstiffss.h
index 824b7ba..867ad11 100644
--- a/src/mbio/mbf_mstiffss.h
+++ b/src/mbio/mbf_mstiffss.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_mstiffss.h	10/14/94
- *	$Id: mbf_mstiffss.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_mstiffss.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_oicgeoda.h b/src/mbio/mbf_oicgeoda.h
index 69af713..3e8c219 100644
--- a/src/mbio/mbf_oicgeoda.h
+++ b/src/mbio/mbf_oicgeoda.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_oicgeoda.h	1/8/99
- *	$Id: mbf_oicgeoda.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_oicgeoda.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_oicmbari.h b/src/mbio/mbf_oicmbari.h
index c3e4831..22eac1f 100644
--- a/src/mbio/mbf_oicmbari.h
+++ b/src/mbio/mbf_oicmbari.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_oicmbari.h	1/8/99
- *	$Id: mbf_oicmbari.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_oicmbari.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_omghdcsj.h b/src/mbio/mbf_omghdcsj.h
index 89ab7f7..3a4a20b 100644
--- a/src/mbio/mbf_omghdcsj.h
+++ b/src/mbio/mbf_omghdcsj.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_omghdcsj.h	3/10/99
- *	$Id: mbf_omghdcsj.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_omghdcsj.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sb2100rw.h b/src/mbio/mbf_sb2100rw.h
index 1724b77..3fc6f1a 100644
--- a/src/mbio/mbf_sb2100rw.h
+++ b/src/mbio/mbf_sb2100rw.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	MBF_SB2100RW.h	3/3/94
- *	$Id: mbf_sb2100rw.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sb2100rw.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sb2120xs.h b/src/mbio/mbf_sb2120xs.h
index b5ba532..e1d7ef7 100644
--- a/src/mbio/mbf_sb2120xs.h
+++ b/src/mbio/mbf_sb2120xs.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_sb2120xs.h	3/20/2000
- *	$Id: mbf_sb2120xs.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sb2120xs.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    D. W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sbifremr.h b/src/mbio/mbf_sbifremr.h
index cf76bc4..a5e5dc8 100644
--- a/src/mbio/mbf_sbifremr.h
+++ b/src/mbio/mbf_sbifremr.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_sbifremr.h	3/29/96
- *	$Id: mbf_sbifremr.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sbifremr.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1996-2014 by
+ *    Copyright (c) 1996-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sbsiocen.h b/src/mbio/mbf_sbsiocen.h
index b582c4a..77a5e72 100644
--- a/src/mbio/mbf_sbsiocen.h
+++ b/src/mbio/mbf_sbsiocen.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_sbsiocen.h	1/20/93
- *	$Id: mbf_sbsiocen.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sbsiocen.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sbsiolsi.h b/src/mbio/mbf_sbsiolsi.h
index 3a123a0..44d929f 100644
--- a/src/mbio/mbf_sbsiolsi.h
+++ b/src/mbio/mbf_sbsiolsi.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_sbsiolsi.h	1/20/93
- *	$Id: mbf_sbsiolsi.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sbsiolsi.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sbsiomrg.h b/src/mbio/mbf_sbsiomrg.h
index 6f54e4f..13d91e0 100644
--- a/src/mbio/mbf_sbsiomrg.h
+++ b/src/mbio/mbf_sbsiomrg.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_sbsiomrg.h	1/20/93
- *	$Id: mbf_sbsiomrg.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sbsiomrg.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sbsioswb.h b/src/mbio/mbf_sbsioswb.h
index 0f33d99..08db784 100644
--- a/src/mbio/mbf_sbsioswb.h
+++ b/src/mbio/mbf_sbsioswb.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_sbsioswb.h	9/18/94
- *	$Id: mbf_sbsioswb.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sbsioswb.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_sburicen.h b/src/mbio/mbf_sburicen.h
index 4c8f540..0843f6b 100644
--- a/src/mbio/mbf_sburicen.h
+++ b/src/mbio/mbf_sburicen.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_sburicen.h	1/20/93
- *	$Id: mbf_sburicen.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_sburicen.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbf_xtfr8101.h b/src/mbio/mbf_xtfr8101.h
index 8f74ec7..829ca57 100644
--- a/src/mbio/mbf_xtfr8101.h
+++ b/src/mbio/mbf_xtfr8101.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbf_xtfr8101.h	8/24/01
- *	$Id: mbf_xtfr8101.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbf_xtfr8101.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbr_3ddepthp.c b/src/mbio/mbr_3ddepthp.c
index 2b71487..5f60721 100644
--- a/src/mbio/mbr_3ddepthp.c
+++ b/src/mbio/mbr_3ddepthp.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_3ddepthp.c	2/11/93
- *	$Id: mbr_3ddepthp.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbr_3ddepthp.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -81,7 +81,7 @@ int mbr_wt_3ddepthp(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_3ddepthp_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_3ddepthp_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_3ddepthp.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mbr_3ddepthp.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_3ddepthp(int verbose, void *mbio_ptr, int *error)
@@ -1021,6 +1021,15 @@ int mbr_3ddepthp_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 				store->year += 1900;
 				store->month++;
 				}
+
+			store->time_d = 0.0;
+			store->navlon = 0.0;
+			store->navlat = 0.0;
+			store->sensordepth = 0.0;
+			store->heading = 0.0;
+			store->roll = 0.0;
+			store->pitch = 0.0;
+			store->speed = 0.0;
 			}
 			
 		/* read all of the pulses */
diff --git a/src/mbio/mbr_asciixyz.c b/src/mbio/mbr_asciixyz.c
index 6bb1a34..201182f 100644
--- a/src/mbio/mbr_asciixyz.c
+++ b/src/mbio/mbr_asciixyz.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_asciixyz.c	5/8/2002
- *	$Id: mbr_asciixyz.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_asciixyz.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -113,7 +113,7 @@ int mbr_dem_asciixyz(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_asciixyz(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_asciixyz(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_asciixyz.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_asciixyz.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_asciixyz(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_bchrtunb.c b/src/mbio/mbr_bchrtunb.c
index 3c4816d..5c6b4bd 100644
--- a/src/mbio/mbr_bchrtunb.c
+++ b/src/mbio/mbr_bchrtunb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_bchrtunb.c	8/8/94
- *	$Id: mbr_bchrtunb.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_bchrtunb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -180,7 +180,7 @@ int mbr_bchrtunb_wr_bath40(int verbose, FILE *mbfp,
 int mbr_bchrtunb_wr_bath32(int verbose, FILE *mbfp,
 		struct mbf_bchrtunb_struct *data, int *error);
 
-static char rcs_id[]="$Id: mbr_bchrtunb.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_bchrtunb.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_bchrtunb(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_bchrxunb.c b/src/mbio/mbr_bchrxunb.c
index bed0ab2..57a94e4 100644
--- a/src/mbio/mbr_bchrxunb.c
+++ b/src/mbio/mbr_bchrxunb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_bchrxunb.c	8/29/97
- *	$Id: mbr_bchrxunb.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_bchrxunb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -141,7 +141,7 @@ int mbr_bchrxunb_wr_bath56(int verbose, FILE *mbfp, void *data_ptr, int *error);
 int mbr_bchrxunb_wr_bath40(int verbose, FILE *mbfp, void *data_ptr, int *error);
 int mbr_bchrxunb_wr_bath32(int verbose, FILE *mbfp, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_bchrxunb.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_bchrxunb.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_bchrxunb(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_cbat8101.c b/src/mbio/mbr_cbat8101.c
index 82f009c..d6d0e68 100644
--- a/src/mbio/mbr_cbat8101.c
+++ b/src/mbio/mbr_cbat8101.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_cbat8101.c	8/8/94
- *	$Id: mbr_cbat8101.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_cbat8101.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -146,7 +146,7 @@ int mbr_cbat8101_wr_bath(int verbose, FILE *mbfp, int swap, void *data_ptr, int
 int mbr_cbat8101_wr_heading(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
 int mbr_cbat8101_wr_attitude(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_cbat8101.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_cbat8101.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_cbat8101(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_cbat9001.c b/src/mbio/mbr_cbat9001.c
index 68a30cb..b9df882 100644
--- a/src/mbio/mbr_cbat9001.c
+++ b/src/mbio/mbr_cbat9001.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_cbat9001.c	8/8/94
- *	$Id: mbr_cbat9001.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_cbat9001.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -174,7 +174,7 @@ int mbr_cbat9001_wr_nav(int verbose, FILE *mbfp, int swap, void *data_ptr, int *
 int mbr_cbat9001_wr_svp(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
 int mbr_cbat9001_wr_bath(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_cbat9001.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_cbat9001.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_cbat9001(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_dsl120pf.c b/src/mbio/mbr_dsl120pf.c
index 10d5562..cafabbe 100644
--- a/src/mbio/mbr_dsl120pf.c
+++ b/src/mbio/mbr_dsl120pf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_dsl120pf.c	8/6/96
- *	$Id: mbr_dsl120pf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_dsl120pf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1996-2014 by
+ *    Copyright (c) 1996-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -135,7 +135,7 @@ int mbr_dsl120pf_wr_bath(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
 int mbr_dsl120pf_wr_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
 int mbr_dsl120pf_wr_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
 
-static char rcs_id[]="$Id: mbr_dsl120pf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_dsl120pf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_dsl120pf(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_dsl120sf.c b/src/mbio/mbr_dsl120sf.c
index 011b8d6..147fa86 100644
--- a/src/mbio/mbr_dsl120sf.c
+++ b/src/mbio/mbr_dsl120sf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_dsl120sf.c	8/6/96
- *	$Id: mbr_dsl120sf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_dsl120sf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1996-2014 by
+ *    Copyright (c) 1996-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -132,7 +132,7 @@ int mbr_dsl120sf_wr_bathamp(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
 int mbr_dsl120sf_wr_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
 int mbr_dsl120sf_wr_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
 
-static char rcs_id[]="$Id: mbr_dsl120sf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_dsl120sf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_dsl120sf(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_edgjstar.c b/src/mbio/mbr_edgjstar.c
index bb4860b..00180b3 100644
--- a/src/mbio/mbr_edgjstar.c
+++ b/src/mbio/mbr_edgjstar.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_edgjstar.c	5/2/2005
- *	$Id: mbr_edgjstar.c 2195 2014-07-10 00:10:27Z caress $
+ *	$Id: mbr_edgjstar.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2005-2014 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -110,7 +110,7 @@ int mbr_dem_edgjstar(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_edgjstar(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_edgjstar(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_edgjstar.c 2195 2014-07-10 00:10:27Z caress $";
+static char rcs_id[]="$Id: mbr_edgjstar.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_edgjstar(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_elmk2unb.c b/src/mbio/mbr_elmk2unb.c
index b2119ed..91827e0 100644
--- a/src/mbio/mbr_elmk2unb.c
+++ b/src/mbio/mbr_elmk2unb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_elmk2unb.c	6/6/97
- *	$Id: mbr_elmk2unb.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_elmk2unb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -153,7 +153,7 @@ int mbr_elmk2unb_wr_pos(int verbose, FILE *mbfp, void *data_ptr, int *error);
 int mbr_elmk2unb_wr_svp(int verbose, FILE *mbfp, void *data_ptr, int *error);
 int mbr_elmk2unb_wr_bathgen(int verbose, FILE *mbfp, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_elmk2unb.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_elmk2unb.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_elmk2unb(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_em12darw.c b/src/mbio/mbr_em12darw.c
index b24a4d6..fd77dfd 100644
--- a/src/mbio/mbr_em12darw.c
+++ b/src/mbio/mbr_em12darw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_em12darw.c	2/2/93
- *	$Id: mbr_em12darw.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_em12darw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -168,7 +168,7 @@ int mbr_zero_em12darw(int verbose, char *data_ptr, int *error);
 int mbr_rt_em12darw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_em12darw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_em12darw.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_em12darw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_em12darw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_em12ifrm.c b/src/mbio/mbr_em12ifrm.c
index b6398b9..14dd6e3 100644
--- a/src/mbio/mbr_em12ifrm.c
+++ b/src/mbio/mbr_em12ifrm.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_em12ifrm.c	12/4/00
- *	$Id: mbr_em12ifrm.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_em12ifrm.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,55 +23,6 @@
  *
  * Author:	D. W. Caress
  * Date:	December 4, 2000
- * $Log: mbr_em12ifrm.c,v $
- * Revision 5.15  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.14  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.13  2004/10/18 04:15:46  caress
- * Minor change.
- *
- * Revision 5.12  2003/12/04 23:10:22  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.11  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.10  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.9  2002/10/02 23:55:42  caress
- * Release 5.0.beta24
- *
- * Revision 5.8  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.7  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.6  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.5  2001/12/18  04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.4  2001/08/10  22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.3  2001-07-19 17:31:11-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/10  20:24:25  caress
- * Initial revision.
- *
  *
  */
 
@@ -129,8 +80,9 @@ int mbr_zero_em12ifrm(int verbose, char *data_ptr, int *error);
 int mbr_rt_em12ifrm(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_em12ifrm(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_em12ifrm_rd_data(int verbose, void *mbio_ptr, int *error);
+int mbr_em12ifrm_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_em12ifrm.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_em12ifrm.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_em12ifrm(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_em300mba.c b/src/mbio/mbr_em300mba.c
index ad43ed5..c0974d0 100644
--- a/src/mbio/mbr_em300mba.c
+++ b/src/mbio/mbr_em300mba.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_em300mba.c	10/16/98
- *	$Id: mbr_em300mba.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_em300mba.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -318,7 +318,7 @@ int mbr_em300mba_wr_ss(int verbose, FILE *mbfp, int swap,
 int mbr_em300mba_wr_wc(int verbose, FILE *mbfp, int swap,
 		struct mbsys_simrad2_struct *store, int *error);
 
-static char rcs_id[]="$Id: mbr_em300mba.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_em300mba.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_em300mba(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_em300raw.c b/src/mbio/mbr_em300raw.c
index bb59319..aa5e985 100644
--- a/src/mbio/mbr_em300raw.c
+++ b/src/mbio/mbr_em300raw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_em300raw.c	10/16/98
- *	$Id: mbr_em300raw.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_em300raw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -333,7 +333,7 @@ int mbr_em300raw_wr_ss(int verbose, FILE *mbfp, int swap,
 int mbr_em300raw_wr_wc(int verbose, FILE *mbfp, int swap,
 		struct mbsys_simrad2_struct *store, int *error);
 
-static char rcs_id[]="$Id: mbr_em300raw.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_em300raw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_em300raw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_em710mba.c b/src/mbio/mbr_em710mba.c
index 49bc1b6..0348ce8 100644
--- a/src/mbio/mbr_em710mba.c
+++ b/src/mbio/mbr_em710mba.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_em710mba.c	2/26/2008
- *	$Id: mbr_em710mba.c 2213 2014-11-13 18:26:48Z caress $
+ *	$Id: mbr_em710mba.c 2241 2015-05-12 21:00:35Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -237,7 +237,7 @@ int mbr_em710mba_wr_ss2_mba(int verbose, void *mbio_ptr, int swap,
 int mbr_em710mba_wr_wc(int verbose, void *mbio_ptr, int swap,
 		struct mbsys_simrad3_struct *store, int *error);
 
-static char rcs_id[]="$Id: mbr_em710mba.c 2213 2014-11-13 18:26:48Z caress $";
+static char rcs_id[]="$Id: mbr_em710mba.c 2241 2015-05-12 21:00:35Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_em710mba(int verbose, void *mbio_ptr, int *error)
@@ -406,7 +406,7 @@ int mbr_info_em710mba(int verbose,
 	*filetype = MB_FILETYPE_SINGLE;
 	*variable_beams = MB_YES;
 	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
+	*beam_flagging = MB_YES;
 	*nav_source = MB_DATA_DATA;
 	*heading_source = MB_DATA_DATA;
 	*vru_source = MB_DATA_DATA;
diff --git a/src/mbio/mbr_em710raw.c b/src/mbio/mbr_em710raw.c
index 84353c8..da9950f 100644
--- a/src/mbio/mbr_em710raw.c
+++ b/src/mbio/mbr_em710raw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_em710raw.c	2/26/2008
- *	$Id: mbr_em710raw.c 2209 2014-11-04 08:54:21Z caress $
+ *	$Id: mbr_em710raw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -227,7 +227,7 @@ int mbr_em710raw_wr_ss2(int verbose, void *mbio_ptr, int swap,
 int mbr_em710raw_wr_wc(int verbose, void *mbio_ptr, int swap,
 		struct mbsys_simrad3_struct *store, int *error);
 
-static char rcs_id[]="$Id: mbr_em710raw.c 2209 2014-11-04 08:54:21Z caress $";
+static char rcs_id[]="$Id: mbr_em710raw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_em710raw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_emoldraw.c b/src/mbio/mbr_emoldraw.c
index fe432ef..db0f436 100644
--- a/src/mbio/mbr_emoldraw.c
+++ b/src/mbio/mbr_emoldraw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_emoldraw.c	3/4/2001
- *	$Id: mbr_emoldraw.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_emoldraw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -159,7 +159,7 @@ int mbr_emoldraw_wr_ss(int verbose, FILE *mbfp,
 int mbr_emoldraw_wr_ssp(int verbose, FILE *mbfp,
 				struct mbsys_simrad_struct *store, int *error);
 
-static char rcs_id[]="$Id: mbr_emoldraw.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_emoldraw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_emoldraw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_gsfgenmb.c b/src/mbio/mbr_gsfgenmb.c
index 41d43e1..962e016 100644
--- a/src/mbio/mbr_gsfgenmb.c
+++ b/src/mbio/mbr_gsfgenmb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_gsfgenmb.c	2/27/98
- *	$Id: mbr_gsfgenmb.c 2194 2014-07-08 06:15:49Z caress $
+ *	$Id: mbr_gsfgenmb.c 2229 2015-02-14 23:04:41Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,63 +23,12 @@
  *
  * Author:	D. W. Caress
  * Date:	February 27, 1998
- * $Log: mbr_gsfgenmb.c,v $
- * Revision 5.10  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.9  2008/01/14 18:08:17  caress
- * Added debug message.
- *
- * Revision 5.8  2006/03/06 21:47:48  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.7  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  2000/07/19  03:51:38  caress
- * Fixed some things.
- *
- * Revision 4.1  1999/05/05  22:48:29  caress
- * Disabled handling of ping flags in GSF data.
- *
- * Revision 4.0  1998/10/05  18:30:03  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
  *
  */
 
 /* standard include files */
 #include <stdio.h>
+#include <stdlib.h>
 #include <math.h>
 #include <string.h>
 
@@ -122,7 +71,7 @@ int mbr_dem_gsfgenmb(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_gsfgenmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_gsfgenmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_gsfgenmb.c 2194 2014-07-08 06:15:49Z caress $";
+static char rcs_id[]="$Id: mbr_gsfgenmb.c 2229 2015-02-14 23:04:41Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_gsfgenmb(int verbose, void *mbio_ptr, int *error)
@@ -553,6 +502,22 @@ int mbr_rt_gsfgenmb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
 		    mb_io_ptr->beamwidth_ltrack = 0.0;
 		    mb_io_ptr->beamwidth_xtrack = 0.0;
 		    }
+		    
+		/* if needed create array for beam flags */
+		if (mb_ping->number_beams > 0 && mb_ping->beam_flags == NULL)
+		    {
+		    mb_ping->beam_flags = (unsigned char *) malloc(mb_ping->number_beams * sizeof(char));
+		    for (i=0;i<mb_ping->number_beams;i++)
+			mb_ping->beam_flags[i] = MB_FLAG_NONE;
+		    }
+		    
+		/* if needed create array for along_track */
+		if (mb_ping->number_beams > 0 && mb_ping->along_track == NULL)
+		    {
+		    mb_ping->along_track = (double *) malloc(mb_ping->number_beams * sizeof(double));
+		    for (i=0;i<mb_ping->number_beams;i++)
+			mb_ping->along_track[i] = 0.0;
+		    }
 		}
 
 	    else
diff --git a/src/mbio/mbr_hir2rnav.c b/src/mbio/mbr_hir2rnav.c
index 397bc23..7a8f57f 100644
--- a/src/mbio/mbr_hir2rnav.c
+++ b/src/mbio/mbr_hir2rnav.c
@@ -2,7 +2,7 @@
  *    The MB-system:	mbr_hir2rnav.c	5/20/99
  *	$Id: mbr_hir2rnav.c 1829 2010-02-05 02:53:39Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbr_hs10jams.c b/src/mbio/mbr_hs10jams.c
index 63f94fc..34cf587 100644
--- a/src/mbio/mbr_hs10jams.c
+++ b/src/mbio/mbr_hs10jams.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hs10jams.c	12/4/00
- *	$Id: mbr_hs10jams.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_hs10jams.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -208,7 +208,7 @@ int mbr_dem_hs10jams(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_hs10jams(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_hs10jams(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hs10jams.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hs10jams.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hs10jams(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsatlraw.c b/src/mbio/mbr_hsatlraw.c
index 0fdf62c..e6c624c 100644
--- a/src/mbio/mbr_hsatlraw.c
+++ b/src/mbio/mbr_hsatlraw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsatlraw.c	2/11/93
- *	$Id: mbr_hsatlraw.c 2202 2014-08-25 03:14:31Z caress $
+ *	$Id: mbr_hsatlraw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -232,7 +232,7 @@ int mbr_hsatlraw_wr_ergnctds(int verbose, FILE *mbfp, void *data_ptr, int *error
 int mbr_hsatlraw_wr_ergnampl(int verbose, FILE *mbfp, void *data_ptr, int *error);
 int mbr_hsatlraw_wr_ldeocmnt(int verbose, FILE *mbfp, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsatlraw.c 2202 2014-08-25 03:14:31Z caress $";
+static char rcs_id[]="$Id: mbr_hsatlraw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsatlraw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsds2lam.c b/src/mbio/mbr_hsds2lam.c
index 027f3a7..8024035 100644
--- a/src/mbio/mbr_hsds2lam.c
+++ b/src/mbio/mbr_hsds2lam.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsds2raw.c	6/20/01
- *	$Id: mbr_hsds2lam.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_hsds2lam.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -95,7 +95,7 @@ int mbr_wt_hsds2lam(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_hsds2lam_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_hsds2lam_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsds2lam.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hsds2lam.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsds2lam(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsds2raw.c b/src/mbio/mbr_hsds2raw.c
index 46e45f2..2ab605e 100644
--- a/src/mbio/mbr_hsds2raw.c
+++ b/src/mbio/mbr_hsds2raw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsds2raw.c	6/20/01
- *	$Id: mbr_hsds2raw.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_hsds2raw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -113,7 +113,7 @@ int mbr_wt_hsds2raw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_hsds2raw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_hsds2raw_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsds2raw.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hsds2raw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsds2raw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsldedmb.c b/src/mbio/mbr_hsldedmb.c
index d65ad91..78cc600 100644
--- a/src/mbio/mbr_hsldedmb.c
+++ b/src/mbio/mbr_hsldedmb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsldedmb.c	2/2/93
- *	$Id: mbr_hsldedmb.c 2185 2014-05-11 06:34:36Z caress $
+ *	$Id: mbr_hsldedmb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -158,7 +158,7 @@ int mbr_dem_hsldedmb(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_hsldedmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_hsldedmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsldedmb.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[]="$Id: mbr_hsldedmb.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsldedmb(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsldeoih.c b/src/mbio/mbr_hsldeoih.c
index ac1a825..18d1dc3 100644
--- a/src/mbio/mbr_hsldeoih.c
+++ b/src/mbio/mbr_hsldeoih.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsldeoih.c	2/11/93
- *	$Id: mbr_hsldeoih.c 2185 2014-05-11 06:34:36Z caress $
+ *	$Id: mbr_hsldeoih.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -209,7 +209,7 @@ int mbr_hsldeoih_wr_calibrate(int verbose, FILE *mbfp,
 int mbr_hsldeoih_wr_comment(int verbose, FILE *mbfp,
 		struct mbf_hsldeoih_struct *data, int *error);
 
-static char rcs_id[]="$Id: mbr_hsldeoih.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[]="$Id: mbr_hsldeoih.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsldeoih(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsmdaraw.c b/src/mbio/mbr_hsmdaraw.c
index 64f40a0..61a33ea 100644
--- a/src/mbio/mbr_hsmdaraw.c
+++ b/src/mbio/mbr_hsmdaraw.c
@@ -2,7 +2,7 @@
  *    The MB-system:	mbr_hsmdaraw.c	2/11/93
  *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbr_hsmdaraw.c,v 5.8 2005/11/05 00:48:04 caress Exp $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -167,7 +167,7 @@ int mbr_wt_hsmdaraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_hsmdaraw_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_hsmdaraw_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsmdaraw.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hsmdaraw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsmdaraw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsmdldih.c b/src/mbio/mbr_hsmdldih.c
index 6586528..ff810f6 100644
--- a/src/mbio/mbr_hsmdldih.c
+++ b/src/mbio/mbr_hsmdldih.c
@@ -2,7 +2,7 @@
  *    The MB-system:	mbr_hsmdldih.c	9/26/95
  *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbr_hsmdldih.c,v 5.10 2005/11/05 00:48:04 caress Exp $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -151,7 +151,7 @@ int mbr_wt_hsmdldih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_hsmdldih_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_hsmdldih_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsmdldih.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hsmdldih.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsmdldih(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsunknwn.c b/src/mbio/mbr_hsunknwn.c
index cab3bf6..431d6c8 100644
--- a/src/mbio/mbr_hsunknwn.c
+++ b/src/mbio/mbr_hsunknwn.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsunknwn.c	10/13/2008
- *	$Id: mbr_hsunknwn.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_hsunknwn.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -107,7 +107,7 @@ int mbr_dem_hsunknwn(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_hsunknwn(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_hsunknwn(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsunknwn.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hsunknwn.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsunknwn(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsuricen.c b/src/mbio/mbr_hsuricen.c
index 79c888d..7b937e5 100644
--- a/src/mbio/mbr_hsuricen.c
+++ b/src/mbio/mbr_hsuricen.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsuricen.c	2/2/93
- *	$Id: mbr_hsuricen.c 2185 2014-05-11 06:34:36Z caress $
+ *	$Id: mbr_hsuricen.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -158,7 +158,7 @@ int mbr_dem_hsuricen(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_hsuricen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_hsuricen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsuricen.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[]="$Id: mbr_hsuricen.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsuricen(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hsurivax.c b/src/mbio/mbr_hsurivax.c
index 418dc51..1cbcaae 100644
--- a/src/mbio/mbr_hsurivax.c
+++ b/src/mbio/mbr_hsurivax.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hsurivax.c	2/2/93
- *	$Id: mbr_hsurivax.c 2185 2014-05-11 06:34:36Z caress $
+ *	$Id: mbr_hsurivax.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -145,7 +145,7 @@ int mbr_dem_hsurivax(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_hsurivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_hsurivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hsurivax.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[]="$Id: mbr_hsurivax.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hsurivax(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hydrob93.c b/src/mbio/mbr_hydrob93.c
index d5a178c..9d462e9 100644
--- a/src/mbio/mbr_hydrob93.c
+++ b/src/mbio/mbr_hydrob93.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hydrob93.c	9/19/2002
- *	$Id: mbr_hydrob93.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_hydrob93.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -94,7 +94,7 @@ int mbr_dem_hydrob93(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_hydrob93(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_hydrob93(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hydrob93.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hydrob93.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hydrob93(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hypc8101.c b/src/mbio/mbr_hypc8101.c
index 2d32151..bfb5899 100644
--- a/src/mbio/mbr_hypc8101.c
+++ b/src/mbio/mbr_hypc8101.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hypc8101.c	8/8/94
- *	$Id: mbr_hypc8101.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_hypc8101.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -116,7 +116,7 @@ int mbr_rt_hypc8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_hypc8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_hypc8101_rd_data(int verbose, void *mbio_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hypc8101.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_hypc8101.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hypc8101(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_hysweep1.c b/src/mbio/mbr_hysweep1.c
index 0c91959..cd03836 100644
--- a/src/mbio/mbr_hysweep1.c
+++ b/src/mbio/mbr_hysweep1.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_hysweep1.c	12/23/2011
- *	$Id: mbr_hysweep1.c 2187 2014-05-28 23:56:32Z caress $
+ *	$Id: mbr_hysweep1.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2011-2014 by
+ *    Copyright (c) 2011-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -81,7 +81,7 @@ int mbr_hysweep1_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 int mbr_hysweep1_rd_line(int verbose, FILE *mbfp, char *line, int *error);
 int mbr_hysweep1_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_hysweep1.c 2187 2014-05-28 23:56:32Z caress $";
+static char rcs_id[]="$Id: mbr_hysweep1.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_hysweep1(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_image83p.c b/src/mbio/mbr_image83p.c
index d40a567..b0aacc4 100644
--- a/src/mbio/mbr_image83p.c
+++ b/src/mbio/mbr_image83p.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_image83p.c	5/5/2008
- *	$Id: mbr_image83p.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_image83p.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -98,7 +98,7 @@ int mbr_dem_image83p(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_image83p(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_image83p(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_image83p.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_image83p.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_image83p(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_imagemba.c b/src/mbio/mbr_imagemba.c
index 402906c..0908233 100644
--- a/src/mbio/mbr_imagemba.c
+++ b/src/mbio/mbr_imagemba.c
@@ -1,8 +1,8 @@
    /*--------------------------------------------------------------------
  *    The MB-system:	mbr_imagemba.c	7/18/2008
- *	$Id: mbr_imagemba.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_imagemba.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -96,7 +96,7 @@ int mbr_dem_imagemba(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_imagemba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_imagemba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_imagemba.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_imagemba.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_imagemba(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_l3xseraw.c b/src/mbio/mbr_l3xseraw.c
index 852242d..dd52831 100644
--- a/src/mbio/mbr_l3xseraw.c
+++ b/src/mbio/mbr_l3xseraw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_l3xseraw.c	3/27/2000
- *	$Id: mbr_l3xseraw.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_l3xseraw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    D. W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -175,7 +175,7 @@ int mbr_l3xseraw_wr_sidescan(int verbose,int *buffer_size,char *buffer,void *sto
 int mbr_l3xseraw_wr_seabeam(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
 int mbr_l3xseraw_wr_comment(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
 
-static char rcs_id[]="$Id: mbr_l3xseraw.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_l3xseraw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_l3xseraw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mbarirov.c b/src/mbio/mbr_mbarirov.c
index f647f5b..fecc731 100644
--- a/src/mbio/mbr_mbarirov.c
+++ b/src/mbio/mbr_mbarirov.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mbarirov.c	5/20/99
- *	$Id: mbr_mbarirov.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mbarirov.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -122,7 +122,7 @@ int mbr_mbarirov_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error
 
 static char header[] = "Year,Day,Time,Usec,Lat,Lon,East,North,Pres,Head,Alti,Pitch,Roll,PosFlag,PresFlag,HeadFlag,AltiFlag,AttitFlag\n";
 
-static char rcs_id[]="$Id: mbr_mbarirov.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mbarirov.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mbarirov(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mbarrov2.c b/src/mbio/mbr_mbarrov2.c
index 2bd578c..7ffc989 100644
--- a/src/mbio/mbr_mbarrov2.c
+++ b/src/mbio/mbr_mbarrov2.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mbarrov2.c	10/3/2006
- *	$Id: mbr_mbarrov2.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mbarrov2.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2006-2014 by
+ *    Copyright (c) 2006-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -78,7 +78,7 @@ int mbr_mbarrov2_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error
 
 static char header[] = "RovName,DiveNumber,DateTime24,EpochSecs,Latitude,Longitude,Pressure,Depth,Altitude,Heading,Pitch,Roll,ShipLatitude,ShipLongitude,ShipHeading,QCFlag\n";
 
-static char rcs_id[]="$Id: mbr_mbarrov2.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mbarrov2.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mbarrov2(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mbldeoih.c b/src/mbio/mbr_mbldeoih.c
index d96537c..a5bf907 100644
--- a/src/mbio/mbr_mbldeoih.c
+++ b/src/mbio/mbr_mbldeoih.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mbldeoih.c	2/2/93
- *	$Id: mbr_mbldeoih.c 2217 2014-12-02 02:39:28Z caress $
+ *	$Id: mbr_mbldeoih.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -135,7 +135,7 @@ int mbr_wt_mbldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 #define	MBF_MBLDEOIH_ID_DATA4		22068	/* V4 big endian, 13398 little endian*/
 #define	MBF_MBLDEOIH_ID_DATA5		22069	/* V5 bin endian, 13654 little endian */
 
-static char rcs_id[]="$Id: mbr_mbldeoih.c 2217 2014-12-02 02:39:28Z caress $";
+static char rcs_id[]="$Id: mbr_mbldeoih.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mbldeoih(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mbnetcdf.c b/src/mbio/mbr_mbnetcdf.c
index d80b2c4..8cb851b 100644
--- a/src/mbio/mbr_mbnetcdf.c
+++ b/src/mbio/mbr_mbnetcdf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mbnetcdf.c	1/25/02
- *	$Id: mbr_mbnetcdf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mbnetcdf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -140,7 +140,7 @@ int mbr_wt_mbnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
 #define MBNETCDF_DEBUG 1
 
-static char rcs_id[]="$Id: mbr_mbnetcdf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mbnetcdf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mbnetcdf(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mbpronav.c b/src/mbio/mbr_mbpronav.c
index ff1160f..9b75eb7 100644
--- a/src/mbio/mbr_mbpronav.c
+++ b/src/mbio/mbr_mbpronav.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mbpronav.c	5/20/99
- *	$Id: mbr_mbpronav.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mbpronav.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -24,56 +24,6 @@
  * Author:	D. W. Caress
  * Date:	October 18, 1999
  *
- * $Log: mbr_mbpronav.c,v $
- * Revision 5.11  2006/10/05 18:58:29  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.10  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2005/03/25 04:23:10  caress
- * Now zeros unused parts of mbsys_singlebeam data.
- *
- * Revision 5.8  2004/06/18 03:15:51  caress
- * Adding support for segy i/o and working on support for Reson 7k format 88.
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.2  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:26:50  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.2  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1999/12/29  00:34:06  caress
- * Release 4.6.8
- *
- * Revision 4.0  1999/10/21  22:39:24  caress
- * Added MBPRONAV format.
- *
- *
  */
 
 /* standard include files */
@@ -120,7 +70,7 @@ int mbr_wt_mbpronav(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_mbpronav_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_mbpronav_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_mbpronav.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mbpronav.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mbpronav(int verbose, void *mbio_ptr, int *error)
@@ -523,8 +473,9 @@ int mbr_rt_mbpronav(int verbose, void *mbio_ptr, void *store_ptr, int *error)
 		store->roll = data->roll;
 		store->pitch = data->pitch;
 		store->heave = data->heave;
-        	for (i=0;i<MB_COMMENT_MAXLINE;i++)
+        	for (i=0;i<MBF_MBPRONAV_MAXLINE-1;i++)
 		    store->comment[i] = data->comment[i];
+		store->comment[MBF_MBPRONAV_MAXLINE-1] = 0;
 
 		/* zero the other parts of the structure */
 		for (i=0;i<8;i++)
@@ -620,8 +571,9 @@ int mbr_wt_mbpronav(int verbose, void *mbio_ptr, void *store_ptr, int *error)
 		data->roll = store->roll;
 		data->pitch = store->pitch;
 		data->heave = store->heave;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
+		for (i=0;i<MBF_MBPRONAV_MAXLINE-1;i++)
 		    data->comment[i] = store->comment[i];
+		data->comment[MBF_MBPRONAV_MAXLINE-1] = 0;
 		data->portlon = store->portlon;
 		data->portlat = store->portlat;
 		data->stbdlon = store->stbdlon;
diff --git a/src/mbio/mbr_mgd77dat.c b/src/mbio/mbr_mgd77dat.c
index 4c826d0..358c56d 100644
--- a/src/mbio/mbr_mgd77dat.c
+++ b/src/mbio/mbr_mgd77dat.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mgd77dat.c	5/18/99
- *	$Id: mbr_mgd77dat.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mgd77dat.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -120,7 +120,7 @@ int mbr_wt_mgd77dat(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_mgd77dat_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_mgd77dat_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_mgd77dat.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mgd77dat.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mgd77dat(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mgd77tab.c b/src/mbio/mbr_mgd77tab.c
index ec323cb..41f44a8 100644
--- a/src/mbio/mbr_mgd77tab.c
+++ b/src/mbio/mbr_mgd77tab.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mgd77tab.c	5/18/99
- *	$Id: mbr_mgd77tab.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbr_mgd77tab.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -723,7 +723,7 @@ int mbr_wt_mgd77tab(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_mgd77tab_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_mgd77tab_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_mgd77tab.c 2172 2014-03-14 07:28:54Z caress $";
+static char rcs_id[]="$Id: mbr_mgd77tab.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mgd77tab(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mgd77txt.c b/src/mbio/mbr_mgd77txt.c
index 15f2e37..b238a8d 100644
--- a/src/mbio/mbr_mgd77txt.c
+++ b/src/mbio/mbr_mgd77txt.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mgd77txt.c	5/18/99
- *	$Id: mbr_mgd77txt.c 2180 2014-04-02 20:58:34Z caress $
+ *	$Id: mbr_mgd77txt.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -217,7 +217,7 @@ int mbr_wt_mgd77txt(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_mgd77txt_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_mgd77txt_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_mgd77txt.c 2180 2014-04-02 20:58:34Z caress $";
+static char rcs_id[]="$Id: mbr_mgd77txt.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mgd77txt(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mr1aldeo.c b/src/mbio/mbr_mr1aldeo.c
index 9994b6d..4770dea 100644
--- a/src/mbio/mbr_mr1aldeo.c
+++ b/src/mbio/mbr_mr1aldeo.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mr1aldeo.c	10/24/95
- *	$Id: mbr_mr1aldeo.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mr1aldeo.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -143,7 +143,7 @@ int mbr_mr1aldeo_wr_hdr(int verbose, XDR *xdrs,
 		struct mbf_mr1aldeo_struct *data, char **hdr_comment, int *error);
 int mbr_mr1aldeo_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1aldeo_struct *data, int *error);
 
-static char rcs_id[]="$Id: mbr_mr1aldeo.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mr1aldeo.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mr1aldeo(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mr1bldeo.c b/src/mbio/mbr_mr1bldeo.c
index 6fe3ef3..866a3d2 100644
--- a/src/mbio/mbr_mr1bldeo.c
+++ b/src/mbio/mbr_mr1bldeo.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mr1bldeo.c	10/24/95
- *	$Id: mbr_mr1bldeo.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mr1bldeo.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -139,7 +139,7 @@ int mbr_mr1bldeo_wr_hdr(int verbose, XDR *xdrs,
 		struct mbf_mr1bldeo_struct *data, char **hdr_comment, int *error);
 int mbr_mr1bldeo_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1bldeo_struct *data, int *error);
 
-static char rcs_id[]="$Id: mbr_mr1bldeo.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mr1bldeo.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mr1bldeo(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mr1prhig.c b/src/mbio/mbr_mr1prhig.c
index 0f851d6..946fd64 100644
--- a/src/mbio/mbr_mr1prhig.c
+++ b/src/mbio/mbr_mr1prhig.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mr1prhig.c	3/3/94
- *	$Id: mbr_mr1prhig.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mr1prhig.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -165,7 +165,7 @@ int mbr_mr1prhig_wr_hdr(int verbose, XDR *xdrs,
 		struct mbf_mr1prhig_struct *data, char **hdr_comment, int *error);
 int mbr_mr1prhig_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1prhig_struct *data, int *error);
 
-static char rcs_id[]="$Id: mbr_mr1prhig.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mr1prhig.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mr1prhig(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mr1prvr2.c b/src/mbio/mbr_mr1prvr2.c
index 8087c91..6bc721a 100644
--- a/src/mbio/mbr_mr1prvr2.c
+++ b/src/mbio/mbr_mr1prvr2.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mr1prvr2.c	3/6/2003
- *	$Id: mbr_mr1prvr2.c 2185 2014-05-11 06:34:36Z caress $
+ *	$Id: mbr_mr1prvr2.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -89,7 +89,7 @@ int mbr_wt_mr1prvr2(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_mr1prvr2_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_mr1prvr2_wr_data(int verbose, void *mbio_ptr, char *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_mr1prvr2.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[]="$Id: mbr_mr1prvr2.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mr1prvr2(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_mstiffss.c b/src/mbio/mbr_mstiffss.c
index 635ba01..0dc8657 100644
--- a/src/mbio/mbr_mstiffss.c
+++ b/src/mbio/mbr_mstiffss.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_mstiffss.c	4/7/98
- *	$Id: mbr_mstiffss.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_mstiffss.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -116,7 +116,7 @@ int mbr_dem_mstiffss(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_mstiffss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_mstiffss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_mstiffss.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_mstiffss.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_mstiffss(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_nvnetcdf.c b/src/mbio/mbr_nvnetcdf.c
index 6535f75..30ee976 100644
--- a/src/mbio/mbr_nvnetcdf.c
+++ b/src/mbio/mbr_nvnetcdf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_nvnetcdf.c	5/4/02
- *	$Id: mbr_nvnetcdf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_nvnetcdf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -94,7 +94,7 @@ int mbr_dem_nvnetcdf(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_nvnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_nvnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_nvnetcdf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_nvnetcdf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_nvnetcdf(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_oicgeoda.c b/src/mbio/mbr_oicgeoda.c
index b4dca37..805ed56 100644
--- a/src/mbio/mbr_oicgeoda.c
+++ b/src/mbio/mbr_oicgeoda.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_oicgeoda.c	2/16/99
- *	$Id: mbr_oicgeoda.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_oicgeoda.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -120,7 +120,7 @@ int mbr_dem_oicgeoda(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_oicgeoda(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_oicgeoda(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_oicgeoda.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_oicgeoda.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_oicgeoda(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_oicmbari.c b/src/mbio/mbr_oicmbari.c
index 521e082..6900c53 100644
--- a/src/mbio/mbr_oicmbari.c
+++ b/src/mbio/mbr_oicmbari.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_oicgeoda.c	2/16/99
- *	$Id: mbr_oicmbari.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_oicmbari.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -123,7 +123,7 @@ int mbr_dem_oicmbari(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_oicmbari(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_oicmbari(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_oicmbari.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_oicmbari.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_oicmbari(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_omghdcsj.c b/src/mbio/mbr_omghdcsj.c
index 508f617..df37711 100644
--- a/src/mbio/mbr_omghdcsj.c
+++ b/src/mbio/mbr_omghdcsj.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_omghdcsj.c	3/10/99
- *	$Id: mbr_omghdcsj.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_omghdcsj.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -132,7 +132,7 @@ int mbr_dem_omghdcsj(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_omghdcsj(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_omghdcsj(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_omghdcsj.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_omghdcsj.c 2227 2015-02-05 21:12:31Z caress $";
 
 int profile_cnt = 0;
 
diff --git a/src/mbio/mbr_photgram.c b/src/mbio/mbr_photgram.c
index afdfa03..b218fcb 100644
--- a/src/mbio/mbr_photgram.c
+++ b/src/mbio/mbr_photgram.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_photgram.c	1/27/2014
- *	$Id: mbr_photgram.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbr_photgram.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -165,7 +165,7 @@ int mbr_wt_photgram(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_photgram_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_photgram_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_photgram.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mbr_photgram.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_photgram(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_reson7kr.c b/src/mbio/mbr_reson7kr.c
index 065e5a0..05abd35 100644
--- a/src/mbio/mbr_reson7kr.c
+++ b/src/mbio/mbr_reson7kr.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_reson7kr.c	4/4/2004
- *	$Id: mbr_reson7kr.c 2220 2015-01-22 18:53:26Z caress $
+ *	$Id: mbr_reson7kr.c 2225 2015-02-05 07:31:48Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -43,8 +43,8 @@
 #include "mb_swap.h"
 
 /* turn on debug statements here */
-#define MBR_RESON7KR_DEBUG 1
-#define MBR_RESON7KR_DEBUG2 1
+//#define MBR_RESON7KR_DEBUG 1
+//#define MBR_RESON7KR_DEBUG2 1
 
 /* essential function prototypes */
 int mbr_register_reson7kr(int verbose, void *mbio_ptr,
@@ -204,7 +204,7 @@ int mbr_reson7kr_wr_soundvelocity(int verbose, int *bufferalloc, char **bufferpt
 int mbr_reson7kr_wr_absorptionloss(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 int mbr_reson7kr_wr_spreadingloss(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 
-static char rcs_id[]="$Id: mbr_reson7kr.c 2220 2015-01-22 18:53:26Z caress $";
+static char rcs_id[]="$Id: mbr_reson7kr.c 2225 2015-02-05 07:31:48Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_reson7kr(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_samesurf.c b/src/mbio/mbr_samesurf.c
index 6b5fb7e..0be3edb 100644
--- a/src/mbio/mbr_samesurf.c
+++ b/src/mbio/mbr_samesurf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_samesurf.c	6/13/2002
- *	$Id: mbr_samesurf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_samesurf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -96,7 +96,7 @@ int mbr_dem_samesurf(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_samesurf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_samesurf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_samesurf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_samesurf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_samesurf(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sb2000sb.c b/src/mbio/mbr_sb2000sb.c
index 17827fe..5e73355 100644
--- a/src/mbio/mbr_sb2000sb.c
+++ b/src/mbio/mbr_sb2000sb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sb2000sb.c	10/11/94
- *	$Id: mbr_sb2000sb.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sb2000sb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -162,7 +162,7 @@ int mbr_dem_sb2000sb(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sb2000sb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sb2000sb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sb2000sb.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sb2000sb.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sb2000sb(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sb2000ss.c b/src/mbio/mbr_sb2000ss.c
index 0c3c472..aede275 100644
--- a/src/mbio/mbr_sb2000ss.c
+++ b/src/mbio/mbr_sb2000ss.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sb2000ss.c	10/14/94
- *	$Id: mbr_sb2000ss.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sb2000ss.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -171,7 +171,7 @@ int mbr_dem_sb2000ss(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sb2000ss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sb2000ss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sb2000ss.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sb2000ss.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sb2000ss(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sb2100bi.c b/src/mbio/mbr_sb2100bi.c
index 0a25115..cddd55c 100644
--- a/src/mbio/mbr_sb2100bi.c
+++ b/src/mbio/mbr_sb2100bi.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sb2100bi.c	12/23/2004
- *	$Id: mbr_sb2100bi.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sb2100bi.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -508,7 +508,7 @@ Record End                      03338           2       varies  unsigned short\n
 /* read & write buffer */
 char	buffer[4*MBSYS_SB2100_PIXELS];
 
-static char rcs_id[]="$Id: mbr_sb2100bi.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sb2100bi.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sb2100b1(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sb2100rw.c b/src/mbio/mbr_sb2100rw.c
index ddbb88a..ef79c2e 100644
--- a/src/mbio/mbr_sb2100rw.c
+++ b/src/mbio/mbr_sb2100rw.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sb2100rw.c	3/3/94
- *	$Id: mbr_sb2100rw.c 2210 2014-11-10 19:53:01Z caress $
+ *	$Id: mbr_sb2100rw.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -241,7 +241,7 @@ int mbr_sb2100rw_wr_tr(int verbose, FILE *mbfp, void *data_ptr, int *error);
 int mbr_sb2100rw_wr_dr(int verbose, FILE *mbfp, void *data_ptr, int *error);
 int mbr_sb2100rw_wr_ss(int verbose, FILE *mbfp, void *data_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sb2100rw.c 2210 2014-11-10 19:53:01Z caress $";
+static char rcs_id[]="$Id: mbr_sb2100rw.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sb2100rw(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sbifremr.c b/src/mbio/mbr_sbifremr.c
index b85a912..fcaf6f9 100644
--- a/src/mbio/mbr_sbifremr.c
+++ b/src/mbio/mbr_sbifremr.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sbifremr.c	3/29/96
- *	$Id: mbr_sbifremr.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sbifremr.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1996-2014 by
+ *    Copyright (c) 1996-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -137,7 +137,7 @@ int mbr_wt_sbifremr(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_sbifremr_rd_data(int verbose, void *mbio_ptr, int *error);
 int mbr_sbifremr_wr_data(int verbose, void *mbio_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sbifremr.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sbifremr.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sbifremr(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sbsiocen.c b/src/mbio/mbr_sbsiocen.c
index c452ff6..f845d6c 100644
--- a/src/mbio/mbr_sbsiocen.c
+++ b/src/mbio/mbr_sbsiocen.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sbsiocen.c	2/2/93
- *	$Id: mbr_sbsiocen.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sbsiocen.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -151,7 +151,7 @@ int mbr_dem_sbsiocen(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sbsiocen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sbsiocen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sbsiocen.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sbsiocen.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sbsiocen(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sbsiolsi.c b/src/mbio/mbr_sbsiolsi.c
index 3f60f2d..23adddb 100644
--- a/src/mbio/mbr_sbsiolsi.c
+++ b/src/mbio/mbr_sbsiolsi.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sbsiolsi.c	2/2/93
- *	$Id: mbr_sbsiolsi.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sbsiolsi.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -154,7 +154,7 @@ int mbr_dem_sbsiolsi(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sbsiolsi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sbsiolsi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sbsiolsi.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sbsiolsi.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sbsiolsi(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sbsiomrg.c b/src/mbio/mbr_sbsiomrg.c
index 77216fe..ea18320 100644
--- a/src/mbio/mbr_sbsiomrg.c
+++ b/src/mbio/mbr_sbsiomrg.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sbsiomrg.c	2/2/93
- *	$Id: mbr_sbsiomrg.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sbsiomrg.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -162,7 +162,7 @@ int mbr_dem_sbsiomrg(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sbsiomrg(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sbsiomrg(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sbsiomrg.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sbsiomrg.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sbsiomrg(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sbsioswb.c b/src/mbio/mbr_sbsioswb.c
index c981aa5..70016a1 100644
--- a/src/mbio/mbr_sbsioswb.c
+++ b/src/mbio/mbr_sbsioswb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sbsioswb.c	9/18/93
- *	$Id: mbr_sbsioswb.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sbsioswb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -163,7 +163,7 @@ int mbr_dem_sbsioswb(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sbsioswb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sbsioswb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sbsioswb.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sbsioswb.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sbsioswb(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sburicen.c b/src/mbio/mbr_sburicen.c
index 1aa4c32..66bf30b 100644
--- a/src/mbio/mbr_sburicen.c
+++ b/src/mbio/mbr_sburicen.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sburicen.c	2/2/93
- *	$Id: mbr_sburicen.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sburicen.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -152,7 +152,7 @@ int mbr_dem_sburicen(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sburicen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sburicen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sburicen.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sburicen.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sburicen(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_sburivax.c b/src/mbio/mbr_sburivax.c
index 962f700..d91f5d2 100644
--- a/src/mbio/mbr_sburivax.c
+++ b/src/mbio/mbr_sburivax.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_sburivax.c	2/2/93
- *	$Id: mbr_sburivax.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_sburivax.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -142,7 +142,7 @@ int mbr_dem_sburivax(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_sburivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_sburivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_sburivax.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_sburivax.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_sburivax(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_segysegy.c b/src/mbio/mbr_segysegy.c
index 9da9a20..f100d96 100644
--- a/src/mbio/mbr_segysegy.c
+++ b/src/mbio/mbr_segysegy.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_segysegy.c	10/27/2006
- *	$Id: mbr_segysegy.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_segysegy.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2006-2014 by
+ *    Copyright (c) 2006-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -72,7 +72,7 @@ int mbr_dem_segysegy(int verbose, void *mbio_ptr, int *error);
 int mbr_rt_segysegy(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_segysegy(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_segysegy.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_segysegy.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_segysegy(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_swplssxi.c b/src/mbio/mbr_swplssxi.c
index 16cb1f3..0a441eb 100644
--- a/src/mbio/mbr_swplssxi.c
+++ b/src/mbio/mbr_swplssxi.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_swplssxi.c	5/6/2013
- *	$Id: mbr_swplssxi.c 2183 2014-04-16 19:54:45Z caress $
+ *	$Id: mbr_swplssxi.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2013-2013 by
+ *    Copyright (c) 2013-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -64,7 +64,7 @@ int mbr_wt_swplssxi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_swplssxi_rd_data(int verbose, void *mbio_ptr, void *store_ptr,
 	int *error);
 
-static char rcs_id[] = "$Id: mbr_swplssxi.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[] = "$Id: mbr_swplssxi.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_swplssxi(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_swplssxp.c b/src/mbio/mbr_swplssxp.c
index 067cfa0..856bccf 100644
--- a/src/mbio/mbr_swplssxp.c
+++ b/src/mbio/mbr_swplssxp.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:    mbr_swplssxp.c  5/6/2013
- *  $Id: mbr_swplssxp.c 2185 2014-05-11 06:34:36Z caress $
+ *  $Id: mbr_swplssxp.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2013-2013 by
+ *    Copyright (c) 2013-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -64,7 +64,7 @@ int mbr_wt_swplssxp(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_swplssxp_rd_data(int verbose, void *mbio_ptr, void *store_ptr,
 	int *error);
 
-static char rcs_id[] = "$Id: mbr_swplssxp.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[] = "$Id: mbr_swplssxp.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_swplssxp(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_tempform.c b/src/mbio/mbr_tempform.c
index 2f1d9ee..ad8304f 100644
--- a/src/mbio/mbr_tempform.c
+++ b/src/mbio/mbr_tempform.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_tempform.c	1/27/2014
- *	$Id: mbr_tempform.c 2166 2014-02-19 22:44:10Z caress $
+ *	$Id: mbr_tempform.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -75,7 +75,7 @@ int mbr_wt_tempform(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_tempform_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_tempform_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_tempform.c 2166 2014-02-19 22:44:10Z caress $";
+static char rcs_id[]="$Id: mbr_tempform.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_tempform(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_wasspenl.c b/src/mbio/mbr_wasspenl.c
index 0c54cc3..f4198fe 100644
--- a/src/mbio/mbr_wasspenl.c
+++ b/src/mbio/mbr_wasspenl.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_wasspenl.c	1/27/2014
- *	$Id: mbr_wasspenl.c 2172 2014-03-14 07:28:54Z caress $
+ *	$Id: mbr_wasspenl.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -80,6 +80,8 @@ int mbr_wasspenl_rd_rawsonar(int verbose, char *buffer, void *store_ptr, int *er
 int mbr_wasspenl_rd_gen_sens(int verbose, char *buffer, void *store_ptr, int *error);
 int mbr_wasspenl_rd_nvupdate(int verbose, char *buffer, void *store_ptr, int *error);
 int mbr_wasspenl_rd_wcd_navi(int verbose, char *buffer, void *store_ptr, int *error);
+int mbr_wasspenl_rd_sensprop(int verbose, char *buffer, void *store_ptr, int *error);
+int mbr_wasspenl_rd_sys_prop(int verbose, char *buffer, void *store_ptr, int *error);
 int mbr_wasspenl_rd_sys_cfg1(int verbose, char *buffer, void *store_ptr, int *error);
 int mbr_wasspenl_rd_mcomment(int verbose, char *buffer, void *store_ptr, int *error);
 int mbr_wasspenl_rd_unknown1(int verbose, char *buffer, void *store_ptr, int *error);
@@ -89,13 +91,13 @@ int mbr_wasspenl_wr_rawsonar(int verbose, int *bufferalloc, char **bufferptr, vo
 int mbr_wasspenl_wr_gen_sens(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 int mbr_wasspenl_wr_nvupdate(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 int mbr_wasspenl_wr_wcd_navi(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
+int mbr_wasspenl_wr_sensprop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
+int mbr_wasspenl_wr_sys_prop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 int mbr_wasspenl_wr_sys_cfg1(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 int mbr_wasspenl_wr_mcomment(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 int mbr_wasspenl_wr_unknown1(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
 
-int mbr_reson7kr_wr_reference(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-
-static char rcs_id[]="$Id: mbr_wasspenl.c 2172 2014-03-14 07:28:54Z caress $";
+static char rcs_id[]="$Id: mbr_wasspenl.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_wasspenl(int verbose, void *mbio_ptr, int *error)
@@ -456,7 +458,7 @@ int mbr_rt_wasspenl(int verbose, void *mbio_ptr, void *store_ptr, int *error)
 	mb_io_ptr->new_kind = store->kind;
 
 #ifdef MBR_WASSPENLDEBUG
-	fprintf(stderr,"Done with mbr_wasspenl_rd_data: status:%d error:%d record kind:%d\n", status, *error, store->kind);
+	fprintf(stderr,"Done with mbr_wasspenl_rd_data: status:%d error:%d record kind:%d\n\n", status, *error, store->kind);
 #endif
 
 	/* print output debug statements */
@@ -534,6 +536,8 @@ int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 	char	**bufferptr;
@@ -544,8 +548,9 @@ int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 	size_t	read_len;
 	int	skip;
 	unsigned int *record_size;
+	int	reset_beamflags;
 	int	done;
-	int	i;
+	int	i, j;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -569,6 +574,8 @@ int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -583,6 +590,7 @@ int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 	/* loop over reading data until a record is ready for return */
 	done = MB_NO;
 	*error = MB_ERROR_NO_ERROR;
+	memset((void *)recordid, 0 , (size_t)12);
 	while (done == MB_NO)
 		{
 		/* read next record header into buffer */
@@ -607,7 +615,6 @@ int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 		    
 		/* get record id string */
 		memcpy((void *)recordid, (void *)&buffer[8], (size_t)8);
-		recordid[9] = '\0';
 #ifdef MBR_WASSPENLDEBUG
 	fprintf(stderr,"Found sync - skip:%d record:%s\n", skip,recordid);
 #endif
@@ -670,7 +677,28 @@ int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 				if (status == MB_SUCCESS)
 					{
 					if (genbathy->ping_number == corbathy->ping_number)
+						{
 						done = MB_YES;
+						
+						/* reset beam flags if necessary */
+						reset_beamflags = MB_NO;
+						for (i=0;i<corbathy->num_beams;i++)
+							{
+							if (corbathy->z[i] == 0 && corbathy->empty[i] != MB_FLAG_NULL)
+								reset_beamflags = MB_YES;
+							}
+						if (reset_beamflags == MB_YES)
+						for (i=0;i<corbathy->num_beams;i++)
+							{
+							j = corbathy->beam_index[i];
+							if (corbathy->z[i] == 0)
+								corbathy->empty[i] = MB_FLAG_NULL;
+							else if (genbathy->flags[j] & 0x01)
+								corbathy->empty[i] = MB_FLAG_NONE;
+							else
+								corbathy->empty[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
+							}
+						}
 					else
 						{
 						status = MB_FAILURE;
@@ -712,6 +740,22 @@ int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 					done = MB_YES;
 				}
 
+			/* read SENSPROP record */
+			else if (strncmp(recordid, "SENSPROP", 8) == 0)
+				{
+				status = mbr_wasspenl_rd_sensprop(verbose, buffer, store_ptr, error);
+				if (status == MB_SUCCESS)
+					done = MB_YES;
+				}
+
+			/* read SYS_PROP record */
+			else if (strncmp(recordid, "SYS_PROP", 8) == 0)
+				{
+				status = mbr_wasspenl_rd_sys_prop(verbose, buffer, store_ptr, error);
+				if (status == MB_SUCCESS)
+					done = MB_YES;
+				}
+
 			/* read SYS_CFG1 record */
 			else if (strncmp(recordid, "SYS_CFG1", 8) == 0)
 				{
@@ -847,6 +891,24 @@ int mbr_wasspenl_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *erro
 		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
 		}
 
+	/* write SENSPROP record */
+	else if (store->kind == MB_DATA_SENSOR_PARAMETERS)
+		{
+		status = mbr_wasspenl_wr_sensprop(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
+		buffer = (char *) *bufferptr;
+		write_len = (size_t)size;
+		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
+		}
+
+	/* write SYS_PROP record */
+	else if (store->kind == MB_DATA_INSTALLATION)
+		{
+		status = mbr_wasspenl_wr_sys_prop(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
+		buffer = (char *) *bufferptr;
+		write_len = (size_t)size;
+		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
+		}
+
 	/* write SYS_CFG1 record */
 	else if (store->kind == MB_DATA_PARAMETER)
 		{
@@ -1508,6 +1570,211 @@ int mbr_wasspenl_rd_wcd_navi(int verbose, char *buffer, void *store_ptr, int *er
 }
 /*--------------------------------------------------------------------*/
 
+int mbr_wasspenl_rd_sensprop(int verbose, char *buffer, void *store_ptr, int *error)
+{
+	char	*function_name = "mbr_wasspenl_rd_sensprop";
+	int	status = MB_SUCCESS;
+	struct mbsys_wassp_struct *store;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+	int	index;
+	int	i;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
+		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
+		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
+		}
+
+	/* get pointer to raw data structure */
+	store = (struct mbsys_wassp_struct *) store_ptr;
+	sensprop = &(store->sensprop);
+
+	/* extract the data */
+	index = 16;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->version)); index += 4;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->flags)); index += 4;
+	mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sea_level_reference)); index += 4;
+	mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->element_spacing)); index += 4;
+	for (i=0;i<8;i++)
+		{
+		mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->spare[i])); index += 4;
+		}
+	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->n)); index += 4;
+	if (sensprop->n_alloc < sensprop->n)
+		{
+		status = mb_reallocd(verbose, __FILE__, __LINE__, sensprop->n * sizeof(struct mbsys_wassp_sensor_struct),
+						(void **)&(sensprop->sensors), error);
+		if (status != MB_SUCCESS)
+			sensprop->n_alloc = 0;
+		else
+			sensprop->n_alloc = sensprop->n;
+		}
+	for (i=0;i<sensprop->n;i++)
+		{
+		mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->sensors[i].sensor_type)); index += 4;
+		mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->sensors[i].flags)); index += 4;
+		sensprop->sensors[i].port_number = buffer[index]; index++;
+		sensprop->sensors[i].device = buffer[index]; index++;
+		sensprop->sensors[i].sentence = buffer[index]; index++;
+		sensprop->sensors[i].sensor_model = buffer[index]; index++;
+		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].latency)); index += 4;
+		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].roll_bias)); index += 4;
+		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].pitch_bias)); index += 4;
+		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].yaw_bias)); index += 4;
+		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].offset_x)); index += 4;
+		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].offset_y)); index += 4;
+		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].offset_z)); index += 4;
+		}
+	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->checksum)); index += 4;
+
+	/* set kind */
+	if (status == MB_SUCCESS)
+		{
+		/* set kind */
+		store->kind = MB_DATA_SENSOR_PARAMETERS;
+		}
+	else
+		{
+		store->kind = MB_DATA_NONE;
+		}
+
+	/* print debug statements */
+	if (verbose >= 5)
+		{
+		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
+		fprintf(stderr,"dbg5       sensprop->version:                    %u\n",sensprop->version);
+		fprintf(stderr,"dbg5       sensprop->flags:                      %u\n",sensprop->flags);
+		fprintf(stderr,"dbg5       sensprop->sea_level_reference:        %f\n",sensprop->sea_level_reference);
+		fprintf(stderr,"dbg5       sensprop->element_spacing:            %f\n",sensprop->element_spacing);
+		for (i=0;i<8;i++)
+			fprintf(stderr,"dbg5       sensprop->spare[%d]:                   %d\n",i,sensprop->spare[i]);
+		fprintf(stderr,"dbg5       sensprop->n:                          %d\n",sensprop->n);
+		for (i=0;i<sensprop->n;i++)
+			{
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_type:    %u\n",i,sensprop->sensors[i].sensor_type);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].flags:          %u\n",i,sensprop->sensors[i].flags);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].port_number:    %u\n",i,sensprop->sensors[i].port_number);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].device:         %u\n",i,sensprop->sensors[i].device);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].sentence:       %u\n",i,sensprop->sensors[i].sentence);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_model:   %u\n",i,sensprop->sensors[i].sensor_model);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].latency:        %f\n",i,sensprop->sensors[i].latency);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].roll_bias:      %f\n",i,sensprop->sensors[i].roll_bias);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].pitch_bias:     %f\n",i,sensprop->sensors[i].pitch_bias);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].yaw_bias:       %f\n",i,sensprop->sensors[i].yaw_bias);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_x:       %f\n",i,sensprop->sensors[i].offset_x);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_y:       %f\n",i,sensprop->sensors[i].offset_y);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_z:       %f\n",i,sensprop->sensors[i].offset_z);	
+			}
+		fprintf(stderr,"dbg5       sensprop->checksum:                   %u\n",sensprop->checksum);	
+		}
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:      %d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:  %d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int mbr_wasspenl_rd_sys_prop(int verbose, char *buffer, void *store_ptr, int *error)
+{
+	char	*function_name = "mbr_wasspenl_rd_sys_prop";
+	int	status = MB_SUCCESS;
+	struct mbsys_wassp_struct *store;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
+	int	index;
+	int	i;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
+		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
+		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
+		}
+
+	/* get pointer to raw data structure */
+	store = (struct mbsys_wassp_struct *) store_ptr;
+	sys_prop = &(store->sys_prop);
+
+	/* extract the data */
+	index = 16;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->version)); index += 4;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->product_type)); index += 4;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->protocol_version)); index += 4;
+	for (i=0;i<4;i++)
+		{
+		mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->sw_version[i])); index += 4;
+		}
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->fw_version)); index += 4;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->hw_version)); index += 4;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->transducer_sn)); index += 4;
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->transceiver_sn)); index += 4;
+	for (i=0;i<8;i++)
+		{
+		mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->spare[i])); index += 4;
+		}
+	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->checksum)); index += 4;
+
+	/* set kind */
+	if (status == MB_SUCCESS)
+		{
+		/* set kind */
+		store->kind = MB_DATA_INSTALLATION;
+		}
+	else
+		{
+		store->kind = MB_DATA_NONE;
+		}
+
+	/* print debug statements */
+	if (verbose >= 5)
+		{
+		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
+		fprintf(stderr,"dbg5       sys_prop->version:                    %u\n",sys_prop->version);
+		fprintf(stderr,"dbg5       sys_prop->product_type:               %u\n",sys_prop->product_type);
+		fprintf(stderr,"dbg5       sys_prop->protocol_version:           %u\n",sys_prop->protocol_version);
+		for (i=0;i<4;i++)
+			fprintf(stderr,"dbg5       sys_prop->sw_version[%d]:             %u\n",i,sys_prop->sw_version[i]);
+		fprintf(stderr,"dbg5       sys_prop->fw_version:                 %u\n",sys_prop->fw_version);
+		fprintf(stderr,"dbg5       sys_prop->hw_version:                 %u\n",sys_prop->hw_version);
+		fprintf(stderr,"dbg5       sys_prop->transducer_sn:              %u\n",sys_prop->transducer_sn);
+		fprintf(stderr,"dbg5       sys_prop->transceiver_sn:             %u\n",sys_prop->transceiver_sn);
+		for (i=0;i<8;i++)
+			fprintf(stderr,"dbg5       sys_prop->spare[%d]:                  %u\n",i,sys_prop->spare[i]);
+		fprintf(stderr,"dbg5       sys_prop->checksum:                   %u\n",sys_prop->checksum);	
+		}
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:      %d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:  %d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
 int mbr_wasspenl_rd_sys_cfg1(int verbose, char *buffer, void *store_ptr, int *error)
 {
 	char	*function_name = "mbr_wasspenl_rd_sys_cfg1";
@@ -1753,6 +2020,8 @@ int mbr_wasspenl_wr_genbathy(int verbose, int *bufferalloc, char **bufferptr, vo
 	/* get pointer to raw data structure */
 	store = (struct mbsys_wassp_struct *) store_ptr;
 	genbathy = &(store->genbathy);
+	genbathy->version = 3;
+	genbathy->checksum = 0x8806CBA5;
 
 	/* print debug statements */
 	if (verbose >= 5)
@@ -1838,9 +2107,6 @@ int mbr_wasspenl_wr_genbathy(int verbose, int *bufferalloc, char **bufferptr, vo
 			}
 
 		/* now add the checksum */
-		genbathy->checksum = 0;
-		for (i=0;i<index;i++)
-			genbathy->checksum += (unsigned char) buffer[i];
 		mb_put_binary_int(MB_YES, genbathy->checksum, &buffer[index]); index += 4;
 		}
 
@@ -1883,6 +2149,8 @@ int mbr_wasspenl_wr_corbathy(int verbose, int *bufferalloc, char **bufferptr, vo
 	/* get pointer to raw data structure */
 	store = (struct mbsys_wassp_struct *) store_ptr;
 	corbathy = &(store->corbathy);
+	corbathy->version = 4;
+	corbathy->checksum = 0x8806CBA5;
 
 	/* print debug statements */
 	if (verbose >= 5)
@@ -1976,9 +2244,6 @@ int mbr_wasspenl_wr_corbathy(int verbose, int *bufferalloc, char **bufferptr, vo
 			}
 
 		/* now add the checksum */
-		corbathy->checksum = 0;
-		for (i=0;i<index;i++)
-			corbathy->checksum += (unsigned char) buffer[i];
 		mb_put_binary_int(MB_YES, corbathy->checksum, &buffer[index]); index += 4;
 		}
 
@@ -2022,6 +2287,8 @@ int mbr_wasspenl_wr_rawsonar(int verbose, int *bufferalloc, char **bufferptr, vo
 	/* get pointer to raw data structure */
 	store = (struct mbsys_wassp_struct *) store_ptr;
 	rawsonar = &(store->rawsonar);
+	rawsonar->version = 2;
+	rawsonar->checksum = 0x8806CBA5;
 
 	/* print debug statements */
 	if (verbose >= 5)
@@ -2107,9 +2374,6 @@ int mbr_wasspenl_wr_rawsonar(int verbose, int *bufferalloc, char **bufferptr, vo
 		memcpy(&buffer[index], rawsonar->rawdata, rawdata_len); index += rawdata_len;
 
 		/* now add the checksum */
-		rawsonar->checksum = 0;
-		for (i=0;i<index;i++)
-			rawsonar->checksum += (unsigned char) buffer[i];
 		mb_put_binary_int(MB_YES, rawsonar->checksum, &buffer[index]); index += 4;
 		}
 
@@ -2135,7 +2399,6 @@ int mbr_wasspenl_wr_gen_sens(int verbose, int *bufferalloc, char **bufferptr, vo
         struct mbsys_wassp_gen_sens_struct *gen_sens;
 	char	*buffer;
 	int	index;
-	int	i;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -2152,6 +2415,8 @@ int mbr_wasspenl_wr_gen_sens(int verbose, int *bufferalloc, char **bufferptr, vo
 	/* get pointer to raw data structure */
 	store = (struct mbsys_wassp_struct *) store_ptr;
 	gen_sens = &(store->gen_sens);
+	gen_sens->version = 2;
+	gen_sens->checksum = 0x8806CBA5;
 
 	/* print debug statements */
 	if (verbose >= 5)
@@ -2197,9 +2462,6 @@ int mbr_wasspenl_wr_gen_sens(int verbose, int *bufferalloc, char **bufferptr, vo
 		memcpy(&buffer[index], gen_sens->message, (size_t)gen_sens->message_length); index += gen_sens->message_length;
 
 		/* now add the checksum */
-		gen_sens->checksum = 0;
-		for (i=0;i<index;i++)
-			gen_sens->checksum += (unsigned char) buffer[i];
 		mb_put_binary_int(MB_YES, gen_sens->checksum, &buffer[index]); index += 4;
 		}
 
@@ -2226,7 +2488,6 @@ int mbr_wasspenl_wr_nvupdate(int verbose, int *bufferalloc, char **bufferptr, vo
         struct mbsys_wassp_nvupdate_struct *nvupdate;
 	char	*buffer;
 	int	index;
-	int	i;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -2243,6 +2504,8 @@ int mbr_wasspenl_wr_nvupdate(int verbose, int *bufferalloc, char **bufferptr, vo
 	/* get pointer to raw data structure */
 	store = (struct mbsys_wassp_struct *) store_ptr;
 	nvupdate = &(store->nvupdate);
+	nvupdate->version = 4;
+	nvupdate->checksum = 0x8806CBA5;
 
 	/* print debug statements */
 	if (verbose >= 5)
@@ -2298,9 +2561,6 @@ int mbr_wasspenl_wr_nvupdate(int verbose, int *bufferalloc, char **bufferptr, vo
 		mb_put_binary_float(MB_YES, nvupdate->nadir_depth, &buffer[index]); index += 4;
 
 		/* now add the checksum */
-		nvupdate->checksum = 0;
-		for (i=0;i<index;i++)
-			nvupdate->checksum += (unsigned char) buffer[i];
 		mb_put_binary_int(MB_YES, nvupdate->checksum, &buffer[index]); index += 4;
 		}
 
@@ -2344,6 +2604,8 @@ int mbr_wasspenl_wr_wcd_navi(int verbose, int *bufferalloc, char **bufferptr, vo
 	/* get pointer to raw data structure */
 	store = (struct mbsys_wassp_struct *) store_ptr;
 	wcd_navi = &(store->wcd_navi);
+	wcd_navi->version = 4;
+	wcd_navi->checksum = 0x8806CBA5;
 
 	/* print debug statements */
 	if (verbose >= 5)
@@ -2407,9 +2669,6 @@ int mbr_wasspenl_wr_wcd_navi(int verbose, int *bufferalloc, char **bufferptr, vo
 			}
 
 		/* now add the checksum */
-		wcd_navi->checksum = 0;
-		for (i=0;i<index;i++)
-			wcd_navi->checksum += (unsigned char) buffer[i];
 		mb_put_binary_int(MB_YES, wcd_navi->checksum, &buffer[index]); index += 4;
 		}
 
@@ -2428,6 +2687,240 @@ int mbr_wasspenl_wr_wcd_navi(int verbose, int *bufferalloc, char **bufferptr, vo
 }
 /*--------------------------------------------------------------------*/
 
+int mbr_wasspenl_wr_sensprop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
+{
+	char	*function_name = "mbr_wasspenl_wr_sensprop";
+	int	status = MB_SUCCESS;
+	struct mbsys_wassp_struct *store;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+	char	*buffer;
+	int	index;
+	int	i;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
+		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
+		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
+		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
+		}
+
+	/* get pointer to raw data structure */
+	store = (struct mbsys_wassp_struct *) store_ptr;
+	sensprop = &(store->sensprop);
+	sensprop->version = 1;
+	sensprop->checksum = 0x8806CBA5;
+
+	/* print debug statements */
+	if (verbose >= 5)
+		{
+		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
+		fprintf(stderr,"dbg5       sensprop->version:                    %u\n",sensprop->version);
+		fprintf(stderr,"dbg5       sensprop->flags:                      %u\n",sensprop->flags);
+		fprintf(stderr,"dbg5       sensprop->sea_level_reference:        %f\n",sensprop->sea_level_reference);
+		fprintf(stderr,"dbg5       sensprop->element_spacing:            %f\n",sensprop->element_spacing);
+		for (i=0;i<8;i++)
+			fprintf(stderr,"dbg5       sensprop->spare[%d]:                   %d\n",i,sensprop->spare[i]);
+		fprintf(stderr,"dbg5       sensprop->n:                          %d\n",sensprop->n);
+		for (i=0;i<sensprop->n;i++)
+			{
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_type:    %u\n",i,sensprop->sensors[i].sensor_type);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].flags:          %u\n",i,sensprop->sensors[i].flags);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].port_number:    %u\n",i,sensprop->sensors[i].port_number);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].device:         %u\n",i,sensprop->sensors[i].device);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].sentence:       %u\n",i,sensprop->sensors[i].sentence);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_model:   %u\n",i,sensprop->sensors[i].sensor_model);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].latency:        %f\n",i,sensprop->sensors[i].latency);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].roll_bias:      %f\n",i,sensprop->sensors[i].roll_bias);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].pitch_bias:     %f\n",i,sensprop->sensors[i].pitch_bias);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].yaw_bias:       %f\n",i,sensprop->sensors[i].yaw_bias);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_x:       %f\n",i,sensprop->sensors[i].offset_x);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_y:       %f\n",i,sensprop->sensors[i].offset_y);	
+			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_z:       %f\n",i,sensprop->sensors[i].offset_z);	
+			}
+		fprintf(stderr,"dbg5       sensprop->checksum:                   %u\n",sensprop->checksum);	
+		}
+
+	/* figure out size of output record */
+	*size = 72 + 40 * sensprop->n;
+
+	/* allocate memory to write rest of record if necessary */
+	if (*bufferalloc < *size)
+		{
+		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
+					(void **)bufferptr, error);
+		if (status != MB_SUCCESS)
+			*bufferalloc = 0;
+		else
+			*bufferalloc = *size;
+		}
+
+	/* proceed to write if buffer allocated */
+	if (status == MB_SUCCESS)
+		{
+		/* get buffer for writing */
+		buffer = (char *) *bufferptr;
+
+		/* insert the data */
+		index = 0;
+		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
+		strncpy(&buffer[index], "SENSPROP", 8); index += 8;
+		mb_put_binary_int(MB_YES, sensprop->version, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, sensprop->flags, &buffer[index]); index += 4;
+		mb_put_binary_float(MB_YES, sensprop->sea_level_reference, &buffer[index]); index += 4;
+		mb_put_binary_float(MB_YES, sensprop->element_spacing, &buffer[index]); index += 4;
+		for (i=0;i<8;i++)
+			{
+			mb_put_binary_int(MB_YES, sensprop->spare[i], &buffer[index]); index += 4;
+			}
+		mb_put_binary_int(MB_YES, sensprop->n, &buffer[index]); index += 4;
+		for (i=0;i<sensprop->n;i++)
+			{
+			mb_put_binary_int(MB_YES, sensprop->sensors[i].sensor_type, &buffer[index]); index += 4;
+			mb_put_binary_int(MB_YES, sensprop->sensors[i].flags, &buffer[index]); index += 4;
+			buffer[index] = sensprop->sensors[i].port_number; index++;
+			buffer[index] = sensprop->sensors[i].device; index++;
+			buffer[index] = sensprop->sensors[i].sentence; index++;
+			buffer[index] = sensprop->sensors[i].sensor_model; index++;
+			mb_put_binary_float(MB_YES, sensprop->sensors[i].latency, &buffer[index]); index += 4;
+			mb_put_binary_float(MB_YES, sensprop->sensors[i].roll_bias, &buffer[index]); index += 4;
+			mb_put_binary_float(MB_YES, sensprop->sensors[i].pitch_bias, &buffer[index]); index += 4;
+			mb_put_binary_float(MB_YES, sensprop->sensors[i].yaw_bias, &buffer[index]); index += 4;
+			mb_put_binary_float(MB_YES, sensprop->sensors[i].offset_x, &buffer[index]); index += 4;
+			mb_put_binary_float(MB_YES, sensprop->sensors[i].offset_y, &buffer[index]); index += 4;
+			mb_put_binary_float(MB_YES, sensprop->sensors[i].offset_z, &buffer[index]); index += 4;
+			}
+
+		/* now add the checksum */
+		mb_put_binary_int(MB_YES, sensprop->checksum, &buffer[index]); index += 4;
+		}
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:      %d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:  %d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int mbr_wasspenl_wr_sys_prop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
+{
+	char	*function_name = "mbr_wasspenl_wr_sys_prop";
+	int	status = MB_SUCCESS;
+	struct mbsys_wassp_struct *store;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
+	char	*buffer;
+	int	index;
+	int	i;
+
+	/* print input debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
+		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
+		fprintf(stderr,"dbg2  Input arguments:\n");
+		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
+		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
+		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
+		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
+		}
+
+	/* get pointer to raw data structure */
+	store = (struct mbsys_wassp_struct *) store_ptr;
+	sys_prop = &(store->sys_prop);
+	sys_prop->version = 1;
+	sys_prop->checksum = 0x8806CBA5;
+
+	/* print debug statements */
+	if (verbose >= 5)
+		{
+		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
+		fprintf(stderr,"dbg5       sys_prop->version:                    %u\n",sys_prop->version);
+		fprintf(stderr,"dbg5       sys_prop->product_type:               %u\n",sys_prop->product_type);
+		fprintf(stderr,"dbg5       sys_prop->protocol_version:           %u\n",sys_prop->protocol_version);
+		for (i=0;i<4;i++)
+			fprintf(stderr,"dbg5       sys_prop->sw_version[%d]:             %u\n",i,sys_prop->sw_version[i]);
+		fprintf(stderr,"dbg5       sys_prop->fw_version:                 %u\n",sys_prop->fw_version);
+		fprintf(stderr,"dbg5       sys_prop->hw_version:                 %u\n",sys_prop->hw_version);
+		fprintf(stderr,"dbg5       sys_prop->transducer_sn:              %u\n",sys_prop->transducer_sn);
+		fprintf(stderr,"dbg5       sys_prop->transceiver_sn:             %u\n",sys_prop->transceiver_sn);
+		for (i=0;i<8;i++)
+			fprintf(stderr,"dbg5       sys_prop->spare[%d]:                  %u\n",i,sys_prop->spare[i]);
+		fprintf(stderr,"dbg5       sys_prop->checksum:                   %u\n",sys_prop->checksum);	
+		}
+
+	/* figure out size of output record */
+	*size = 96;
+
+	/* allocate memory to write rest of record if necessary */
+	if (*bufferalloc < *size)
+		{
+		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
+					(void **)bufferptr, error);
+		if (status != MB_SUCCESS)
+			*bufferalloc = 0;
+		else
+			*bufferalloc = *size;
+		}
+
+	/* proceed to write if buffer allocated */
+	if (status == MB_SUCCESS)
+		{
+		/* get buffer for writing */
+		buffer = (char *) *bufferptr;
+
+		/* insert the data */
+		index = 0;
+		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
+		strncpy(&buffer[index], "SYS_PROP", 8); index += 8;
+		mb_put_binary_int(MB_YES, sys_prop->version, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, sys_prop->product_type, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, sys_prop->protocol_version, &buffer[index]); index += 4;
+		for (i=0;i<4;i++)
+			{
+			mb_put_binary_int(MB_YES, sys_prop->sw_version[i], &buffer[index]); index += 4;
+			}
+		mb_put_binary_int(MB_YES, sys_prop->fw_version, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, sys_prop->hw_version, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, sys_prop->transducer_sn, &buffer[index]); index += 4;
+		mb_put_binary_int(MB_YES, sys_prop->transceiver_sn, &buffer[index]); index += 4;
+		for (i=0;i<8;i++)
+			{
+			mb_put_binary_int(MB_YES, sys_prop->spare[i], &buffer[index]); index += 4;
+			}
+
+		/* now add the checksum */
+		mb_put_binary_int(MB_YES, sys_prop->checksum, &buffer[index]); index += 4;
+		}
+
+	/* print output debug statements */
+	if (verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:      %d\n",*error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:  %d\n",status);
+		}
+
+	/* return status */
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
 int mbr_wasspenl_wr_sys_cfg1(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
 {
 	char	*function_name = "mbr_wasspenl_wr_sys_cfg1";
@@ -2510,7 +3003,6 @@ int mbr_wasspenl_wr_mcomment(int verbose, int *bufferalloc, char **bufferptr, vo
         struct mbsys_wassp_mcomment_struct *mcomment;
 	char	*buffer;
 	int	index;
-	int	i;
 
 	/* print input debug statements */
 	if (verbose >= 2)
@@ -2527,6 +3019,7 @@ int mbr_wasspenl_wr_mcomment(int verbose, int *bufferalloc, char **bufferptr, vo
 	/* get pointer to raw data structure */
 	store = (struct mbsys_wassp_struct *) store_ptr;
 	mcomment = &(store->mcomment);
+	mcomment->checksum = 0x8806CBA5;
 
 	/* print debug statements */
 	if (verbose >= 5)
@@ -2566,9 +3059,6 @@ int mbr_wasspenl_wr_mcomment(int verbose, int *bufferalloc, char **bufferptr, vo
 		memcpy(&buffer[index], mcomment->comment_message, (size_t)mcomment->comment_length); index += mcomment->comment_length;
 
 		/* now add the checksum */
-		mcomment->checksum = 0;
-		for (i=0;i<index;i++)
-			mcomment->checksum += (unsigned char) buffer[i];
 		mb_put_binary_int(MB_YES, mcomment->checksum, &buffer[index]); index += 4;
 		}
 
diff --git a/src/mbio/mbr_xtfb1624.c b/src/mbio/mbr_xtfb1624.c
index 2c467a6..ac2e38d 100644
--- a/src/mbio/mbr_xtfb1624.c
+++ b/src/mbio/mbr_xtfb1624.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_xtfb1624.c	3/29/2011
- *	$Id: mbr_xtfb1624.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_xtfb1624.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2012-2014 by
+ *    Copyright (c) 2012-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -412,7 +412,7 @@ int mbr_rt_xtfb1624(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_xtfb1624(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_xtfb1624_rd_data(int verbose, void *mbio_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_xtfb1624.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_xtfb1624.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_xtfb1624(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbr_xtfr8101.c b/src/mbio/mbr_xtfr8101.c
index 835e2f2..5cf54db 100644
--- a/src/mbio/mbr_xtfr8101.c
+++ b/src/mbio/mbr_xtfr8101.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbr_xtfr8101.c	8/8/94
- *	$Id: mbr_xtfr8101.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbr_xtfr8101.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -111,7 +111,7 @@ int mbr_rt_xtfr8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_wt_xtfr8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
 int mbr_xtfr8101_rd_data(int verbose, void *mbio_ptr, int *error);
 
-static char rcs_id[]="$Id: mbr_xtfr8101.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbr_xtfr8101.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbr_register_xtfr8101(int verbose, void *mbio_ptr, int *error)
diff --git a/src/mbio/mbsys_3datdepthlidar.c b/src/mbio/mbsys_3datdepthlidar.c
index e931906..e2a727a 100644
--- a/src/mbio/mbsys_3datdepthlidar.c
+++ b/src/mbio/mbsys_3datdepthlidar.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_3datdepthlidar.c	3.00	5/7/2013
- *	$Id: mbsys_3datdepthlidar.c 2204 2014-09-06 02:34:58Z caress $
+ *	$Id: mbsys_3datdepthlidar.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2013-2014 by
+ *    Copyright (c) 2013-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -184,7 +184,7 @@
 
 #define MBF_3DDEPTHP_DEBUG 1
 
-static char rcs_id[]="$Id: mbsys_3datdepthlidar.c 2204 2014-09-06 02:34:58Z caress $";
+static char rcs_id[]="$Id: mbsys_3datdepthlidar.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*-------------------------------------------------------------------- */
 int mbsys_3datdepthlidar_alloc
diff --git a/src/mbio/mbsys_3datdepthlidar.h b/src/mbio/mbsys_3datdepthlidar.h
index e93978f..43b1b34 100644
--- a/src/mbio/mbsys_3datdepthlidar.h
+++ b/src/mbio/mbsys_3datdepthlidar.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_3datdepthlidar.h	11/29/2013
- *	$Id: mbsys_3datdepthlidar.h 2185 2014-05-11 06:34:36Z caress $
+ *	$Id: mbsys_3datdepthlidar.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2013-2014 by
+ *    Copyright (c) 2013-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_atlas.c b/src/mbio/mbsys_atlas.c
index 246ac04..f72467e 100644
--- a/src/mbio/mbsys_atlas.c
+++ b/src/mbio/mbsys_atlas.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_atlas.c	3.00	6/25/01
- *	$Id: mbsys_atlas.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_atlas.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -82,7 +82,7 @@
 #define MBSYS_ATLAS_C
 #include "mbsys_atlas.h"
 
-static char rcs_id[]="$Id: mbsys_atlas.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_atlas.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_atlas_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_atlas.h b/src/mbio/mbsys_atlas.h
index 721a549..0cd4e0b 100644
--- a/src/mbio/mbsys_atlas.h
+++ b/src/mbio/mbsys_atlas.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_atlas.h	6/22/01
- *	$Id: mbsys_atlas.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_atlas.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_benthos.c b/src/mbio/mbsys_benthos.c
index d222d09..341e741 100644
--- a/src/mbio/mbsys_benthos.c
+++ b/src/mbio/mbsys_benthos.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_benthos.c	3.00	3/29/2011
- *	$Id: mbsys_benthos.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_benthos.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2012-2014 by
+ *    Copyright (c) 2012-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -41,7 +41,7 @@
 #include "mb_define.h"
 #include "mbsys_benthos.h"
 
-static char rcs_id[]="$Id: mbsys_benthos.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_benthos.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_benthos_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_benthos.h b/src/mbio/mbsys_benthos.h
index f9fdfc2..8ff6a0a 100644
--- a/src/mbio/mbsys_benthos.h
+++ b/src/mbio/mbsys_benthos.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_benthos.h	3/29/2011
- *	$Id: mbsys_benthos.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_benthos.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2012-2014 by
+ *    Copyright (c) 2012-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_dsl.c b/src/mbio/mbsys_dsl.c
index e17a1a1..5db0f07 100644
--- a/src/mbio/mbsys_dsl.c
+++ b/src/mbio/mbsys_dsl.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_dsl.c	3.00	8/5/96
- *	$Id: mbsys_dsl.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_dsl.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1996-2014 by
+ *    Copyright (c) 1996-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -97,7 +97,7 @@
 #include "mb_define.h"
 #include "mbsys_dsl.h"
 
-static char rcs_id[]="$Id: mbsys_dsl.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_dsl.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_dsl_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_dsl.h b/src/mbio/mbsys_dsl.h
index 985861d..95f2e27 100644
--- a/src/mbio/mbsys_dsl.h
+++ b/src/mbio/mbsys_dsl.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_dsl.h	8/5/94
- *	$Id: mbsys_dsl.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_dsl.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1996-2014 by
+ *    Copyright (c) 1996-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_elac.c b/src/mbio/mbsys_elac.c
index c6aecc2..841f8e1 100644
--- a/src/mbio/mbsys_elac.c
+++ b/src/mbio/mbsys_elac.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_elac.c	3.00	8/20/94
- *	$Id: mbsys_elac.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_elac.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -123,7 +123,7 @@
 #include "mb_define.h"
 #include "mbsys_elac.h"
 
-static char rcs_id[]="$Id: mbsys_elac.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_elac.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_elac_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_elac.h b/src/mbio/mbsys_elac.h
index fedb653..5dfa275 100644
--- a/src/mbio/mbsys_elac.h
+++ b/src/mbio/mbsys_elac.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_elac.h	8/20/94
- *	$Id: mbsys_elac.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_elac.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_elacmk2.c b/src/mbio/mbsys_elacmk2.c
index 9434acf..08d0872 100644
--- a/src/mbio/mbsys_elacmk2.c
+++ b/src/mbio/mbsys_elacmk2.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_elac.c	3.00	8/20/94
- *	$Id: mbsys_elacmk2.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_elacmk2.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -131,7 +131,7 @@
 #include "mb_define.h"
 #include "mbsys_elacmk2.h"
 
- static char rcs_id[]="$Id: mbsys_elacmk2.c 2175 2014-03-18 23:03:39Z caress $";
+ static char rcs_id[]="$Id: mbsys_elacmk2.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_elacmk2_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_elacmk2.h b/src/mbio/mbsys_elacmk2.h
index 0bbb893..724331c 100644
--- a/src/mbio/mbsys_elacmk2.h
+++ b/src/mbio/mbsys_elacmk2.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_elacmk2.h	6/10/97
- *	$Id: mbsys_elacmk2.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_elacmk2.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_gsf.c b/src/mbio/mbsys_gsf.c
index 02f93f3..2c5b0ce 100644
--- a/src/mbio/mbsys_gsf.c
+++ b/src/mbio/mbsys_gsf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_gsf.c	3.00	8/20/94
- *	$Id: mbsys_gsf.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_gsf.c 2249 2015-06-26 19:26:09Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -39,7 +39,7 @@
 #include "mb_define.h"
 #include "mbsys_gsf.h"
 
-static char rcs_id[]="$Id: mbsys_gsf.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mbsys_gsf.c 2249 2015-06-26 19:26:09Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_gsf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
@@ -1135,6 +1135,13 @@ int mbsys_gsf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
 			ttimes[i] = mb_ping->travel_time[i];
 			angles[i] = fabs(mb_ping->beam_angle[i]);
 			angles_forward[i] = mb_ping->beam_angle_forward[i];
+			if (mb_ping->beam_angle[i] < 0.0
+				&& mb_ping->across_track[i] < 0.0
+				&& (fabs(mb_ping->beam_angle_forward[i]) < 90.0
+				    || fabs(mb_ping->beam_angle_forward[i]) > 270.0))
+				{
+				angles_forward[i] += 180.0;
+				}
 			heave[i] = mb_ping->heave;
 			alongtrack_offset[i] = 0.0;
 			}
diff --git a/src/mbio/mbsys_gsf.h b/src/mbio/mbsys_gsf.h
index 1c04b68..79a77e1 100644
--- a/src/mbio/mbsys_gsf.h
+++ b/src/mbio/mbsys_gsf.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_gsf.h	6/10/97
- *	$Id: mbsys_gsf.h 2192 2014-07-07 14:32:05Z caress $
+ *	$Id: mbsys_gsf.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_hdcs.c b/src/mbio/mbsys_hdcs.c
index 4f5e881..1fe271f 100644
--- a/src/mbio/mbsys_hdcs.c
+++ b/src/mbio/mbsys_hdcs.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hdcs.c	3/1/99
- *	$Id: mbsys_hdcs.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_hdcs.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -37,7 +37,7 @@
 #include "mb_define.h"
 #include "mbsys_hdcs.h"
 
-static char rcs_id[]="$Id: mbsys_hdcs.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mbsys_hdcs.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_hdcs_alloc(int verbose, void *mbio_ptr, void **store_ptr,
@@ -277,7 +277,7 @@ int mbsys_hdcs_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
 int mbsys_hdcs_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
 		int *sonartype, int *error)
 {
-	char	*function_name = "mbsys_hdcs_sidescantype";
+	char	*function_name = "mbsys_hdcs_sonartype";
 	int	status = MB_SUCCESS;
 	struct mb_io_struct *mb_io_ptr;
 	struct mbsys_hdcs_struct *store;
diff --git a/src/mbio/mbsys_hdcs.h b/src/mbio/mbsys_hdcs.h
index e21e928..26ea4e9 100644
--- a/src/mbio/mbsys_hdcs.h
+++ b/src/mbio/mbsys_hdcs.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hdcs.h	3/16/99
- *	$Id: mbsys_hdcs.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_hdcs.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -20,38 +20,6 @@
  * Author:	D. W. Caress
  * Date:	March 16, 1999
  *
- * $Log: mbsys_hdcs.h,v $
- * Revision 5.6  2008/03/14 18:33:03  caress
- * Updated support for JHC format 151.
- *
- * Revision 5.5  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
- *
  */
 /*
  * Notes on the MBSYS_HDCS data structure:
@@ -463,6 +431,10 @@ int mbsys_hdcs_deall(int verbose, void *mbio_ptr, void **store_ptr,
 			int *error);
 int mbsys_hdcs_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
 			int *kind, int *nbath, int *namp, int *nss, int *error);
+int mbsys_hdcs_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
+                        int *sonartype, int *error);
+int mbsys_hdcs_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
+                        int *ss_type, int *error);
 int mbsys_hdcs_extract(int verbose, void *mbio_ptr, void *store_ptr,
 			int *kind, int time_i[7], double *time_d,
 			double *navlon, double *navlat,
diff --git a/src/mbio/mbsys_hs10.c b/src/mbio/mbsys_hs10.c
index 044baaf..ed9880b 100644
--- a/src/mbio/mbsys_hs10.c
+++ b/src/mbio/mbsys_hs10.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hs10.c	12/4/00
- *	$Id: mbsys_hs10.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_hs10.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -59,7 +59,7 @@
 #include "mb_define.h"
 #include "mbsys_hs10.h"
 
-static char rcs_id[]="$Id: mbsys_hs10.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_hs10.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_hs10_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_hs10.h b/src/mbio/mbsys_hs10.h
index fff4a8e..46ec38b 100644
--- a/src/mbio/mbsys_hs10.h
+++ b/src/mbio/mbsys_hs10.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hs10.h	12/4/00
- *	$Id: mbsys_hs10.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_hs10.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_hsds.c b/src/mbio/mbsys_hsds.c
index 28479d5..10350e5 100644
--- a/src/mbio/mbsys_hsds.c
+++ b/src/mbio/mbsys_hsds.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hsds.c	3/2/93
- *	$Id: mbsys_hsds.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_hsds.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -147,7 +147,7 @@
 #include "mb_define.h"
 #include "mbsys_hsds.h"
 
-static char rcs_id[]="$Id: mbsys_hsds.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_hsds.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_hsds_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_hsds.h b/src/mbio/mbsys_hsds.h
index ed8fed7..6154caf 100644
--- a/src/mbio/mbsys_hsds.h
+++ b/src/mbio/mbsys_hsds.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hsds.h	2/16/93
- *	$Id: mbsys_hsds.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_hsds.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_hsmd.c b/src/mbio/mbsys_hsmd.c
index 19fe893..3f828f4 100644
--- a/src/mbio/mbsys_hsmd.c
+++ b/src/mbio/mbsys_hsmd.c
@@ -2,7 +2,7 @@
  *    The MB-system:	mbsys_hsmd.c	Aug 10, 1995
  *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbsys_hsmd.c,v 5.6 2005/11/05 00:48:03 caress Exp $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -114,7 +114,7 @@
 #include "mb_define.h"
 #include "mbsys_hsmd.h"
 
-static char rcs_id[]="$Id: mbsys_hsmd.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_hsmd.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_hsmd_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_hsmd.h b/src/mbio/mbsys_hsmd.h
index f82dbac..6d490fa 100644
--- a/src/mbio/mbsys_hsmd.h
+++ b/src/mbio/mbsys_hsmd.h
@@ -2,7 +2,7 @@
  *    The MB-system:	mbsys_hsmd.h	8/12/95
  *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbsys_hsmd.h,v 5.5 2005/11/05 00:48:04 caress Exp $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_hysweep.c b/src/mbio/mbsys_hysweep.c
index 60f81b4..6efe24f 100644
--- a/src/mbio/mbsys_hysweep.c
+++ b/src/mbio/mbsys_hysweep.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hysweep.c	3.00	12/23/2011
- *	$Id: mbsys_hysweep.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_hysweep.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2011-2014 by
+ *    Copyright (c) 2011-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -39,7 +39,7 @@
 /* turn on debug statements here */
 /* #define MSYS_HYSWEEP_DEBUG 1 */
 
-static char rcs_id[]="$Id: mbsys_hysweep.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mbsys_hysweep.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_hysweep_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_hysweep.h b/src/mbio/mbsys_hysweep.h
index bff04f0..8776bd1 100644
--- a/src/mbio/mbsys_hysweep.h
+++ b/src/mbio/mbsys_hysweep.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_hysweep.h	12/23/2011
- *	$Id: mbsys_hysweep.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_hysweep.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2011-2014 by
+ *    Copyright (c) 2011-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,7 +23,6 @@
  * Author:	D. W. Caress (MBARI)
  * Date:	December 23, 2011
  *
- * $Log: mbsys_hysweep.h,v $
  *
  */
 /*
@@ -859,6 +858,10 @@ int mbsys_hysweep_deall(int verbose, void *mbio_ptr, void **store_ptr,
 			int *error);
 int mbsys_hysweep_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
 			int *kind, int *nbath, int *namp, int *nss, int *error);
+int mbsys_hysweep_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
+                        int *sonartype, int *error);
+int mbsys_hysweep_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
+                        int *ss_type, int *error);
 int mbsys_hysweep_pingnumber(int verbose, void *mbio_ptr,
 		int *pingnumber, int *error);
 int mbsys_hysweep_extract(int verbose, void *mbio_ptr, void *store_ptr,
diff --git a/src/mbio/mbsys_image83p.c b/src/mbio/mbsys_image83p.c
index 5cbb352..a6cdaeb 100644
--- a/src/mbio/mbsys_image83p.c
+++ b/src/mbio/mbsys_image83p.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_image83p.c	5/5/2008
- *	$Id: mbsys_image83p.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_image83p.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -51,7 +51,7 @@
 #include "mb_define.h"
 #include "mbsys_image83p.h"
 
- static char rcs_id[]="$Id: mbsys_image83p.c 2175 2014-03-18 23:03:39Z caress $";
+ static char rcs_id[]="$Id: mbsys_image83p.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_image83p_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_image83p.h b/src/mbio/mbsys_image83p.h
index 5e1d86b..fca6b52 100644
--- a/src/mbio/mbsys_image83p.h
+++ b/src/mbio/mbsys_image83p.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_image83p.h	5/5/2008
- *	$Id: mbsys_image83p.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_image83p.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_jstar.c b/src/mbio/mbsys_jstar.c
index 7a48948..ff009ed 100644
--- a/src/mbio/mbsys_jstar.c
+++ b/src/mbio/mbsys_jstar.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_jstar.c	10/4/94
- *	$Id: mbsys_jstar.c 2195 2014-07-10 00:10:27Z caress $
+ *	$Id: mbsys_jstar.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2005-2014 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -61,7 +61,7 @@
 #include "mb_segy.h"
 #include "mbsys_jstar.h"
 
-static char rcs_id[]="$Id: mbsys_jstar.c 2195 2014-07-10 00:10:27Z caress $";
+static char rcs_id[]="$Id: mbsys_jstar.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_jstar_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_jstar.h b/src/mbio/mbsys_jstar.h
index a7b6223..e492910 100644
--- a/src/mbio/mbsys_jstar.h
+++ b/src/mbio/mbsys_jstar.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_jstar.h	2/21/2005
- *	$Id: mbsys_jstar.h 2195 2014-07-10 00:10:27Z caress $
+ *	$Id: mbsys_jstar.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2005-2014 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_ldeoih.c b/src/mbio/mbsys_ldeoih.c
index ae3dbf5..450ba45 100644
--- a/src/mbio/mbsys_ldeoih.c
+++ b/src/mbio/mbsys_ldeoih.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_ldeoih.c	2/26/93
- *	$Id: mbsys_ldeoih.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_ldeoih.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -36,7 +36,7 @@
 #include "mb_define.h"
 #include "mbsys_ldeoih.h"
 
-static char rcs_id[]="$Id: mbsys_ldeoih.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mbsys_ldeoih.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_ldeoih_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_ldeoih.h b/src/mbio/mbsys_ldeoih.h
index 839e823..70acd1a 100644
--- a/src/mbio/mbsys_ldeoih.h
+++ b/src/mbio/mbsys_ldeoih.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_ldeoih.h	3/2/93
- *	$Id: mbsys_ldeoih.h 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_ldeoih.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_mr1.c b/src/mbio/mbsys_mr1.c
index 253f99d..11c1b6c 100644
--- a/src/mbio/mbsys_mr1.c
+++ b/src/mbio/mbsys_mr1.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mr1.c	7/19/94
- *	$Id: mbsys_mr1.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_mr1.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -131,7 +131,7 @@
 #include "mb_define.h"
 #include "mbsys_mr1.h"
 
- static char rcs_id[]="$Id: mbsys_mr1.c 2175 2014-03-18 23:03:39Z caress $";
+ static char rcs_id[]="$Id: mbsys_mr1.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_mr1_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_mr1.h b/src/mbio/mbsys_mr1.h
index 226fb28..d77f9bb 100644
--- a/src/mbio/mbsys_mr1.h
+++ b/src/mbio/mbsys_mr1.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mr1.h	7/19/94
- *	$Id: mbsys_mr1.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_mr1.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_mr1b.c b/src/mbio/mbsys_mr1b.c
index 8be63cc..07cdd68 100644
--- a/src/mbio/mbsys_mr1b.c
+++ b/src/mbio/mbsys_mr1b.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mr1b.c	7/19/94
- *	$Id: mbsys_mr1b.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_mr1b.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -105,7 +105,7 @@
 #include "mb_define.h"
 #include "mbsys_mr1b.h"
 
- static char rcs_id[]="$Id: mbsys_mr1b.c 2175 2014-03-18 23:03:39Z caress $";
+ static char rcs_id[]="$Id: mbsys_mr1b.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_mr1b_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_mr1b.h b/src/mbio/mbsys_mr1b.h
index 416dff6..be58357 100644
--- a/src/mbio/mbsys_mr1b.h
+++ b/src/mbio/mbsys_mr1b.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mr1b.h	7/19/94
- *	$Id: mbsys_mr1b.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_mr1b.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_mr1v2001.c b/src/mbio/mbsys_mr1v2001.c
index 03c65b0..1e903ef 100644
--- a/src/mbio/mbsys_mr1v2001.c
+++ b/src/mbio/mbsys_mr1v2001.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mr1v2001.c	3/6/2003
- *	$Id: mbsys_mr1v2001.c 2188 2014-05-31 10:00:02Z caress $
+ *	$Id: mbsys_mr1v2001.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -52,7 +52,7 @@
 #include "mbbs.h"
 #include "mbsys_mr1v2001.h"
 
- static char rcs_id[]="$Id: mbsys_mr1v2001.c 2188 2014-05-31 10:00:02Z caress $";
+ static char rcs_id[]="$Id: mbsys_mr1v2001.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_mr1v2001_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_mr1v2001.h b/src/mbio/mbsys_mr1v2001.h
index 5c3153b..08da5cc 100644
--- a/src/mbio/mbsys_mr1v2001.h
+++ b/src/mbio/mbsys_mr1v2001.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mr1v2001.h	3/6/2003
- *	$Id: mbsys_mr1v2001.h 2188 2014-05-31 10:00:02Z caress $
+ *	$Id: mbsys_mr1v2001.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_mstiff.c b/src/mbio/mbsys_mstiff.c
index c97aba2..6417ee1 100644
--- a/src/mbio/mbsys_mstiff.c
+++ b/src/mbio/mbsys_mstiff.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mstiff.c	4/10/98
- *	$Id: mbsys_mstiff.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_mstiff.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -75,7 +75,7 @@
 #include "mb_define.h"
 #include "mbsys_mstiff.h"
 
-static char rcs_id[]="$Id: mbsys_mstiff.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_mstiff.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_mstiff_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_mstiff.h b/src/mbio/mbsys_mstiff.h
index 9bda5db..14b7206 100644
--- a/src/mbio/mbsys_mstiff.h
+++ b/src/mbio/mbsys_mstiff.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_mstiff.h	4/10/98
- *	$Id: mbsys_mstiff.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_mstiff.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_navnetcdf.c b/src/mbio/mbsys_navnetcdf.c
index 01d6006..b7513d9 100644
--- a/src/mbio/mbsys_navnetcdf.c
+++ b/src/mbio/mbsys_navnetcdf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_navnetcdf.c	4/11/2002
- *	$Id: mbsys_navnetcdf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_navnetcdf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -58,7 +58,7 @@
 #include "mb_define.h"
 #include "mbsys_navnetcdf.h"
 
-static char rcs_id[]="$Id: mbsys_navnetcdf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_navnetcdf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_navnetcdf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_navnetcdf.h b/src/mbio/mbsys_navnetcdf.h
index 72567a0..5102ec5 100644
--- a/src/mbio/mbsys_navnetcdf.h
+++ b/src/mbio/mbsys_navnetcdf.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_navnetcdf.h	5/4/2002
- *	$Id: mbsys_navnetcdf.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_navnetcdf.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_netcdf.c b/src/mbio/mbsys_netcdf.c
index 72ef0dc..8d47b14 100644
--- a/src/mbio/mbsys_netcdf.c
+++ b/src/mbio/mbsys_netcdf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_netcdf.c	4/11/2002
- *	$Id: mbsys_netcdf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_netcdf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -71,7 +71,7 @@
 #include "mb_define.h"
 #include "mbsys_netcdf.h"
 
-static char rcs_id[]="$Id: mbsys_netcdf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_netcdf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_netcdf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_netcdf.h b/src/mbio/mbsys_netcdf.h
index 95a1c68..cd1ff4f 100644
--- a/src/mbio/mbsys_netcdf.h
+++ b/src/mbio/mbsys_netcdf.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_netcdf.h	4/8/2002
- *	$Id: mbsys_netcdf.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_netcdf.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_oic.c b/src/mbio/mbsys_oic.c
index 509835e..c7772d7 100644
--- a/src/mbio/mbsys_oic.c
+++ b/src/mbio/mbsys_oic.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_oic.c	3/1/99
- *	$Id: mbsys_oic.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_oic.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -77,7 +77,7 @@
 #include "mb_define.h"
 #include "mbsys_oic.h"
 
-static char rcs_id[]="$Id: mbsys_oic.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_oic.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_oic_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_oic.h b/src/mbio/mbsys_oic.h
index 655ae0d..13c520f 100644
--- a/src/mbio/mbsys_oic.h
+++ b/src/mbio/mbsys_oic.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_oic.h	3/1/99
- *	$Id: mbsys_oic.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_oic.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_reson.c b/src/mbio/mbsys_reson.c
index 3cbdfc8..08bacde 100644
--- a/src/mbio/mbsys_reson.c
+++ b/src/mbio/mbsys_reson.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_reson.c	3.00	8/20/94
- *	$Id: mbsys_reson.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_reson.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -127,7 +127,7 @@
 #include "mb_define.h"
 #include "mbsys_reson.h"
 
-static char rcs_id[]="$Id: mbsys_reson.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_reson.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_reson_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_reson.h b/src/mbio/mbsys_reson.h
index 49f2193..29584b5 100644
--- a/src/mbio/mbsys_reson.h
+++ b/src/mbio/mbsys_reson.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_reson.h	8/20/94
- *	$Id: mbsys_reson.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_reson.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_reson7k.c b/src/mbio/mbsys_reson7k.c
index 393dc2a..607c752 100644
--- a/src/mbio/mbsys_reson7k.c
+++ b/src/mbio/mbsys_reson7k.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_reson7k.c	3.00	3/23/2004
- *	$Id: mbsys_reson7k.c 2220 2015-01-22 18:53:26Z caress $
+ *	$Id: mbsys_reson7k.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -44,7 +44,7 @@
 /* turn on debug statements here */
 /* #define MSYS_RESON7KR_DEBUG 1 */
 
-static char rcs_id[]="$Id: mbsys_reson7k.c 2220 2015-01-22 18:53:26Z caress $";
+static char rcs_id[]="$Id: mbsys_reson7k.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_reson7k_zero7kheader(int verbose, s7k_header	*header,
diff --git a/src/mbio/mbsys_reson7k.h b/src/mbio/mbsys_reson7k.h
index 0275094..9b84cd6 100644
--- a/src/mbio/mbsys_reson7k.h
+++ b/src/mbio/mbsys_reson7k.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_reson7k.h	3/3/2004
- *	$Id: mbsys_reson7k.h 2220 2015-01-22 18:53:26Z caress $
+ *	$Id: mbsys_reson7k.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -20,8 +20,6 @@
  * Author:	D. W. Caress
  * Date:	March 3, 2004
  *
- * $Log: mbsys_reson7k.h,v $
- *
  *
  */
 /*
@@ -2435,6 +2433,8 @@ struct mbsys_reson7k_struct
 int mbsys_reson7k_checkheader(s7k_header header);
 
 /* system specific function prototypes */
+int mbsys_reson7k_zero7kheader(int verbose, s7k_header	*header,
+			int *error);
 int mbsys_reson7k_alloc(int verbose, void *mbio_ptr, void **store_ptr,
 			int *error);
 int mbsys_reson7k_survey_alloc(int verbose,
diff --git a/src/mbio/mbsys_reson8k.c b/src/mbio/mbsys_reson8k.c
index f7a5bdd..0b3860b 100644
--- a/src/mbio/mbsys_reson8k.c
+++ b/src/mbio/mbsys_reson8k.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_reson8k.c	3.00	8/20/94
- *	$Id: mbsys_reson8k.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_reson8k.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -64,7 +64,7 @@
 #include "mb_define.h"
 #include "mbsys_reson8k.h"
 
-static char rcs_id[]="$Id: mbsys_reson8k.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_reson8k.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_reson8k_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_reson8k.h b/src/mbio/mbsys_reson8k.h
index 0dece0e..9a1b342 100644
--- a/src/mbio/mbsys_reson8k.h
+++ b/src/mbio/mbsys_reson8k.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_reson.h	8/20/94
- *	$Id: mbsys_reson8k.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_reson8k.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_sb.c b/src/mbio/mbsys_sb.c
index 6a40a5d..b1d5aae 100644
--- a/src/mbio/mbsys_sb.c
+++ b/src/mbio/mbsys_sb.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_sb.c	2/26/93
- *	$Id: mbsys_sb.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_sb.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -135,7 +135,7 @@
 #include "mb_define.h"
 #include "mbsys_sb.h"
 
-static char rcs_id[]="$Id: mbsys_sb.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_sb.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_sb_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_sb.h b/src/mbio/mbsys_sb.h
index 8f9153a..92da8ab 100644
--- a/src/mbio/mbsys_sb.h
+++ b/src/mbio/mbsys_sb.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_sb.h	2/17/93
- *	$Id: mbsys_sb.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_sb.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_sb2000.c b/src/mbio/mbsys_sb2000.c
index 2f7a3d3..75ea40b 100644
--- a/src/mbio/mbsys_sb2000.c
+++ b/src/mbio/mbsys_sb2000.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_sb2000.c	10/4/94
- *	$Id: mbsys_sb2000.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_sb2000.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -132,7 +132,7 @@
 #include "mb_define.h"
 #include "mbsys_sb2000.h"
 
-static char rcs_id[]="$Id: mbsys_sb2000.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_sb2000.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_sb2000_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_sb2000.h b/src/mbio/mbsys_sb2000.h
index a3c4237..3612ae2 100644
--- a/src/mbio/mbsys_sb2000.h
+++ b/src/mbio/mbsys_sb2000.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_sb2000.h	10/4/94
- *	$Id: mbsys_sb2000.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_sb2000.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_sb2100.c b/src/mbio/mbsys_sb2100.c
index 081e5a0..14c4261 100644
--- a/src/mbio/mbsys_sb2100.c
+++ b/src/mbio/mbsys_sb2100.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_sb2100.c	3/2/94
- *	$Id: mbsys_sb2100.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_sb2100.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -145,7 +145,7 @@
 #include "mb_define.h"
 #include "mbsys_sb2100.h"
 
-static char rcs_id[]="$Id: mbsys_sb2100.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_sb2100.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_sb2100_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_sb2100.h b/src/mbio/mbsys_sb2100.h
index 4e7f8f6..f512caf 100644
--- a/src/mbio/mbsys_sb2100.h
+++ b/src/mbio/mbsys_sb2100.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_sb2100.h	2/4/94
- *	$Id: mbsys_sb2100.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_sb2100.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_simrad.c b/src/mbio/mbsys_simrad.c
index 226c3cc..ef8e369 100644
--- a/src/mbio/mbsys_simrad.c
+++ b/src/mbio/mbsys_simrad.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_simrad.c	3.00	8/5/94
- *	$Id: mbsys_simrad.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_simrad.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -183,7 +183,7 @@
 #define MBSYS_SIMRAD_C
 #include "mbsys_simrad.h"
 
-static char rcs_id[]="$Id: mbsys_simrad.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_simrad.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_simrad_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_simrad.h b/src/mbio/mbsys_simrad.h
index 988693b..b822741 100644
--- a/src/mbio/mbsys_simrad.h
+++ b/src/mbio/mbsys_simrad.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_simrad.h	8/5/94
- *	$Id: mbsys_simrad.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_simrad.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1994-2014 by
+ *    Copyright (c) 1994-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_simrad2.c b/src/mbio/mbsys_simrad2.c
index c240fc6..cc39f9e 100644
--- a/src/mbio/mbsys_simrad2.c
+++ b/src/mbio/mbsys_simrad2.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_simrad2.c	3.00	10/9/98
- *	$Id: mbsys_simrad2.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_simrad2.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -161,7 +161,7 @@
 #include "mb_define.h"
 #include "mbsys_simrad2.h"
 
-static char rcs_id[]="$Id: mbsys_simrad2.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_simrad2.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_simrad2_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_simrad2.h b/src/mbio/mbsys_simrad2.h
index 074b896..659a17c 100644
--- a/src/mbio/mbsys_simrad2.h
+++ b/src/mbio/mbsys_simrad2.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_simrad2.h		10/9/98
- *	$Id: mbsys_simrad2.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_simrad2.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1998-2014 by
+ *    Copyright (c) 1998-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_simrad3.c b/src/mbio/mbsys_simrad3.c
index 76714ce..53a850e 100644
--- a/src/mbio/mbsys_simrad3.c
+++ b/src/mbio/mbsys_simrad3.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_simrad3.c	3.00	2/22/2008
- *	$Id: mbsys_simrad3.c 2209 2014-11-04 08:54:21Z caress $
+ *	$Id: mbsys_simrad3.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -65,7 +65,7 @@
 #include "mb_define.h"
 #include "mbsys_simrad3.h"
 
-static char rcs_id[]="$Id: mbsys_simrad3.c 2209 2014-11-04 08:54:21Z caress $";
+static char rcs_id[]="$Id: mbsys_simrad3.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_simrad3_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_simrad3.h b/src/mbio/mbsys_simrad3.h
index ced7400..37b64ac 100644
--- a/src/mbio/mbsys_simrad3.h
+++ b/src/mbio/mbsys_simrad3.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_simrad3.h	2/22/2008
- *	$Id: mbsys_simrad3.h 2209 2014-11-04 08:54:21Z caress $
+ *	$Id: mbsys_simrad3.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_singlebeam.c b/src/mbio/mbsys_singlebeam.c
index e7e670e..95c89b5 100644
--- a/src/mbio/mbsys_singlebeam.c
+++ b/src/mbio/mbsys_singlebeam.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_singlebeam.c	4/13/99
- *	$Id: mbsys_singlebeam.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_singlebeam.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -93,7 +93,7 @@
 #include "mb_define.h"
 #include "mbsys_singlebeam.h"
 
-static char rcs_id[]="$Id: mbsys_singlebeam.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_singlebeam.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_singlebeam_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_singlebeam.h b/src/mbio/mbsys_singlebeam.h
index 1fc3288..c8f9dbb 100644
--- a/src/mbio/mbsys_singlebeam.h
+++ b/src/mbio/mbsys_singlebeam.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_singlebeam.h	4/13/93
- *	$Id: mbsys_singlebeam.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_singlebeam.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1999-2014 by
+ *    Copyright (c) 1999-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_stereopair.c b/src/mbio/mbsys_stereopair.c
index 3b4b5ce..6e0eacb 100644
--- a/src/mbio/mbsys_stereopair.c
+++ b/src/mbio/mbsys_stereopair.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_stereopair.c	3.00	11/22/2014
- *	$Id: mbsys_stereopair.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_stereopair.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -37,7 +37,7 @@
 #include "mb_define.h"
 #include "mbsys_stereopair.h"
 
-static char version_id[]="$Id: mbsys_stereopair.c 2215 2014-11-29 22:21:19Z caress $";
+static char version_id[]="$Id: mbsys_stereopair.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_stereopair_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_stereopair.h b/src/mbio/mbsys_stereopair.h
index 65f2df9..1e04d94 100644
--- a/src/mbio/mbsys_stereopair.h
+++ b/src/mbio/mbsys_stereopair.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_stereopair.h	11/22/2014
- *	$Id: mbsys_stereopair.h 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_stereopair.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -267,13 +267,13 @@ int mbsys_stereopair_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
 			double *angles_forward, double *angles_null,
 			double *heave, double *alongtrack_offset,
 			double *draft, double *ssv, int *error);
-//int mbsys_stereopair_detects(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nbeams, int *detects, int *error);
+int mbsys_stereopair_detects(int verbose, void *mbio_ptr, void *store_ptr,
+			int *kind, int *nbeams, int *detects, int *error);
 //int mbsys_stereopair_pulses(int verbose, void *mbio_ptr, void *store_ptr,
 //                        int *kind, int *nbeams, int *pulses, int *error);
-//int mbsys_stereopair_gains(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, double *transmit_gain, double *pulse_length,
-//			double *receive_gain, int *error);
+int mbsys_stereopair_gains(int verbose, void *mbio_ptr, void *store_ptr,
+			int *kind, double *transmit_gain, double *pulse_length,
+			double *receive_gain, int *error);
 //int mbsys_stereopair_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
 //			int *kind, int *nrawss,
 //			double *rawss,
diff --git a/src/mbio/mbsys_surf.c b/src/mbio/mbsys_surf.c
index 75bcd32..8ce9b7b 100644
--- a/src/mbio/mbsys_surf.c
+++ b/src/mbio/mbsys_surf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_surf.c	3.00	6/25/01
- *	$Id: mbsys_surf.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_surf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -74,7 +74,7 @@ double mbsys_get_depth(	SurfMultiBeamDepth* 			MultiBeamDepth,
 						float	heave,
 						int		n );
 
-static char rcs_id[]="$Id: mbsys_surf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_surf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_surf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_surf.h b/src/mbio/mbsys_surf.h
index 8171e05..7b684a4 100644
--- a/src/mbio/mbsys_surf.h
+++ b/src/mbio/mbsys_surf.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_surf.h	6/13/02
- *	$Id: mbsys_surf.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_surf.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_swathplus.c b/src/mbio/mbsys_swathplus.c
index 6510b01..d69378d 100644
--- a/src/mbio/mbsys_swathplus.c
+++ b/src/mbio/mbsys_swathplus.c
@@ -1,8 +1,8 @@
 /*-------------------------------------------------------------------
  *    The MB-system:	mbsys_swathplus.c	3.00	1/27/2014
- *	$Id: mbsys_swathplus.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_swathplus.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -45,9 +45,17 @@ static int get_sxp_heave(int verbose, swpls_sxpping *sxp_sxpping, double *heave,
 	int *error);
 static int set_sxp_height(int verbose, double heave, swpls_sxpping *sxp_ping,
 	int *error);
+int swpls_angles_to_quat(int verbose, const swpls_angles *orientation,
+	swpls_quaternion *q, int *error);
+int swpls_quat_to_angles(int verbose, const swpls_quaternion *q,
+	swpls_angles *orientation, int *error);
+int swpls_slerp(int verbose, const swpls_quaternion *q0,
+	const swpls_quaternion *q1, double t, swpls_quaternion *q,
+	int *error);
+static double wrap_pi(double theta);
 
 static char rcs_id[] =
-	"$Id: mbsys_swathplus.c 2215 2014-11-29 22:21:19Z caress $";
+	"$Id: mbsys_swathplus.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_swathplus_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_swathplus.h b/src/mbio/mbsys_swathplus.h
index f29726b..5b4f676 100644
--- a/src/mbio/mbsys_swathplus.h
+++ b/src/mbio/mbsys_swathplus.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_swathplus.h	1/28/2014
- *	$Id: mbsys_swathplus.h 2183 2014-04-16 19:54:45Z caress $
+ *	$Id: mbsys_swathplus.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_templatesystem.c b/src/mbio/mbsys_templatesystem.c
index d96bf21..39ba797 100644
--- a/src/mbio/mbsys_templatesystem.c
+++ b/src/mbio/mbsys_templatesystem.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_templatesystem.c	3.00	1/27/2014
- *	$Id: mbsys_templatesystem.c 2166 2014-02-19 22:44:10Z caress $
+ *	$Id: mbsys_templatesystem.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -37,7 +37,7 @@
 #include "mb_define.h"
 #include "mbsys_templatesystem.h"
 
-static char version_id[]="$Id: mbsys_templatesystem.c 2166 2014-02-19 22:44:10Z caress $";
+static char version_id[]="$Id: mbsys_templatesystem.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_templatesystem_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_templatesystem.h b/src/mbio/mbsys_templatesystem.h
index a9d5660..8916ac0 100644
--- a/src/mbio/mbsys_templatesystem.h
+++ b/src/mbio/mbsys_templatesystem.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_templatesystem.h	1/28/2014
- *	$Id: mbsys_templatesystem.h 2166 2014-02-19 22:44:10Z caress $
+ *	$Id: mbsys_templatesystem.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/mbsys_wassp.c b/src/mbio/mbsys_wassp.c
index dd0052a..ba08ee5 100644
--- a/src/mbio/mbsys_wassp.c
+++ b/src/mbio/mbsys_wassp.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_wassp.c	3.00	1/27/2014
- *	$Id: mbsys_wassp.c 2215 2014-11-29 22:21:19Z caress $
+ *	$Id: mbsys_wassp.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -37,7 +37,7 @@
 #include "mb_define.h"
 #include "mbsys_wassp.h"
 
-static char version_id[]="$Id: mbsys_wassp.c 2215 2014-11-29 22:21:19Z caress $";
+static char version_id[]="$Id: mbsys_wassp.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_wassp_alloc(int verbose, void *mbio_ptr, void **store_ptr,
@@ -53,6 +53,8 @@ int mbsys_wassp_alloc(int verbose, void *mbio_ptr, void **store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 
@@ -87,6 +89,8 @@ int mbsys_wassp_alloc(int verbose, void *mbio_ptr, void **store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -117,6 +121,8 @@ int mbsys_wassp_deall(int verbose, void *mbio_ptr, void **store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
         
@@ -139,6 +145,8 @@ int mbsys_wassp_deall(int verbose, void *mbio_ptr, void **store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 	
@@ -155,6 +163,11 @@ int mbsys_wassp_deall(int verbose, void *mbio_ptr, void **store_ptr,
 		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(wcd_navi->wcdata_mag), error);
 		wcd_navi->wcdata_alloc = 0;
 		}
+	if (sensprop->n_alloc > 0)
+		{
+		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(sensprop->sensors), error);
+		sensprop->n_alloc = 0;
+		}
 	if (sys_cfg1->sys_cfg1_data_alloc > 0)
 		{
 		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(sys_cfg1->sys_cfg1_data), error);
@@ -192,6 +205,8 @@ int mbsys_wassp_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 
@@ -217,6 +232,8 @@ int mbsys_wassp_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 	
@@ -270,6 +287,8 @@ int mbsys_wassp_pingnumber(int verbose, void *mbio_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 
@@ -294,6 +313,8 @@ int mbsys_wassp_pingnumber(int verbose, void *mbio_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -328,6 +349,8 @@ int mbsys_wassp_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 
@@ -353,6 +376,8 @@ int mbsys_wassp_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -394,6 +419,8 @@ int mbsys_wassp_extract(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 	double	headingx, headingy;
@@ -421,6 +448,8 @@ int mbsys_wassp_extract(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -710,6 +739,8 @@ int mbsys_wassp_insert(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 	double	headingx, headingy;
@@ -780,6 +811,8 @@ int mbsys_wassp_insert(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -884,6 +917,8 @@ int mbsys_wassp_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 	double	alpha, beta, theta, phi;
@@ -917,6 +952,8 @@ int mbsys_wassp_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -1017,6 +1054,8 @@ int mbsys_wassp_detects(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 	int	i;
@@ -1044,6 +1083,8 @@ int mbsys_wassp_detects(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -1132,6 +1173,8 @@ int mbsys_wassp_gains(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 
@@ -1157,6 +1200,8 @@ int mbsys_wassp_gains(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -1237,6 +1282,8 @@ int mbsys_wassp_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 
@@ -1262,6 +1309,8 @@ int mbsys_wassp_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -1335,6 +1384,8 @@ int mbsys_wassp_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 	int	i;
@@ -1361,6 +1412,8 @@ int mbsys_wassp_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
@@ -1499,6 +1552,8 @@ int mbsys_wassp_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
         struct mbsys_wassp_gen_sens_struct *gen_sens;
         struct mbsys_wassp_nvupdate_struct *nvupdate;
         struct mbsys_wassp_wcd_navi_struct *wcd_navi;
+        struct mbsys_wassp_sensprop_struct *sensprop;
+        struct mbsys_wassp_sys_prop_struct *sys_prop;
 	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
 	struct mbsys_wassp_mcomment_struct *mcomment;
 	int	i;
@@ -1541,6 +1596,8 @@ int mbsys_wassp_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
         gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
         nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
         wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
+        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
+        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
         sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
         mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
 
diff --git a/src/mbio/mbsys_wassp.h b/src/mbio/mbsys_wassp.h
index 2689610..06d8892 100644
--- a/src/mbio/mbsys_wassp.h
+++ b/src/mbio/mbsys_wassp.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_wassp.h	1/28/2014
- *	$Id: mbsys_wassp.h 2166 2014-02-19 22:44:10Z caress $
+ *	$Id: mbsys_wassp.h 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -28,6 +28,7 @@
  *   1. This MBIO format supports the generic interface message output
  *      by the ENL WASSP multibeam sonars.
  *   2. Reference: WASSP Generic ICD 2.2, 15 October 2013.
+ *   2.            WASSP Generic ICD 2.4, 17 February 2015.
  *   3. The WASSP data stream consists of several different data
  *      records that can vary among models and installations.
  *   4. The WASSP multibeam models as of January 2014 incude:
@@ -52,7 +53,7 @@
  *        WCD_NAVI - Water Column Information
  *        SYS_CFG1 - Unknown record at start of file
  *                     (3224 bytes including sync and checksum)
- *   9. A sample file logged by the ENL datalogger has an 804 byte UTF-8
+ *   9. Some but not all sample files logged by the ENL datalogger have an 804 byte UTF-8
  *      header that looks like:
  *      ********************************************************************************
  *      **************************************** PM Version: 2.4.1.288****************
@@ -104,7 +105,10 @@
 #define MBSYS_WASSP_RECORD_CORBATHY     4   // Corrected Bathymetry
 #define MBSYS_WASSP_RECORD_NVUPDATE     4   // Nav Data Message
 #define MBSYS_WASSP_RECORD_WCD_NAVI     5   // Water Column Information
-#define MBSYS_WASSP_RECORD_SYS_CFG1     6   // Unknown record at start of file
+#define MBSYS_WASSP_RECORD_SENSPROP     6   // Sensor Properties
+#define MBSYS_WASSP_RECORD_SYS_PROP     7   // System Properties
+#define MBSYS_WASSP_RECORD_MCOMMENT     8   // Comment (MB-System only)
+#define MBSYS_WASSP_RECORD_SYS_CFG1     9   // Unknown record at start of some files
 
 /*---------------------------------------------------------------*/
 /* Record size definitions (if needed for use in data reading and writing) */
@@ -123,64 +127,161 @@
 struct mbsys_wassp_genbathy_struct
 	{
         /* GENBATHY Record */
+        /* Supported Products: - WMB-3250 */
         /* Uncorrected Bathymetry
          * All the bottom detection points will be supplied as range and angle values.
          * The length of the output message is variable, dependant on the number of beam data.
          * In addition to the Flags the sample number will be set to zero when detection is invalid. */
+        /* unsigned int sync; */               /* 0x77F9345A */
+        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
+        /* char         header[8]; */          /* "GENBATHY" */
         unsigned int    version;               /* 3 */
         double          msec;                  /* A millisecond time stamp of rising edge
-                                                         * of Transmit pulse in UTC time (UTC time
-                                                         * is calculated from the timestamp of the
-                                                         * ZDA sentence and or a PPS signal when
-                                                         * available) No local time zone correction
-                                                         * is applied. */
-        mb_u_char       day;                   /* UTC time from NMEA ZDA */
-        mb_u_char       month;                 /* UTC time from NMEA ZDA */
-        unsigned short  year;                  /* UTC time from NMEA ZDA */
+                                                * of Transmit pulse in UTC time (UTC time
+                                                * is calculated from the timestamp of the
+                                                * ZDA sentence and or a PPS signal when
+                                                * available) No local time zone correction
+                                                * is applied.
+                                                * On systems not supporting UTC time, this
+                                                * will be system referenced time. */
+        mb_u_char       day;                   /* UTC time from NMEA ZDA time message, if available */
+        mb_u_char       month;                 /* UTC time from NMEA ZDA time message, if available */
+        unsigned short  year;                  /* UTC time from NMEA ZDA time message, if available */
         unsigned int    ping_number;           /* Sequential number. */
-        unsigned int    sonar_model;
+        unsigned int    sonar_model;           /* unused in ICD 2.4 */
         unsigned long   transducer_serial_number;
         unsigned int    number_beams;
-        unsigned int    modeflags;
-        float           sampling_frequency;    /* Hz */
-        float           acoustic_frequency;    /* Hz */
+        unsigned int    modeflags;             /* Bit field:
+                                                *   Bit 0: Roll information is valid (not implemented)
+                                                *   Bit 1: Backscatter information is valid in beam data
+                                                *   Bits 2-31: Reserved for future use */
+        float           sampling_frequency;    /* Sonar sampling frequency (Hz) */
+        float           acoustic_frequency;    /* Sonar nominal acoustic frequency (Hz) */
         float           tx_power;              /* Voltage (volts) rms applied to
-                                                         * transmitter in dB.*/
-        float           pulse_width;           /* Pulse width in milliseconds */
+                                                * transmitter in dB. If "Sample Type" field is set
+                                                * to "un-calibrated" this will be the nominal
+                                                * power level */
+        float           pulse_width;           /* Pulse length in milliseconds */
         float           absorption_loss;       /* Configurable value applied by WASSP. */
         float           spreading_loss;        /* 0, 30 or 40 as selected by WASSP GUI,
                                                          * units dB (as function of target range
                                                          * in metres) */
-        unsigned int    sample_type;           /* Set to 0 if un-calibrated.
-                                                         * Set to 1 if calibrated. */
+        unsigned int    sample_type;           /* Set to 0 if un-calibrated. Set to 1 if calibrated.
+                                                * All dB values will be relative rather than absolute
+                                                * if ‘Sample Type’ is ‘un-calibrated’ */
         float           sound_velocity;        /* Sound velocity at the sonar head in m/s
                                                          * (that was used in beam forming) */
         float           detection_point[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Non-corrected fractional sample number
-                                                         * with the reference to the receiver’s
-                                                         * acoustic centre with the zero sample at
-                                                         * the transmit time. */
+                                                /* Non-corrected fractional sample number
+                                                 * with the reference to the receiver’s
+                                                 * acoustic centre with the zero sample at
+                                                 * the transmit time. */
         float           rx_angle[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Beam steering angle with reference to
-                                                         * receiver’s acoustic centre in the sonar
-                                                         * reference frame, at the detection point;
-                                                         * in degrees. */
+                                                /* Beam steering angle with reference to
+                                                 * receiver’s acoustic centre in the sonar
+                                                 * reference frame, at the detection point;
+                                                 * in degrees. */
         unsigned int    flags[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Bit fields:
-                                                            Bit 0: Detection Success
-                                                            Bit 1: Detection Valid
-                                                            Bit 2: WMT Detection
-                                                            Bit 3: SAC Detection
-                                                            Bits 4-31: Reserved for future use */
+                                                /* Bit fields:
+                                                    Bit 0: Detection Success
+                                                    Bit 1: Detection Valid
+                                                    Bit 2: WMT Detection
+                                                    Bit 3: SAC Detection
+                                                    Bits 4-31: Reserved for future use */
         float           backscatter[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Max target strength (dB) at seafloor on
-                                                         * this beam. */
-        unsigned int    checksum;              /* checksum format TBD */
+                                                /* Target strength (dB) at seafloor 
+                                                 * detection point on this beam. */
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
         };
 
+struct mbsys_wassp_gen_sens_struct
+	{
+        /* GEN_SENS Record */
+        /* Supported Products: - WMB-3250 */
+        /* External Sensor Data
+         * The External Sensor Data would be a WASSP time-stamped replica of the External Sensor Data
+         * (e.g. Attitude, NMEA data) received by the WASSP. This data may be required to provide a
+         * facility to undo the sensor stabilization performed by WASSP.
+         */
+        unsigned int    version;               /* 2 */
+        double          msec;                  /* A millisecond time stamp of rising edge
+                                                         * of Transmit pulse in UTC time (UTC time
+                                                         * is calculated from the timestamp of the
+                                                         * ZDA sentence and or a PPS signal when
+                                                         * available) No local time zone correction
+                                                         * is applied. */
+        unsigned int    port_number;           /* Serial port stream number (1-10) */
+        mb_u_char       message_length;        /* length of message in characters */
+        char            message[MBSYS_WASSP_MAX_MESSAGE];
+                                                        /* Copy of Sensor Data
+                                                         * Length of this field = Size – 33 (followed by
+                                                         * line feed and or carriage return characters)
+                                                         * e.g. $HEHDT,45.2,,*67 */
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
+
+struct mbsys_wassp_rawsonar_struct
+	{
+        /* RAWSONAR Record */
+        /* Supported Products: - WMB-3250 */
+        /* Raw water column data (roll stabilized sonar)
+         * This packet is only roll stabilized if the WASSP system has valid roll information available.
+         * The data contained in this packet is to be dB signal levels received by time and angle. Some
+         * filtering of the data may be applied to remove side lobes and noise. This data is likely to be
+         * a subset of the full sampling resolution of the system – less beams and less samples. The first
+         * sample of raw data is the first sampling period starting from the rising edge of the transmit
+         * pulse and ending at the end of the sampling period determined by the Sample Rate.
+         * The Spreading Loss value applied to this data can be found in the preceding GENBATHY packet.
+         */
+        unsigned int    version;                /* 2 */
+        double          msec;                   /* A millisecond time stamp of rising edge
+                                                 * of Transmit pulse in UTC time (UTC time
+                                                 * is calculated from the timestamp of the
+                                                 * ZDA sentence and or a PPS signal when
+                                                 * available) No local time zone correction
+                                                 * is applied. 
+                                                 * On systems not supporting UTC time, this
+                                                 * will be system referenced time. */
+        unsigned int    ping_number;            /* Sequential number. */
+        float           sample_rate;            /* Frequency (Hz) of raw data in this packet */
+        unsigned int    n;                      /* Number of beams of raw data in this packet */
+        unsigned int    m;                      /* Number of samples (per beam) of raw data in this packet */
+        float           tx_power;               /* Voltage (volts) rms applied to
+                                                         * transmitter in dB.*/
+        float           pulse_width;            /* Pulse length in milliseconds */
+        unsigned int    sample_type;            /* Set to 0 if un-calibrated.
+                                                         * Set to 1 if calibrated. */
+        unsigned short  spare[MBSYS_WASSP_MAX_BEAMS];
+                                                /* Unused */
+        unsigned short  beam_index[MBSYS_WASSP_MAX_BEAMS];
+                                                /* Equivalent beam Index into uncorrected bathy
+                                                 * (GENBATHY) record of each beam. */
+        unsigned int    detection_point[MBSYS_WASSP_MAX_BEAMS];
+                                                /* Index of sample which most closely matches
+                                                 * seafloor detection. 0 = not valid. */
+        float           beam_angle[MBSYS_WASSP_MAX_BEAMS];
+                                                /* Beam angle for this beam in degrees (negative
+                                                 * port side of nadir) */
+        size_t          rawdata_alloc;          /* Number of shorts allocated for rawdata array */
+        short           *rawdata;               /* If Sample Type = 0 then Signal Levels at
+                                                 * sample/beam in dB*100 (divide by 100 to get
+                                                 * actual signal level dB). The order is
+                                                 *   sample 1 x [0, 1, 2, 3, ... N] 
+                                                 *   sample 2 x [0, 1, 2, 3, ... N] 
+                                                 *   .....
+                                                 *   sample M x [0, 1, 2, 3, ... N] 
+                                                 * If Sample Type = 1 then calibrated db*100. */
+        unsigned int    checksum;               /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
+
+
 struct mbsys_wassp_corbathy_struct
 	{
         /* CORBATHY Record */
+        /* Supported Products:
+         *   WMB-3250
+         *   WMB-3230
+         *   WMB-5230 */
         /* Corrected Bathymetry
          * Use this data for use as fully corrected bathymetry data. The ships sensors
          * integrated into the WASSP correct this information for leaver arm, pitch, roll, yaw,
@@ -191,171 +292,144 @@ struct mbsys_wassp_corbathy_struct
          *      3) All points are sent for every beam even if they contain no detection data.
          *         So you can check if it is valid by checking the Y value, if this is 0 then the
          *         detection is not valid and should not be used.
-         *      4) The X,Y,Z positions are based on the fully corrected output using leaver arm,
+         *      4) The X,Y,Z positions are relative to the position in Table 5 Corrected Bathy.
+         *         This is based on the fully corrected output using lever arm,
          *         sensor data and sound speed information available. This means if the X, Y, Z
          *         offsets in the WASSP application are correct, there is no need to account for
          *         the distance between GPS antenna and transducer or any pitch/roll/heave inclination.
          *      5) Sign of Longitude is normal (East = positive)
          *      6) Depths are tide corrected unless tides are disabled in the WASSP system.
          */
-        unsigned int    version;               /* 3 */
-        double          msec;                  /* A millisecond time stamp of rising edge
-                                                         * of Transmit pulse in UTC time (UTC time
-                                                         * is calculated from the timestamp of the
-                                                         * ZDA sentence and or a PPS signal when
-                                                         * available) No local time zone correction
-                                                         * is applied. */
+        /* unsigned int sync; */               /* 0x77F9345A */
+        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
+        /* char         header[8]; */          /* "CORBATHY" */
+        unsigned int    version;               /* 3 for ICD 2.2, 4 for ICD 2.4 */
+        double          msec;                  /* Version 4: unused
+                                                * Version 3:
+                                                * A millisecond time stamp of rising edge
+                                                * of Transmit pulse in UTC time (UTC time
+                                                * is calculated from the timestamp of the
+                                                * ZDA sentence and or a PPS signal when
+                                                * available) No local time zone correction
+                                                * is applied.
+                                                * On systems not supporting UTC time, this
+                                                * will be system referenced time. */
         unsigned int    num_beams;             /* Fixed by software. Invalid points have depth set to 0.0. */
         unsigned int    ping_number;           /* Ping sequence number */
         double          latitude;              /* Latitude at transducer in degrees*/
         double          longitude;             /* Longitude at transducer in degrees */
         float           bearing;               /* Bearing/Heading of vessel on transmit in degrees */
-        float           roll;                  /* Roll of vessel on transmit in radians */
-        float           pitch;                 /* Pitch of vessel on transmit in radians */
+        float           roll;                  /* Roll of vessel on transmit in degrees */
+        float           pitch;                 /* Pitch of vessel on transmit in degrees */
         float           heave;                 /* Heave of vessel on transmit at transducer in meters */
         unsigned int    sample_type;           /* Set to 0 if un-calibrated. Set to 1 if calibrated. */
-        unsigned int    spare[6];
+        float           tide;                  /* Tide adjustment applied in meters */
+        unsigned int    spare[5];
         unsigned int    beam_index[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Beam index number */
+                                                /* Beam index number */
         float           x[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Distance to detection point in metres laterally along
-                                                         * west/east axis. East of vessel is positive. */
+                                                /* Distance to detection point in metres laterally along
+                                                 * west/east axis. East of position is positive. */
         float           y[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Distance to detection point in metres laterally along
-                                                         * north/south axis. South of vessel is positive. */
+                                                /* Distance to detection point in metres laterally along
+                                                 * north/south axis. South of position is positive. */
         float           z[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Depth in meters for the detection point. –ve = down.
-                                                         * 0 = not valid */
+                                                /* Depth in meters for the detection point. –ve = down.
+                                                 * 0 = not valid */
         float           beam_angle[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Angle of the beam this detection appears on in radians
-                                                         * positive for starboard side of vessel. */
+                                                /* Angle of the beam this detection appears on in radians
+                                                 * positive for starboard side of vessel. */
         float           backscatter[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Max target strength (dB) at seafloor on this beam. */
+                                                /* Post-processed target strength (dB) at seafloor on this beam. */
         mb_u_char       quality[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Detection information - (0=none, 1=WMT, 2=SAC) */
+                                                /* Detection information - (0=none, 1=WMT, 2=SAC) */
         mb_u_char       fish[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Fish intensity value for all fish targets vertically above
-                                                         * detection point. */
+                                                /* Fish intensity value for all fish targets vertically above
+                                                 * detection point. */
         mb_u_char       roughness[MBSYS_WASSP_MAX_BEAMS]; /* Unused */
         mb_u_char       empty[MBSYS_WASSP_MAX_BEAMS];   /* Unused */
         unsigned int    pad[MBSYS_WASSP_MAX_BEAMS];     /* Unused */
-        unsigned int    checksum;               /* checksum format TBD */
-       };
-
-struct mbsys_wassp_rawsonar_struct
-	{
-        /* RAWSONAR Record */
-        /* Raw water column data (roll stabilized sonar)
-         * This packet is only roll stabilized if the WASSP system has valid roll information available.
-         * The data contained in this packet is to be dB signal levels received by time and angle. Some
-         * filtering of the data may be applied to remove side lobes and noise. This data is likely to be
-         * a subset of the full sampling resolution of the system – less beams and less samples. The first
-         * sample of raw data is the first sampling period starting from the rising edge of the transmit
-         * pulse and ending at the end of the sampling period determined by the Sample Rate.
-         */
-        unsigned int    version;               /* 2 */
-        double          msec;                  /* A millisecond time stamp of rising edge
-                                                         * of Transmit pulse in UTC time (UTC time
-                                                         * is calculated from the timestamp of the
-                                                         * ZDA sentence and or a PPS signal when
-                                                         * available) No local time zone correction
-                                                         * is applied. */
-        unsigned int    ping_number;           /* Sequential number. */
-        float           sample_rate;           /* Frequency (Hz) of raw data in this packet */
-        unsigned int    n;                     /* Number of beams of raw data in this packet */
-        unsigned int    m;                     /* Number of samples (per beam) of raw data in this packet */
-        float           tx_power;              /* Voltage (volts) rms applied to
-                                                         * transmitter in dB.*/
-        float           pulse_width;           /* Pulse width in milliseconds */
-        unsigned int    sample_type;           /* Set to 0 if un-calibrated.
-                                                         * Set to 1 if calibrated. */
-        unsigned short  spare[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Set to 0 until assigned a function */
-        unsigned short  beam_index[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Equivalent beam Index into uncorrected bathy
-                                                         * (GENBATHY) record of each beam. */
-        unsigned int    detection_point[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Index of sample which most closely matches
-                                                         * seafloor detection. 0 = not valid. */
-        float           beam_angle[MBSYS_WASSP_MAX_BEAMS];
-                                                        /* Beam angle for this beam in degrees (negative
-                                                         * port side of nadir) */
-        size_t          rawdata_alloc;         /* Number of shorts allocated for rawdata array */
-        short           *rawdata;              /* If Sample Type = 0 then Signal Levels at
-                                                         * sample/beam in dB*100 (divide by 100 to get
-                                                         * actual signal level dB). The order is N x sample 1
-                                                         * then N x sample 2... etc. If Sample Type = 1
-                                                         * then calibrated db*100. */
-        unsigned int    checksum;              /* checksum format TBD */
-       };
-
-struct mbsys_wassp_gen_sens_struct
-	{
-        /* GEN_SENS Record */
-        /* External Sensor Data
-         * The External Sensor Data would be a WASSP time-stamped replica of the External Sensor Data
-         * (e.g. Attitude, NMEA data) received by the WASSP. This data may be required to provide a
-         * facility to undo the sensor stabilization performed by WASSP.
-         */
-        unsigned int    version;               /* 2 */
-        double          msec;                  /* A millisecond time stamp of rising edge
-                                                         * of Transmit pulse in UTC time (UTC time
-                                                         * is calculated from the timestamp of the
-                                                         * ZDA sentence and or a PPS signal when
-                                                         * available) No local time zone correction
-                                                         * is applied. */
-        unsigned int    port_number;           /* Serial port stream number (1-10) */
-        mb_u_char       message_length;        /* length of message in characters */
-        char            message[MBSYS_WASSP_MAX_MESSAGE];
-                                                        /* Copy of Sensor Data
-                                                         * Length of this field = Size – 33 (followed by
-                                                         * line feed and or carriage return characters)
-                                                         * e.g. $HEHDT,45.2,,*67 */
-        unsigned int    checksum;              /* checksum format TBD */
-       };
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
 
 struct mbsys_wassp_nvupdate_struct
 	{
         /* NVUPDATE Record */
+        /* Supported Products:
+         *   WMB-3250
+         *   WMB-3230
+         *   WMB-5230 */
         /* Nav Data Message
          * This message is used to update the external application with the most current navigation data.
-         * This is output at approx 100ms interval. This data DOES NOT relate to the detection data or
-         * water column data and is just the most recent nav data the WASSP system is processing.
+         * This is output at approximately 100ms intervals. This data DOES NOT relate to the detection data or
+         * water column data and is just the most recent navigation data the WASSP system is processing.
          * Data shown will be that configured to be used by the WASSP system. All serial data is also
          * sent via the raw data format.
          * Please Note: MAG value has no units at this time. The value is the intensity of the returned
          * echo at the detection point, this value is affected by transmission losses and power levels.
+         * NOTES:
+         *      1) Sign of Longitude is E positive, W negative
+         *      2) Sign of Latitude is N positive, S negative
          */
+        /* unsigned int sync; */               /* 0x77F9345A */
+        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
+        /* char         header[8]; */          /* "NVUPDATE" */
         unsigned int    version;               /* 4 */
-        double          latitude;              /* Latitude from GPS sensor in decimal degrees */
-        double          longitude;             /* Longitude from GPS sensor in decimal degrees */
-        float           sog;                   /* speed over ground in knots */
-        float           cog;                   /* course over ground in degrees */
-        float           heading;               /* vessel heading in degrees */
-        float           roll;                  /* vessel roll in degrees */
-        float           pitch;                 /* vessel pitch in degrees */
-        float           heave;                 /* vessel heave in meters */
-        float           nadir_depth;           /* Roll corrected depth below transducer in meters */
-        unsigned int    checksum;              /* checksum format TBD */
-       };
+        double          latitude;              /* Latitude from GPS sensor in decimal degrees.
+                                                * Set to “-999” if no valid latitude is received. */
+        double          longitude;             /* Longitude from GPS sensor in decimal degrees.
+                                                * Set to “-999” if no valid longitude is received. */
+        float           sog;                   /* Speed over ground in knots.
+                                                * Set to “-999” if no valid speed is received. */
+        float           cog;                   /* Course over ground in degrees.
+                                                * Set to “-999” if no valid course is received. */
+        float           heading;               /* Vessel heading in degrees.
+                                                * Set to “-999” if no valid heading is received. */
+        float           roll;                  /* Vessel roll in degrees.
+                                                * Set to “-999” if no valid roll is received. */
+        float           pitch;                 /* Vessel pitch in degrees.
+                                                * Set to “-999” if no valid pitch is received. */
+        float           heave;                 /* Vessel heave in meters.
+                                                * Set to “-999” if no valid heave is received. */
+        float           nadir_depth;           /* Roll corrected depth below transducer in meters.
+                                                * Set to “-999” if no valid depth is received. */
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
 
 struct mbsys_wassp_wcd_navi_struct
 	{
         /* WCD_NAVI Record */
+        /* Supported Products:
+         *   WMB-3250
+         *   WMB-3230
+         *   WMB-5230 */
         /* Water Column Information
          * This message is sent over the network after each detection message is sent, thus the water
-         * column data is valid for the previous ping that has just been received. */
-        unsigned int    version;               /* 3 */
+         * column data is valid for the previous ping that has just been received.
+         * Notes:
+         *      1. The X positions are relative to the vessel position 
+         *      2. The Y depths are tide corrected unless tides are disabled in the WASSP system
+         *      3. MAG value has no units at this time. The value is the intensity of the returned
+         *      echo at the detection point, this value is affected by transmission losses and
+         *      power levels. */
+        /* unsigned int sync; */               /* 0x77F9345A */
+        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
+        /* char         header[8]; */          /* "WCD_NAVI" */
+        unsigned int    version;               /* 3 for ICD 2.2, 4 for ICD 2.4 */
         double          latitude;              /* Latitude from GPS sensor in decimal degrees */
         double          longitude;             /* Longitude from GPS sensor in decimal degrees */
         unsigned int    num_points;            /* Number of water column points to follow */
         float           bearing;               /* Bearing of vessel for fish targets, degrees */
-        double          msec;                  /* A millisecond time stamp of rising edge
-                                                         * of Transmit pulse in UTC time (UTC time
-                                                         * is calculated from the timestamp of the
-                                                         * ZDA sentence and or a PPS signal when
-                                                         * available) No local time zone correction
-                                                         * is applied. */
+        double          msec;                  /* Version 4: unused
+                                                * Version 3:
+                                                * A millisecond time stamp of rising edge
+                                                * of Transmit pulse in UTC time (UTC time
+                                                * is calculated from the timestamp of the
+                                                * ZDA sentence and or a PPS signal when
+                                                * available) No local time zone correction
+                                                * is applied.
+                                                * On systems not supporting UTC time, this
+                                                * will be system referenced time. */
         unsigned int    ping_number;           /* Ping sequence number */
         float           sample_rate;           /* Sampling frequency in Hz for the Water Column Information */
         size_t          wcdata_alloc;          /* Number of points allocated for wcdata arrays */
@@ -363,8 +437,140 @@ struct mbsys_wassp_wcd_navi_struct
                                                          * from vessels heading. Negative value is port. */
         float           *wcdata_y;             /* Depth in meters for the water column point. */
         float           *wcdata_mag;           /* Intensity value for water column point, not referenced */
-        unsigned int    checksum;              /* checksum format TBD */
-       };
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
+
+struct mbsys_wassp_sensprop_struct
+	{
+        /* SENSPROP Record */
+        /* Supported Products:
+         *   WMB-3250
+         *   WMB-3230
+         *   WMB-5230 */
+        /* Sensor Properties
+         * These data packets contain WASSP properties.
+         * Packets are sent on connection and if any properties are changed.
+         * All positions are relative to the vessel’s reference point
+         * - see WASSP installation manual. */
+        /* unsigned int sync; */                /* 0x77F9345A */
+        /* unsigned int size; */                /* Size in bytes of this record from start of sync pattern to end of checksum */
+        /* char         header[8]; */           /* "SENSPROP" */
+        unsigned int    version;                /* 1 */
+        unsigned int    flags;                  /* Bit field:
+                                                 *      Bit 0: Pitch Compensation
+                                                 *      Bit 1: Heave Compensation
+                                                 *      Bit 2: Roll Correction
+                                                 *      Bit 3: Swap Roll
+                                                 *      Bit 4: Swap Array
+                                                 *      Bit 5: Invert Roll
+                                                 *      Bit 6: Induced Heave
+                                                 *      Bit 7: PPS applied
+                                                 *      Bit 8: Auto Power by signal
+                                                 *      Bits 9-31: Reserved for future use */
+        float           sea_level_reference;    /* Sea Level Reference
+                                                 *  Meters from ship’s reference to sea level,
+                                                 *  down is positive */
+        float           element_spacing;        /* Element spacing in millimeters */
+        unsigned int    spare[8];               /* Spare */
+        unsigned int    n;                      /* Number of sensors */
+        size_t          n_alloc;                /* Number of sensors allocated */
+        struct mbsys_wassp_sensor_struct *sensors; /* Array of sensor details */
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
+
+struct mbsys_wassp_sensor_struct
+	{
+        unsigned int    sensor_type;            /* Sensor type:
+                                                 *      1: Roll
+                                                 *      2: Pitch
+                                                 *      4: Heave
+                                                 *      8: Heading
+                                                 *      16: Transducer
+                                                 *      32: Position */
+        unsigned int    flags;                  /* Bit field:
+                                                 *      Bit 0: Device active
+                                                 *      Bit 1: Offsets set
+                                                 *      Bit 2: Roll Bias set
+                                                 *      Bit 3: Pitch Bias set
+                                                 *      Bit 4: Yaw Bias set
+                                                 *      Bits 5-31: Reserved for future use */
+        mb_u_char       port_number;            /* Port number */
+        mb_u_char       device;                 /* Device Type which the port number applies to:
+                                                 *      0: Unknown
+                                                 *      1: WASSP Serial Transfer Task */
+        mb_u_char       sentence;               /* Sentence used:
+                                                 *      0: n/a
+                                                 *      10: GGA
+                                                 *      11: GGL
+                                                 *      12: GNS
+                                                 *      13: RMC
+                                                 *      14: GGK (Trimble)
+                                                 *      15: ZDA
+                                                 *      20: HDM
+                                                 *      21: HDT
+                                                 *      22: HDG
+                                                 *      23: VTG
+                                                 *      31: PSXN (Kongsberg)
+                                                 *      32: PASHR (Applanix)
+                                                 *      33: PFEC,ATT (Furuno)
+                                                 *      34: PFEC,HVE (Furuno)
+                                                 *      35: RCD (JRC)
+                                                 *      100: TSS1
+                                                 *      101: Minisense */
+        mb_u_char       sensor_model;           /* Sensor model:
+                                                 *      0: Unknown
+                                                 *      10: WASSP 160
+                                                 *      11: WASSP 80
+                                                 *      12: WASSP 160 Vs
+                                                 *      13: WASSP 160 Vl
+                                                 *      40: Applanix POS MV V4
+                                                 *      41: Furuno SC30
+                                                 *      42: Furuno SC50
+                                                 *      43: JRC JLR20
+                                                 *      44: CDL Minisense
+                                                 *      45: Kongsberg MRU
+                                                 *      46: Teledyne TSS
+                                                 *      47: Maretron SSC200
+                                                 *      48: SMC IMU-108 */
+        float           latency;                /* Latency in seconds */
+        float           roll_bias;              /* Roll offset, degrees, positive stbd down */
+        float           pitch_bias;             /* Pitch offset, degrees, positive bow up */
+        float           yaw_bias;               /* Heading offset, degrees, positive stbd */
+        float           offset_x;               /* Meters from ship’s reference, fwd is positive */
+        float           offset_y;               /* Meters from ship’s reference, stbd is positive */
+        float           offset_z;               /* Meters from ship’s reference, down is positive */
+        };
+
+struct mbsys_wassp_sys_prop_struct
+	{
+        /* SYS_PROP Record */
+        /* Supported Products:
+         *   WMB-3250
+         *   WMB-3230
+         *   WMB-5230 */
+        /* System Properties
+         * These data packets contain WASSP properties.
+         * Packets are sent on connection and if any properties are changed.
+         * All positions are relative to the vessel’s reference point
+         * - see WASSP installation manual. */
+        /* unsigned int sync; */                /* 0x77F9345A */
+        /* unsigned int size; */                /* Size in bytes of this record from start of sync pattern to end of checksum */
+        /* char         header[8]; */           /* "SYS_PROP" */
+        unsigned int    version;                /* 1 */
+        unsigned int    product_type;           /* Product type:
+                                                 *      1: WMB-3230
+                                                 *      2: WMB-5230
+                                                 *      3: WMB-3250 */
+        unsigned int    protocol_version;       /* Protocol version x100, currently 240 */
+        unsigned int    sw_version[4];          /* Software version:
+                                                 * Product Version, Major Version, Minor Version, Build */
+        unsigned int    fw_version;             /* Firmware version */
+        unsigned int    hw_version;             /* Hardware version */
+        unsigned int    transducer_sn;          /* Transducer serial number in ASCII */
+        unsigned int    transceiver_sn;         /* Transceiver serial number in ASCII */
+        unsigned int    spare[8];               /* Spare */
+        unsigned int    checksum;               /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
 
 struct mbsys_wassp_sys_cfg1_struct
 	{
@@ -374,8 +580,8 @@ struct mbsys_wassp_sys_cfg1_struct
         size_t          sys_cfg1_data_alloc;    /* Number of bytes allocated to hold the sys_cfg1 record */
         size_t          sys_cfg1_len;           /* Number of bytes stored from the sys_cfg1 record */
         char            *sys_cfg1_data;         /* SYS_CFG1 record stored as raw bytes */
-        unsigned int    checksum;               /* checksum format TBD */
-       };
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
+        };
 
 struct mbsys_wassp_mcomment_struct
 	{
@@ -384,7 +590,7 @@ struct mbsys_wassp_mcomment_struct
          * This record is defined only for MB-System */
         unsigned int    comment_length;         /* Comment length in bytes */
         char            comment_message[MB_COMMENT_MAXLINE];
-        unsigned int    checksum;               /* checksum format TBD */
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
        };
 
 struct mbsys_wassp_unknown1_struct
@@ -394,7 +600,7 @@ struct mbsys_wassp_unknown1_struct
         size_t          unknown1_data_alloc;    /* Number of bytes allocated to hold the unknown1 record */
         size_t          unknown1_len;           /* Number of bytes stored from the unknown1 record */
         char            *unknown1_data;         /* unknown1 record stored as raw bytes */
-        unsigned int    checksum;               /* checksum format TBD */
+        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
        };
 
 /* Data system structure */
@@ -410,21 +616,27 @@ struct mbsys_wassp_struct
         /* GENBATHY record */
         struct mbsys_wassp_genbathy_struct genbathy;
 
-        /* CORBATHY record */
-        struct mbsys_wassp_corbathy_struct corbathy;
-
         /* RAWSONAR record */
         struct mbsys_wassp_rawsonar_struct rawsonar;
 
         /* GEN_SENS record */
         struct mbsys_wassp_gen_sens_struct gen_sens;
 
+        /* CORBATHY record */
+        struct mbsys_wassp_corbathy_struct corbathy;
+
         /* NVUPDATE record */
         struct mbsys_wassp_nvupdate_struct nvupdate;
 
         /* WCD_NAVI record */
         struct mbsys_wassp_wcd_navi_struct wcd_navi;
 
+        /* SENSPROP record */
+        struct mbsys_wassp_sensprop_struct sensprop;
+
+        /* SYS_PROP record */
+        struct mbsys_wassp_sys_prop_struct sys_prop;
+
         /* SYS_CFG1 record */
         struct mbsys_wassp_sys_cfg1_struct sys_cfg1;
         
diff --git a/src/mbio/mbsys_xse.c b/src/mbio/mbsys_xse.c
index 5d5029c..d21831d 100644
--- a/src/mbio/mbsys_xse.c
+++ b/src/mbio/mbsys_xse.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_xse.c	3/27/2000
- *	$Id: mbsys_xse.c 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_xse.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    D. W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -113,7 +113,7 @@
 #include "mb_define.h"
 #include "mbsys_xse.h"
 
-static char rcs_id[]="$Id: mbsys_xse.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbsys_xse.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 int mbsys_xse_alloc(int verbose, void *mbio_ptr, void **store_ptr,
diff --git a/src/mbio/mbsys_xse.h b/src/mbio/mbsys_xse.h
index 83c9ad2..93627ff 100644
--- a/src/mbio/mbsys_xse.h
+++ b/src/mbio/mbsys_xse.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsys_xse.h	3/27/2000
- *	$Id: mbsys_xse.h 2175 2014-03-18 23:03:39Z caress $
+ *	$Id: mbsys_xse.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    D. W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbio/stamp-h1 b/src/mbio/stamp-h1
new file mode 100644
index 0000000..589f022
--- /dev/null
+++ b/src/mbio/stamp-h1
@@ -0,0 +1 @@
+timestamp for src/mbio/mb_config.h
diff --git a/src/mbnavadjust/Makefile.am b/src/mbnavadjust/Makefile.am
index 2807e1c..37406ef 100644
--- a/src/mbnavadjust/Makefile.am
+++ b/src/mbnavadjust/Makefile.am
@@ -1,20 +1,19 @@
 bin_PROGRAMS = mbnavadjust mbnavadjustmerge
 
-AM_CFLAGS = 
+AM_CFLAGS =  ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
 
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      -I${top_srcdir}/src/mbaux \
-	      ${motif_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I${top_srcdir}/src/gsf
-endif
+	      -I${top_srcdir}/src/gsf \
+	      ${libmotif_CPPFLAGS} 
 
 AM_LDFLAGS = 
 
 LIBS = ${top_builddir}/src/mbio/libmbio.la \
 	${top_builddir}/src/mbaux/libmbaux.la \
 	${top_builddir}/src/mbaux/libmbxgr.la \
-	${motif_LIBS} \
+       	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
+	${libmotif_LIBS} \
 	$(LIBM)
 
 mbnavadjust_SOURCES = mbnavadjust.c mbnavadjust_callbacks.c mbnavadjust_creation.c \
diff --git a/src/mbnavadjust/Makefile.in b/src/mbnavadjust/Makefile.in
index 6f57f25..423d1a3 100644
--- a/src/mbnavadjust/Makefile.in
+++ b/src/mbnavadjust/Makefile.in
@@ -79,7 +79,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = mbnavadjust$(EXEEXT) mbnavadjustmerge$(EXEEXT)
- at BUILD_GSF_TRUE@am__append_1 = -I${top_srcdir}/src/gsf
 subdir = src/mbnavadjust
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -198,8 +197,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -213,7 +210,8 @@ LIBOBJS = @LIBOBJS@
 LIBS = ${top_builddir}/src/mbio/libmbio.la \
 	${top_builddir}/src/mbaux/libmbaux.la \
 	${top_builddir}/src/mbaux/libmbxgr.la \
-	${motif_LIBS} \
+       	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
+	${libmotif_LIBS} \
 	$(LIBM)
 
 LIBTOOL = @LIBTOOL@
@@ -221,6 +219,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -284,19 +283,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -309,8 +315,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -324,9 +328,12 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CFLAGS = 
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	${motif_CPPFLAGS} $(am__append_1)
+AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
+	      ${libmotif_CPPFLAGS} 
+
 AM_LDFLAGS = 
 mbnavadjust_SOURCES = mbnavadjust.c mbnavadjust_callbacks.c mbnavadjust_creation.c \
 	mbnavadjust_prog.c mbnavadjust_util.c mbnavadjust_creation.h \
diff --git a/src/mbnavadjust/Makefile.template b/src/mbnavadjust/Makefile.template
deleted file mode 100644
index 5443757..0000000
--- a/src/mbnavadjust/Makefile.template
+++ /dev/null
@@ -1,94 +0,0 @@
-#     The MB-system:	Makefile.template  6/23/95
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2000-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbnavadjust directory level
-# Author:	D. W. Caress
-# Date:		September 7, 2000
-#
-# $Log: Makefile.template,v $
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of Motif include files:
-MOTIFINCDIR = /usr/include/Xm
-MOTIFLIBS = -lXm -lXt -lX11
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -DIRIX
-LFLAGS =  -lmalloc -lm -lsun -g
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the executable and man page
-all: $(BINDIR)/mbnavadjust
-
-### link the executable
-$(BINDIR)/mbnavadjust: mbnavadjust.o \
-		mbnavadjust_creation.o \
-		mbnavadjust_callbacks.o \
-		mbnavadjust_util.o \
-		mbnavadjust_prog.o \
-		$(LIBDIR)/libmbio.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbxgr.a
-	$(CC) $(CFLAGS) mbnavadjust.o \
-		mbnavadjust_creation.o \
-		mbnavadjust_callbacks.o \
-		mbnavadjust_util.o \
-		mbnavadjust_prog.o \
-		$(LIBDIR)/libmbio.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbxgr.a \
-		$(MOTIFLIBS) $(LFLAGS) \
-		-o $(BINDIR)/mbnavadjust
-
-### compile the source files
-mbnavadjust.o: mbnavadjust.c mbnavadjust_creation.h mbnavadjust.h \
-	mbnavadjust_extrawidgets.h ../mbaux/mb_aux.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -I$(MOTIFINCDIR) -c mbnavadjust.c
-mbnavadjust_creation.o: mbnavadjust_creation.c mbnavadjust_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbnavadjust_creation.c
-mbnavadjust_callbacks.o: mbnavadjust_callbacks.c mbnavadjust.h mbnavadjust_creation.h \
-	mbnavadjust_extrawidgets.h ../mbaux/mb_xgraphics.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -I$(MOTIFINCDIR) -c mbnavadjust_callbacks.c
-mbnavadjust_util.o: mbnavadjust_util.c mbnavadjust_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbnavadjust_util.c
-mbnavadjust_prog.o: mbnavadjust_prog.c mbnavadjust.h  ../mbio/mb_format.h \
-		../mbio/mb_io.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbaux/mb_aux.h ../mbaux/mb_xgraphics.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -c mbnavadjust_prog.c
-
-clean:
-	rm -f core *.o
diff --git a/src/mbnavadjust/mbnavadjust.c b/src/mbnavadjust/mbnavadjust.c
index acded69..7812697 100644
--- a/src/mbnavadjust/mbnavadjust.c
+++ b/src/mbnavadjust/mbnavadjust.c
@@ -60,6 +60,11 @@ extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
  */
 extern void BxExitCB(Widget, XtPointer, XtPointer);
 
+/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
+#ifdef WIN32
+#	undef BOOL
+#endif
+
 /* Begin user code block <globals> */
 
 #include "mb_define.h"
@@ -99,7 +104,7 @@ int main( int argc, char **argv)
      * Initialize Xt.
      */
 
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
 
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbnavadjust/mbnavadjust.h b/src/mbnavadjust/mbnavadjust.h
index ba46242..8340ca6 100644
--- a/src/mbnavadjust/mbnavadjust.h
+++ b/src/mbnavadjust/mbnavadjust.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavadjust.h	6/24/95
- *    $Id: mbnavadjust.h 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mbnavadjust.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -53,11 +53,14 @@
 #define	MBNA_INVERSION_NONE		0
 #define	MBNA_INVERSION_OLD		1
 #define	MBNA_INVERSION_CURRENT		2
+#define MBNA_INVERT_ZFULL		0
+#define MBNA_INVERT_ZISOLATED		1
 #define	MBNA_FILE_POORNAV		1
 #define	MBNA_FILE_GOODNAV		2
 #define	MBNA_FILE_FIXEDNAV		3
 #define	MBNA_FILE_FIXEDXYNAV		4
 #define	MBNA_FILE_FIXEDZNAV		5
+#define	MBNA_TIE_NONE			0
 #define	MBNA_TIE_XYZ			1
 #define	MBNA_TIE_XY			2
 #define	MBNA_TIE_Z			3
@@ -103,8 +106,9 @@
 #define MBNA_GOODOVERLAP_THRESHOLD		25
 #define MBNA_BETTEROVERLAP_THRESHOLD		50
 
-#define	MBNA_MODELPLOT_SEQUENTIAL	0
-#define	MBNA_MODELPLOT_SURVEY		1
+#define	MBNA_MODELPLOT_TIMESERIES	0
+#define	MBNA_MODELPLOT_PERTURBATION	1
+#define	MBNA_MODELPLOT_TIEOFFSETS	2
 #define	MBNA_MODELPLOT_LEFT_WIDTH	25
 #define	MBNA_MODELPLOT_LEFT_HEIGHT	65
 #define	MBNA_MODELPLOT_X_SPACE		10
@@ -166,6 +170,16 @@ struct mbna_section {
 	int	show_in_modelplot;
 	int	modelplot_start_count;
 	int	contoursuptodate;
+	int	global_tie_status;
+	int	global_tie_snav;
+	double	global_tie_offset_x;
+	double	global_tie_offset_y;
+	double	global_tie_offset_x_m;
+	double	global_tie_offset_y_m;
+	double	global_tie_offset_z_m;
+	double	global_tie_xsigma;
+	double	global_tie_ysigma;
+	double	global_tie_zsigma;
 };
 struct mbna_file {
 	int	status;
@@ -284,6 +298,7 @@ MBNAVADJUST_EXTERNAL int	mbna_verbose;
 MBNAVADJUST_EXTERNAL int	mbna_status;
 MBNAVADJUST_EXTERNAL int	mbna_view_list;
 MBNAVADJUST_EXTERNAL int	mbna_view_mode;
+MBNAVADJUST_EXTERNAL int	mbna_invert_mode;
 MBNAVADJUST_EXTERNAL int	mbna_color_foreground;
 MBNAVADJUST_EXTERNAL int	mbna_color_background;
 MBNAVADJUST_EXTERNAL int	mbna_survey_select;
@@ -368,6 +383,7 @@ MBNAVADJUST_EXTERNAL int	mbna_zoom_x2;
 MBNAVADJUST_EXTERNAL int	mbna_zoom_y2;
 MBNAVADJUST_EXTERNAL double mbna_smoothweight;
 MBNAVADJUST_EXTERNAL double mbna_offsetweight;
+MBNAVADJUST_EXTERNAL double mbna_zweightfactor;
 MBNAVADJUST_EXTERNAL int	mbna_bias_mode;
 MBNAVADJUST_EXTERNAL int	mbna_allow_set_tie;
 
@@ -415,58 +431,64 @@ MBNAVADJUST_EXTERNAL int	mbna_reset_crossings;
 
 /* function prototype definitions */
 void	do_mbnavadjust_init(int argc, char **argv);
-void	do_set_controls();
-void	do_update_status();
-void	do_update_modelplot_status();
-void	do_naverr_init();
-void	do_update_naverr();
-void	do_naverr_offsetlabel();
-void	do_naverr_test_graphics();
+void	do_set_controls(void);
+void	do_update_status(void);
+void	do_update_modelplot_status(void);
+void	do_naverr_init(void);
+void	do_update_naverr(void);
+void	do_naverr_offsetlabel(void);
+void	do_naverr_test_graphics(void);
 void	do_naverr_plot(int plotmode);
 int	do_message_on(char *message);
 int	do_message_update(char *message);
-int	do_message_off();
+int	do_message_off(void);
 int	do_error_dialog(char *s1, char *s2, char *s3);
-void    do_bell();
-int	mbnavadjust_init_globals();
+void	do_bell(int length);
+int	mbnavadjust_init_globals(void);
 int	mbnavadjust_init(int argc,char **argv);
 int	mbnavadjust_set_colors(int ncol, int *pixels);
 int	mbnavadjust_set_borders(int *cn_brdr, int *cr_brdr, int *zc_brdr);
 int	mbnavadjust_set_graphics(void *cn_xgid, void *cr_xgid, void *zc_xgid);
 int	mbnavadjust_file_new(char *projectname);
 int	mbnavadjust_file_open(char *projectname);
-int	mbnavadjust_close_project();
-int	mbnavadjust_write_project();
-int	mbnavadjust_read_project();
+int	mbnavadjust_close_project(void);
+int	mbnavadjust_write_project(void);
+int	mbnavadjust_read_project(void);
 int	mbnavadjust_import_data(char *path, int format);
 int	mbnavadjust_import_file(char *path, int format, int firstfile);
-int	mbnavadjust_findcrossings();
+int 	mbnavadjust_bin_bathymetry(double altitude, int beams_bath, char *beamflag, double *bath,
+				double *bathacrosstrack, double *bathalongtrack,
+				int mbna_bin_beams_bath, double mbna_bin_pseudobeamwidth,
+				double mbna_bin_swathwidth, char *bin_beamflag,
+				double *bin_bath, double *bin_bathacrosstrack, double *bin_bathalongtrack,
+				int *error);
+int	mbnavadjust_findcrossings(void);
 int	mbnavadjust_findcrossingsfile(int ifile);
-int	mbnavadjust_poornav_file();
-int	mbnavadjust_goodnav_file();
-int	mbnavadjust_fixednav_file();
-int	mbnavadjust_fixedxynav_file();
-int	mbnavadjust_fixedznav_file();
-int	mbnavadjust_set_tie_xy();
-int	mbnavadjust_set_tie_z();
-int	mbnavadjust_set_tie_xyz();
-int	mbnavadjust_naverr_save();
+int	mbnavadjust_poornav_file(void);
+int	mbnavadjust_goodnav_file(void);
+int	mbnavadjust_fixednav_file(void);
+int	mbnavadjust_fixedxynav_file(void);
+int	mbnavadjust_fixedznav_file(void);
+int	mbnavadjust_set_tie_xy(void);
+int	mbnavadjust_set_tie_z(void);
+int	mbnavadjust_set_tie_xyz(void);
+int	mbnavadjust_naverr_save(void);
 int	mbnavadjust_naverr_specific(int new_crossing, int new_tie);
-int	mbnavadjust_naverr_next();
-int	mbnavadjust_naverr_previous();
-int	mbnavadjust_naverr_nextunset();
-int	mbnavadjust_naverr_selecttie();
-int	mbnavadjust_naverr_addtie();
-int	mbnavadjust_naverr_deletetie();
+int	mbnavadjust_naverr_next(void);
+int	mbnavadjust_naverr_previous(void);
+int	mbnavadjust_naverr_nextunset(void);
+int	mbnavadjust_naverr_selecttie(void);
+int	mbnavadjust_naverr_addtie(void);
+int	mbnavadjust_naverr_deletetie(void);
 int	mbnavadjust_deletetie(int icrossing, int jtie, int deletestatus);
-int	mbnavadjust_naverr_settie();
-int	mbnavadjust_naverr_resettie();
-int	mbnavadjust_naverr_checkoksettie();
-int	mbnavadjust_naverr_skip();
-int	mbnavadjust_naverr_unset();
-int	mbnavadjust_crossing_load();
-int	mbnavadjust_crossing_unload();
-int	mbnavadjust_crossing_replot();
+int	mbnavadjust_naverr_settie(void);
+int	mbnavadjust_naverr_resettie(void);
+int	mbnavadjust_naverr_checkoksettie(void);
+int	mbnavadjust_naverr_skip(void);
+int	mbnavadjust_naverr_unset(void);
+int	mbnavadjust_crossing_load(void);
+int	mbnavadjust_crossing_unload(void);
+int	mbnavadjust_crossing_replot(void);
 int	mbnavadjust_section_load(int file_id, int section_id, void **swathraw_ptr, void **swath_ptr, int num_pings);
 int	mbnavadjust_section_translate(int file_id, void *swathraw_ptr, void *swath_ptr, double zoffset);
 int	mbnavadjust_section_contour(int fileid, int sectionid,
@@ -479,30 +501,32 @@ int	mbnavadjust_crossing_overlapbounds(int crossing_id,
 				double offset_x, double offset_y,
 				double *lonmin, double *lonmax,
 				double *latmin, double *latmax);
-int	mbnavadjust_get_misfit();
-int	mbnavadjust_get_misfitxy();
+int	mbnavadjust_get_misfit(void);
+int	mbnavadjust_get_misfitxy(void);
 void 	plot(double x,double y,int ipen);
 void 	newpen(int ipen);
 void 	justify_string(double height,char *string, double *s);
 void 	plot_string(double x, double y, double hgt, double angle, char *label);
-void	mbnavadjust_naverr_scale();
+void	mbnavadjust_naverr_scale(void);
 void	mbnavadjust_naverr_plot(int plotmode);
 int	mbnavadjust_autopick(int do_vertical);
-int	mbnavadjust_autosetsvsvertical();
-int	mbnavadjust_zerozoffsets();
-int	mbnavadjust_invertnav();
-int	mbnavadjust_applynav();
-int	mbnavadjust_interpolatesolution();
-int	mbnavadjust_modelplot_plot();
+int	mbnavadjust_autosetsvsvertical(void);
+int	mbnavadjust_zerozoffsets(void);
+int	mbnavadjust_invertnav(void);
+int	mbnavadjust_applynav(void);
+int	mbnavadjust_interpolatesolution(void);
+int	mbnavadjust_modelplot_plot(void);
 int	mbnavadjust_set_modelplot_graphics(void *modp_xgid, int *modp_borders);
-int	mbnavadjust_modelplot_plot_sequential();
-int	mbnavadjust_modelplot_plot_tielist();
+int	mbnavadjust_modelplot_plot_timeseries(void);
+int	mbnavadjust_modelplot_plot_perturbation(void);
+int	mbnavadjust_modelplot_plot_tieoffsets(void);
 int	mbnavadjust_modelplot_pick(int x, int y);
-int	mbnavadjust_modelplot_pick_tielist(int x, int y);
-int	mbnavadjust_modelplot_pick_sequential(int x, int y);
+int	mbnavadjust_modelplot_pick_timeseries(int x, int y);
+int	mbnavadjust_modelplot_pick_perturbation(int x, int y);
+int	mbnavadjust_modelplot_pick_tieoffsets(int x, int y);
 int	mbnavadjust_modelplot_middlepick(int x, int y);
-int	mbnavadjust_modelplot_setzoom();
-int	mbnavadjust_modelplot_clearblock();
+int	mbnavadjust_modelplot_setzoom(void);
+int	mbnavadjust_modelplot_clearblock(void);
 int	mbnavadjust_crossing_compare(const void *a, const void *b);
 
 void	do_list_data_select( Widget w, XtPointer client_data, XtPointer call_data);
@@ -560,6 +584,54 @@ void	get_text_string(Widget w, String str);
 int	do_info_add(char *info, int timetag);
 void	do_modelplot_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused);
 
-XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
+void	do_naverr_setoffset( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_naverr_fullsize( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_naverr_applyzoffset( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_biases_apply( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_biases_applyall( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_biases_init( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_biases_toggle( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_biases_heading( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_biases_roll( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_controls_apply( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_scale_controls_sectionlength( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_scale_controls_sectionsoundings( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_scale_controls_decimation( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_scale_contourinterval( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_scale_controls_tickinterval( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_controls_scale_colorinterval( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_scale_controls_smoothing( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_scale_controls_zoffset( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_view_showwithselectedsurveys( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_view_showwithselectedfile( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_view_showsections( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_view_showbettercrossings( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_poornav( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_goodnav( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_fixednav( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_fixedxynav( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_fixedznav( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_tie_xy( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_z( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_action_tie_xyz( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_zerozoffsets( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_apply_nav( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_show( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_fullsize( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_input( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_expose( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_tieoffsets( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_perturbation( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_timeseries( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_modelplot_clearblock( Widget w, XtPointer client_data, XtPointer call_data);
+void	do_make_grid( Widget w, XtPointer client_data, XtPointer call_data);
+
+void 	BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void 	BxManageCB(Widget w, XtPointer client, XtPointer call);
+void 	BxPopupCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void 	BxExitCB(Widget w, XtPointer client, XtPointer call);
+void 	BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
 
 /*--------------------------------------------------------------------*/
diff --git a/src/mbnavadjust/mbnavadjust_callbacks.c b/src/mbnavadjust/mbnavadjust_callbacks.c
index dfc20e1..f14ee3a 100644
--- a/src/mbnavadjust/mbnavadjust_callbacks.c
+++ b/src/mbnavadjust/mbnavadjust_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavadjust_callbacks.c	2/22/2000
- *    $Id: mbnavadjust_callbacks.c 2201 2014-08-21 00:49:46Z caress $
+ *    $Id: mbnavadjust_callbacks.c 2252 2015-07-01 19:35:37Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -21,64 +21,6 @@
  * Author:	D. W. Caress
  * Date:	March 22, 2000
  *
- * $Log: mbnavadjust_callbacks.c,v $
- * Revision 5.19  2008/12/22 08:32:52  caress
- * Added additional model view - survey vs survey rather than sequential.
- *
- * Revision 5.18  2008/10/17 07:52:44  caress
- * Check in on October 17, 2008.
- *
- * Revision 5.17  2008/09/11 20:12:43  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.16  2008/07/10 18:08:10  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.13  2008/05/16 22:42:32  caress
- * Release 5.1.1beta18 - working towards use of 3D uncertainty.
- *
- * Revision 5.12  2008/01/14 18:15:46  caress
- * Minor fixes.
- *
- * Revision 5.11  2007/05/14 06:34:11  caress
- * Many changes to mbnavadjust, including adding z offsets and 3D search grids.
- *
- * Revision 5.10  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.9  2006/01/24 19:18:42  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.8  2005/06/04 04:34:06  caress
- * Added notion of "truecrossings", so it's possible to process the data while only looking at crossing tracks and ignoring overlap points.
- *
- * Revision 5.7  2004/12/02 06:34:27  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.6  2004/05/21 23:31:28  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.5  2003/04/17 21:07:49  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/08/28 01:32:45  caress
- * Finished first cut at man page.
- *
- * Revision 5.3  2002/03/26 07:43:57  caress
- * Release 5.0.beta15
- *
- * Revision 5.2  2001/07/20 00:33:43  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22 07:45:59  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:55:48  caress
- * First cut at Version 5.0.
- *
- * Revision 4.0  2000/09/30  07:00:06  caress
- * Snapshot for Dale.
- *
  *
  */
 /*--------------------------------------------------------------------*/
@@ -149,13 +91,21 @@
 #endif
 #endif
 
+#ifndef FIXED
+#define FIXED "fixed"
+#endif
+
 Widget		BxFindTopShell PROTOTYPE((Widget));
 WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
 
 /*--------------------------------------------------------------------*/
 
+/* id variables */
+static char svn_id[] = "$Id: mbnavadjust_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
+static char program_name[] = "MBnavadjust";
+
 /* XG variable declarations */
-#define xgfont "-misc-fixed-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
+#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
 #define EV_MASK (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | KeyPressMask | KeyReleaseMask | ExposureMask)
 XtAppContext	app_context;
 Display		*display;
@@ -740,14 +690,19 @@ void do_set_controls()
 	XmTextFieldSetString(textField_format, string);
 
 	/* set model view style togglebuttons */
-	if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+	if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
 	    {
-	    XmToggleButtonSetState(toggleButton_modelplot_sequential,
+	    XmToggleButtonSetState(toggleButton_modelplot_timeseries,
+			TRUE, TRUE);
+	    }
+	else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
+	    {
+	    XmToggleButtonSetState(toggleButton_modelplot_perturbation,
 			TRUE, TRUE);
 	    }
 	else
 	    {
-	    XmToggleButtonSetState(toggleButton_modelplot_block,
+	    XmToggleButtonSetState(toggleButton_modelplot_tieoffsets,
 			TRUE, TRUE);
 	    }
 
@@ -1695,8 +1650,10 @@ void do_update_status()
         		fprintf(stderr,"%s\n Xing  Tie Fil:Sec:Nv  Fil:Sec:Nv      OffLon      OffLat     dOffLon     dOffLat\n",string);
 		if (project.num_files > 0)
 			{
-			/* count ties */
+			/* count crossing ties and global ties */
 			num_ties = 0;
+			
+			/* count crossing ties */
 			for (i=0;i<project.num_crossings;i++)
 				{
 				crossing = &(project.crossings[i]);
@@ -1723,12 +1680,28 @@ void do_update_status()
 					num_ties += crossing->num_ties;
 					}
 				}
+			
+			/* count global ties */
+			for (i=0;i<project.num_files;i++)
+				{
+				file = &(project.files[i]);
+				for (j=0;j<file->num_sections;j++)
+					{
+					section = &(file->sections[j]);
+					if (section->global_tie_status != MBNA_TIE_NONE)
+						num_ties++;
+					}
+				}
+			    
+			/* allocate strings for list */
 			xstr = (XmString *) malloc(num_ties * sizeof(XmString));
 
 			/* generate list */
 			num_crossings = 0;
 			num_ties = 0;
 			iselect = MBNA_SELECT_NONE;
+			
+			/* start with crossing ties */
 			for (i=0;i<project.num_crossings;i++)
 				{
 				crossing = &(project.crossings[i]);
@@ -1792,10 +1765,10 @@ void do_update_status()
 						    tie->offset_x_m,
 						    tie->offset_y_m,
 						    tie->offset_z_m,
-						    dx, dy, dz,
 						    tie->sigmar1,
 						    tie->sigmar2,
 						    tie->sigmar3,
+						    dx, dy, dz,
 						    dr1, dr2, dr3);
 					    else if (tie->inversion_status == MBNA_INVERSION_OLD)
 						sprintf(string,"%4d %2d %s %2.2d:%3.3d:%3.3d:%2.2d %2.2d:%3.3d:%3.3d:%2.2d %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %4.3f %4.3f %4.3f ***",
@@ -1812,10 +1785,10 @@ void do_update_status()
 						    tie->offset_x_m,
 						    tie->offset_y_m,
 						    tie->offset_z_m,
-						    dx, dy, dz,
 						    tie->sigmar1,
 						    tie->sigmar2,
 						    tie->sigmar3,
+						    dx, dy, dz,
 						    dr1, dr2, dr3);
 					    else
 						sprintf(string,"%4d %2d %s %2.2d:%3.3d:%3.3d:%2.2d %2.2d:%3.3d:%3.3d:%2.2d %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f",
@@ -1844,14 +1817,69 @@ void do_update_status()
 					    num_ties++;
 					    }
 					}
-    				    }
-			    XmListAddItems(list_data,xstr,num_ties,0);
-			    for (k=0;k<num_ties;k++)
-				    {
-    				    XmStringFree(xstr[k]);
-    				    }
-    			    free(xstr);
-			    }
+    				}
+			
+			/* now list global ties */
+			for (i=0;i<project.num_files;i++)
+				{
+				file = &(project.files[i]);
+				for (j=0;j<file->num_sections;j++)
+					{
+					section = &(file->sections[j]);
+					if (section->global_tie_status != MBNA_TIE_NONE
+					 	&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
+							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
+								&& mbna_survey_select == file->block)
+							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
+								&& mbna_file_select == i)
+							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
+								&& mbna_survey_select == file->block)
+							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
+								&& mbna_file_select == i)
+							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
+								&& mbna_file_select == i
+								&& mbna_section_select == j)))
+						{
+						dx = section->global_tie_offset_x_m - section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon;
+						dy = section->global_tie_offset_y_m - section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat;
+						dz = section->global_tie_offset_z_m - section->snav_z_offset[section->global_tie_snav];
+						dr1 = fabs(dx / section->global_tie_xsigma);
+						dr2 = fabs(dy / section->global_tie_ysigma);
+						dr3 = fabs(dz / section->global_tie_zsigma);
+
+						if (section->global_tie_status == MBNA_TIE_XYZ)
+							tiestatus = tiestatus_xyz;
+						else if (section->global_tie_status == MBNA_TIE_XY)
+							tiestatus = tiestatus_xy;
+						else if (section->global_tie_status == MBNA_TIE_Z)
+							tiestatus = tiestatus_z;
+						sprintf(string,"%2.2d:%3.3d:%3.3d:%2.2d %s %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %4.3f %4.3f %4.3f",
+							    project.files[i].block, i,  j, section->global_tie_snav,
+							    tiestatus,
+							    section->global_tie_offset_x_m,
+							    section->global_tie_offset_y_m,
+							    section->global_tie_offset_z_m,
+							    section->global_tie_xsigma,
+							    section->global_tie_ysigma,
+							    section->global_tie_zsigma,
+							    dx, dy, dz,
+							    dr1, dr2, dr3);
+						xstr[num_ties] = XmStringCreateLocalized(string);
+						if (mbna_verbose > 0)
+							fprintf(stderr,"%s\n",string);
+						num_ties++;
+						}
+					}
+				}
+
+
+			XmListAddItems(list_data,xstr,num_ties,0);
+			for (k=0;k<num_ties;k++)
+				{
+				XmStringFree(xstr[k]);
+				}
+			free(xstr);
+			}
 		if (iselect != MBNA_SELECT_NONE)
 			{
 			XmListSelectPos(list_data,iselect+1,0);
@@ -2774,7 +2802,26 @@ void do_update_modelplot_status()
 		    }
 
 	    /* set model view status label */
-	    if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+	    if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+		{
+		if (mbna_crossing_select == MBNA_SELECT_NONE)
+			{
+			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select untied crossing; <right> drag zoom extent\":t\"No Selection\"");
+			}
+		else
+			{
+			crossing = &(project.crossings[mbna_crossing_select]);
+			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select untied crossing; <right> drag zoom extent\":t\"Selected Crossing: %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d\"",
+				    mbna_crossing_select,
+				    project.files[crossing->file_id_1].block,
+				    crossing->file_id_1,
+				    crossing->section_1,
+				    project.files[crossing->file_id_2].block,
+				    crossing->file_id_2,
+				    crossing->section_2);
+			}
+		}
+	    else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 		{
 		if (mbna_crossing_select == MBNA_SELECT_NONE)
 			{
@@ -2840,6 +2887,13 @@ do_naverr_init()
 
     /* Setup the font for just the "canvas" screen. */
     fontStruct = XLoadQueryFont(display, xgfont);
+    if (fontStruct == NULL)
+        {
+	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
+        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
+	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+	exit(-1);
+        }
     XSetFont(display,cont_gc,fontStruct->fid);
     XSetFont(display,corr_gc,fontStruct->fid);
 
@@ -3157,6 +3211,7 @@ do_list_data_select( Widget w, XtPointer client_data, XtPointer call_data)
     int	*position_list = NULL;
     int position_count = 0;
     int	num_files, num_sections, num_crossings, num_ties;
+    int	found;
     int	i, j;
 
     if (XmListGetSelectedPos(list_data,&position_list,&position_count))
@@ -3488,6 +3543,7 @@ do_list_data_select( Widget w, XtPointer client_data, XtPointer call_data)
 		/* get crossing and tie from list */
 		num_crossings = 0;
 		num_ties = 0;
+		found = MB_NO;
 		for (i=0;i<project.num_crossings;i++)
 			{
 			crossing = &(project.crossings[i]);
@@ -3517,25 +3573,30 @@ do_list_data_select( Widget w, XtPointer client_data, XtPointer call_data)
 						{
 						mbna_crossing_select = i;
 						mbna_tie_select = j;
+						found = MB_YES;
 						}
 					num_ties++;
 					}
 				}
 			}
 
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-
-		/* else if naverr window is up, load selected crossing */
-		else
-		    {
-		    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-		    do_update_naverr();
-		    }
+		/* load selected crossing tie into naverr window, global ties ignored */
+		if (found == MB_YES)
+			{
+			/* bring up naverr window if required */
+			if (mbna_naverr_load == MB_NO)
+				{
+				do_naverr_init();
+				}
+	
+			/* else if naverr window is up, load selected crossing */
+			else
+				{
+				mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
+				mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
+				do_update_naverr();
+				}
+			}
 		}
      	free(position_list);
       	}
@@ -5493,6 +5554,13 @@ do_modelplot_show( Widget w, XtPointer client_data, XtPointer call_data)
 
     /* Setup the font for just the "canvas" screen. */
     fontStruct = XLoadQueryFont(display, xgfont);
+    if (fontStruct == NULL)
+        {
+	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
+        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
+	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+	exit(-1);
+        }
     XSetFont(display,modp_gc,fontStruct->fid);
     XSelectInput(display, modp_xid, EV_MASK );
 
@@ -5591,6 +5659,13 @@ do_modelplot_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *un
 
 		/* Setup the font for just the "canvas" screen. */
 		fontStruct = XLoadQueryFont(display, xgfont);
+		if (fontStruct == NULL)
+		    {
+		    fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
+		    fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
+		    fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+		    exit(-1);
+		    }
 		XSetFont(display,modp_gc,fontStruct->fid);
 		XSelectInput(display, modp_xid, EV_MASK );
 
@@ -5623,7 +5698,13 @@ do_modelplot_fullsize( Widget w, XtPointer client_data, XtPointer call_data)
 	/* replot model */
 	mbna_modelplot_zoom_x1 = 0;
 	mbna_modelplot_zoom_x2 = 0;
-	if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+	if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+	    {
+	    mbna_modelplot_zoom = MB_NO;
+	    mbna_modelplot_start = 0;
+	    mbna_modelplot_end = 0;
+	    }
+	else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 	    {
 	    mbna_modelplot_zoom = MB_NO;
 	    mbna_modelplot_start = 0;
@@ -5767,47 +5848,64 @@ do_modelplot_expose( Widget w, XtPointer client_data, XtPointer call_data)
 /*--------------------------------------------------------------------*/
 
 void
-do_modelplot_block( Widget w, XtPointer client_data, XtPointer call_data)
+do_modelplot_tieoffsets( Widget w, XtPointer client_data, XtPointer call_data)
 {
     XmAnyCallbackStruct *acs;
     acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_modelplot_block\n"); */
+//fprintf(stderr,"Called do_modelplot_tieoffsets %d\n",XmToggleButtonGetState(toggleButton_modelplot_tieoffsets));
 
-	if (XmToggleButtonGetState(toggleButton_modelplot_block))
+	if (XmToggleButtonGetState(toggleButton_modelplot_tieoffsets))
 	    {
-	    project.modelplot_style = MBNA_MODELPLOT_SURVEY;
+	    project.modelplot_style = MBNA_MODELPLOT_TIEOFFSETS;
 
 	    /* update model status */
 	    do_update_modelplot_status();
 
 	    /* replot the model */
-    	    mbnavadjust_modelplot_plot();
+	     mbnavadjust_modelplot_plot();
 	    }
-	else
-	    project.modelplot_style = MBNA_MODELPLOT_SEQUENTIAL;
 }
 
 /*--------------------------------------------------------------------*/
 
 void
-do_modelplot_sequential( Widget w, XtPointer client_data, XtPointer call_data)
+do_modelplot_perturbation( Widget w, XtPointer client_data, XtPointer call_data)
 {
     XmAnyCallbackStruct *acs;
     acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_modelplot_sequential\n"); */
+//fprintf(stderr,"Called do_modelplot_perturbation %d\n",XmToggleButtonGetState(toggleButton_modelplot_perturbation));
 
-	if (XmToggleButtonGetState(toggleButton_modelplot_sequential))
+	if (XmToggleButtonGetState(toggleButton_modelplot_perturbation))
 	    {
-	    project.modelplot_style = MBNA_MODELPLOT_SEQUENTIAL;
+	    project.modelplot_style = MBNA_MODELPLOT_PERTURBATION;
 
 	    /* update model status */
 	    do_update_modelplot_status();
 
 	    /* replot the model */
-    	    mbnavadjust_modelplot_plot();
+	    mbnavadjust_modelplot_plot();
+	    }
+}
+
+/*--------------------------------------------------------------------*/
+
+void
+do_modelplot_timeseries( Widget w, XtPointer client_data, XtPointer call_data)
+{
+    XmAnyCallbackStruct *acs;
+    acs = (XmAnyCallbackStruct*)call_data;
+//fprintf(stderr,"Called do_modelplot_timeseries %d\n",XmToggleButtonGetState(toggleButton_modelplot_timeseries));
+
+	if (XmToggleButtonGetState(toggleButton_modelplot_timeseries))
+	    {
+	    project.modelplot_style = MBNA_MODELPLOT_TIMESERIES;
+
+	    /* update model status */
+	    do_update_modelplot_status();
+
+	    /* replot the model */
+	    mbnavadjust_modelplot_plot();
 	    }
-	else
-	    project.modelplot_style = MBNA_MODELPLOT_SURVEY;
 }
 
 /*--------------------------------------------------------------------*/
@@ -6059,8 +6157,7 @@ do_error_dialog(char *s1, char *s2, char *s3)
 
 /*--------------------------------------------------------------------*/
 void
-do_bell(length)
-int	length;
+do_bell(int length)
 {
 	XBell(display,length);
 }
diff --git a/src/mbnavadjust/mbnavadjust_creation.c b/src/mbnavadjust/mbnavadjust_creation.c
index 4cf876f..27fde0c 100644
--- a/src/mbnavadjust/mbnavadjust_creation.c
+++ b/src/mbnavadjust/mbnavadjust_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
@@ -98,8 +109,9 @@ extern void do_modelplot_input(Widget, XtPointer, XtPointer);
 extern void do_modelplot_expose(Widget, XtPointer, XtPointer);
 extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
 extern void do_modelplot_dismiss(Widget, XtPointer, XtPointer);
-extern void do_modelplot_sequential(Widget, XtPointer, XtPointer);
-extern void do_modelplot_block(Widget, XtPointer, XtPointer);
+extern void do_modelplot_timeseries(Widget, XtPointer, XtPointer);
+extern void do_modelplot_perturbation(Widget, XtPointer, XtPointer);
+extern void do_modelplot_tieoffsets(Widget, XtPointer, XtPointer);
 extern void do_scale_controls_zoffset(Widget, XtPointer, XtPointer);
 extern void do_scale_controls_smoothing(Widget, XtPointer, XtPointer);
 extern void do_scale_controls_sectionlength(Widget, XtPointer, XtPointer);
@@ -322,7 +334,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 36); ac++;
         XtSetArg(args[ac], XmNheight, 22); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_file = XmCreateCascadeButton(menuBar_mbnavadjust,
             (char *)"cascadeButton_file",
@@ -355,7 +367,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_new = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_new",
@@ -383,7 +395,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_open = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_open",
@@ -411,7 +423,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_close = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_close",
@@ -442,7 +454,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_importdata = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_importdata",
@@ -478,7 +490,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_quit = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_quit",
@@ -511,7 +523,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 55); ac++;
         XtSetArg(args[ac], XmNheight, 22); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_option = XmCreateCascadeButton(menuBar_mbnavadjust,
             (char *)"cascadeButton_option",
@@ -544,7 +556,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_option, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_option, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls = XmCreatePushButton(pulldownMenu_option,
             (char *)"pushButton_controls",
@@ -576,7 +588,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 45); ac++;
         XtSetArg(args[ac], XmNheight, 22); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_view = XmCreateCascadeButton(menuBar_mbnavadjust,
             (char *)"cascadeButton_view",
@@ -609,7 +621,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showsurveys = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showsurveys",
@@ -633,7 +645,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showdata = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showdata",
@@ -657,7 +669,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showsections = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showsections",
@@ -681,7 +693,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showcrossings = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showcrossings",
@@ -705,7 +717,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showmediocrecrossings = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showmediocrecrossings",
@@ -729,7 +741,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showgoodcrossings = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showgoodcrossings",
@@ -753,7 +765,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showbettercrossings = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showbettercrossings",
@@ -777,7 +789,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showtruecrossings = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showtruecrossings",
@@ -801,7 +813,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showties = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showties",
@@ -832,7 +844,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_showallsurveys = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_showallsurveys",
@@ -856,7 +868,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_showselectedsurvey = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_showselectedsurvey",
@@ -880,7 +892,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_showselectedfile = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_showselectedfile",
@@ -904,7 +916,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_showwithselectedsurvey = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_showwithselectedsurvey",
@@ -928,7 +940,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_showwithselectedfile = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_showwithselectedfile",
@@ -952,7 +964,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_showselectedsection = XmCreateToggleButton(pulldownMenu_view,
             (char *)"toggleButton_showselectedsection",
@@ -983,7 +995,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_makegrid = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_makegrid",
@@ -1007,7 +1019,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_showmodelplot = XmCreatePushButton(pulldownMenu_view,
             (char *)"pushButton_showmodelplot",
@@ -1040,7 +1052,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 53); ac++;
         XtSetArg(args[ac], XmNheight, 22); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_action = XmCreateCascadeButton(menuBar_mbnavadjust,
             (char *)"cascadeButton_action",
@@ -1073,7 +1085,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_poornav = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_poornav",
@@ -1097,7 +1109,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_goodnav = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_goodnav",
@@ -1121,7 +1133,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_fixednav = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_fixednav",
@@ -1145,7 +1157,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_fixedxynav = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_fixedxynav",
@@ -1169,7 +1181,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_fixedznav = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_fixedznav",
@@ -1193,7 +1205,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_tie_xy = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_tie_xy",
@@ -1217,7 +1229,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_tie_z = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_tie_z",
@@ -1241,7 +1253,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_tie_xyz = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_tie_xyz",
@@ -1272,7 +1284,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_autopick = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_autopick",
@@ -1296,7 +1308,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_autopickhorizontal = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_autopickhorizontal",
@@ -1320,7 +1332,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_autosetsvsvertical = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_autosetsvsvertical",
@@ -1351,7 +1363,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_newcrossings = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_newcrossings",
@@ -1382,7 +1394,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_analyzecrossings = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_analyzecrossings",
@@ -1415,7 +1427,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_zerozoffsets = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_zerozoffsets",
@@ -1446,7 +1458,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_invertnav = XmCreatePushButton(pulldownMenu_action,
             (char *)"pushButton_invertnav",
@@ -1470,7 +1482,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_applynav = XmCreatePushButtonGadget(pulldownMenu_action,
             (char *)"pushButton_applynav",
@@ -1502,7 +1514,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 22); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_about = XmCreateCascadeButton(menuBar_mbnavadjust,
             (char *)"cascadeButton_about",
@@ -1535,7 +1547,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_about, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_about, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_about = XmCreatePushButton(pulldownMenu_about,
             (char *)"pushButton_about",
@@ -1607,7 +1619,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 440); ac++;
         XtSetArg(args[ac], XmNheight, 140); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbnavadjust, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_status = XmCreateLabel(form_mbnavadjust,
             (char *)"label_status",
@@ -1635,7 +1647,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbnavadjust, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_listdata = XmCreateLabel(form_mbnavadjust,
             (char *)"label_listdata",
@@ -1734,7 +1746,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 510); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_pleasewait = XmCreateLabel(bulletinBoard_message,
             (char *)"label_pleasewait",
@@ -1762,7 +1774,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 510); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_message = XmCreateLabel(bulletinBoard_message,
             (char *)"label_message",
@@ -1812,7 +1824,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_two = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_two",
@@ -1840,7 +1852,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_one = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_one",
@@ -1868,7 +1880,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_three = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_three",
@@ -1895,7 +1907,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_error = XmCreatePushButton(bulletinBoard_error,
             (char *)"pushButton_error",
@@ -1935,7 +1947,7 @@ CreatemainWindow(Widget parent)
 
     ac = 0;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+        BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     XtSetArg(args[ac], XmNx, 160); ac++;
     XtSetArg(args[ac], XmNy, 480); ac++;
@@ -1955,7 +1967,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -1985,13 +1997,13 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_MODELESS); ac++;
         XtSetArg(args[ac], XmNlistVisibleItemCount, 13); ac++;
         XtSetArg(args[ac], XmNtextFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNlabelFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNbuttonFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
         XtSetArg(args[ac], XmNnoResize, True); ac++;
@@ -2068,7 +2080,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_unset = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_unset",
@@ -2096,7 +2108,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_minxymisfit = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_minxymisfit",
@@ -2142,7 +2154,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_zerozoffset = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_zerozoffset",
@@ -2181,7 +2193,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 66); ac++;
         XtSetArg(args[ac], XmNheight, 22); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_settings, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_settings, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_settings = XmCreateCascadeButton(menuBar_settings,
             (char *)"cascadeButton_settings",
@@ -2214,7 +2226,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_settings, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_settings, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_biases = XmCreatePushButton(pulldownMenu_settings,
             (char *)"pushButton_naverr_biases",
@@ -2239,7 +2251,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_settings, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_settings, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_controls = XmCreatePushButton(pulldownMenu_settings,
             (char *)"pushButton_naverr_controls",
@@ -2271,7 +2283,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_settie = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_settie",
@@ -2310,7 +2322,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 174); ac++;
         XtSetArg(args[ac], XmNheight, 26); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_misfitcenter, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_misfitcenter, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_misfitcenter_zero = XmCreateToggleButton(radioBox_misfitcenter,
             (char *)"toggleButton_misfitcenter_zero",
@@ -2337,7 +2349,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 174); ac++;
         XtSetArg(args[ac], XmNheight, 26); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_misfitcenter, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_misfitcenter, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_misfitcenter_auto = XmCreateToggleButton(radioBox_misfitcenter,
             (char *)"toggleButton_misfitcenter_auto",
@@ -2366,7 +2378,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_resettie = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_resettie",
@@ -2395,7 +2407,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_addtie = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_addtie",
@@ -2424,7 +2436,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_deletetie = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_deletetie",
@@ -2452,7 +2464,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_fullsize = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_fullsize",
@@ -2480,7 +2492,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_zerooffset = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_zerooffset",
@@ -2510,7 +2522,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 300); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_naverr_offsets = XmCreateLabel(bulletinBoard_naverr,
             (char *)"label_naverr_offsets",
@@ -2538,7 +2550,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_nextunset = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_nextunset",
@@ -2568,7 +2580,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 300); ac++;
         XtSetArg(args[ac], XmNheight, 150); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_naverr_status = XmCreateLabel(bulletinBoard_naverr,
             (char *)"label_naverr_status",
@@ -2632,7 +2644,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_dismiss = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_dismiss",
@@ -2663,7 +2675,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_selecttie = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_selecttie",
@@ -2692,7 +2704,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_minimum = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_minmisfit",
@@ -2721,7 +2733,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_next = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_next",
@@ -2750,7 +2762,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_previous = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_previous",
@@ -2779,7 +2791,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_naverr_setnone = XmCreatePushButton(bulletinBoard_naverr,
             (char *)"pushButton_naverr_setnone",
@@ -2853,7 +2865,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_biases_applyall = XmCreatePushButton(bulletinBoard_biases,
             (char *)"pushButton_biases_applyall",
@@ -2910,7 +2922,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 58); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_biases_heading2 = XmCreateScale(bulletinBoard_biases,
             (char *)"scale_biases_heading2",
@@ -2944,7 +2956,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 58); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_biases_roll2 = XmCreateScale(bulletinBoard_biases,
             (char *)"scale_biases_roll2",
@@ -2978,7 +2990,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 58); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_biases_roll1 = XmCreateScale(bulletinBoard_biases,
             (char *)"scale_biases_roll1",
@@ -3015,7 +3027,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 58); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_biases_heading1 = XmCreateScale(bulletinBoard_biases,
             (char *)"scale_biases_heading1",
@@ -3044,7 +3056,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_biases_files = XmCreateLabel(bulletinBoard_biases,
             (char *)"label_biases_files",
@@ -3081,7 +3093,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 121); ac++;
         XtSetArg(args[ac], XmNheight, 26); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_biases_together, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_biases_together, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_biases_together = XmCreateToggleButton(radioBox_biases_together,
             (char *)"toggleButton_biases_together",
@@ -3107,7 +3119,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 121); ac++;
         XtSetArg(args[ac], XmNheight, 26); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_biases_together, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_biases_together, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_biases_separate = XmCreateToggleButton(radioBox_biases_together,
             (char *)"toggleButton_biases_separate",
@@ -3134,7 +3146,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_biases_apply = XmCreatePushButton(bulletinBoard_biases,
             (char *)"pushButton_biases_apply",
@@ -3162,7 +3174,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_biases_dismiss = XmCreatePushButton(bulletinBoard_biases,
             (char *)"pushButton_biases_dismiss",
@@ -3207,7 +3219,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 250); ac++;
@@ -3245,7 +3257,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 170); ac++;
         XtSetArg(args[ac], XmNy, 410); ac++;
@@ -3273,7 +3285,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 230); ac++;
@@ -3300,7 +3312,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 270); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -3327,7 +3339,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 110); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -3354,7 +3366,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 110); ac++;
@@ -3381,7 +3393,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 150); ac++;
@@ -3408,7 +3420,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 80); ac++;
@@ -3435,7 +3447,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 180); ac++;
@@ -3473,7 +3485,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
@@ -3501,7 +3513,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 30); ac++;
@@ -3528,7 +3540,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
+            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 0); ac++;
         XtSetArg(args[ac], XmNy, 0); ac++;
@@ -3592,7 +3604,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 480); ac++;
     XtSetArg(args[ac], XmNheight, 36); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_zoffset = XmCreateScale(form_controls,
         (char *)"scale_controls_zoffset",
@@ -3614,7 +3626,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_zoffset = XmCreateLabel(form_controls,
             (char *)"label_controls_zoffset",
@@ -3642,7 +3654,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_smoothing = XmCreateLabel(form_controls,
             (char *)"label_controls_smoothing",
@@ -3670,7 +3682,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 488); ac++;
     XtSetArg(args[ac], XmNheight, 36); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_smoothing = XmCreateScale(form_controls,
         (char *)"scale_controls_smoothing",
@@ -3703,7 +3715,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 160); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_sectionlength = XmCreateLabel(form_controls,
             (char *)"label_controls_sectionlength",
@@ -3731,7 +3743,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 438); ac++;
     XtSetArg(args[ac], XmNheight, 36); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_sectionlength = XmCreateScale(form_controls,
         (char *)"scale_controls_sectionlength",
@@ -3753,7 +3765,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 489); ac++;
     XtSetArg(args[ac], XmNheight, 36); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_tickinterval = XmCreateScale(form_controls,
         (char *)"scale_controls_tickinterval",
@@ -3775,7 +3787,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 489); ac++;
     XtSetArg(args[ac], XmNheight, 36); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_colorinterval = XmCreateScale(form_controls,
         (char *)"scale_controls_colorinterval",
@@ -3797,7 +3809,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 489); ac++;
     XtSetArg(args[ac], XmNheight, 36); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_contourinterval = XmCreateScale(form_controls,
         (char *)"scale_controls_contourinterval",
@@ -3819,7 +3831,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_contourinterval = XmCreateLabel(form_controls,
             (char *)"label_controls_contourinterval",
@@ -3847,7 +3859,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 130); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_colorinterval = XmCreateLabel(form_controls,
             (char *)"label_controls_colorinterval",
@@ -3875,7 +3887,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_tickinterval = XmCreateLabel(form_controls,
             (char *)"label_controls_tickinterval",
@@ -3902,7 +3914,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls_apply = XmCreatePushButton(form_controls,
             (char *)"pushButton_controls_apply",
@@ -3952,7 +3964,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 489); ac++;
     XtSetArg(args[ac], XmNheight, 36); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_decimation = XmCreateScale(form_controls,
         (char *)"scale_controls_decimation",
@@ -3974,7 +3986,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_decimation = XmCreateLabel(form_controls,
             (char *)"label_controls_decimation",
@@ -4002,7 +4014,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_controls_sectionsoundings = XmCreateLabel(form_controls,
             (char *)"label_controls_sectionsoundings",
@@ -4031,7 +4043,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 439); ac++;
     XtSetArg(args[ac], XmNheight, 43); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     scale_controls_sectionsoundings = XmCreateScale(form_controls,
         (char *)"scale_controls_sectionsoundings",
@@ -4052,7 +4064,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 108); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls_dismiss = XmCreatePushButton(form_controls,
             (char *)"pushButton_controls_dismiss",
@@ -4098,12 +4110,12 @@ CreatemainWindow(Widget parent)
         tmp0 = (XmString) BX_CONVERT(bulletinBoard_modelplot, (char *)"Clear Block",
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 360); ac++;
+        XtSetArg(args[ac], XmNx, 480); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_modelplot_clearblock = XmCreatePushButton(bulletinBoard_modelplot,
             (char *)"pushButton_modelplot_clearblock",
@@ -4123,7 +4135,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
     XtSetArg(args[ac], XmNx, 80); ac++;
     XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 185); ac++;
+    XtSetArg(args[ac], XmNwidth, 270); ac++;
     XtSetArg(args[ac], XmNheight, 32); ac++;
     XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
     radioBox = XmCreateRadioBox(bulletinBoard_modelplot,
@@ -4136,19 +4148,45 @@ CreatemainWindow(Widget parent)
     {
         XmString    tmp0;
 
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Sequential",
+        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Time Series",
+                XmRXmString, 0, &argok);
+        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
+        XtSetArg(args[ac], XmNwidth, 88); ac++;
+        XtSetArg(args[ac], XmNheight, 26); ac++;
+        XtSetArg(args[ac], XmNfontList,
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            XmRFontList, 0, &argok)); if (argok) ac++;
+        toggleButton_modelplot_timeseries = XmCreateToggleButton(radioBox,
+            (char *)"toggleButton_modelplot_timeseries",
+            args,
+            ac);
+        XtManageChild(toggleButton_modelplot_timeseries);
+
+        /**
+         * Free any memory allocated for resources.
+         */
+        XmStringFree((XmString)tmp0);
+    }
+
+    XtAddCallback(toggleButton_modelplot_timeseries, XmNvalueChangedCallback, do_modelplot_timeseries, (XtPointer)0);
+
+    ac = 0;
+    {
+        XmString    tmp0;
+
+        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Perturbation",
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNwidth, 88); ac++;
         XtSetArg(args[ac], XmNheight, 26); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modelplot_sequential = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_modelplot_sequential",
+        toggleButton_modelplot_perturbation = XmCreateToggleButton(radioBox,
+            (char *)"toggleButton_modelplot_perturbation",
             args,
             ac);
-        XtManageChild(toggleButton_modelplot_sequential);
+        XtManageChild(toggleButton_modelplot_perturbation);
 
         /**
          * Free any memory allocated for resources.
@@ -4156,25 +4194,25 @@ CreatemainWindow(Widget parent)
         XmStringFree((XmString)tmp0);
     }
 
-    XtAddCallback(toggleButton_modelplot_sequential, XmNvalueChangedCallback, do_modelplot_sequential, (XtPointer)0);
+    XtAddCallback(toggleButton_modelplot_perturbation, XmNvalueChangedCallback, do_modelplot_perturbation, (XtPointer)0);
 
     ac = 0;
     {
         XmString    tmp0;
 
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Block",
+        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Tie Offsets",
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNwidth, 88); ac++;
         XtSetArg(args[ac], XmNheight, 26); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modelplot_block = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_modelplot_block",
+        toggleButton_modelplot_tieoffsets = XmCreateToggleButton(radioBox,
+            (char *)"toggleButton_modelplot_tieoffsets",
             args,
             ac);
-        XtManageChild(toggleButton_modelplot_block);
+        XtManageChild(toggleButton_modelplot_tieoffsets);
 
         /**
          * Free any memory allocated for resources.
@@ -4182,7 +4220,7 @@ CreatemainWindow(Widget parent)
         XmStringFree((XmString)tmp0);
     }
 
-    XtAddCallback(toggleButton_modelplot_block, XmNvalueChangedCallback, do_modelplot_block, (XtPointer)0);
+    XtAddCallback(toggleButton_modelplot_tieoffsets, XmNvalueChangedCallback, do_modelplot_tieoffsets, (XtPointer)0);
 
     ac = 0;
     {
@@ -4191,12 +4229,12 @@ CreatemainWindow(Widget parent)
         tmp0 = (XmString) BX_CONVERT(bulletinBoard_modelplot, (char *)"Full Size",
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 270); ac++;
+        XtSetArg(args[ac], XmNx, 390); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_modelplot_fullsize = XmCreatePushButton(bulletinBoard_modelplot,
             (char *)"pushButton_modelplot_fullsize",
@@ -4221,12 +4259,12 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 450); ac++;
+        XtSetArg(args[ac], XmNx, 570); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNwidth, 550); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_modelplot_status = XmCreateLabel(bulletinBoard_modelplot,
             (char *)"label_modelplot_status",
@@ -4270,7 +4308,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 60); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_modelplot_dismiss = XmCreatePushButton(bulletinBoard_modelplot,
             (char *)"pushButton_modelplot_dismiss",
diff --git a/src/mbnavadjust/mbnavadjust_creation.h b/src/mbnavadjust/mbnavadjust_creation.h
index 0828b20..deed97d 100644
--- a/src/mbnavadjust/mbnavadjust_creation.h
+++ b/src/mbnavadjust/mbnavadjust_creation.h
@@ -37,8 +37,9 @@
 EXTERNAL Widget   bulletinBoard_modelplot;
 EXTERNAL Widget   pushButton_modelplot_clearblock;
 EXTERNAL Widget   radioBox;
-EXTERNAL Widget   toggleButton_modelplot_sequential;
-EXTERNAL Widget   toggleButton_modelplot_block;
+EXTERNAL Widget   toggleButton_modelplot_timeseries;
+EXTERNAL Widget   toggleButton_modelplot_perturbation;
+EXTERNAL Widget   toggleButton_modelplot_tieoffsets;
 EXTERNAL Widget   label_modelplot_status;
 EXTERNAL Widget   drawingArea_modelplot;
 EXTERNAL Widget   scale_controls_zoffset;
diff --git a/src/mbnavadjust/mbnavadjust_extrawidgets.h b/src/mbnavadjust/mbnavadjust_extrawidgets.h
index 2ddf5e5..b2c2918 100644
--- a/src/mbnavadjust/mbnavadjust_extrawidgets.h
+++ b/src/mbnavadjust/mbnavadjust_extrawidgets.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavedit_extrawidgets.h	8/7/95
- *    $Id: mbnavadjust_extrawidgets.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbnavadjust_extrawidgets.h 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/mbnavadjust/mbnavadjust_io.c b/src/mbnavadjust/mbnavadjust_io.c
index 648e5a4..ff30846 100644
--- a/src/mbnavadjust/mbnavadjust_io.c
+++ b/src/mbnavadjust/mbnavadjust_io.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavadjust_io.c	3/23/00
- *    $Id: mbnavadjust_io.c 2201 2014-08-21 00:49:46Z caress $
+ *    $Id: mbnavadjust_io.c 2238 2015-04-15 06:00:52Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -43,7 +43,7 @@
 /* define mbnavadjust io structures */
 #include "mbnavadjust_io.h"
 
-static char version_id[] = "$Id: mbnavadjust_io.c 2201 2014-08-21 00:49:46Z caress $";
+static char version_id[] = "$Id: mbnavadjust_io.c 2238 2015-04-15 06:00:52Z caress $";
 static char program_name[] = "mbnavadjust i/o functions";
 
 /*--------------------------------------------------------------------*/
@@ -173,7 +173,7 @@ int mbnavadjust_new_project(int verbose, char *projectpath,
                         project->zoffsetwidth = zoffsetwidth;
                         project->inversion = MBNA_INVERSION_NONE;
                         project->modelplot = MB_NO;
-                        project->modelplot_style = MBNA_MODELPLOT_SEQUENTIAL;
+                        project->modelplot_style = MBNA_MODELPLOT_TIMESERIES;
                         project->logfp = NULL;
                         
                         project->inversion = MBNA_INVERSION_NONE;
@@ -246,7 +246,7 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
 	char	obuffer[BUFFER_MAX];
 	char	command[MB_PATH_MAXLINE];
 	char	*result;
-	int	versionmajor, versionminor;
+	int	versionmajor, versionminor, version_id;
 	double	dummy;
 	int	nscan, idummy, jdummy;
 	int	s1id, s2id;
@@ -362,8 +362,9 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
                                                 || strcmp(label,"FILE_VERSION") != 0))
                                         status = MB_FAILURE;
                 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
+				version_id = 100 * versionmajor + versionminor;
                 
-                                if (versionmajor > 3 || (versionmajor == 3 && versionminor > 2))
+                                if (version_id >= 302)
                                         {
                                         if (status == MB_SUCCESS
                                                 && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
@@ -408,6 +409,20 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
                                         status = MB_FAILURE;
                 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
                 
+				if (version_id >= 306)
+					{
+					if (status == MB_SUCCESS
+						&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+							|| (nscan = sscanf(buffer,"%s %d",label,&project->num_blocks)) != 2
+							|| strcmp(label,"NUMBLOCKS") != 0))
+						status = MB_FAILURE;
+					}
+				else
+					{
+					project->num_blocks = 0;
+					}
+		if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
+
                                 if (status == MB_SUCCESS
                                         && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                 || (nscan = sscanf(buffer,"%s %d",label,&project->num_crossings)) != 2
@@ -423,7 +438,7 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
                 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
                 
                                 if (status == MB_SUCCESS
-                                        && ((100*versionmajor + versionminor) > 100)
+                                        && version_id >= 101
                                         && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                 || (nscan = sscanf(buffer,"%s %d",label,&project->section_soundings)) != 2
                                                 || strcmp(label,"SECTIONSOUNDINGS") != 0))
@@ -467,7 +482,7 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
                 
                                 if (status == MB_SUCCESS)
                                         {
-                                        if (versionmajor > 3 || (versionmajor == 3 && versionminor > 0))
+                                        if (version_id >= 301)
                                                 {
                                                 if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                         || (nscan = sscanf(buffer,"%s %lf",label,&project->smoothing)) != 2
@@ -475,7 +490,7 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
                                                         status = MB_FAILURE;
                                                 project->precision = SIGMA_MINIMUM;
                                                 }
-                                        else if (versionmajor > 1 || (versionmajor == 1 && versionminor > 2))
+                                        else if (version_id >= 103)
                                                 {
                                                 if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                         || (nscan = sscanf(buffer,"%s %lf",label,&project->precision)) != 2
@@ -493,7 +508,7 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
                 
                                 if (status == MB_SUCCESS)
                                         {
-                                        if ((versionmajor > 1 || (versionmajor == 1 && versionminor > 4))
+                                        if (version_id >= 105
                                                 && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                         || (nscan = sscanf(buffer,"%s %lf",label,&project->zoffsetwidth)) != 2
                                                         || strcmp(label,"ZOFFSETWIDTH") != 0))
@@ -549,21 +564,50 @@ int mbnavadjust_read_project(int verbose, char *projectpath,
                                         file->num_snavs = 0;
                                         file->num_pings = 0;
                                         file->num_beams = 0;
-                                        if (status == MB_SUCCESS
-                                                && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                        || (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
-                                                        &idummy,
-                                                        &(file->status),
-                                                        &(file->id),
-                                                        &(file->format),
-                                                        &(file->heading_bias_import),
-                                                        &(file->roll_bias_import),
-                                                        &(file->heading_bias),
-                                                        &(file->roll_bias),
-                                                        &(file->num_sections),
-                                                        &(file->output_id),
-                                                        file->file)) != 11))
-                                                status = MB_FAILURE;
+					if (version_id >= 306)
+						{
+						if (status == MB_SUCCESS
+							&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+								|| (nscan = sscanf(buffer,"FILE %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %d %d %s",
+								&idummy,
+								&(file->status),
+								&(file->id),
+								&(file->format),
+								&(file->block),
+								&(file->block_offset_x),
+								&(file->block_offset_y),
+								&(file->block_offset_z),
+								&(file->heading_bias_import),
+								&(file->roll_bias_import),
+								&(file->heading_bias),
+								&(file->roll_bias),
+								&(file->num_sections),
+								&(file->output_id),
+								file->file)) != 15))
+							status = MB_FAILURE;
+						}
+					else
+						{
+						if (status == MB_SUCCESS
+							&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+								|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
+								&idummy,
+								&(file->status),
+								&(file->id),
+								&(file->format),
+								&(file->heading_bias_import),
+								&(file->roll_bias_import),
+								&(file->heading_bias),
+								&(file->roll_bias),
+								&(file->num_sections),
+								&(file->output_id),
+								file->file)) != 11))
+							status = MB_FAILURE;
+						file->block = 0;
+						file->block_offset_x = 0.0;
+						file->block_offset_y = 0.0;
+						file->block_offset_z = 0.0;
+						}
                 
                                         /* set file->path as absolute path
                                             - file->file may be a relative path */
@@ -680,39 +724,90 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
                                                         }
                 
                                                     /* reverse offset values if older values */
-                                                    if (versionmajor < 3)
+                                                    if (version_id < 300)
                                                         {
                                                         section->snav_lon_offset[k] *= -1.0;
                                                         section->snav_lat_offset[k] *= -1.0;
                                                         section->snav_z_offset[k] *= -1.0;
                                                         }
                                                     }
-                                                section->global_start_ping = project->num_pings;
-                                                section->global_start_snav = project->num_snavs - section->continuity;
-                                                file->num_snavs += section->num_pings;
-                                                file->num_pings += section->num_pings;
-                                                file->num_beams += section->num_beams;
-                                                project->num_snavs += (section->num_snav - section->continuity);
-                                                project->num_pings += section->num_pings;
-                                                project->num_beams += section->num_beams;
-                                                }
-                                        }
-                
-                                /* count the number of blocks */
-                                project->num_blocks = 0;
-                                for (i=0;i<project->num_files;i++)
-                                    {
-                                    file = &project->files[i];
-                                    if (i==0 || file->sections[0].continuity == MB_NO)
-                                        {
-                                        project->num_blocks++;
-                                        }
-                                    file->block = project->num_blocks - 1;
-                                    file->block_offset_x = 0.0;
-                                    file->block_offset_y = 0.0;
-                                    file->block_offset_z = 0.0;
-                                    }
+						
+						/* global fixed frame tie, whether defined or not */
+						if (version_id >= 305)
+							{
+							if (status == MB_SUCCESS)
+								result = fgets(buffer,BUFFER_MAX,hfp);
+							if (status == MB_SUCCESS && result == buffer)
+								nscan = sscanf(buffer,"GLOBALTIE %d %d %lf %lf %lf %lf %lf %lf",
+									&section->global_tie_status,
+									&section->global_tie_snav,
+									&section->global_tie_offset_x,
+									&section->global_tie_offset_y,
+									&section->global_tie_offset_z_m,
+									&section->global_tie_xsigma,
+									&section->global_tie_ysigma,
+									&section->global_tie_zsigma);
+							mb_coor_scale(verbose,0.5 * (section->latmin + section->latmax),
+									&mtodeglon,&mtodeglat);
+							section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
+							section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
+							}
+						else if (version_id == 304)
+							{
+							if (status == MB_SUCCESS)
+								result = fgets(buffer,BUFFER_MAX,hfp);
+							if (status == MB_SUCCESS && result == buffer)
+								nscan = sscanf(buffer,"GLOBALTIE %d %lf %lf %lf %lf %lf %lf",
+									&section->global_tie_snav,
+									&section->global_tie_offset_x,
+									&section->global_tie_offset_y,
+									&section->global_tie_offset_z_m,
+									&section->global_tie_xsigma,
+									&section->global_tie_ysigma,
+									&section->global_tie_zsigma);
+							if (section->global_tie_snav != MBNA_SELECT_NONE)
+								section->global_tie_status = MBNA_TIE_XYZ;
+							else
+								section->global_tie_status = MBNA_TIE_NONE;
+							mb_coor_scale(verbose,0.5 * (section->latmin + section->latmax),
+									&mtodeglon,&mtodeglat);
+							section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
+							section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
+							}
+						else
+							{
+							section->global_tie_status = MBNA_TIE_NONE;
+							section->global_tie_snav = MBNA_SELECT_NONE;
+							section->global_tie_offset_x = 0.0;
+							section->global_tie_offset_y = 0.0;
+							section->global_tie_offset_x_m = 0.0;
+							section->global_tie_offset_y_m = 0.0;
+							section->global_tie_offset_z_m = 0.0;
+							section->global_tie_xsigma = 0.0;
+							section->global_tie_ysigma = 0.0;
+							section->global_tie_zsigma = 0.0;
+							}
+						}
+					}
                 
+				/* count the number of blocks */
+				if (version_id < 306)
+					{
+					project->num_blocks = 0;
+					for (i=0;i<project->num_files;i++)
+						{
+						file = &project->files[i];
+						if (i==0 || file->sections[0].continuity == MB_NO)
+							{
+							project->num_blocks++;
+							}
+						file->block = project->num_blocks - 1;
+						file->block_offset_x = 0.0;
+						file->block_offset_y = 0.0;
+						file->block_offset_z = 0.0;
+						}
+					}
+		    
                                 /* read crossings */
                                 project->num_crossings_analyzed = 0;
                                 project->num_goodcrossings = 0;
@@ -724,7 +819,7 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
                                         /* read each crossing */
                                         crossing = &project->crossings[i];
                                         if (status == MB_SUCCESS
-                                                && ((100*versionmajor + versionminor) >= 106))
+                                                && version_id >= 106)
                                                 {
                                                 if (status == MB_SUCCESS
                                                         && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
@@ -744,7 +839,7 @@ fprintf(stderr, "read failed on crossing: %s\n", buffer);
                                                                 }
                                                 }
                                         else if (status == MB_SUCCESS
-                                                && ((100*versionmajor + versionminor) >= 102))
+                                                && version_id >= 102)
                                                 {
                                                 crossing->overlap = 0;
                                                 if (status == MB_SUCCESS
@@ -795,7 +890,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
                 
                                         /* reorder crossing to be early file first older file second if
                                                 file version prior to 3.00 */
-                                        if (versionmajor < 3)
+                                        if (version_id < 300)
                                                 {
                                                 idummy = crossing->file_id_1;
                                                 jdummy = crossing->section_1;
@@ -811,7 +906,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
                                                 {
                                                 /* read each tie */
                                                 tie = &crossing->ties[j];
-                                                if (status == MB_SUCCESS && ((100*versionmajor + versionminor) > 301))
+                                                if (status == MB_SUCCESS && version_id >= 302)
                                                         {
                                                         if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                                 || (nscan = sscanf(buffer,"TIE %d %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
@@ -833,7 +928,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
 fprintf(stderr, "read failed on tie: %s\n", buffer);
                                                                 }
                                                         }
-                                                else if (status == MB_SUCCESS && ((100*versionmajor + versionminor) > 103))
+                                                else if (status == MB_SUCCESS && version_id >= 104)
                                                         {
                                                         if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                                 || (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
@@ -880,7 +975,7 @@ fprintf(stderr, "read failed on tie: %s\n", buffer);
                 
                                                 /* reorder crossing to be early file first older file second if
                                                         file version prior to 3.00 */
-                                                if (versionmajor < 3)
+                                                if (version_id < 300)
                                                         {
                                                         idummy = tie->snav_1;
                                                         dummy = tie->snav_1_time_d;
@@ -897,7 +992,7 @@ fprintf(stderr, "read failed on tie: %s\n", buffer);
                                                         }
                 
                                                 /* for version 2.0 or later read covariance */
-                                                if (status == MB_SUCCESS && ((100*versionmajor + versionminor) >= 200))
+                                                if (status == MB_SUCCESS && version_id >= 200)
                                                         {
                                                         if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
                                                                 || (nscan = sscanf(buffer,"COV %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
@@ -1260,13 +1355,14 @@ fprintf(stderr,"Writing project %s\n", project->name);
 		fprintf(hfp,"##MBNAVADJUST PROJECT\n");
 		fprintf(hfp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
 		fprintf(hfp,"PROGRAM_VERSION\t%s\n",version_id);
-		fprintf(hfp,"FILE_VERSION\t3.03\n");
+		fprintf(hfp,"FILE_VERSION\t3.06\n");
 		fprintf(hfp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
 		fprintf(hfp,"NAME\t%s\n",project->name);
 		fprintf(hfp,"PATH\t%s\n",project->path);
 		fprintf(hfp,"HOME\t%s\n",project->home);
 		fprintf(hfp,"DATADIR\t%s\n",project->datadir);
 		fprintf(hfp,"NUMFILES\t%d\n",project->num_files);
+		fprintf(hfp,"NUMBLOCKS\t%d\n",project->num_blocks);
 		fprintf(hfp,"NUMCROSSINGS\t%d\n",project->num_crossings);
 		fprintf(hfp,"SECTIONLENGTH\t%f\n",project->section_length);
 		fprintf(hfp,"SECTIONSOUNDINGS\t%d\n",project->section_soundings);
@@ -1281,11 +1377,15 @@ fprintf(stderr,"Writing project %s\n", project->name);
 			{
 			/* write out basic file info */
 			file = &project->files[i];
-			fprintf(hfp,"FILE %4d %4d %4d %4d %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
+			fprintf(hfp,"FILE %4d %4d %4d %4d %4d %13.8f %13.8f %13.8f %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
 				i,
 				file->status,
 				file->id,
 				file->format,
+				file->block,
+				file->block_offset_x,
+				file->block_offset_y,
+				file->block_offset_z,
 				file->heading_bias_import,
 				file->roll_bias_import,
 				file->heading_bias,
@@ -1335,6 +1435,15 @@ fprintf(stderr,"Writing project %s\n", project->name);
 					    section->snav_lat_offset[k],
 					    section->snav_z_offset[k]);
 				    }
+				fprintf(hfp,"GLOBALTIE %2d %4d %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
+						section->global_tie_status,
+						section->global_tie_snav,
+						section->global_tie_offset_x,
+						section->global_tie_offset_y,
+						section->global_tie_offset_z_m,
+						section->global_tie_xsigma,
+						section->global_tie_ysigma,
+						section->global_tie_zsigma);
 				}
 			}
 
diff --git a/src/mbnavadjust/mbnavadjust_io.h b/src/mbnavadjust/mbnavadjust_io.h
index 879e3ff..86ed69e 100644
--- a/src/mbnavadjust/mbnavadjust_io.h
+++ b/src/mbnavadjust/mbnavadjust_io.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavadjust_io.h	4/18/2014
- *    $Id: mbnavadjust_io.h 2201 2014-08-21 00:49:46Z caress $
+ *    $Id: mbnavadjust_io.h 2238 2015-04-15 06:00:52Z caress $
  
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -50,6 +50,7 @@
 #define	MBNA_FILE_FIXEDNAV		3
 #define	MBNA_FILE_FIXEDXYNAV		4
 #define	MBNA_FILE_FIXEDZNAV		5
+#define	MBNA_TIE_NONE			0
 #define	MBNA_TIE_XYZ			1
 #define	MBNA_TIE_XY			2
 #define	MBNA_TIE_Z			3
@@ -93,8 +94,9 @@
 #define MBNA_BIAS_DIFFERENT		1
 #define MBNA_OVERLAP_THRESHOLD		25
 
-#define	MBNA_MODELPLOT_SEQUENTIAL	0
-#define	MBNA_MODELPLOT_SURVEY		1
+#define	MBNA_MODELPLOT_TIMESERIES	0
+#define	MBNA_MODELPLOT_PERTURBATION	1
+#define	MBNA_MODELPLOT_TIEOFFSETS	2
 #define	MBNA_MODELPLOT_LEFT_WIDTH	25
 #define	MBNA_MODELPLOT_LEFT_HEIGHT	65
 #define	MBNA_MODELPLOT_X_SPACE		10
@@ -166,6 +168,16 @@ struct mbna_section {
 	int	show_in_modelplot;
 	int	modelplot_start_count;
 	int	contoursuptodate;
+	int	global_tie_status;
+	int	global_tie_snav;
+	double	global_tie_offset_x;
+	double	global_tie_offset_y;
+	double	global_tie_offset_x_m;
+	double	global_tie_offset_y_m;
+	double	global_tie_offset_z_m;
+	double	global_tie_xsigma;
+	double	global_tie_ysigma;
+	double	global_tie_zsigma;
 };
 struct mbna_file {
 	int	status;
diff --git a/src/mbnavadjust/mbnavadjust_prog.c b/src/mbnavadjust/mbnavadjust_prog.c
index 16fecab..2c09bbb 100644
--- a/src/mbnavadjust/mbnavadjust_prog.c
+++ b/src/mbnavadjust/mbnavadjust_prog.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavadjust_prog.c	3/23/00
- *    $Id: mbnavadjust_prog.c 2219 2014-12-11 21:22:25Z caress $
+ *    $Id: mbnavadjust_prog.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -77,7 +77,7 @@ struct swathraw
 	};
 
 /* id variables */
-static char rcs_id[] = "$Id: mbnavadjust_prog.c 2219 2014-12-11 21:22:25Z caress $";
+static char rcs_id[] = "$Id: mbnavadjust_prog.c 2239 2015-05-07 00:51:42Z caress $";
 static char program_name[] = "mbnavadjust";
 static char help_message[] =  "mbnavadjust is an interactive navigation adjustment package for swath sonar data.\n";
 static char usage_message[] = "mbnavadjust [-Iproject -V -H]";
@@ -121,6 +121,9 @@ double	timegap;
 #define GREEN	3
 #define BLUE	4
 #define CORAL	5
+#define YELLOW	6
+#define ORANGE	23
+#define PURPLE	255
 
 #define	XG_SOLIDLINE	0
 #define	XG_DASHLINE	1
@@ -217,11 +220,12 @@ int mbnavadjust_init_globals()
 	project.num_ties = 0;
 	project.inversion = MBNA_INVERSION_NONE;
 	project.modelplot = MB_NO;
-	project.modelplot_style = MBNA_MODELPLOT_SEQUENTIAL;
+	project.modelplot_style = MBNA_MODELPLOT_TIMESERIES;
 	project.logfp = NULL;
  	mbna_status = MBNA_STATUS_GUI;
  	mbna_view_list = MBNA_VIEW_LIST_FILES;
  	mbna_view_mode = MBNA_VIEW_MODE_ALL;
+	mbna_invert_mode = MBNA_INVERT_ZISOLATED;
 	mbna_color_foreground = BLACK;
 	mbna_color_background = WHITE;
  	project.section_length = 0.14;
@@ -230,12 +234,12 @@ int mbnavadjust_init_globals()
 	project.precision = SIGMA_MINIMUM;
 	project.smoothing = MBNA_SMOOTHING_DEFAULT;
 	project.zoffsetwidth = 5.0;
-	mbna_file_id_1 = -1;
-	mbna_section_1 = -1;
-	mbna_file_id_2 = -1;
-	mbna_section_2 = -1;
- 	mbna_current_crossing = -1;
- 	mbna_current_tie = -1;
+	mbna_file_id_1 = MBNA_SELECT_NONE;
+	mbna_section_1 = MBNA_SELECT_NONE;
+	mbna_file_id_2 = MBNA_SELECT_NONE;
+	mbna_section_2 = MBNA_SELECT_NONE;
+ 	mbna_current_crossing = MBNA_SELECT_NONE;
+ 	mbna_current_tie = MBNA_SELECT_NONE;
 	mbna_naverr_load = MB_NO;
  	mbna_file_select = MBNA_SELECT_NONE;
  	mbna_survey_select = MBNA_SELECT_NONE;
@@ -258,6 +262,7 @@ int mbnavadjust_init_globals()
 	mbna_contour2.vector = NULL;
 	mbna_smoothweight = 100.0;
 	mbna_offsetweight = 0.01;
+	mbna_zweightfactor = 1.0;
 	mbna_misfit_center = MBNA_MISFIT_AUTOCENTER;
 	mbna_minmisfit_nthreshold = MBNA_MISFIT_NTHRESHOLD;
 	mbna_minmisfit = 0.0;
@@ -655,7 +660,11 @@ int mbnavadjust_file_new(char *projectname)
 				project.zoffsetwidth = 5.0;
 
 				/* create data directory */
+#ifdef WIN32
+				if (_mkdir(project.datadir) != 0)
+#else
 				if (mkdir(project.datadir,00775) != 0)
+#endif
 					{
 					strcpy(error1,"Unable to create new project!");
 					strcpy(error2,"Error creating data directory.");
@@ -1024,13 +1033,14 @@ fprintf(stderr,"Writing project %s\n", project.name);
 		fprintf(hfp,"##MBNAVADJUST PROJECT\n");
 		fprintf(hfp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
 		fprintf(hfp,"PROGRAM_VERSION\t%s\n",rcs_id);
-		fprintf(hfp,"FILE_VERSION\t3.03\n");
+		fprintf(hfp,"FILE_VERSION\t3.06\n");
 		fprintf(hfp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
 		fprintf(hfp,"NAME\t%s\n",project.name);
 		fprintf(hfp,"PATH\t%s\n",project.path);
 		fprintf(hfp,"HOME\t%s\n",project.home);
 		fprintf(hfp,"DATADIR\t%s\n",project.datadir);
 		fprintf(hfp,"NUMFILES\t%d\n",project.num_files);
+		fprintf(hfp,"NUMBLOCKS\t%d\n",project.num_blocks);
 		fprintf(hfp,"NUMCROSSINGS\t%d\n",project.num_crossings);
 		fprintf(hfp,"SECTIONLENGTH\t%f\n",project.section_length);
 		fprintf(hfp,"SECTIONSOUNDINGS\t%d\n",project.section_soundings);
@@ -1045,39 +1055,43 @@ fprintf(stderr,"Writing project %s\n", project.name);
 			{
 			/* write out basic file info */
 			file = &project.files[i];
-			fprintf(hfp,"FILE %4d %4d %4d %4d %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
-				i,
-				file->status,
-				file->id,
-				file->format,
-				file->heading_bias_import,
-				file->roll_bias_import,
-				file->heading_bias,
-				file->roll_bias,
-				file->num_sections,
-				file->output_id,
-				file->file);
+			fprintf(hfp,"FILE %4d %4d %4d %4d %4d %13.8f %13.8f %13.8f %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
+					i,
+					file->status,
+					file->id,
+					file->format,
+					file->block,
+					file->block_offset_x,
+					file->block_offset_y,
+					file->block_offset_z,
+					file->heading_bias_import,
+					file->roll_bias_import,
+					file->heading_bias,
+					file->roll_bias,
+					file->num_sections,
+					file->output_id,
+					file->file);
 
 			/* write out section info */
 			for (j=0;j<file->num_sections;j++)
 				{
 				section = &file->sections[j];
 				fprintf(hfp,"SECTION %4d %5d %5d %d %d %10.6f %16.6f %16.6f %13.8f %13.8f %13.8f %13.8f %9.3f %9.3f %d\n",
-					j,
-					section->num_pings,
-					section->num_beams,
-					section->num_snav,
-					section->continuity,
-					section->distance,
-					section->btime_d,
-					section->etime_d,
-					section->lonmin,
-					section->lonmax,
-					section->latmin,
-					section->latmax,
-					section->depthmin,
-					section->depthmax,
-					section->contoursuptodate);
+						j,
+						section->num_pings,
+						section->num_beams,
+						section->num_snav,
+						section->continuity,
+						section->distance,
+						section->btime_d,
+						section->etime_d,
+						section->lonmin,
+						section->lonmax,
+						section->latmin,
+						section->latmax,
+						section->depthmin,
+						section->depthmax,
+						section->contoursuptodate);
 				for (k=MBNA_MASK_DIM-1;k>=0;k--)
 				    {
 				    for (l=0;l<MBNA_MASK_DIM;l++)
@@ -1089,16 +1103,25 @@ fprintf(stderr,"Writing project %s\n", project.name);
 				for (k=0;k<section->num_snav;k++)
 				    {
 				    fprintf(hfp,"SNAV %4d %5d %10.6f %16.6f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-					    k,
-					    section->snav_id[k],
-					    section->snav_distance[k],
-					    section->snav_time_d[k],
-					    section->snav_lon[k],
-					    section->snav_lat[k],
-					    section->snav_lon_offset[k],
-					    section->snav_lat_offset[k],
-					    section->snav_z_offset[k]);
+						k,
+						section->snav_id[k],
+						section->snav_distance[k],
+						section->snav_time_d[k],
+						section->snav_lon[k],
+						section->snav_lat[k],
+						section->snav_lon_offset[k],
+						section->snav_lat_offset[k],
+						section->snav_z_offset[k]);
 				    }
+				fprintf(hfp,"GLOBALTIE %2d %4d %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
+						section->global_tie_status,
+						section->global_tie_snav,
+						section->global_tie_offset_x,
+						section->global_tie_offset_y,
+						section->global_tie_offset_z_m,
+						section->global_tie_xsigma,
+						section->global_tie_ysigma,
+						section->global_tie_zsigma);
 				}
 			}
 
@@ -1167,7 +1190,7 @@ fprintf(stderr,"Writing project %s\n", project.name);
 		do_info_add(message, MB_YES);
 		}
 
-	/* open and write datalist file */
+	/* open and write datalist files */
 	sprintf(datalist,"%s%s.mb-1",project.path,project.name);
 	if ((hfp = fopen(datalist,"w")) != NULL)
 		{
@@ -1179,14 +1202,33 @@ fprintf(stderr,"Writing project %s\n", project.name);
 			}
 		fclose(hfp);
 		}
-
-	/* else set error */
-	else
+	sprintf(datalist,"%s/%s.dir/datalist_unfixed.mb-1",project.path,project.name);
+	if ((hfp = fopen(datalist,"w")) != NULL)
 		{
-		status = MB_FAILURE;
-		sprintf(message,"Unable to update project %s\n > Datalist file: %s\n",
-			project.name, datalist);
-		do_info_add(message, MB_YES);
+		for (i=0;i<project.num_files;i++)
+			{
+			/* write file entry for each unfixed file */
+			if (project.files[i].status != MBNA_FILE_FIXEDNAV)
+				{
+				file = &project.files[i];
+				fprintf(hfp,"../%s %d\n", file->file, file->format);
+				}
+			}
+		fclose(hfp);
+		}
+	sprintf(datalist,"%s/%s.dir/datalist_fixed.mb-1",project.path,project.name);
+	if ((hfp = fopen(datalist,"w")) != NULL)
+		{
+		for (i=0;i<project.num_files;i++)
+			{
+			/* write file entry for each unfixed file */
+			if (project.files[i].status == MBNA_FILE_FIXEDNAV)
+				{
+				file = &project.files[i];
+				fprintf(hfp,"../%s %d\n", file->file, file->format);
+				}
+			}
+		fclose(hfp);
 		}
 
 	/* write mbgrdviz route files in which each tie point or crossing is a two point route
@@ -1980,8 +2022,9 @@ int mbnavadjust_read_project()
 	char	obuffer[BUFFER_MAX];
 	char	command[MB_PATH_MAXLINE];
 	char	*result;
-	int	versionmajor, versionminor;
+	int	versionmajor, versionminor, version_id;
 	double	dummy;
+	double	mtodeglon, mtodeglat;
 	int	nscan, idummy, jdummy;
 	int	s1id, s2id;
 	int	shellstatus;
@@ -2029,8 +2072,9 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 				|| strcmp(label,"FILE_VERSION") != 0))
 			status = MB_FAILURE;
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
+		version_id = 100 * versionmajor + versionminor;
 
-		if (versionmajor > 3 || (versionmajor == 3 && versionminor > 2))
+		if (version_id >= 302)
 			{
 			if (status == MB_SUCCESS
 				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
@@ -2075,6 +2119,20 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 			status = MB_FAILURE;
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
 
+		if (version_id >= 306)
+			{
+			if (status == MB_SUCCESS
+				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+					|| (nscan = sscanf(buffer,"%s %d",label,&project.num_blocks)) != 2
+					|| strcmp(label,"NUMBLOCKS") != 0))
+				status = MB_FAILURE;
+			}
+		else
+			{
+			project.num_blocks = 0;
+			}
+if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
+
 		if (status == MB_SUCCESS
 			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 				|| (nscan = sscanf(buffer,"%s %d",label,&project.num_crossings)) != 2
@@ -2090,7 +2148,7 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
 
 		if (status == MB_SUCCESS
-			&& ((100*versionmajor + versionminor) > 100)
+			&& version_id >= 101
 			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 				|| (nscan = sscanf(buffer,"%s %d",label,&project.section_soundings)) != 2
 				|| strcmp(label,"SECTIONSOUNDINGS") != 0))
@@ -2134,7 +2192,7 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 
 		if (status == MB_SUCCESS)
 			{
-			if (versionmajor > 3 || (versionmajor == 3 && versionminor > 0))
+			if (version_id >= 301)
 				{
 				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 					|| (nscan = sscanf(buffer,"%s %lf",label,&project.smoothing)) != 2
@@ -2142,7 +2200,7 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 					status = MB_FAILURE;
 				project.precision = SIGMA_MINIMUM;
 				}
-			else if (versionmajor > 1 || (versionmajor == 1 && versionminor > 2))
+			else if (version_id >= 103)
 				{
 				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 					|| (nscan = sscanf(buffer,"%s %lf",label,&project.precision)) != 2
@@ -2160,13 +2218,11 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__F
 
 		if (status == MB_SUCCESS)
 			{
-			if ((versionmajor > 1 || (versionmajor == 1 && versionminor > 4))
+			if (version_id >= 105
 				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 					|| (nscan = sscanf(buffer,"%s %lf",label,&project.zoffsetwidth)) != 2
 					|| strcmp(label,"ZOFFSETWIDTH") != 0))
 				status = MB_FAILURE;
-			else
-				project.zoffsetwidth = 5.0;
 			}
 
 		/* allocate memory for files array */
@@ -2216,21 +2272,50 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__F
 			file->num_snavs = 0;
 			file->num_pings = 0;
 			file->num_beams = 0;
-			if (status == MB_SUCCESS
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
-					&idummy,
-					&(file->status),
-					&(file->id),
-					&(file->format),
-					&(file->heading_bias_import),
-					&(file->roll_bias_import),
-					&(file->heading_bias),
-					&(file->roll_bias),
-					&(file->num_sections),
-					&(file->output_id),
-					file->file)) != 11))
-				status = MB_FAILURE;
+			if (version_id >= 306)
+				{
+				if (status == MB_SUCCESS
+					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %d %d %s",
+						&idummy,
+						&(file->status),
+						&(file->id),
+						&(file->format),
+						&(file->block),
+						&(file->block_offset_x),
+						&(file->block_offset_y),
+						&(file->block_offset_z),
+						&(file->heading_bias_import),
+						&(file->roll_bias_import),
+						&(file->heading_bias),
+						&(file->roll_bias),
+						&(file->num_sections),
+						&(file->output_id),
+						file->file)) != 15))
+					status = MB_FAILURE;
+				}
+			else
+				{
+				if (status == MB_SUCCESS
+					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
+						&idummy,
+						&(file->status),
+						&(file->id),
+						&(file->format),
+						&(file->heading_bias_import),
+						&(file->roll_bias_import),
+						&(file->heading_bias),
+						&(file->roll_bias),
+						&(file->num_sections),
+						&(file->output_id),
+						file->file)) != 11))
+					status = MB_FAILURE;
+				file->block = 0;
+				file->block_offset_x = 0.0;
+				file->block_offset_y = 0.0;
+				file->block_offset_z = 0.0;
+				}
 
 			/* set file->path as absolute path
 			    - file->file may be a relative path */
@@ -2292,14 +2377,14 @@ fprintf(stderr, "read failed on section: %s\n", buffer);
 				if (nscan < 15)
 					section->contoursuptodate = MB_NO;
 				for (k=MBNA_MASK_DIM-1;k>=0;k--)
-				    {
-				    if (status == MB_SUCCESS)
-					result = fgets(buffer,BUFFER_MAX,hfp);
-				    for (l=0;l<MBNA_MASK_DIM;l++)
 					{
-					sscanf(&buffer[l], "%1d", &section->coverage[l+k*MBNA_MASK_DIM]);
+					if (status == MB_SUCCESS)
+					    result = fgets(buffer,BUFFER_MAX,hfp);
+					for (l=0;l<MBNA_MASK_DIM;l++)
+						{
+						sscanf(&buffer[l], "%1d", &section->coverage[l+k*MBNA_MASK_DIM]);
+						}
 					}
-				    }
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
 /*fprintf(stderr,"%s/nvs_%4.4d_%4.4d.mb71\n",
 project.datadir,file->id,j);
@@ -2347,13 +2432,87 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
 					}
 
 				    /* reverse offset values if older values */
-				    if (versionmajor < 3)
+				    if (version_id < 300)
 					{
 				    	section->snav_lon_offset[k] *= -1.0;
 				    	section->snav_lat_offset[k] *= -1.0;
 				    	section->snav_z_offset[k] *= -1.0;
 					}
 				    }
+				    
+				/* global fixed frame tie, whether defined or not */
+				if (version_id >= 305)
+					{
+					if (status == MB_SUCCESS)
+						result = fgets(buffer,BUFFER_MAX,hfp);
+					if (status == MB_SUCCESS && result == buffer)
+						nscan = sscanf(buffer,"GLOBALTIE %d %d %lf %lf %lf %lf %lf %lf",
+							&section->global_tie_status,
+							&section->global_tie_snav,
+							&section->global_tie_offset_x,
+							&section->global_tie_offset_y,
+							&section->global_tie_offset_z_m,
+							&section->global_tie_xsigma,
+							&section->global_tie_ysigma,
+							&section->global_tie_zsigma);
+					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
+							&mtodeglon,&mtodeglat);
+					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
+					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
+/* if (section->global_tie_status != MBNA_TIE_NONE)
+fprintf(stderr,"READ GLOBALTIE: %d %d %lf %lf %lf %lf %lf %lf\n",
+section->global_tie_status,
+section->global_tie_snav,
+section->global_tie_offset_x,
+section->global_tie_offset_y,
+section->global_tie_offset_z_m,
+section->global_tie_xsigma,
+section->global_tie_ysigma,
+section->global_tie_zsigma); */
+					}
+				else if (version_id == 304)
+					{
+					if (status == MB_SUCCESS)
+						result = fgets(buffer,BUFFER_MAX,hfp);
+					if (status == MB_SUCCESS && result == buffer)
+						nscan = sscanf(buffer,"GLOBALTIE %d %lf %lf %lf %lf %lf %lf",
+							&section->global_tie_snav,
+							&section->global_tie_offset_x,
+							&section->global_tie_offset_y,
+							&section->global_tie_offset_z_m,
+							&section->global_tie_xsigma,
+							&section->global_tie_ysigma,
+							&section->global_tie_zsigma);
+					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
+							&mtodeglon,&mtodeglat);
+					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
+					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
+					if (section->global_tie_snav != MBNA_SELECT_NONE)
+						section->global_tie_status = MBNA_TIE_XYZ;
+					else
+						section->global_tie_status = MBNA_TIE_NONE;
+/* if (section->global_tie_snav != MBNA_SELECT_NONE)
+fprintf(stderr,"READ GLOBALTIE: %d %lf %lf %lf %lf %lf %lf\n",
+section->global_tie_snav,
+section->global_tie_offset_x,
+section->global_tie_offset_y,
+section->global_tie_offset_z_m,
+section->global_tie_xsigma,
+section->global_tie_ysigma,
+section->global_tie_zsigma); */
+					}
+				else
+					{
+					section->global_tie_snav = MBNA_TIE_NONE;
+					section->global_tie_snav = MBNA_SELECT_NONE;
+					section->global_tie_offset_x = 0.0;
+					section->global_tie_offset_y = 0.0;
+					section->global_tie_offset_z_m = 0.0;
+					section->global_tie_xsigma = 0.0;
+					section->global_tie_ysigma = 0.0;
+					section->global_tie_zsigma = 0.0;
+					}
+
 				section->global_start_ping = project.num_pings;
 				section->global_start_snav = project.num_snavs - section->continuity;
 				file->num_snavs += section->num_pings;
@@ -2366,19 +2525,22 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
 			}
 
 		/* count the number of blocks */
-		project.num_blocks = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (i==0 || file->sections[0].continuity == MB_NO)
-		    	{
-			project.num_blocks++;
+		if (version_id < 306)
+			{
+			project.num_blocks = 0;
+			for (i=0;i<project.num_files;i++)
+				{
+				file = &project.files[i];
+				if (i==0 || file->sections[0].continuity == MB_NO)
+					{
+					project.num_blocks++;
+					}
+				file->block = project.num_blocks - 1;
+				file->block_offset_x = 0.0;
+				file->block_offset_y = 0.0;
+				file->block_offset_z = 0.0;
+				}
 			}
-		    file->block = project.num_blocks - 1;
-		    file->block_offset_x = 0.0;
-		    file->block_offset_y = 0.0;
-		    file->block_offset_z = 0.0;
-		    }
 
 		/* read crossings */
  		project.num_crossings_analyzed = 0;
@@ -2391,7 +2553,7 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
 			/* read each crossing */
 			crossing = &project.crossings[i];
 			if (status == MB_SUCCESS
-				&& ((100*versionmajor + versionminor) >= 106))
+				&& version_id >= 106)
 				{
 				if (status == MB_SUCCESS
 					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
@@ -2411,7 +2573,7 @@ fprintf(stderr, "read failed on crossing: %s\n", buffer);
 						}
 				}
 			else if (status == MB_SUCCESS
-				&& ((100*versionmajor + versionminor) >= 102))
+				&& version_id >= 102)
 				{
 				crossing->overlap = 0;
 				if (status == MB_SUCCESS
@@ -2462,7 +2624,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
 
 			/* reorder crossing to be early file first older file second if
 				file version prior to 3.00 */
-			if (versionmajor < 3)
+			if (version_id < 300)
 				{
 				idummy = crossing->file_id_1;
 				jdummy = crossing->section_1;
@@ -2478,7 +2640,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
 				{
 				/* read each tie */
 				tie = &crossing->ties[j];
-				if (status == MB_SUCCESS && ((100*versionmajor + versionminor) > 301))
+				if (status == MB_SUCCESS && version_id >= 302)
 					{
 					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 						|| (nscan = sscanf(buffer,"TIE %d %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
@@ -2500,7 +2662,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
 fprintf(stderr, "read failed on tie: %s\n", buffer);
 						}
 					}
-				else if (status == MB_SUCCESS && ((100*versionmajor + versionminor) > 103))
+				else if (status == MB_SUCCESS && version_id >= 104)
 					{
 					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 						|| (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
@@ -2547,7 +2709,7 @@ fprintf(stderr, "read failed on tie: %s\n", buffer);
 
 				/* reorder crossing to be early file first older file second if
 					file version prior to 3.00 */
-				if (versionmajor < 3)
+				if (version_id < 300)
 					{
 					idummy = tie->snav_1;
 					dummy = tie->snav_1_time_d;
@@ -2564,7 +2726,7 @@ fprintf(stderr, "read failed on tie: %s\n", buffer);
 					}
 
 				/* for version 2.0 or later read covariance */
-				if (status == MB_SUCCESS && ((100*versionmajor + versionminor) >= 200))
+				if (status == MB_SUCCESS && version_id >= 200)
 					{
 					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 						|| (nscan = sscanf(buffer,"COV %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
@@ -3554,6 +3716,16 @@ section->distance, distance, project.section_length);*/
 				section->depthmin = 0.0;
 				section->depthmax = 0.0;
 				section->contoursuptodate = MB_NO;
+				section->global_tie_status = MBNA_TIE_NONE;
+				section->global_tie_snav = MBNA_SELECT_NONE;
+				section->global_tie_offset_x = 0.0;
+				section->global_tie_offset_y = 0.0;
+				section->global_tie_offset_x_m = 0.0;
+				section->global_tie_offset_y_m = 0.0;
+				section->global_tie_offset_z_m = 0.0;
+				section->global_tie_xsigma = 0.0;
+				section->global_tie_ysigma = 0.0;
+				section->global_tie_zsigma = 0.0;
 				new_segment = MB_NO;
 
 				/* open output section file */
@@ -5024,7 +5196,7 @@ int mbnavadjust_naverr_specific(int new_crossing, int new_tie)
 			    mbna_snav_2_time_d = tie->snav_2_time_d;
 			    mbna_offset_x = tie->offset_x;
 			    mbna_offset_y = tie->offset_y;
-			    mbna_offset_z = tie->offset_y_m;
+			    mbna_offset_z = tie->offset_z_m;
 /* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
 			    }
 			else
@@ -10074,6 +10246,8 @@ mbnavadjust_invertnav()
 	struct mbna_file *file1;
 	struct mbna_file *file2;
 	struct mbna_section *section;
+	struct mbna_section *section1;
+	struct mbna_section *section2;
 	struct mbna_crossing *crossing;
 	struct mbna_tie *tie;
 	int	nnav;
@@ -10082,24 +10256,25 @@ mbnavadjust_invertnav()
 	int	ncols = 0;
 	int	ntie = 0;
 	int	nfixed = 0;
+	int	nglobal = 0;
+	int	nmisfit = 0;
 	double	*x = NULL;
 	double	*xx = NULL;
 	double	*xa = NULL;
 	int	*nxs = NULL;
 	double	*xs = NULL;
 	double	*xw = NULL;
-	double	misfit_initial;
-	double	misfit, misfit_ties;
+	double	misfit, misfit_initial, misfit_ties_initial, misfit_norm_initial, misfit_ties, misfit_norm;
 	double	offsetx, offsety, offsetz, offsetr;
-	double	offsetsigma;
-	double	weight;
+	double	projected_offset;
+	double	xyweight, zweight;
 	double	dtime_d;
 	int	done, iter;
 	int	nseq, nseqlast;
 	int	nchange;
 	int	ndx, ndx2;
 	int	icrossing, jtie;
-	int	isection, isnav, inav;
+	int	ifile, isection, isnav, inav;
 	int	nc1, nc2, nc3;
 	int	i, j, k;
 
@@ -10180,7 +10355,7 @@ mbnavadjust_invertnav()
 		}
 
 
-	/* invert if there is a project and all crossings have been analyzed */
+	/* invert if there is a project and enough crossings have been analyzed */
     	if (project.open == MB_YES
     		&& project.num_crossings > 0
 		&& (project.num_crossings_analyzed >= 10
@@ -10201,9 +10376,11 @@ mbnavadjust_invertnav()
 		/* figure out the average offsets between connected sets of files
 			- invert for x y z offsets for the blocks */
 
-		/* calculate the initial misfit */
+		/* calculate the initial misfit, count number of crossing ties and global ties */
 		ntie = 0;
+		nglobal = 0;
 		misfit_initial = 0.0;
+		nmisfit = 0;
 		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 		    {
 		    crossing = &project.crossings[icrossing];
@@ -10213,13 +10390,44 @@ mbnavadjust_invertnav()
 			for (j=0;j<crossing->num_ties;j++)
 				{
 				tie = (struct mbna_tie *) &crossing->ties[j];
-				misfit_initial += tie->offset_x_m * tie->offset_x_m;
-				misfit_initial += tie->offset_y_m * tie->offset_y_m;
-				misfit_initial += tie->offset_z_m * tie->offset_z_m;
+				if (tie->status != MBNA_TIE_Z)
+					{
+					misfit_initial += tie->offset_x_m * tie->offset_x_m;
+					misfit_initial += tie->offset_y_m * tie->offset_y_m;
+					nmisfit += 2;
+					}
+				if (tie->status != MBNA_TIE_XY)
+					{
+					misfit_initial += tie->offset_z_m * tie->offset_z_m;
+					nmisfit++;
+					}
 				}
 			}
 		    }
-		misfit_initial = sqrt(misfit_initial) / ntie;
+		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (isection=0;isection<file->num_sections;isection++)
+			{
+			section = &file->sections[isection];
+			if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				nglobal++;
+				if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					misfit_initial += section->global_tie_offset_x_m * section->global_tie_offset_x_m;
+					misfit_initial += section->global_tie_offset_y_m * section->global_tie_offset_y_m;
+					nmisfit += 2;
+					}
+				if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					misfit_initial += section->global_tie_offset_z_m * section->global_tie_offset_z_m;
+					nmisfit++;
+					}
+				}
+			}
+		    }
+		misfit_initial = sqrt(misfit_initial) / nmisfit;
 		perturbationsizeold = misfit_initial;
 
 		/* count the number of fixed files */
@@ -10275,7 +10483,6 @@ mbnavadjust_invertnav()
 			    }
 
 			/* loop over crossings getting set ties */
-			ntie = 0;
 			for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 			    {
 			    crossing = &project.crossings[icrossing];
@@ -10294,7 +10501,6 @@ mbnavadjust_invertnav()
 				{
 				/* get tie */
 				tie = (struct mbna_tie *) &crossing->ties[j];
-				ntie++;
 
 				/* get current offset vector including reduction of block solution */
 				if (tie->status != MBNA_TIE_Z)
@@ -10436,6 +10642,41 @@ icrossing,j,nc1,nc2,offsetx,offsety,offsetz); */
 				    }
 				}
 			    }
+			    
+			/* loop over all global ties */
+			for (ifile=0;ifile<project.num_files;ifile++)
+			    {
+			    file = &project.files[ifile];
+			    for (isection=0;isection<file->num_sections;isection++)
+				{
+				section = &file->sections[isection];
+				if (section->global_tie_status != MBNA_TIE_NONE)
+				    {
+				    /* get block id for snav point */
+				    nc1 = file->block;
+    
+				    /* get current offset vector including reduction of block solution */
+				    if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					offsetx = section->global_tie_offset_x_m - (x[3*nc1]   + xx[3*nc1]);
+					offsety = section->global_tie_offset_y_m - (x[3*nc1+1] + xx[3*nc1+1]);
+					
+					xx[3*nc1]   += 0.5 * offsetx;
+					xx[3*nc1+1] += 0.5 * offsety;
+					}
+				    if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					offsetz = section->global_tie_offset_z_m - (x[3*nc1+2] + xx[3*nc1+2]);
+					xx[3*nc1+2] += 0.5 * offsetz;
+					}
+
+//fprintf(stderr,"STAGE 1 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  x: %f %f %f     xx: %f %f %f     offset: %f %f %f\n",
+//section->global_tie_status,ifile,isection,section->global_tie_snav,
+//x[3*nc1],x[3*nc1+1],x[3*nc1+2],xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
+//offsetx,offsety,offsetz);
+				    }
+				}
+			    }
 
 			/* calculate 2-norm of perturbation */
 			perturbationsize = 0.0;
@@ -10451,22 +10692,22 @@ icrossing,j,nc1,nc2,offsetx,offsety,offsetz); */
 			    x[i] += xx[i];
 			    }
 
-			 /* check for convergence */
-			 perturbationchange = perturbationsize - perturbationsizeold;
-			 convergencecriterea = fabs(perturbationchange) / misfit_initial;
-			 if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
+			/* check for convergence */
+			perturbationchange = perturbationsize - perturbationsizeold;
+			convergencecriterea = fabs(perturbationchange) / misfit_initial;
+			if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
 		    	     done = MB_YES;
 /* fprintf(stderr,"BLOCK INVERT: iter:%d ntie:%d misfit_initial:%f misfit_ties:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
 iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,convergencecriterea,done);*/
 
-			 if (done == MB_NO)
+			if (done == MB_NO)
 		             {
 			     perturbationsizeold = perturbationsize;
 			     iter++;
 			     }
-			 }
+			}
 
-		    /* if there are no fixed blocks contributing to ties,
+		    /* if there are no fixed blocks contributing to ties or global ties,
 		    	then get average offsets of blocks not flagged as bad
 			to provide a static offset to move final model to be more consistent
 			with the good blocks than the poorly navigated blocks */
@@ -10474,7 +10715,7 @@ iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,converg
 		    block_offset_avg_y = 0.0;
 		    block_offset_avg_z = 0.0;
 		    navg = 0;
-		    if (nfixed == 0)
+		    if (nfixed == 0 && nglobal == 0)
 		    	{
 			for (i=0;i<project.num_blocks;i++)
 			    {
@@ -10503,13 +10744,13 @@ iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,converg
 /* fprintf(stderr,"Average block offsets: x:%f y:%f z:%f  Used %d of %d blocks\n",
 block_offset_avg_x,block_offset_avg_y,block_offset_avg_z,navg,project.num_blocks); */
 
-		    /* output solution */
-		    fprintf(stderr,"\nAverage offsets: %f %f %f\n",block_offset_avg_x,block_offset_avg_y,block_offset_avg_z);
-		    for (i=0;i<ncols/3;i++)
-			{
-			fprintf(stderr, "Survey block:%d  offsets: %f %f %f\n",
-				    i, x[3*i], x[3*i+1], x[3*i+2]);
-			}
+/* output solution */
+/* fprintf(stderr,"\nAverage offsets: %f %f %f\n",block_offset_avg_x,block_offset_avg_y,block_offset_avg_z);
+for (i=0;i<ncols/3;i++)
+{
+fprintf(stderr, "Survey block:%d  offsets: %f %f %f\n",
+	    i, x[3*i], x[3*i+1], x[3*i+2]);
+} */
 
 		    /* extract results */
 		    for (i=0;i<project.num_files;i++)
@@ -10531,83 +10772,6 @@ i,file->block,file->block_offset_x,file->block_offset_y,file->block_offset_z); *
 		/* Initialize arrays, solution, perturbation                      */
 		/*----------------------------------------------------------------*/
 
-		/* calculate initial weighted misfit */
-		misfit_initial = 0.0;
-		ntie = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-
-		    /* use only set crossings */
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    for (j=0;j<crossing->num_ties;j++)
-			{
-			/* get tie */
-			tie = (struct mbna_tie *) &crossing->ties[j];
-
-			/* get absolute id for first snav point */
-			file1 = &project.files[crossing->file_id_1];
-			section = &file1->sections[crossing->section_1];
-			nc1 = section->snav_invert_id[tie->snav_1];
-
-			/* get absolute id for second snav point */
-			file2 = &project.files[crossing->file_id_2];
-			section = &file2->sections[crossing->section_2];
-			nc2 = section->snav_invert_id[tie->snav_2];
-/* if (nc1 > nsnav - 1 || nc2 > nsnav -1
-|| nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
-
-			/* get observed offset vector including reduction of block solution */
-			if (tie->status != MBNA_TIE_Z)
-			    {
-			    offsetx = tie->offset_x_m - (file2->block_offset_x - file1->block_offset_x);
-			    offsety = tie->offset_y_m - (file2->block_offset_y - file1->block_offset_y);
-			    }
-			else
-			    {
-			    offsetx = 0.0;
-			    offsety = 0.0;
-			    }
-			if (tie->status != MBNA_TIE_XY)
-			    {
-			    offsetz = tie->offset_z_m - (file2->block_offset_z - file1->block_offset_z);
-			    }
-			else
-			    {
-			    offsetz = 0.0;
-			    }
-
-			/* get long axis misfit */
-			misfit = mbna_offsetweight / tie->sigmar1
-						* (offsetx * tie->sigmax1[0]
-							+ offsety * tie->sigmax1[1]
-							+ offsetz * tie->sigmax1[2]);
-			misfit_initial += misfit * misfit;
-/* fprintf(stderr,"Initial Misfit: %d %f %f\n", ntie, misfit, misfit_initial);*/
-
-			/* get horizontal axis misfit */
-			misfit = mbna_offsetweight / tie->sigmar2
-						* (offsetx * tie->sigmax2[0]
-							+ offsety * tie->sigmax2[1]
-							+ offsetz * tie->sigmax2[2]);
-			misfit_initial += misfit * misfit;
-/* fprintf(stderr,"Initial Misfit: %d %f %f\n", ntie, misfit, misfit_initial);*/
-
-			/* get semi-vertical axis misfit */
-			misfit = mbna_offsetweight / tie->sigmar3
-						* (offsetx * tie->sigmax3[0]
-							+ offsety * tie->sigmax3[1]
-							+ offsetz * tie->sigmax3[2]);
-			misfit_initial += misfit * misfit;
-/* fprintf(stderr,"Initial Misfit: %d %f %f\n\n", ntie, misfit, misfit_initial);*/
-
-			ntie++;
-			}
-		    }
-		misfit_initial = sqrt(misfit_initial) / ntie;
-/* fprintf(stderr,"ntie:%d misfit_initial:%f\n",ntie,misfit_initial);*/
-
 		/* count dimension of solution guess vector */
 		nnav = 0;
 		nsnav = 0;
@@ -10620,7 +10784,8 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 			nsnav += section->num_snav - section->continuity;
 			for (isnav=0;isnav<section->num_snav;isnav++)
 			    {
-			    if (section->snav_num_ties[isnav] > 0)
+			    if (section->snav_num_ties[isnav] > 0
+				|| section->global_tie_snav == isnav)
 				{
 				section->snav_invert_id[isnav] = nnav;
 				nnav++;
@@ -10634,6 +10799,8 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
 		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
 		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xa,&error);
+		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xs,&error);
+		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xw,&error);
 		inav = 0;
 		for (i=0;i<project.num_files;i++)
 		    {
@@ -10643,7 +10810,8 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 			section = &file->sections[j];
 			for (isnav=0;isnav<section->num_snav;isnav++)
 			    {
-			    if (section->snav_num_ties[isnav] > 0)
+			    if (section->snav_num_ties[isnav] > 0
+				|| section->global_tie_snav == isnav)
 				{
 				x[ndf * inav] = 0.0;
 				x[ndf * inav + 1] = 0.0;
@@ -10660,12 +10828,125 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 			}
 		    }
 
+		/* calculate initial normalized misfit */
+		misfit_ties_initial = 0.0;
+		misfit_norm_initial = 0.0;
+		nmisfit = 0;
+		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
+		    {
+		    crossing = &project.crossings[icrossing];
+
+		    /* use only set crossings */
+		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
+		    for (j=0;j<crossing->num_ties;j++)
+			{
+			/* get tie */
+			tie = (struct mbna_tie *) &crossing->ties[j];
+
+			/* get absolute id for first snav point */
+			file1 = &project.files[crossing->file_id_1];
+			section1 = &file1->sections[crossing->section_1];
+			nc1 = section1->snav_invert_id[tie->snav_1];
+
+			/* get absolute id for second snav point */
+			file2 = &project.files[crossing->file_id_2];
+			section2 = &file2->sections[crossing->section_2];
+			nc2 = section2->snav_invert_id[tie->snav_2];
+if (nc1 > nsnav - 1 || nc2 > nsnav -1
+|| nc1 < 0 || nc2 < 0)
+fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
+
+			/* get offset after removal of block solution */
+			offsetx = tie->offset_x_m - (file2->block_offset_x - file1->block_offset_x);
+			offsety = tie->offset_y_m - (file2->block_offset_y - file1->block_offset_y);
+			offsetz = tie->offset_z_m - (file2->block_offset_z - file1->block_offset_z);
+
+			if (tie->status != MBNA_TIE_Z)
+			    {
+			    /* get long axis misfit */
+			    misfit = (offsetx * tie->sigmax1[0]
+					    + offsety * tie->sigmax1[1]
+					    + offsetz * tie->sigmax1[2]);
+			    misfit_ties_initial += misfit * misfit;
+			    misfit_norm_initial += misfit * misfit / tie->sigmar1 / tie->sigmar1;
+			    nmisfit++;
+
+			    /* get horizontal axis misfit */
+			    misfit = (offsetx * tie->sigmax2[0]
+					    + offsety * tie->sigmax2[1]
+					    + offsetz * tie->sigmax2[2]);
+			    misfit_ties_initial += misfit * misfit;
+			    misfit_norm_initial += misfit * misfit / tie->sigmar2 / tie->sigmar2;
+			    nmisfit++;
+			    }
+
+			if (tie->status != MBNA_TIE_XY)
+			    {
+			    /* get semi-vertical axis misfit */
+			    misfit = (offsetx * tie->sigmax3[0]
+					    + offsety * tie->sigmax3[1]
+					    + offsetz * tie->sigmax3[2]);
+			    misfit_ties_initial += misfit * misfit;
+			    misfit_norm_initial += misfit * misfit / tie->sigmar3 / tie->sigmar3;
+			    nmisfit++;
+			    }
+			}
+		    }
+		for (ifile=0;ifile<project.num_files;ifile++)
+		    {
+		    /* get file */
+		    file = &project.files[ifile];
+		    for (isection=0;isection<file->num_sections;isection++)
+			{
+			/* get section */
+			section = &file->sections[isection];
+			if (section->global_tie_status != MBNA_TIE_NONE)
+			    {
+			    /* get absolute id for snav point */
+			    nc1 = section->snav_invert_id[section->global_tie_snav];
+if (nc1 > nsnav - 1 || nc1 < 0)
+fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
+
+			    /* get offset after removal of block solution */
+			    offsetx = section->global_tie_offset_x_m - file->block_offset_x;
+			    offsety = section->global_tie_offset_y_m - file->block_offset_y;
+			    offsetz = section->global_tie_offset_z_m - file->block_offset_z;
+	    
+			    if (section->global_tie_status != MBNA_TIE_Z)
+				{
+				/* get x axis misfit */
+				misfit = offsetx;
+				misfit_ties_initial += misfit * misfit;
+				misfit_norm_initial += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
+				nmisfit++;
+
+				/* get y axis misfit */
+				misfit = offsety;
+				misfit_ties_initial += misfit * misfit;
+				misfit_norm_initial += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
+				nmisfit++;
+				}
+
+			    if (section->global_tie_status != MBNA_TIE_XY)
+				{
+				/* get z axis misfit */
+				misfit = offsetz;
+				misfit_ties_initial += misfit * misfit;
+				misfit_norm_initial += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
+				nmisfit++;
+				}
+			    }
+			}
+		    }
+		misfit_ties_initial = sqrt(misfit_ties_initial) / nmisfit;
+		misfit_norm_initial = sqrt(misfit_norm_initial) / nmisfit;
+
 		/*----------------------------------------------------------------*/
 		/* Step 2 - construct "average" model satisfying ties with        */
 		/*     fixed data (if needed) - this gets pulled out of the       */
 		/*     data along with the average block offsets.                 */
 		/*----------------------------------------------------------------*/
-		if (nfixed > 0)
+		if (nfixed > 0 || nglobal > 0)
 		    {
 		    /* set message dialog on */
 		    sprintf(message,"Getting average offsets relative to fixed data...");
@@ -10673,8 +10954,6 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 
 		    /* allocate some extra arrays */
 		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, nnav * sizeof(int), (void **)&nxs,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xs,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xw,&error);
 		    for (inav=0;inav<nnav;inav++)
 		    	{
 			nxs[inav] = 0;
@@ -10910,32 +11189,216 @@ i,j,isnav,inav,nseqlast,nseq,file->status,nxs[inav],nxs[inav+1]); */
 				}
 			    }
 			}
-
-		    /* construct average offset model */
-		    for (inav=0;inav<nnav;inav++)
-			{
-			if (xw[ndf * inav] > 0.0)
-			    {
-			    xa[ndf * inav] += xs[ndf * inav] / xw[ndf * inav];
-			    xa[ndf * inav + 1] += xs[ndf * inav + 1] / xw[ndf * inav + 1];
-			    xa[ndf * inav + 2] += xs[ndf * inav + 2] / xw[ndf * inav + 2];
-			    }
-/*fprintf(stderr,"inav:%d xw:%f xa:%f %f %f\n",inav,xw[ndf * inav],xa[ndf * inav],xa[ndf * inav + 1],xa[ndf * inav + 2]);*/
-			}
-
-		    /* save solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
+			
+		    /* loop over all global ties */
+		    for (ifile=0;ifile<project.num_files;ifile++)
 			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
+			file = &project.files[ifile];
+			for (isection=0;isection<file->num_sections;isection++)
 			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
+			    section = &file->sections[isection];
+			    if (section->global_tie_status != MBNA_TIE_NONE)
 				{
-				if (section->snav_num_ties[isnav] > 0)
+				/* get absolute id for snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+
+			        /* get current offset vector including reduction of block solution */
+				offsetx = section->global_tie_offset_x_m - xa[3*nc1];
+				offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
+				offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
+/*fprintf(stderr,"STAGE 2 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  tie: %f %f %f  model offset: %f %f %f\n",
+section->global_tie_status,ifile,isection,section->global_tie_snav,
+section->global_tie_offset_x_m,section->global_tie_offset_y_m,section->global_tie_offset_z_m,
+offsetx,offsety,offsetz); */
+
+				/* figure out how far each tied nav point is from the global tie point */
+		    		for (inav=0;inav<nnav;inav++)
+				    nxs[inav] = 0;
+
+				/* first set the global tied nav point */
+				nxs[nc1] = 1;
+
+				/* now loop over all nav points repeatedly */
+				done = MB_NO;
+				while (done == MB_NO)
 				    {
-				    k = section->snav_invert_id[isnav];
+				    nchange = 0;
+
+				    /* run forward through the data */
+				    inav = 0;
+				    nseq = 0;
+			    	    nseqlast = 0;
+				    for (i=0;i<project.num_files;i++)
+					{
+					file1 = &project.files[i];
+					for (j=0;j<file1->num_sections;j++)
+					    {
+					    section1 = &file1->sections[j];
+					    if (section1->continuity == MB_NO)
+			    	    		nseq = 0;
+					    for (isnav=0;isnav<section1->num_snav;isnav++)
+						{
+						if (section1->snav_num_ties[isnav] > 0)
+						    {
+						    if (inav > 0 && nseq > 0 && file1->status != MBNA_FILE_FIXEDNAV
+						    	&& nxs[inav-1] > 0 && (nxs[inav-1] < nxs[inav] - 1 || nxs[inav] == 0))
+						    	{
+							nxs[inav] = nxs[inav-1] + 1;
+							nchange++;
+							}
+
+						    /* increment sequence counters */
+						    nseqlast = nseq;
+						    nseq++;
+						    inav++;
+						    }
+						}
+					    }
+					}
+
+				    /* run backward through the data */
+			    	    nseq = 0;
+			    	    nseqlast = 0;
+				    for (i=project.num_files-1;i>=0;i--)
+					{
+					file1 = &project.files[i];
+					for (j=file1->num_sections-1;j>=0;j--)
+					    {
+					    section1 = &file1->sections[j];
+					    for (isnav=section1->num_snav-1;isnav>=0;isnav--)
+						{
+						if (section1->snav_num_ties[isnav] > 0)
+						    {
+						    inav--;
+						    if (inav >= 0 && nseqlast > 0 && file1->status != MBNA_FILE_FIXEDNAV
+						    	&& nxs[inav+1] > 0 && (nxs[inav+1] < nxs[inav] - 1 || nxs[inav] == 0))
+						    	{
+							nxs[inav] = nxs[inav+1] + 1;
+							nchange++;
+							}
+
+						    /* increment sequence counters */
+						    nseqlast = nseq;
+						    nseq++;
+						    }
+						}
+					    if (section1->continuity == MB_NO)
+			    	    		nseq = 0;
+					    }
+					}
+
+				    /* run through ties */
+				    for (i=0;i<project.num_crossings;i++)
+					{
+					/* use only set crossings */
+					if (project.crossings[i].status == MBNA_CROSSING_STATUS_SET)
+					for (j=0;j<project.crossings[i].num_ties;j++)
+					    {
+					    /* get tie */
+					    tie = (struct mbna_tie *) &project.crossings[i].ties[j];
+
+					    /* get absolute id for first snav point */
+					    file1 = &project.files[project.crossings[i].file_id_1];
+					    section1 = &file1->sections[project.crossings[i].section_1];
+					    nc1 = section1->snav_invert_id[tie->snav_1];
+
+					    /* get absolute id for second snav point */
+					    file2 = &project.files[project.crossings[i].file_id_2];
+					    section2 = &file2->sections[project.crossings[i].section_2];
+					    nc2 = section2->snav_invert_id[tie->snav_2];
+
+					    /* check for nav points needing closeness setting */
+					    if (nxs[nc1] > 0 && nxs[nc2] == 0)
+					    	{
+						if (file2->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc2] = nxs[nc1] + 1;
+						    nchange++;
+						    }
+						}
+					    else if (nxs[nc1] > 0 && nxs[nc2] > nxs[nc1] + 1)
+					    	{
+						if (file2->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc2] = nxs[nc1] + 1;
+						    nchange++;
+						    }
+						}
+					    else if (nxs[nc2] > 0 && nxs[nc1] == 0)
+					    	{
+						if (file1->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc1] = nxs[nc2] + 1;
+						    nchange++;
+						    }
+						}
+					    else if (nxs[nc2] > 0 && nxs[nc1] > nxs[nc2] + 1)
+					    	{
+						if (file1->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc1] = nxs[nc2] + 1;
+						    nchange++;
+						    }
+						}
+					    }
+					}
+
+				    /* check for done */
+			    	    if (nchange == 0)
+				    	done = MB_YES;
+				    }
+
+				/* now loop over the data adding the offset with weighting inversely set by the
+					"distance" from each nav point to the offset point */
+				for (inav=0;inav<nnav;inav++)
+				    {
+				    if (nxs[inav] > 0)
+				    	{
+					if (section->global_tie_status != MBNA_TIE_Z)
+					    {
+					    xs[ndf * inav]     += offsetx / (nxs[inav] * nxs[inav]);
+					    xs[ndf * inav + 1] += offsety / (nxs[inav] * nxs[inav]);
+					    xw[ndf * inav]     += 1.0 / (nxs[inav] * nxs[inav]);
+					    xw[ndf * inav + 1] += 1.0 / (nxs[inav] * nxs[inav]);
+					    }
+					if (section->global_tie_status != MBNA_TIE_XY)
+					    {
+					    xs[ndf * inav + 2] += offsetz / (nxs[inav] * nxs[inav]);
+					    xw[ndf * inav + 2] += 1.0 / (nxs[inav] * nxs[inav]);
+					    }
+					}
+				    }
+				}
+			    }
+			}
+
+		    /* construct average offset model */
+		    for (inav=0;inav<nnav;inav++)
+			{
+			if (xw[ndf * inav] > 0.0)
+			    xa[ndf * inav] += xs[ndf * inav] / xw[ndf * inav];
+			if (xw[ndf * inav + 1] > 0.0)
+			    xa[ndf * inav + 1] += xs[ndf * inav + 1] / xw[ndf * inav + 1];
+			if (xw[ndf * inav + 2] > 0.0)
+			    xa[ndf * inav + 2] += xs[ndf * inav + 2] / xw[ndf * inav + 2];
+//fprintf(stderr,"XA CALC:  xs: %f %f %f  xw: %f %f %f  xa: %f %f %f\n",
+//xs[ndf*inav],xs[ndf*inav+1],xs[ndf*inav+2],xw[ndf*inav],xw[ndf*inav+1],xw[ndf*inav+2],xa[ndf*inav],xa[ndf*inav+1],xa[ndf*inav+2]);
+			}
+
+		    /* save solution */
+		    k = 0;
+		    for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			for (j=0;j<file->num_sections;j++)
+			    {
+			    section = &file->sections[j];
+			    for (isnav=0;isnav<section->num_snav;isnav++)
+				{
+				if (section->snav_num_ties[isnav] > 0
+				    || section->global_tie_snav == isnav)
+				    {
+				    k = section->snav_invert_id[isnav];
 				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
 /* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k]:%f xa[3*k]:%f mbna_mtodeglon:%f section->snav_lon_offset[isnav]:%f\n",
 i,j,isnav,k,x[3*k],xa[3*k],mbna_mtodeglon,section->snav_lon_offset[isnav]); */
@@ -10945,8 +11408,6 @@ i,j,isnav,k,x[3*k+1],xa[3*k+1],mbna_mtodeglat,section->snav_lat_offset[isnav]);
 				    section->snav_z_offset[isnav] = (x[3*k+2] + xa[3*k+2]);
 /* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k+2]:%f xa[3*k+2]:%f section->snav_z_offset[isnav]:%f\n\n",
 i,j,isnav,k,x[3*k+2],xa[3*k+2],section->snav_z_offset[isnav]); */
-fprintf(stderr,"i:%d j:%d isnav:%d k:%d xa: %f %f %f  x: %f %f %f\n",i,j,isnav,k,
-xa[3*k],xa[3*k+1],xa[3*k+2],x[3*k],x[3*k+1],x[3*k+2]);
 				    }
 				}
 			    }
@@ -10976,8 +11437,7 @@ xa[3*k],xa[3*k+1],xa[3*k+2],x[3*k],x[3*k+1],x[3*k+2]);
 		    if (project.modelplot == MB_YES && iter % 25 == 0)
 		    	mbnavadjust_modelplot_plot();
 
-
-		    /* loop over all ties, working only with ties including fixed sections */
+		    /* output goodness of fit for ties including fixed sections */
 		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 			{
 			crossing = &project.crossings[icrossing];
@@ -11007,16 +11467,53 @@ xa[3*k],xa[3*k+1],xa[3*k+2],x[3*k],x[3*k+1],x[3*k+2]);
 				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]);
 				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]);
 				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]);
-fprintf(stderr,"STAGE 2 RESULT: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
-icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
+//fprintf(stderr,"STAGE 2 RESULT - CROSSING TIE: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
+//icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
+				}
+			    }
+			}
+
+		    /* output goodness of fit for global ties */
+		    for (ifile=0;ifile<project.num_files;ifile++)
+			{
+			file = &project.files[ifile];
+			for (isection=0;isection<file->num_sections;isection++)
+			    {
+			    /* get section */
+			    section = (struct mbna_section *) &file->sections[isection];
+			    
+			    /* only work with set global ties */
+			    if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				/* get absolute id for first snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+
+//fprintf(stderr,"STAGE 2 RESULT - GLOBAL TIE: %2.2d:%2.2d:%2.2d  tie: \n",
+//ifile,isection,section->global_tie_snav);
+//if (section->global_tie_status != MBNA_TIE_Z)
+//fprintf(stderr,"x: %f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
+//if (section->global_tie_status != MBNA_TIE_XY)
+//fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
+//fprintf(stderr,"  model offset: ");
+
+			        /* get current offset vector including reduction of block solution */
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    offsetx = section->global_tie_offset_x_m - xa[3*nc1];
+				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
+//fprintf(stderr,"x: %f y:%f ",offsetx,offsety);
+				    }
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
+//fprintf(stderr,"z:%f ",offsetz);	
+				    }
 				}
 			    }
 			}
 
 		    /* deallocate arrays */
 		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&nxs,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xs,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xw,&error);
 		    }
 
 
@@ -11027,14 +11524,16 @@ icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
 		/* loop until convergence */
 		done = MB_NO;
 		iter = 0;
-		perturbationsizeold = misfit_initial;
+		perturbationsizeold = misfit_ties_initial;
 		mbna_smoothweight = pow(10.0, project.smoothing) * mbna_offsetweight;
 		while (done == MB_NO)
 		    {
-		    /* zero solution */
+		    /* zero smoothed adjustment vector solution */
 		    for (i=0;i<ncols;i++)
 			{
 			xx[i] = 0.0;
+			xs[i] = 0.0;
+			xw[i] = 0.0;
 			}
 
 		    /* loop over each crossing, applying offsets evenly to both points */
@@ -11051,13 +11550,13 @@ icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
 
 			    /* get absolute id for first snav point */
 			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
+			    section1 = &file1->sections[crossing->section_1];
+			    nc1 = section1->snav_invert_id[tie->snav_1];
 
 			    /* get absolute id for second snav point */
 			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
+			    section2 = &file2->sections[crossing->section_2];
+			    nc2 = section2->snav_invert_id[tie->snav_2];
 if (file1->sections[crossing->section_1].snav_time_d[tie->snav_1] == file2->sections[crossing->section_2].snav_time_d[tie->snav_2])
 fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d   %d:%d:%d  DIFF:%f\n",
 	crossing->file_id_1,crossing->section_1,tie->snav_1,
@@ -11068,10 +11567,8 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    /* get current offset vector including reduction of block solution */
 			    if (tie->status != MBNA_TIE_Z)
 			        {
-				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1])
-			    		    - (x[3*nc2] + xx[3*nc2] - x[3*nc1] - xx[3*nc1]);
-				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1])
-			    		    - (x[3*nc2+1] + xx[3*nc2+1] - x[3*nc1+1] - xx[3*nc1+1]);
+				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]) - (x[3*nc2] - x[3*nc1]);
+				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]) - (x[3*nc2+1] - x[3*nc1+1]);
 				}
 			    else
 			        {
@@ -11080,8 +11577,7 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				}
 			    if (tie->status != MBNA_TIE_XY)
 			        {
-				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2])
-			    		    - (x[3*nc2+2] + xx[3*nc2+2] - x[3*nc1+2] - xx[3*nc1+2]);
+				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]) - (x[3*nc2+2] - x[3*nc1+2]);
 				}
 			    else
 			        {
@@ -11094,50 +11590,66 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				- weight inversely by size of error for that component */
 
 			    /* deal with long axis */
-			    offsetsigma = offsetx * tie->sigmax1[0]
-			    		+ offsety * tie->sigmax1[1]
-					+ offsetz * tie->sigmax1[2];
-			    if (fabs(offsetsigma) > 0.0)
-			    	weight = MAX(mbna_offsetweight / tie->sigmar1, 1.0);
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				projected_offset = offsetx * tie->sigmax1[0]
+						+ offsety * tie->sigmax1[1]
+						+ offsetz * tie->sigmax1[2];
+			    else
+				projected_offset = offsetx * tie->sigmax1[0]
+						+ offsety * tie->sigmax1[1];
+			    if (fabs(tie->sigmar1) > 0.0)
+			    	{
+				xyweight = sqrt(mbna_offsetweight / tie->sigmar1);
+				zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar1);
+				}
 			    else
-			    	weight = 1.0;
+			    	{
+				xyweight = 0.0;
+			    	zweight = 0.0;
+				}
+//zweight = 0.0;
 
 			    /* deal with fixed, good, or poor status of sections */
 			    if (file1->status == file2->status)
 			    	{
 				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];				    
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11145,44 +11657,50 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    	{
 				if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11190,44 +11708,50 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11236,36 +11760,41 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11274,49 +11803,55 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11324,98 +11859,130 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				}
+			    xw[3*nc1]   += xyweight;
+			    xw[3*nc1+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc1+2] += zweight;
+			    xw[3*nc2]   += xyweight;
+			    xw[3*nc2+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc2+2] += zweight;
 /* fprintf(stderr,"long axis:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
+nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
+nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
 
 			    /* deal with horizontal axis */
-			    offsetsigma = offsetx * tie->sigmax2[0]
-			    		+ offsety * tie->sigmax2[1]
-					+ offsetz * tie->sigmax2[2];
-			    if (offsetsigma > 0.0)
-			    	weight = MAX(mbna_offsetweight / tie->sigmar2, 1.0);
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				projected_offset = offsetx * tie->sigmax2[0]
+						+ offsety * tie->sigmax2[1]
+						+ offsetz * tie->sigmax2[2];
+			    else
+				projected_offset = offsetx * tie->sigmax2[0]
+						+ offsety * tie->sigmax2[1];
+			    if (fabs(tie->sigmar2) > 0.0)
+			    	{
+				xyweight = sqrt(mbna_offsetweight / tie->sigmar2);
+			    	zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar2);
+				}
 			    else
-			    	weight = 1.0;
+			    	{
+				xyweight = 0.0;
+			    	zweight = 0.0;
+				}
+//zweight = 0.0;
 
 			    /* deal with fixed, good, or poor status of sections */
 			    if (file1->status == file2->status)
 			    	{
 				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11423,44 +11990,52 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11468,44 +12043,52 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11514,36 +12097,42 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11552,49 +12141,57 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11602,98 +12199,143 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				}
+			    xw[3*nc1]   += xyweight;
+			    xw[3*nc1+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc1+2] += zweight;
+			    xw[3*nc2]   += xyweight;
+			    xw[3*nc2+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc2+2] += zweight;
 /* fprintf(stderr,"horizontal:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
+nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
+nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
 
 			    /* deal with semi-vertical axis */
-			    offsetsigma = offsetx * tie->sigmax3[0]
-			    		+ offsety * tie->sigmax3[1]
-					+ offsetz * tie->sigmax3[2];
-			    if (offsetsigma > 0.0)
-			    	weight = MAX(mbna_offsetweight / tie->sigmar3, 1.0);
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				projected_offset = offsetx * tie->sigmax3[0]
+						+ offsety * tie->sigmax3[1]
+						+ offsetz * tie->sigmax3[2];
+			    else
+				projected_offset = offsetz * tie->sigmax3[2];
+			    if (fabs(tie->sigmar3) > 0.0)
+			    	{
+				xyweight = sqrt(mbna_offsetweight / tie->sigmar3);
+			    	zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / tie->sigmar3);
+				}
 			    else
-			    	weight = 1.0;
+			    	{
+				xyweight = 0.0;
+			    	zweight = 0.0;
+				}
+//xyweight = 0.0;
+//zweight = 1.0;
 
 			    /* deal with fixed, good, or poor status of sections */
 			    if (file1->status == file2->status)
 			    	{
 				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11701,44 +12343,68 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11746,44 +12412,68 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11792,36 +12482,54 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
+				    xs[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11830,49 +12538,73 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11880,69 +12612,186 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				}
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				{
+				xw[3*nc1]   += xyweight;
+				xw[3*nc1+1] += xyweight;
+				}
+			    xw[3*nc1+2] += zweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				{
+				xw[3*nc2]   += xyweight;
+				xw[3*nc2+1] += xyweight;
+				}
+			    xw[3*nc2+2] += zweight;
 /* fprintf(stderr,"semi-vertical:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
-
-/* fprintf(stderr,"icrossing:%d j:%d tie->offset_x_m:%f x[3*%d]:%f x[3*%d]:%f offsetx:%f xx[3*%d]:%f xx[3*%d]:%f\n",
-icrossing,j,tie->offset_x_m,nc2,x[3*nc2],nc1,x[3*nc1],offsetx,nc2,xx[3*nc2],nc1,xx[3*nc1]);
-fprintf(stderr,"icrossing:%d j:%d tie->offset_y_m:%f x[3*%d+1]:%f x[3*%d+1]:%f offsety:%f xx[3*%d+1]:%f xx[3*%d+1]:%f\n",
-icrossing,j,tie->offset_y_m,nc2,x[3*nc2+1],nc1,x[3*nc1+1],offsety,nc2,xx[3*nc2+1],nc1,xx[3*nc1+1]);
-fprintf(stderr,"icrossing:%d j:%d tie->offset_z_m:%f x[3*%d+2]:%f x[3*%d+2]:%f offsetz:%f xx[3*%d+2]:%f xx[3*%d+2]:%f\n\n",
-icrossing,j,tie->offset_z_m,nc2,x[3*nc2+2],nc1,x[3*nc1+2],offsetz,nc2,xx[3*nc2+2],nc1,xx[3*nc1+2]);*/
+nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
+nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
+
+			    }
+			}
+
+		    /* loop over all global ties applying offsets to the affected points */
+		    for (ifile=0;ifile<project.num_files;ifile++)
+			{
+			file = &project.files[ifile];
+
+			for (isection=0;isection<file->num_sections;isection++)
+			    {
+			    /* use only set global ties */
+			    section = &file->sections[isection];
+			    if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				/* get absolute id for first snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+				
+				/* get current offset vector including reduction of block solution */
+				offsetx = 0.0;
+				offsety = 0.0;
+				offsetz = 0.0;
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    offsetx = section->global_tie_offset_x_m - xa[3*nc1] - x[3*nc1];
+				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1] - x[3*nc1+1];
+				    }
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2] - x[3*nc1+2];
+				    }
+				offsetr = sqrt(offsetx * offsetx + offsety * offsety + offsetz * offsetz);
+				
+				/* global ties have a simple error ellipse oriented on the axes */
+				
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    /* deal with x-axis */
+				    projected_offset = offsetx;
+				    if (fabs(section->global_tie_xsigma) > 0.0)
+					xyweight = sqrt(mbna_offsetweight / section->global_tie_xsigma);
+				    else
+					xyweight = 0.0;
+//fprintf(stderr,"GLOBAL X: xyweight:%f mbna_offsetweight:%f xsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_xsigma);
+				    xs[3*nc1]   += xyweight * projected_offset;
+				    xw[3*nc1]   += xyweight;
+					
+				    /* deal with y-axis */
+				    projected_offset = offsety;
+				    if (fabs(section->global_tie_ysigma) > 0.0)
+					xyweight = sqrt(mbna_offsetweight / section->global_tie_ysigma);
+				    else
+					xyweight = 0.0;
+//fprintf(stderr,"GLOBAL Y: xyweight:%f mbna_offsetweight:%f zsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_ysigma);
+				    xs[3*nc1+1] += xyweight * projected_offset;
+				    xw[3*nc1+1] += xyweight;
+				    }
+				    
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    /* deal with z-axis */
+				    projected_offset = offsetz;
+				    if (fabs(section->global_tie_zsigma) > 0.0)
+					zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / section->global_tie_zsigma);
+				    else
+					zweight = 0.0;
+//fprintf(stderr,"GLOBAL Z: zweight:%f mbna_offsetweight:%f sigma:%f\n",zweight,mbna_offsetweight,section->global_tie_zsigma);
+				    xs[3*nc1+2] += zweight * projected_offset;
+				    xw[3*nc1+2] += zweight;
+				    }
+/* fprintf(stderr,"STAGE 3 GLOBAL TIE: %2d:%2d:%2d  status:%d  nc1:%d  tie: ",ifile,isection,section->global_tie_snav,section->global_tie_status,nc1);
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
+fprintf(stderr," xa: ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xa[3*nc1],xa[3*nc1+1]);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xa[3*nc1+2]);
+fprintf(stderr," x: ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",x[3*nc1],x[3*nc1+1]);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",x[3*nc1+2]);
+fprintf(stderr," xx: ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xs[3*nc1],xs[3*nc1+1]);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xs[3*nc1+2]);
+fprintf(stderr," (off-xa-x-xx): ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",offsetx,offsety);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",offsetz);
+fprintf(stderr,"\n");*/
+				}
 			    }
 			}
 
-		    /* now loop over all points applying smoothing */
+
+		    /* now loop over all points applying smoothing to the xx[] vector */
 		    nseq = 0;
 		    ndx = 0;
 		    ndx2 = 0;
-		    for (i=0;i<project.num_files;i++)
+		    for (ifile=0;ifile<project.num_files;ifile++)
 			{
-			file = &project.files[i];
+			file = &project.files[ifile];
 			if (file->status != MBNA_FILE_FIXEDNAV)
 			for (isection=0;isection<file->num_sections;isection++)
 			    {
@@ -11952,7 +12801,8 @@ icrossing,j,tie->offset_z_m,nc2,x[3*nc2+2],nc1,x[3*nc1+2],offsetz,nc2,xx[3*nc2+2
 			    for (isnav=0;isnav<section->num_snav;isnav++)
 				{
 				/* work only with points that are tied */
-				if (section->snav_num_ties[isnav] > 0)
+				if (section->snav_num_ties[isnav] > 0
+				    || (section->global_tie_status != MBNA_TIE_NONE && section->global_tie_snav == isnav))
 				    {
 				    /* get ids for tied nav points */
 				    if (nseq > 1)
@@ -11973,23 +12823,27 @@ icrossing,j,tie->offset_z_m,nc2,x[3*nc2+2],nc1,x[3*nc1+2],offsetz,nc2,xx[3*nc2+2
 				    if (nseq > 0 && dtime_d > 0.0)
 					{
 			    		/* get current offset vector */
-					offsetx = (x[3*nc3]   + xx[3*nc3]   + xa[3*nc3]   - x[3*nc2]   - xx[3*nc2]   - xa[3*nc2]);
-					offsety = (x[3*nc3+1] + xx[3*nc3+1] + xa[3*nc3+1] - x[3*nc2+1] - xx[3*nc2+1] - xa[3*nc2+1]);
-					offsetz = (x[3*nc3+2] + xx[3*nc3+2] + xa[3*nc3+2] - x[3*nc2+2] - xx[3*nc2+2] - xa[3*nc2+2]);
+					offsetx = (x[3*nc3]   - x[3*nc2]);
+					offsety = (x[3*nc3+1] - x[3*nc2+1]);
+					offsetz = (x[3*nc3+2] - x[3*nc2+2]);
 
 					/* add remaining offsets to both points */
-					weight = 0.5 * MIN(mbna_smoothweight / dtime_d, 1.0);
-					xx[3*nc2]   +=  weight * offsetx;
-					xx[3*nc2+1] +=  weight * offsety;
-					xx[3*nc2+2] +=  weight * offsetz;
-					xx[3*nc3]   += -weight * offsetx;
-					xx[3*nc3+1] += -weight * offsety;
-					xx[3*nc3+2] += -weight * offsetz;
+					xyweight = mbna_smoothweight / dtime_d;
+					zweight = mbna_smoothweight / dtime_d;
+					xs[3*nc2]   +=  0.5 * xyweight * offsetx;
+					xs[3*nc2+1] +=  0.5 * xyweight * offsety;
+					xs[3*nc2+2] +=  0.5 * zweight * offsetz;
+					xs[3*nc3]   += -0.5 * xyweight * offsetx;
+					xs[3*nc3+1] += -0.5 * xyweight * offsety;
+					xs[3*nc3+2] += -0.5 * zweight * offsetz;
+					xw[3*nc2]   += xyweight;
+					xw[3*nc2+1] += xyweight;
+					xw[3*nc2+2] += zweight;
+					xw[3*nc3]   += xyweight;
+					xw[3*nc3+1] += xyweight;
+					xw[3*nc3+2] += zweight;
 
 					ndx++;
-/* fprintf(stderr,"1st Derivative: nc2:%d offsets:%f %f %f  weight:%f perturbation:%f %f %f\n",
-nc2,offsetx,offsety,offsetz,weight,
-0.5 * weight * offsetx,0.5 * weight * offsety,0.5 * weight * offsetz);*/
 					}
 
 				    /* add second derivative constraint if nseq > 2  AND dtime_d > 0.0 */
@@ -11997,29 +12851,31 @@ nc2,offsetx,offsety,offsetz,weight,
 				    if (nseq > 1 && dtime_d > 0.0)
 					{
 			    		/* get current offset vector */
-					offsetx = (x[3*nc1] + xx[3*nc1]
-							- 2.0 * (x[3*nc2] + xx[3*nc2])
-							+ x[3*nc3] + xx[3*nc3]);
-					offsety = (x[3*nc1+1] + xx[3*nc1+1]
-							- 2.0 * (x[3*nc2+1] + xx[3*nc2+1])
-							+ x[3*nc3+1] + xx[3*nc3+1]);
-					offsetz = (x[3*nc1+2] + xx[3*nc1+2]
-							- 2.0 * (x[3*nc2+2] + xx[3*nc2+2])
-							+ x[3*nc3+2] + xx[3*nc3+2]);
+					offsetx = x[3*nc1]   - 2.0 * x[3*nc2]   + x[3*nc3];
+					offsety = x[3*nc1+1] - 2.0 * x[3*nc2+1] + x[3*nc3+1];
+					offsetz = x[3*nc1+2] - 2.0 * x[3*nc2+2] + x[3*nc3+2];
 
 					/* add remaining offsets to both points, or just one if one is fixed (weight 2nd derivative 1/4th of first derivative)*/
-					weight = 0.125 * MIN(mbna_smoothweight / dtime_d, 1.0);
-					xx[3*nc1]   += -0.5 * weight * offsetx;
-					xx[3*nc1+1] += -0.5 * weight * offsety;
-					xx[3*nc1+2] += -0.5 * weight * offsetz;
-					xx[3*nc2]   +=  weight * offsetx;
-					xx[3*nc2+1] +=  weight * offsety;
-					xx[3*nc2+2] +=  weight * offsetz;
-					xx[3*nc3]   += -0.5 * weight * offsetx;
-					xx[3*nc3+1] += -0.5 * weight * offsety;
-					xx[3*nc3+2] += -0.5 * weight * offsetz;
-/* fprintf(stderr,"2nd Derivative: nc2:%d offsets:%f %f %f  weight:%f perturbation:%f %f %f\n",
-nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offsety,0.25 * weight * offsetz);*/
+					xyweight = mbna_smoothweight / dtime_d / dtime_d;
+					zweight = mbna_smoothweight / dtime_d / dtime_d;
+					xs[3*nc1]   += -xyweight * offsetx;
+					xs[3*nc1+1] += -xyweight * offsety;
+					xs[3*nc1+2] += -zweight * offsetz;
+					xs[3*nc2]   +=  2.0 * xyweight * offsetx;
+					xs[3*nc2+1] +=  2.0 * xyweight * offsety;
+					xs[3*nc2+2] +=  2.0 * zweight * offsetz;
+					xs[3*nc3]   += -xyweight * offsetx;
+					xs[3*nc3+1] += -xyweight * offsety;
+					xs[3*nc3+2] += -zweight * offsetz;
+					xw[3*nc1]   += xyweight;
+					xw[3*nc1+1] += xyweight;
+					xw[3*nc1+2] += zweight;
+					xw[3*nc2]   += xyweight;
+					xw[3*nc2+1] += xyweight;
+					xw[3*nc2+2] += zweight;
+					xw[3*nc3]   += xyweight;
+					xw[3*nc3+1] += xyweight;
+					xw[3*nc3+2] += zweight;
 
 					ndx2++;
 					}
@@ -12031,10 +12887,14 @@ nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offse
 			    }
 			}
 
-		    /* calculate 2-norm of perturbation */
+		    /* calculate perturbation and 2-norm of perturbation */
 		    perturbationsize = 0.0;
 		    for (i=0;i<ncols;i++)
 			{
+			if (xw[i] > 0.0)
+				xx[i] = xs[i] / xw[i];
+			else
+				xx[i] = 0.0;
 			perturbationsize += xx[i] * xx[i];
 			}
 		    perturbationsize = sqrt(perturbationsize) / ncols;
@@ -12048,9 +12908,10 @@ nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offse
 /* fprintf(stderr,"x:%f\n",x[i]);*/
 			}
 
-		    /* calculate weighted misfit */
+		    /* calculate misfit */
 		    misfit_ties = 0.0;
-		    ntie = 0;
+		    misfit_norm = 0.0;
+		    nmisfit = 0;
 		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 			{
 			crossing = &project.crossings[icrossing];
@@ -12061,58 +12922,113 @@ nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offse
 			    {
 			    /* get tie */
 			    tie = (struct mbna_tie *) &crossing->ties[j];
-			    ntie++;
 
 			    /* get absolute id for first snav point */
 			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
+			    section1 = &file1->sections[crossing->section_1];
+			    nc1 = section1->snav_invert_id[tie->snav_1];
 
 			    /* get absolute id for second snav point */
 			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
+			    section2 = &file2->sections[crossing->section_2];
+			    nc2 = section2->snav_invert_id[tie->snav_2];
 if (nc1 > nsnav - 1 || nc2 > nsnav -1
 || nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);
+fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
 
-			    /* get observed offset vector including reduction of block solution */
+			    /* get observed offset vector including removal of block solution */
 			    offsetx = (x[3*nc2] + xa[3*nc2] - x[3*nc1] - xa[3*nc1]) - tie->offset_x_m;
 			    offsety = (x[3*nc2+1] + xa[3*nc2+1] - x[3*nc1+1] - xa[3*nc1+1]) - tie->offset_y_m;
 			    offsetz = (x[3*nc2+2] + xa[3*nc2+2] - x[3*nc1+2] - xa[3*nc1+2]) - tie->offset_z_m;
 
-			    /* get long axis misfit */
-			    misfit = mbna_offsetweight / tie->sigmar1
-						    * (offsetx * tie->sigmax1[0]
-							    + offsety * tie->sigmax1[1]
-							    + offsetz * tie->sigmax1[2]);
-			    misfit_ties += misfit * misfit;
-
-			    /* get horizontal axis misfit */
-			    misfit = mbna_offsetweight / tie->sigmar2
-						    * (offsetx * tie->sigmax2[0]
-							    + offsety * tie->sigmax2[1]
-							    + offsetz * tie->sigmax2[2]);
-			    misfit_ties += misfit * misfit;
+			    if (tie->status != MBNA_TIE_Z)
+				{
+				/* get long axis misfit */
+				misfit = (offsetx * tie->sigmax1[0]
+						+ offsety * tie->sigmax1[1]
+						+ offsetz * tie->sigmax1[2]);
+				misfit_ties += misfit * misfit;
+				misfit_norm += misfit * misfit / tie->sigmar1 / tie->sigmar1;
+				nmisfit++;
+    
+				/* get horizontal axis misfit */
+				misfit = (offsetx * tie->sigmax2[0]
+						+ offsety * tie->sigmax2[1]
+						+ offsetz * tie->sigmax2[2]);
+				misfit_ties += misfit * misfit;
+				misfit_norm += misfit * misfit / tie->sigmar2 / tie->sigmar2;
+				nmisfit++;
+				}
 
-			    /* get semi-vertical axis misfit */
-			    misfit = mbna_offsetweight / tie->sigmar3
-						    * (offsetx * tie->sigmax3[0]
-							    + offsety * tie->sigmax3[1]
-							    + offsetz * tie->sigmax3[2]);
-			    misfit_ties += misfit * misfit;
+			    if (tie->status != MBNA_TIE_XY)
+				{
+				/* get semi-vertical axis misfit */
+				misfit = (offsetx * tie->sigmax3[0]
+						+ offsety * tie->sigmax3[1]
+						+ offsetz * tie->sigmax3[2]);
+				misfit_ties += misfit * misfit;
+				misfit_norm += misfit * misfit / tie->sigmar3 / tie->sigmar3;
+				nmisfit++;
+				}
+			    }
+			}
+		    for (ifile=0;ifile<project.num_files;ifile++)
+			{
+			/* get file */
+			file = &project.files[ifile];
+			for (isection=0;isection<file->num_sections;isection++)
+			    {
+			    /* get section */
+			    section = &file->sections[isection];
+			    if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				/* get absolute id for snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+if (nc1 > nsnav - 1 || nc1 < 0)
+fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
+
+				/* get observed offset vector including removal of block solution */
+				offsetx = (x[3*nc1] + xa[3*nc1]) - section->global_tie_offset_x_m;
+				offsety = (x[3*nc1+1] + xa[3*nc1+1]) - section->global_tie_offset_y_m;
+				offsetz = (x[3*nc1+2] + xa[3*nc1+2]) - section->global_tie_offset_z_m;
+		
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    /* get x axis misfit */
+				    misfit = offsetx;
+				    misfit_ties += misfit * misfit;
+				    misfit_norm += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
+				    nmisfit++;
+    
+				    /* get y axis misfit */
+				    misfit = offsety;
+				    misfit_ties += misfit * misfit;
+				    misfit_norm += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
+				    nmisfit++;
+				    }
+    
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    /* get z axis misfit */
+				    misfit = offsetz;
+				    misfit_ties += misfit * misfit;
+				    misfit_norm += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
+				    nmisfit++;
+				    }
+				}
 			    }
 			}
-		    misfit_ties = sqrt(misfit_ties) / ntie;
+		    misfit_ties = sqrt(misfit_ties) / nmisfit;
+		    misfit_norm = sqrt(misfit_norm) / nmisfit;
 
 		    /* check for convergence */
 		    perturbationchange = perturbationsize - perturbationsizeold;
-		    convergencecriterea = fabs(perturbationchange) / misfit_initial;
+		    convergencecriterea = fabs(perturbationchange) / misfit_ties_initial;
 		    if (convergencecriterea < MBNA_CONVERGENCE || convergencecriterea > 10000.0 || iter > MBNA_INTERATION_MAX)
 		    	done = MB_YES;
 
-/* fprintf(stderr,"MODEL INVERT: iter:%d ntie:%d misfit_initial:%f misfit_ties:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,convergencecriterea,done); */
+fprintf(stderr,"MODEL INVERT: iter:%d nmisfit:%d misfit_initial:%f misfit_ties_initial:%f misfit_ties:%f misfit_norm_initial:%f misfit_norm:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
+iter,nmisfit,misfit_initial,misfit_ties_initial,misfit_ties,misfit_norm_initial,misfit_norm,perturbationsize,perturbationchange,convergencecriterea,done);
 
 		    if (done == MB_NO)
 		        {
@@ -12130,7 +13046,8 @@ iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,converg
 			    section = &file->sections[j];
 			    for (isnav=0;isnav<section->num_snav;isnav++)
 				{
-				if (section->snav_num_ties[isnav] > 0)
+				if (section->snav_num_ties[isnav] > 0
+				    || section->global_tie_snav == isnav)
 				    {
 				    k = section->snav_invert_id[isnav];
 				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
@@ -12240,6 +13157,37 @@ offset_x,offset_y,offset_z,tie->inversion_offset_x_m,tie->inversion_offset_y_m,t
 			}
 		    }
 
+		/* get global tie results */
+		sprintf(message, " > Global Tie Offsets (m):  id  observed  solution  error\n");
+		do_info_add(message, MB_NO);
+		for (ifile=0;ifile<project.num_files;ifile++)
+		    {
+		    file = &project.files[ifile];
+		    for (isection=0;isection<file->num_sections;isection++)
+			{
+			section = &file->sections[isection];
+			if (section->global_tie_status != MBNA_TIE_NONE)
+			    {
+			    offset_x =  section->snav_lon_offset[section->global_tie_snav];
+			    offset_y =  section->snav_lat_offset[section->global_tie_snav];
+			    offset_z =  section->snav_z_offset[section->global_tie_snav];
+			    
+			    sprintf(message, " >     %2.2d:%2.2d:%2.2d %d   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f\n",
+				ifile,isection,section->global_tie_snav,section->global_tie_status,
+				section->global_tie_offset_x_m,
+				section->global_tie_offset_y_m,
+				section->global_tie_offset_z_m,
+				offset_x / mbna_mtodeglon,
+				offset_y / mbna_mtodeglat,
+				offset_z,
+				(offset_x / mbna_mtodeglon - section->global_tie_offset_x_m),
+				(offset_y / mbna_mtodeglat - section->global_tie_offset_y_m),
+				(offset_z - section->global_tie_offset_z_m));
+			    do_info_add(message, MB_NO);
+			    }
+			}
+		    }
+
 		/* write updated project */
 		project.inversion = MBNA_INVERSION_CURRENT;
 		mbnavadjust_write_project();
@@ -12248,6 +13196,8 @@ offset_x,offset_y,offset_z,tie->inversion_offset_x_m,tie->inversion_offset_y_m,t
 		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
 		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
 		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xa,&error);
+		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xs,&error);
+		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xw,&error);
 
 		/* turn off message dialog */
 		do_message_off();
@@ -12670,7 +13620,8 @@ mbnavadjust_interpolatesolution()
 		for (isnav=0;isnav<section->num_snav;isnav++)
 		    {
 		    /* deal with constrained snav points */
-		    if (section->snav_num_ties[isnav] > 0)
+		    if (section->snav_num_ties[isnav] > 0
+			|| section->global_tie_snav == isnav)
 			{
 			/* if no previous tie set apply current offset to intervening snav points */
 			if (previoustie == MB_NO)
@@ -12987,7 +13938,7 @@ mbnavadjust_modelplot_setzoom()
 	if ((mbna_modelplot_zoom_x1 >= 0 || mbna_modelplot_zoom_x2 >= 0)
 	    && mbna_modelplot_zoom_x1 != mbna_modelplot_zoom_x2)
 		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
 			{
 			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
 			xo = 5 * MBNA_MODELPLOT_X_SPACE;
@@ -13010,19 +13961,42 @@ mbnavadjust_modelplot_setzoom()
 				mbna_modelplot_zoom = MB_NO;
 			}
 
-		else
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
-			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itiestart = MAX(0,itiestart);
-			itieend = MIN(mbna_num_ties_plot-1, itieend);
-			if (itieend > itiestart)
-				{
-				mbna_modelplot_tiezoom = MB_YES;
-				mbna_modelplot_tiestartzoom = itiestart;
-				mbna_modelplot_tieendzoom = itieend;
+			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
+			xo = 5 * MBNA_MODELPLOT_X_SPACE;
+			xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
+
+			ipingstart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
+					+ mbna_modelplot_start;
+			ipingstart = MIN(MAX(ipingstart, 0), project.num_pings - 1);
+			ipingend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
+					+ mbna_modelplot_start;
+			ipingend = MIN(MAX(ipingend, 0), project.num_pings - 1);
+
+			if (ipingend > ipingstart)
+				{
+				mbna_modelplot_zoom = MB_YES;
+				mbna_modelplot_startzoom = ipingstart;
+				mbna_modelplot_endzoom = ipingend;
+				}
+			else
+				mbna_modelplot_zoom = MB_NO;
+			}
+
+		else
+			{
+			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
+					/ mbna_modelplot_xscale;
+			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
+					/ mbna_modelplot_xscale;
+			itiestart = MAX(0,itiestart);
+			itieend = MIN(mbna_num_ties_plot-1, itieend);
+			if (itieend > itiestart)
+				{
+				mbna_modelplot_tiezoom = MB_YES;
+				mbna_modelplot_tiestartzoom = itiestart;
+				mbna_modelplot_tieendzoom = itieend;
 				}
 			else
 				mbna_modelplot_tiezoom = MB_NO;
@@ -13035,7 +14009,13 @@ mbnavadjust_modelplot_setzoom()
 	/* reset zoom to off otherwise */
 	else
 		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+			{
+			mbna_modelplot_zoom = MB_NO;
+			mbna_modelplot_start = 0;
+			mbna_modelplot_end = project.num_pings - 1;
+			}
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
 			mbna_modelplot_zoom = MB_NO;
 			mbna_modelplot_start = 0;
@@ -13086,13 +14066,17 @@ mbnavadjust_modelplot_pick(int x, int y)
     		&& project.inversion != MBNA_INVERSION_NONE
 		&& project.modelplot == MB_YES)
     		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+			{
+			mbnavadjust_modelplot_pick_timeseries(x, y);
+			}
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
-			mbnavadjust_modelplot_pick_sequential(x, y);
+			mbnavadjust_modelplot_pick_perturbation(x, y);
 			}
 		else
 			{
-			mbnavadjust_modelplot_pick_tielist(x, y);
+			mbnavadjust_modelplot_pick_tieoffsets(x, y);
 			}
 		}
 
@@ -13112,10 +14096,10 @@ mbnavadjust_modelplot_pick(int x, int y)
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_pick_sequential(int x, int y)
+mbnavadjust_modelplot_pick_timeseries(int x, int y)
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_sequential";
+	char	*function_name = "mbnavadjust_modelplot_pick_timeseries";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -13146,7 +14130,7 @@ mbnavadjust_modelplot_pick_sequential(int x, int y)
 		&& project.modelplot == MB_YES)
     		{
 		rangemin = 10000000;
-fprintf(stderr,"mbnavadjust_modelplot_pick_sequential: %d %d\n",x,y);
+fprintf(stderr,"mbnavadjust_modelplot_pick_timeseries: %d %d\n",x,y);
 		/* search by looping over crossings */
 		for (i=0;i<project.num_crossings;i++)
 		    {
@@ -13335,10 +14319,233 @@ fprintf(stderr,"mbnavadjust_modelplot_pick_sequential: %d %d\n",x,y);
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_pick_tielist(int x, int y)
+mbnavadjust_modelplot_pick_perturbation(int x, int y)
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_pick_perturbation";
+	int	status = MB_SUCCESS;
+	struct mbna_file *file;
+	struct mbna_section *section;
+	struct mbna_crossing *crossing;
+	struct mbna_tie *tie;
+	int	range;
+	int	rangemin;
+	int	pick_crossing;
+	int	pick_tie;
+	int	pick_file;
+	int	pick_section;
+	int	pick_snav;
+	int	ntieselect;
+	int	i, j, ix, iy, iping;
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		fprintf(stderr,"dbg2       x:           %d\n",x);
+		fprintf(stderr,"dbg2       y:           %d\n",y);
+		}
+
+	/* find nearest snav pt with tie */
+    	if (project.open == MB_YES
+    		&& project.inversion != MBNA_INVERSION_NONE
+		&& project.modelplot == MB_YES)
+    		{
+		rangemin = 10000000;
+fprintf(stderr,"mbnavadjust_modelplot_pick_perturbation: %d %d\n",x,y);
+		/* search by looping over crossings */
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+
+		    /* loop over all ties for this crossing */
+		    for (j=0;j<crossing->num_ties;j++)
+		    	{
+			tie = &(crossing->ties[j]);
+
+			/* handle first snav point */
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+
+			if (section->show_in_modelplot == MB_YES)
+				{
+				iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+				}
+
+			/* handle second snav point */
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+
+			if (section->show_in_modelplot == MB_YES)
+				{
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_2;
+					pick_section = crossing->section_2;
+					pick_snav = tie->snav_2;
+					}
+
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_2;
+					pick_section = crossing->section_2;
+					pick_snav = tie->snav_2;
+					}
+
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_2;
+					pick_section = crossing->section_2;
+					pick_snav = tie->snav_2;
+					}
+				}
+			}
+		    }
+
+		/* deal with successful pick */
+		if (rangemin < 10000000)
+			{
+			/* count the number of ties associated with the selected snav point */
+			ntieselect = 0;
+			for (i=0;i<project.num_crossings;i++)
+			    {
+			    crossing = &(project.crossings[i]);
+
+			    /* loop over all ties for this crossing */
+			    for (j=0;j<crossing->num_ties;j++)
+		    		{
+				tie = &(crossing->ties[j]);
+
+				/* handle first snav point */
+				file = &project.files[crossing->file_id_1];
+				section = &file->sections[crossing->section_1];
+				if (pick_file == crossing->file_id_1
+					&& pick_section == crossing->section_1
+					&& pick_snav == tie->snav_1)
+					ntieselect++;
+
+				/* handle second snav point */
+				file = &project.files[crossing->file_id_2];
+				section = &file->sections[crossing->section_2];
+				if (pick_file == crossing->file_id_2
+					&& pick_section == crossing->section_2
+					&& pick_snav == tie->snav_2)
+					ntieselect++;
+				}
+			    }
+
+			/* if only one tie go ahead and select it and open it in naverr */
+			if (ntieselect == 1)
+				{
+			    	mbna_crossing_select = pick_crossing;
+			    	mbna_tie_select = pick_tie;
+				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
+				mbna_modelplot_picksection = MBNA_SELECT_NONE;
+				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
+
+				/* bring up naverr window if required */
+				if (mbna_naverr_load == MB_NO)
+				    {
+				    do_naverr_init();
+				    }
+
+				/* else if naverr window is up, load selected crossing */
+				else
+				    {
+				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
+				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
+				    do_update_naverr();
+				    do_update_status();
+				    }
+				}
+
+			/* else if multiple ties */
+			else if (ntieselect > 1)
+				{
+				mbna_modelplot_pickfile = pick_file;
+				mbna_modelplot_picksection = pick_section;
+				mbna_modelplot_picksnav = pick_snav;
+
+				}
+			}
+		}
+
+	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_pick_tieoffsets(int x, int y)
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_tielist";
+	char	*function_name = "mbnavadjust_modelplot_pick_tieoffsets";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -13498,10 +14705,10 @@ mbnavadjust_modelplot_middlepick(int x, int y)
     		&& project.inversion != MBNA_INVERSION_NONE
 		&& project.modelplot == MB_YES)
 		{
-		/* middle pick for sequential plot is either choosing one of multiple available
+		/* middle pick for timeseries plot is either choosing one of multiple available
 			ties from a tied crossing (left button) pick, or if that is not the
 			situation, picking the nearest untied crossing */
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
 			{
 			/* first snav pick had multiple ties - now pick which one to use */
 			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
@@ -13596,7 +14803,7 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 						    pick_section = crossing->section_1;
 						    pick_snav = tie->snav_1;
 						    }
-	    fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
 					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
 					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
@@ -13609,7 +14816,7 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 						    pick_section = crossing->section_1;
 						    pick_snav = tie->snav_1;
 						    }
-	    fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
 					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
 					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
@@ -13622,7 +14829,7 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 						    pick_section = crossing->section_1;
 						    pick_snav = tie->snav_1;
 						    }
-	fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);
+	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 					    }
 					}
 				    }
@@ -13782,78 +14989,145 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 			    }
 			}
 
-		/* middle pick for tie (block) plot is choosing which survey vs survey group (block)
-			to plot by itself */
-		else
+		/* middle pick for perturbation plot is either choosing one of multiple available
+			ties from a tied crossing (left button) pick, or if that is not the
+			situation, picking the nearest untied crossing */
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
-			rangemin = 10000000;
-
-			/* search by looping over crossings */
-			for (i=0;i<project.num_crossings;i++)
+			/* first snav pick had multiple ties - now pick which one to use */
+			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
 			    {
-			    crossing = &(project.crossings[i]);
+			    rangemin = 10000000;
 
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
+			    for (i=0;i<project.num_crossings;i++)
 				{
-				tie = &(crossing->ties[j]);
+				/* check if this crossing includes the picked snav */
+				crossing = &(project.crossings[i]);
 
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
+				/* check first snav */
+				if (crossing->file_id_1 == mbna_modelplot_pickfile
+					&& crossing->section_1 == mbna_modelplot_picksection)
+				    {
+				    /* loop over the ties */
+				    for (j=0;j<crossing->num_ties;j++)
+					{
+					tie = &(crossing->ties[j]);
+					if (tie->snav_1 == mbna_modelplot_picksnav)
+					    {
+					    file = &project.files[crossing->file_id_2];
+					    section = &file->sections[crossing->section_2];
+					    iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
 
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
+					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_2;
+						    pick_section = crossing->section_2;
+						    pick_snav = tie->snav_2;
+						    }
+	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
+					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_2;
+						    pick_section = crossing->section_2;
+						    pick_snav = tie->snav_2;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
+					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_2;
+						    pick_section = crossing->section_2;
+						    pick_snav = tie->snav_2;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+					    }
 					}
+				    }
 
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
+				/* check second snav */
+				if (crossing->file_id_2 == mbna_modelplot_pickfile
+					&& crossing->section_2 == mbna_modelplot_picksection)
+				    {
+				    /* loop over the ties */
+				    for (j=0;j<crossing->num_ties;j++)
 					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
+					tie = &(crossing->ties[j]);
+					if (tie->snav_2 == mbna_modelplot_picksnav)
+					    {
+					    file = &project.files[crossing->file_id_1];
+					    section = &file->sections[crossing->section_1];
+					    iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_1;
+						    pick_section = crossing->section_1;
+						    pick_snav = tie->snav_1;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+
+					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_1;
+						    pick_section = crossing->section_1;
+						    pick_snav = tie->snav_1;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+
+					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_1;
+						    pick_section = crossing->section_1;
+						    pick_snav = tie->snav_1;
+						    }
+	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+					    }
 					}
+				    }
 				}
-			    }
 
-			/* deal with successful pick */
-			if (rangemin < 10000000)
+			    /* deal with successful pick */
+			    if (rangemin < 10000000)
 				{
-				crossing = &(project.crossings[pick_crossing]);
+				/* select tie and open it in naverr */
 				mbna_crossing_select = pick_crossing;
 				mbna_tie_select = pick_tie;
 				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
 				mbna_modelplot_picksection = MBNA_SELECT_NONE;
 				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-				mbna_modelplot_blocksurvey1 = project.files[crossing->file_id_1].block;
-				mbna_modelplot_blocksurvey2 = project.files[crossing->file_id_2].block;
-				mbna_modelplot_tiezoom = MB_NO;
 
 				/* bring up naverr window if required */
 				if (mbna_naverr_load == MB_NO)
@@ -13870,111 +15144,1207 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 				    do_update_status();
 				    }
 				}
-			}
-		}
+			    }
+
+			/* else pick closest untied crossing */
+			else
+			    {
+			    rangemin = 10000000;
+
+			    /* search by looping over crossings */
+			    for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* check only untied crossings */
+				if (crossing->num_ties == 0)
+				    {
+				    file = &project.files[crossing->file_id_1];
+				    section = &file->sections[crossing->section_1];
+
+				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_1;
+					    pick_section = crossing->section_1;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_1;
+					    pick_section = crossing->section_1;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_1;
+					    pick_section = crossing->section_1;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    /* handle second snav point */
+				    file = &project.files[crossing->file_id_2];
+				    section = &file->sections[crossing->section_2];
+
+				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_2;
+					    pick_section = crossing->section_2;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_2;
+					    pick_section = crossing->section_2;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_2;
+					    pick_section = crossing->section_2;
+					    pick_snav = section->num_snav/2;
+					    }
+				    }
+				}
+
+			    /* deal with successful pick */
+			    if (rangemin < 10000000)
+				{
+				mbna_crossing_select = pick_crossing;
+				mbna_tie_select = MBNA_SELECT_NONE;
+				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
+				mbna_modelplot_picksection = MBNA_SELECT_NONE;
+				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
+
+				/* bring up naverr window if required */
+				if (mbna_naverr_load == MB_NO)
+				    {
+				    do_naverr_init();
+				    }
+
+				/* else if naverr window is up, load selected crossing */
+				else
+				    {
+				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
+				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
+				    do_update_naverr();
+				    do_update_status();
+				    }
+				}
+			    }
+			}
+
+		/* middle pick for tie offsets plot is choosing which survey vs survey group (block)
+			to plot by itself */
+		else
+			{
+			rangemin = 10000000;
+
+			/* search by looping over crossings */
+			for (i=0;i<project.num_crossings;i++)
+			    {
+			    crossing = &(project.crossings[i]);
+
+			    /* loop over all ties for this crossing */
+			    for (j=0;j<crossing->num_ties;j++)
+				{
+				tie = &(crossing->ties[j]);
+
+				/* handle first snav point */
+				file = &project.files[crossing->file_id_1];
+				section = &file->sections[crossing->section_1];
+
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
+
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+				}
+			    }
+
+			/* deal with successful pick */
+			if (rangemin < 10000000)
+				{
+				crossing = &(project.crossings[pick_crossing]);
+				mbna_crossing_select = pick_crossing;
+				mbna_tie_select = pick_tie;
+				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
+				mbna_modelplot_picksection = MBNA_SELECT_NONE;
+				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
+				mbna_modelplot_blocksurvey1 = project.files[crossing->file_id_1].block;
+				mbna_modelplot_blocksurvey2 = project.files[crossing->file_id_2].block;
+				mbna_modelplot_tiezoom = MB_NO;
+
+				/* bring up naverr window if required */
+				if (mbna_naverr_load == MB_NO)
+				    {
+				    do_naverr_init();
+				    }
+
+				/* else if naverr window is up, load selected crossing */
+				else
+				    {
+				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
+				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
+				    do_update_naverr();
+				    do_update_status();
+				    }
+				}
+			}
+		}
+
+	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_clearblock()
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_clearblock";
+	int	status = MB_SUCCESS;
+	struct mbna_crossing *crossing;
+	int	block1, block2;
+	int	i, j;
+/*fprintf(stderr,"Called %s\n",function_name);*/
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		}
+
+	/* only proceed if model plot is active and a crossing is selected */
+    	if (project.open == MB_YES
+		&& project.modelplot == MB_YES
+		&& mbna_current_crossing != MBNA_SELECT_NONE)
+    		{
+		/* delete all ties associated with the same pair of surveys as the currently selected crossing */
+		crossing = &(project.crossings[mbna_current_crossing]);
+		block1 = project.files[crossing->file_id_1].block;
+		block2 = project.files[crossing->file_id_2].block;
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+		    if (crossing->num_ties > 0
+		    	&& ((project.files[crossing->file_id_1].block == block1
+		    		&& project.files[crossing->file_id_2].block == block2)
+			    || (project.files[crossing->file_id_1].block == block2
+		    		&& project.files[crossing->file_id_2].block == block1)))
+			{
+			for (j=crossing->num_ties-1;j>=0;j--)
+			    {
+			    mbnavadjust_deletetie(i, j, MBNA_CROSSING_STATUS_NONE);
+			    }
+			}
+		    }
+		}
+
+ 	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_plot()
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_plot";
+	int	status = MB_SUCCESS;
+/*fprintf(stderr,"Called %s\n",function_name);*/
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		}
+
+	/* plot model if an inversion has been performed */
+    	if (project.open == MB_YES
+    		&& project.inversion != MBNA_INVERSION_NONE
+		&& project.modelplot == MB_YES)
+    		{
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+			{
+			mbnavadjust_modelplot_plot_timeseries();
+			}
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
+			{
+			mbnavadjust_modelplot_plot_perturbation();
+			}
+		else
+			{
+			mbnavadjust_modelplot_plot_tieoffsets();
+			}
+		}
+
+ 	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_plot_timeseries()
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_plot_timeseries";
+	int	status = MB_SUCCESS;
+	struct mbna_file *file;
+	struct mbna_section *section;
+	struct mbna_crossing *crossing;
+	struct mbna_tie *tie;
+	double	lon_offset_min;
+	double	lon_offset_max;
+	double	lat_offset_min;
+	double	lat_offset_max;
+	double	z_offset_min;
+	double	z_offset_max;
+	double	xymax, yzmax;
+	int	plot_width;
+	int	plot_height;
+	int	first, iping;
+	char	label[STRING_MAX];
+	int	stringwidth, stringascent, stringdescent;
+	int	pixel;
+	int	ixo, iyo, ix, iy;
+	int	i, j, isnav;
+	int	imodelplot_start, imodelplot_end;
+//fprintf(stderr,"Called %s\n",function_name);
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		}
+
+	/* plot model if an inversion has been performed */
+    	if (project.open == MB_YES
+    		&& project.inversion != MBNA_INVERSION_NONE
+		&& project.modelplot == MB_YES)
+    		{
+		/* first loop over files setting all plot flags off for both files and sections */
+		first = MB_YES;
+		mbna_modelplot_count = 0;
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			file->show_in_modelplot = MB_NO;
+			for (j=0;j<file->num_sections;j++)
+				{
+				section = &file->sections[j];
+				section->show_in_modelplot = MB_NO;
+				}
+			}
+
+		/* now loop over files setting file or section plot flags on as necessary */
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+
+			/* check if this file will be plotted */
+			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
+				{
+				if (file->block == mbna_survey_select)
+					{
+					file->show_in_modelplot = MB_YES;
+					}
+				}
+
+			/* check if this file will be plotted */
+			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
+				{
+				if (i == mbna_file_select)
+					{
+					file->show_in_modelplot = MB_YES;
+					}
+				}
+
+			/* check if each section in this file will be plotted */
+			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
+				{
+				for (j=0;j<file->num_sections;j++)
+					{
+					section = &file->sections[j];
+					if (i == mbna_file_select && j == mbna_section_select)
+						{
+						section->show_in_modelplot = MB_YES;
+						}
+					}
+				}
+
+			/* else every file will be plotted */
+			else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
+				{
+				file->show_in_modelplot = MB_YES;
+				}
+			}
+
+		/* if view mode is with survey loop over all crossings */
+		if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* if either file is part of the selected survey
+					then set plot flags on for both files */
+				if (project.files[crossing->file_id_1].block == mbna_survey_select
+				    || project.files[crossing->file_id_2].block == mbna_survey_select)
+					{
+					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
+					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+		/* else if view mode is with file loop over all crossings */
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* if either file is selected
+					then set plot flags on for both files */
+				if (crossing->file_id_1 == mbna_file_select || crossing->file_id_2 == mbna_file_select)
+					{
+					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
+					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+		/* else if view mode is with section loop over all crossings */
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* if either section is selected
+					then set plot flags on for both files */
+				if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
+				    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
+					{
+					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
+					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+		/* finally loop over files again setting all section plot flags on for files with plot flags on */
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			if (file->show_in_modelplot == MB_YES)
+				{
+				for (j=0;j<file->num_sections;j++)
+					{
+					section = &file->sections[j];
+					section->show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+
+		/* get min maxes by looping over files and sections checking for sections to be plotted */
+		first = MB_YES;
+		mbna_modelplot_count = 0;
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			for (j=0;j<file->num_sections;j++)
+				{
+				section = &file->sections[j];
+
+				/* if this section will be plotted use the snav values */
+				if (section->show_in_modelplot == MB_YES)
+					{
+					section->modelplot_start_count = mbna_modelplot_count;
+					for (isnav=0;isnav<section->num_snav;isnav++)
+						{
+						if (mbna_modelplot_zoom == MB_NO
+						    || (mbna_modelplot_count >= mbna_modelplot_startzoom && mbna_modelplot_count <= mbna_modelplot_endzoom))
+						    {
+							if (first == MB_YES)
+								{
+								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon;
+								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon;
+								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat;
+								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat;
+								z_offset_min = section->snav_z_offset[isnav];
+								z_offset_max = section->snav_z_offset[isnav];
+								first = MB_NO;
+								}
+							else
+								{
+								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon);
+								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon);
+								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat);
+								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat);
+								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav]);
+								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav]);
+								}
+							}
+						}
+					mbna_modelplot_count += section->snav_id[section->num_snav-1];
+					}
+				}
+			}
+
+		/* set plot bounds */
+		if (mbna_modelplot_zoom == MB_YES)
+			{
+			mbna_modelplot_start = mbna_modelplot_startzoom;
+			mbna_modelplot_end = mbna_modelplot_endzoom;
+			}
+		else
+			{
+			mbna_modelplot_start = 0;
+			mbna_modelplot_end = mbna_modelplot_count - 1;
+			}
+
+		/* get scaling */
+		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
+		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
+		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
+		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
+		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
+		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
+		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
+		xymax = MAX(fabs(lat_offset_min),xymax);
+		xymax = MAX(fabs(lat_offset_max),xymax);
+		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
+		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
+		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
+		yzmax = MAX(yzmax,0.5);
+		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
+
+		/* clear screens for first plot */
+		xg_fillrectangle(pmodp_xgid, 0, 0,
+				modp_borders[1], modp_borders[3],
+				pixel_values[mbna_color_background], XG_SOLIDLINE);
+
+		/* plot the bounds */
+		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
+
+		/* plot title */
+		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
+			{
+			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
+			{
+			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
+			{
+			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
+			{
+			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
+			{
+			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
+				mbna_survey_select, mbna_file_select, mbna_section_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
+			{
+			sprintf(label, "Display All Data");
+			}
+
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		/* plot labels */
+		sprintf(label, "East-West Offset (meters) vs. Ping Count");
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_start);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth / 2;
+		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_end);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
+		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 0.0);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lon + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", -1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+
+		sprintf(label, "North-South Offset (meters) vs. Ping Count");
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_start);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth / 2;
+		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_end);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
+		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 0.0);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lat + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", -1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+
+		sprintf(label, "Vertical Offset (meters) vs. Ping Count");
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_start);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth / 2;
+		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_end);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
+		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 1.1 * yzmax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 0.0);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_z + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", -1.1 * yzmax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		/* set clipping */
+		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
+
+		/* loop over all crossings and plot and plot those without ties in green */
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+		    if (crossing->num_ties== 0)
+		    	{
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				}
+			}
+		    }
+
+		/* Now plot the east-west offsets */
+		ixo = 0;
+		iyo = 0;
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[isnav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[isnav] / mbna_mtodeglon);
+				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
+				    else if (i > 0 || j > 0)
+					{
+					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
+						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
+					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    ixo = ix;
+				    iyo = iy;
+				    }
+				}
+			}
+		    }
+
+		/* Now plot the north-south offsets */
+		ixo = 0;
+		iyo = 0;
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[isnav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[isnav] / mbna_mtodeglat);
+				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
+				    else if (i > 0 || j > 0)
+					{
+					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
+						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
+					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    ixo = ix;
+				    iyo = iy;
+				    }
+				}
+			}
+		    }
+
+		/* Now plot the vertical offsets */
+		ixo = 0;
+		iyo = 0;
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[isnav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[isnav]);
+				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
+				    else if (i > 0 || j > 0)
+					{
+					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
+						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
+					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    ixo = ix;
+				    iyo = iy;
+				    }
+				}
+			}
+		    }
+
+		/* loop over all crossings and plot ties */
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+		    for (j=0;j<crossing->num_ties;j++)
+		    	{
+			tie = &(crossing->ties[j]);
+
+			if (tie->inversion_status == MBNA_INVERSION_CURRENT)
+				pixel = pixel_values[mbna_color_foreground];
+			else
+				pixel = pixel_values[BLUE];
+
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				}
+			}
+		    }
+
+		/* Loop over all files plotting global ties */
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    
+				    if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					/* east-west offsets */
+					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon);
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					
+					/* north-south offsets */
+					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat);
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    
+				    if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					/* vertical offsets */
+					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->global_tie_snav]);
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    }
+				}
+			}
+		    }
+
+		/* plot current tie in red */
+		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
+			{
+			crossing = &(project.crossings[mbna_current_crossing]);
+			tie = &(crossing->ties[mbna_current_tie]);
+
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+			}
+
+		/* or if tie not selected then plot current crossing in red */
+		else if (mbna_current_crossing != MBNA_SELECT_NONE)
+			{
+			crossing = &(project.crossings[mbna_current_crossing]);
+
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+			}
+
+		/* if a modelplot pick did not resolve a single tie, plot the options for a second pick */
+		if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				/* check if this crossing includes the picked snav */
+				crossing = &(project.crossings[i]);
+
+				/* check first snav */
+				if (crossing->file_id_1 == mbna_modelplot_pickfile
+					&& crossing->section_1 == mbna_modelplot_picksection)
+					{
+					/* loop over the ties */
+					for (j=0;j<crossing->num_ties;j++)
+						{
+						tie = &(crossing->ties[j]);
+						if (crossing->file_id_1 == mbna_modelplot_pickfile
+						    && crossing->section_1 == mbna_modelplot_picksection
+						    && tie->snav_1 == mbna_modelplot_picksnav)
+							{
+							file = &project.files[crossing->file_id_1];
+							section = &file->sections[crossing->section_1];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
 
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
+							file = &project.files[crossing->file_id_2];
+							section = &file->sections[crossing->section_2];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
 
-	return(status);
-}
-/*--------------------------------------------------------------------*/
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
+							}
+						}
+					}
 
-int
-mbnavadjust_modelplot_clearblock()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_clearblock";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	int	block1, block2;
-	int	i, j;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+				/* check second snav */
+				if (crossing->file_id_2 == mbna_modelplot_pickfile
+					&& crossing->section_2 == mbna_modelplot_picksection)
+					{
+					/* loop over the ties */
+					for (j=0;j<crossing->num_ties;j++)
+						{
+						tie = &(crossing->ties[j]);
+						if (crossing->file_id_2 == mbna_modelplot_pickfile
+						    && crossing->section_2 == mbna_modelplot_picksection
+						    && tie->snav_2 == mbna_modelplot_picksnav)
+							{
+							file = &project.files[crossing->file_id_2];
+							section = &file->sections[crossing->section_2];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
 
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
 
-	/* only proceed if model plot is active and a crossing is selected */
-    	if (project.open == MB_YES
-		&& project.modelplot == MB_YES
-		&& mbna_current_crossing != MBNA_SELECT_NONE)
-    		{
-		/* delete all ties associated with the same pair of surveys as the currently selected crossing */
-		crossing = &(project.crossings[mbna_current_crossing]);
-		block1 = project.files[crossing->file_id_1].block;
-		block2 = project.files[crossing->file_id_2].block;
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties > 0
-		    	&& ((project.files[crossing->file_id_1].block == block1
-		    		&& project.files[crossing->file_id_2].block == block2)
-			    || (project.files[crossing->file_id_1].block == block2
-		    		&& project.files[crossing->file_id_2].block == block1)))
-			{
-			for (j=crossing->num_ties-1;j>=0;j--)
-			    {
-			    mbnavadjust_deletetie(i, j, MBNA_CROSSING_STATUS_NONE);
-			    }
+							file = &project.files[crossing->file_id_1];
+							section = &file->sections[crossing->section_1];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
+							}
+						}
+					}
+				}
 			}
-		    }
-		}
 
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
+		/* plot zoom if active */
+		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
+			{
+			imodelplot_start = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
+			imodelplot_start = MIN(MAX(imodelplot_start, 0), project.num_pings - 1);
+			imodelplot_end = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
+			imodelplot_end = MIN(MAX(imodelplot_end, 0), project.num_pings - 1);
 
-	return(status);
-}
-/*--------------------------------------------------------------------*/
+			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_start - mbna_modelplot_start));
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
 
-int
-mbnavadjust_modelplot_plot()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot";
-	int	status = MB_SUCCESS;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_end - mbna_modelplot_start));
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+			}
 
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
+		/* reset clipping */
+		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
 
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
-			{
-			mbnavadjust_modelplot_plot_sequential();
-			}
-		else
-			{
-			mbnavadjust_modelplot_plot_tielist();
-			}
 		}
 
  	/* print output debug statements */
@@ -13990,13 +16360,14 @@ mbnavadjust_modelplot_plot()
 
 	return(status);
 }
+
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_plot_sequential()
+mbnavadjust_modelplot_plot_perturbation()
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_sequential";
+	char	*function_name = "mbnavadjust_modelplot_plot_perturbation";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -14018,7 +16389,7 @@ mbnavadjust_modelplot_plot_sequential()
 	int	ixo, iyo, ix, iy;
 	int	i, j, isnav;
 	int	imodelplot_start, imodelplot_end;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+//fprintf(stderr,"Called %s\n",function_name);
 
  	/* print input debug statements */
 	if (mbna_verbose >= 2)
@@ -14178,22 +16549,22 @@ mbnavadjust_modelplot_plot_sequential()
 						    {
 							if (first == MB_YES)
 								{
-								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								z_offset_min = section->snav_z_offset[isnav];
-								z_offset_max = section->snav_z_offset[isnav];
+								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
+								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
+								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
+								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
+								z_offset_min = section->snav_z_offset[isnav] - file->block_offset_z;
+								z_offset_max = section->snav_z_offset[isnav] - file->block_offset_z;
 								first = MB_NO;
 								}
 							else
 								{
-								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav]);
-								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav]);
+								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
+								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
+								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
+								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
+								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav] - file->block_offset_z);
+								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav] - file->block_offset_z);
 								}
 							}
 						}
@@ -14404,11 +16775,11 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
 				}
 
@@ -14421,11 +16792,11 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
 				}
 			}
@@ -14446,7 +16817,7 @@ mbnavadjust_modelplot_plot_sequential()
 				    {
 				    iping = section->modelplot_start_count + section->snav_id[isnav];
 				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[isnav] / mbna_mtodeglon);
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x));
 				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
 					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
 				    else if (i > 0 || j > 0)
@@ -14477,7 +16848,7 @@ mbnavadjust_modelplot_plot_sequential()
 				    {
 				    iping = section->modelplot_start_count + section->snav_id[isnav];
 				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[isnav] / mbna_mtodeglat);
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y));
 				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
 					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
 				    else if (i > 0 || j > 0)
@@ -14508,7 +16879,7 @@ mbnavadjust_modelplot_plot_sequential()
 				    {
 				    iping = section->modelplot_start_count + section->snav_id[isnav];
 				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[isnav]);
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[isnav] - file->block_offset_z));
 				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
 					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
 				    else if (i > 0 || j > 0)
@@ -14546,11 +16917,11 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
 				}
 
@@ -14563,16 +16934,58 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
 				}
 			}
 		    }
 
+		/* Loop over all files plotting global ties */
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    
+				    if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					/* east-west offsets */
+					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon - file->block_offset_x));
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					
+					/* north-south offsets */
+					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat - file->block_offset_y));
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    
+				    if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					/* vertical offsets */
+					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->global_tie_snav] - file->block_offset_z));
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    }
+				}
+			}
+		    }
+
 		/* plot current tie in red */
 		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
 			{
@@ -14588,13 +17001,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14608,13 +17021,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14634,13 +17047,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14654,13 +17067,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14695,13 +17108,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14715,13 +17128,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14750,13 +17163,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14770,13 +17183,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14827,10 +17240,10 @@ mbnavadjust_modelplot_plot_sequential()
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_plot_tielist()
+mbnavadjust_modelplot_plot_tieoffsets()
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_tielist";
+	char	*function_name = "mbnavadjust_modelplot_plot_tieoffsets";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -14858,7 +17271,7 @@ mbnavadjust_modelplot_plot_tielist()
 	int	plot_index;
 	int	isurvey1, isurvey2;
 	int	i, j;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+//fprintf(stderr,"Called %s\n",function_name);
 
  	/* print input debug statements */
 	if (mbna_verbose >= 2)
diff --git a/src/mbnavadjust/mbnavadjust_prog.c b/src/mbnavadjust/mbnavadjust_prog.c.orig
similarity index 78%
copy from src/mbnavadjust/mbnavadjust_prog.c
copy to src/mbnavadjust/mbnavadjust_prog.c.orig
index 16fecab..e62ee74 100644
--- a/src/mbnavadjust/mbnavadjust_prog.c
+++ b/src/mbnavadjust/mbnavadjust_prog.c.orig
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavadjust_prog.c	3/23/00
- *    $Id: mbnavadjust_prog.c 2219 2014-12-11 21:22:25Z caress $
+ *    $Id: mbnavadjust_prog.c 2238 2015-04-15 06:00:52Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -77,7 +77,7 @@ struct swathraw
 	};
 
 /* id variables */
-static char rcs_id[] = "$Id: mbnavadjust_prog.c 2219 2014-12-11 21:22:25Z caress $";
+static char rcs_id[] = "$Id: mbnavadjust_prog.c 2238 2015-04-15 06:00:52Z caress $";
 static char program_name[] = "mbnavadjust";
 static char help_message[] =  "mbnavadjust is an interactive navigation adjustment package for swath sonar data.\n";
 static char usage_message[] = "mbnavadjust [-Iproject -V -H]";
@@ -121,6 +121,9 @@ double	timegap;
 #define GREEN	3
 #define BLUE	4
 #define CORAL	5
+#define YELLOW	6
+#define ORANGE	23
+#define PURPLE	255
 
 #define	XG_SOLIDLINE	0
 #define	XG_DASHLINE	1
@@ -217,11 +220,12 @@ int mbnavadjust_init_globals()
 	project.num_ties = 0;
 	project.inversion = MBNA_INVERSION_NONE;
 	project.modelplot = MB_NO;
-	project.modelplot_style = MBNA_MODELPLOT_SEQUENTIAL;
+	project.modelplot_style = MBNA_MODELPLOT_TIMESERIES;
 	project.logfp = NULL;
  	mbna_status = MBNA_STATUS_GUI;
  	mbna_view_list = MBNA_VIEW_LIST_FILES;
  	mbna_view_mode = MBNA_VIEW_MODE_ALL;
+	mbna_invert_mode = MBNA_INVERT_ZISOLATED;
 	mbna_color_foreground = BLACK;
 	mbna_color_background = WHITE;
  	project.section_length = 0.14;
@@ -230,12 +234,12 @@ int mbnavadjust_init_globals()
 	project.precision = SIGMA_MINIMUM;
 	project.smoothing = MBNA_SMOOTHING_DEFAULT;
 	project.zoffsetwidth = 5.0;
-	mbna_file_id_1 = -1;
-	mbna_section_1 = -1;
-	mbna_file_id_2 = -1;
-	mbna_section_2 = -1;
- 	mbna_current_crossing = -1;
- 	mbna_current_tie = -1;
+	mbna_file_id_1 = MBNA_SELECT_NONE;
+	mbna_section_1 = MBNA_SELECT_NONE;
+	mbna_file_id_2 = MBNA_SELECT_NONE;
+	mbna_section_2 = MBNA_SELECT_NONE;
+ 	mbna_current_crossing = MBNA_SELECT_NONE;
+ 	mbna_current_tie = MBNA_SELECT_NONE;
 	mbna_naverr_load = MB_NO;
  	mbna_file_select = MBNA_SELECT_NONE;
  	mbna_survey_select = MBNA_SELECT_NONE;
@@ -258,6 +262,7 @@ int mbnavadjust_init_globals()
 	mbna_contour2.vector = NULL;
 	mbna_smoothweight = 100.0;
 	mbna_offsetweight = 0.01;
+	mbna_zweightfactor = 1.0;
 	mbna_misfit_center = MBNA_MISFIT_AUTOCENTER;
 	mbna_minmisfit_nthreshold = MBNA_MISFIT_NTHRESHOLD;
 	mbna_minmisfit = 0.0;
@@ -1024,13 +1029,14 @@ fprintf(stderr,"Writing project %s\n", project.name);
 		fprintf(hfp,"##MBNAVADJUST PROJECT\n");
 		fprintf(hfp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
 		fprintf(hfp,"PROGRAM_VERSION\t%s\n",rcs_id);
-		fprintf(hfp,"FILE_VERSION\t3.03\n");
+		fprintf(hfp,"FILE_VERSION\t3.06\n");
 		fprintf(hfp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
 		fprintf(hfp,"NAME\t%s\n",project.name);
 		fprintf(hfp,"PATH\t%s\n",project.path);
 		fprintf(hfp,"HOME\t%s\n",project.home);
 		fprintf(hfp,"DATADIR\t%s\n",project.datadir);
 		fprintf(hfp,"NUMFILES\t%d\n",project.num_files);
+		fprintf(hfp,"NUMBLOCKS\t%d\n",project.num_blocks);
 		fprintf(hfp,"NUMCROSSINGS\t%d\n",project.num_crossings);
 		fprintf(hfp,"SECTIONLENGTH\t%f\n",project.section_length);
 		fprintf(hfp,"SECTIONSOUNDINGS\t%d\n",project.section_soundings);
@@ -1045,39 +1051,43 @@ fprintf(stderr,"Writing project %s\n", project.name);
 			{
 			/* write out basic file info */
 			file = &project.files[i];
-			fprintf(hfp,"FILE %4d %4d %4d %4d %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
-				i,
-				file->status,
-				file->id,
-				file->format,
-				file->heading_bias_import,
-				file->roll_bias_import,
-				file->heading_bias,
-				file->roll_bias,
-				file->num_sections,
-				file->output_id,
-				file->file);
+			fprintf(hfp,"FILE %4d %4d %4d %4d %4d %13.8f %13.8f %13.8f %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
+					i,
+					file->status,
+					file->id,
+					file->format,
+					file->block,
+					file->block_offset_x,
+					file->block_offset_y,
+					file->block_offset_z,
+					file->heading_bias_import,
+					file->roll_bias_import,
+					file->heading_bias,
+					file->roll_bias,
+					file->num_sections,
+					file->output_id,
+					file->file);
 
 			/* write out section info */
 			for (j=0;j<file->num_sections;j++)
 				{
 				section = &file->sections[j];
 				fprintf(hfp,"SECTION %4d %5d %5d %d %d %10.6f %16.6f %16.6f %13.8f %13.8f %13.8f %13.8f %9.3f %9.3f %d\n",
-					j,
-					section->num_pings,
-					section->num_beams,
-					section->num_snav,
-					section->continuity,
-					section->distance,
-					section->btime_d,
-					section->etime_d,
-					section->lonmin,
-					section->lonmax,
-					section->latmin,
-					section->latmax,
-					section->depthmin,
-					section->depthmax,
-					section->contoursuptodate);
+						j,
+						section->num_pings,
+						section->num_beams,
+						section->num_snav,
+						section->continuity,
+						section->distance,
+						section->btime_d,
+						section->etime_d,
+						section->lonmin,
+						section->lonmax,
+						section->latmin,
+						section->latmax,
+						section->depthmin,
+						section->depthmax,
+						section->contoursuptodate);
 				for (k=MBNA_MASK_DIM-1;k>=0;k--)
 				    {
 				    for (l=0;l<MBNA_MASK_DIM;l++)
@@ -1089,16 +1099,25 @@ fprintf(stderr,"Writing project %s\n", project.name);
 				for (k=0;k<section->num_snav;k++)
 				    {
 				    fprintf(hfp,"SNAV %4d %5d %10.6f %16.6f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-					    k,
-					    section->snav_id[k],
-					    section->snav_distance[k],
-					    section->snav_time_d[k],
-					    section->snav_lon[k],
-					    section->snav_lat[k],
-					    section->snav_lon_offset[k],
-					    section->snav_lat_offset[k],
-					    section->snav_z_offset[k]);
+						k,
+						section->snav_id[k],
+						section->snav_distance[k],
+						section->snav_time_d[k],
+						section->snav_lon[k],
+						section->snav_lat[k],
+						section->snav_lon_offset[k],
+						section->snav_lat_offset[k],
+						section->snav_z_offset[k]);
 				    }
+				fprintf(hfp,"GLOBALTIE %2d %4d %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
+						section->global_tie_status,
+						section->global_tie_snav,
+						section->global_tie_offset_x,
+						section->global_tie_offset_y,
+						section->global_tie_offset_z_m,
+						section->global_tie_xsigma,
+						section->global_tie_ysigma,
+						section->global_tie_zsigma);
 				}
 			}
 
@@ -1167,7 +1186,7 @@ fprintf(stderr,"Writing project %s\n", project.name);
 		do_info_add(message, MB_YES);
 		}
 
-	/* open and write datalist file */
+	/* open and write datalist files */
 	sprintf(datalist,"%s%s.mb-1",project.path,project.name);
 	if ((hfp = fopen(datalist,"w")) != NULL)
 		{
@@ -1179,14 +1198,33 @@ fprintf(stderr,"Writing project %s\n", project.name);
 			}
 		fclose(hfp);
 		}
-
-	/* else set error */
-	else
+	sprintf(datalist,"%s/%s.dir/datalist_unfixed.mb-1",project.path,project.name);
+	if ((hfp = fopen(datalist,"w")) != NULL)
 		{
-		status = MB_FAILURE;
-		sprintf(message,"Unable to update project %s\n > Datalist file: %s\n",
-			project.name, datalist);
-		do_info_add(message, MB_YES);
+		for (i=0;i<project.num_files;i++)
+			{
+			/* write file entry for each unfixed file */
+			if (project.files[i].status != MBNA_FILE_FIXEDNAV)
+				{
+				file = &project.files[i];
+				fprintf(hfp,"../%s %d\n", file->file, file->format);
+				}
+			}
+		fclose(hfp);
+		}
+	sprintf(datalist,"%s/%s.dir/datalist_fixed.mb-1",project.path,project.name);
+	if ((hfp = fopen(datalist,"w")) != NULL)
+		{
+		for (i=0;i<project.num_files;i++)
+			{
+			/* write file entry for each unfixed file */
+			if (project.files[i].status == MBNA_FILE_FIXEDNAV)
+				{
+				file = &project.files[i];
+				fprintf(hfp,"../%s %d\n", file->file, file->format);
+				}
+			}
+		fclose(hfp);
 		}
 
 	/* write mbgrdviz route files in which each tie point or crossing is a two point route
@@ -1980,8 +2018,9 @@ int mbnavadjust_read_project()
 	char	obuffer[BUFFER_MAX];
 	char	command[MB_PATH_MAXLINE];
 	char	*result;
-	int	versionmajor, versionminor;
+	int	versionmajor, versionminor, version_id;
 	double	dummy;
+	double	mtodeglon, mtodeglat;
 	int	nscan, idummy, jdummy;
 	int	s1id, s2id;
 	int	shellstatus;
@@ -2029,8 +2068,9 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 				|| strcmp(label,"FILE_VERSION") != 0))
 			status = MB_FAILURE;
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
+		version_id = 100 * versionmajor + versionminor;
 
-		if (versionmajor > 3 || (versionmajor == 3 && versionminor > 2))
+		if (version_id >= 302)
 			{
 			if (status == MB_SUCCESS
 				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
@@ -2075,6 +2115,20 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 			status = MB_FAILURE;
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
 
+		if (version_id >= 306)
+			{
+			if (status == MB_SUCCESS
+				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+					|| (nscan = sscanf(buffer,"%s %d",label,&project.num_blocks)) != 2
+					|| strcmp(label,"NUMBLOCKS") != 0))
+				status = MB_FAILURE;
+			}
+		else
+			{
+			project.num_blocks = 0;
+			}
+if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
+
 		if (status == MB_SUCCESS
 			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 				|| (nscan = sscanf(buffer,"%s %d",label,&project.num_crossings)) != 2
@@ -2090,7 +2144,7 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
 
 		if (status == MB_SUCCESS
-			&& ((100*versionmajor + versionminor) > 100)
+			&& version_id >= 101
 			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 				|| (nscan = sscanf(buffer,"%s %d",label,&project.section_soundings)) != 2
 				|| strcmp(label,"SECTIONSOUNDINGS") != 0))
@@ -2134,7 +2188,7 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 
 		if (status == MB_SUCCESS)
 			{
-			if (versionmajor > 3 || (versionmajor == 3 && versionminor > 0))
+			if (version_id >= 301)
 				{
 				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 					|| (nscan = sscanf(buffer,"%s %lf",label,&project.smoothing)) != 2
@@ -2142,7 +2196,7 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__
 					status = MB_FAILURE;
 				project.precision = SIGMA_MINIMUM;
 				}
-			else if (versionmajor > 1 || (versionmajor == 1 && versionminor > 2))
+			else if (version_id >= 103)
 				{
 				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 					|| (nscan = sscanf(buffer,"%s %lf",label,&project.precision)) != 2
@@ -2160,13 +2214,11 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__F
 
 		if (status == MB_SUCCESS)
 			{
-			if ((versionmajor > 1 || (versionmajor == 1 && versionminor > 4))
+			if (version_id >= 105
 				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 					|| (nscan = sscanf(buffer,"%s %lf",label,&project.zoffsetwidth)) != 2
 					|| strcmp(label,"ZOFFSETWIDTH") != 0))
 				status = MB_FAILURE;
-			else
-				project.zoffsetwidth = 5.0;
 			}
 
 		/* allocate memory for files array */
@@ -2216,21 +2268,50 @@ if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__F
 			file->num_snavs = 0;
 			file->num_pings = 0;
 			file->num_beams = 0;
-			if (status == MB_SUCCESS
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
-					&idummy,
-					&(file->status),
-					&(file->id),
-					&(file->format),
-					&(file->heading_bias_import),
-					&(file->roll_bias_import),
-					&(file->heading_bias),
-					&(file->roll_bias),
-					&(file->num_sections),
-					&(file->output_id),
-					file->file)) != 11))
-				status = MB_FAILURE;
+			if (version_id >= 306)
+				{
+				if (status == MB_SUCCESS
+					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %d %d %s",
+						&idummy,
+						&(file->status),
+						&(file->id),
+						&(file->format),
+						&(file->block),
+						&(file->block_offset_x),
+						&(file->block_offset_y),
+						&(file->block_offset_z),
+						&(file->heading_bias_import),
+						&(file->roll_bias_import),
+						&(file->heading_bias),
+						&(file->roll_bias),
+						&(file->num_sections),
+						&(file->output_id),
+						file->file)) != 15))
+					status = MB_FAILURE;
+				}
+			else
+				{
+				if (status == MB_SUCCESS
+					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
+						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
+						&idummy,
+						&(file->status),
+						&(file->id),
+						&(file->format),
+						&(file->heading_bias_import),
+						&(file->roll_bias_import),
+						&(file->heading_bias),
+						&(file->roll_bias),
+						&(file->num_sections),
+						&(file->output_id),
+						file->file)) != 11))
+					status = MB_FAILURE;
+				file->block = 0;
+				file->block_offset_x = 0.0;
+				file->block_offset_y = 0.0;
+				file->block_offset_z = 0.0;
+				}
 
 			/* set file->path as absolute path
 			    - file->file may be a relative path */
@@ -2292,14 +2373,14 @@ fprintf(stderr, "read failed on section: %s\n", buffer);
 				if (nscan < 15)
 					section->contoursuptodate = MB_NO;
 				for (k=MBNA_MASK_DIM-1;k>=0;k--)
-				    {
-				    if (status == MB_SUCCESS)
-					result = fgets(buffer,BUFFER_MAX,hfp);
-				    for (l=0;l<MBNA_MASK_DIM;l++)
 					{
-					sscanf(&buffer[l], "%1d", &section->coverage[l+k*MBNA_MASK_DIM]);
+					if (status == MB_SUCCESS)
+					    result = fgets(buffer,BUFFER_MAX,hfp);
+					for (l=0;l<MBNA_MASK_DIM;l++)
+						{
+						sscanf(&buffer[l], "%1d", &section->coverage[l+k*MBNA_MASK_DIM]);
+						}
 					}
-				    }
 if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
 /*fprintf(stderr,"%s/nvs_%4.4d_%4.4d.mb71\n",
 project.datadir,file->id,j);
@@ -2347,13 +2428,87 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
 					}
 
 				    /* reverse offset values if older values */
-				    if (versionmajor < 3)
+				    if (version_id < 300)
 					{
 				    	section->snav_lon_offset[k] *= -1.0;
 				    	section->snav_lat_offset[k] *= -1.0;
 				    	section->snav_z_offset[k] *= -1.0;
 					}
 				    }
+				    
+				/* global fixed frame tie, whether defined or not */
+				if (version_id >= 305)
+					{
+					if (status == MB_SUCCESS)
+						result = fgets(buffer,BUFFER_MAX,hfp);
+					if (status == MB_SUCCESS && result == buffer)
+						nscan = sscanf(buffer,"GLOBALTIE %d %d %lf %lf %lf %lf %lf %lf",
+							&section->global_tie_status,
+							&section->global_tie_snav,
+							&section->global_tie_offset_x,
+							&section->global_tie_offset_y,
+							&section->global_tie_offset_z_m,
+							&section->global_tie_xsigma,
+							&section->global_tie_ysigma,
+							&section->global_tie_zsigma);
+					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
+							&mtodeglon,&mtodeglat);
+					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
+					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
+/* if (section->global_tie_status != MBNA_TIE_NONE)
+fprintf(stderr,"READ GLOBALTIE: %d %d %lf %lf %lf %lf %lf %lf\n",
+section->global_tie_status,
+section->global_tie_snav,
+section->global_tie_offset_x,
+section->global_tie_offset_y,
+section->global_tie_offset_z_m,
+section->global_tie_xsigma,
+section->global_tie_ysigma,
+section->global_tie_zsigma); */
+					}
+				else if (version_id == 304)
+					{
+					if (status == MB_SUCCESS)
+						result = fgets(buffer,BUFFER_MAX,hfp);
+					if (status == MB_SUCCESS && result == buffer)
+						nscan = sscanf(buffer,"GLOBALTIE %d %lf %lf %lf %lf %lf %lf",
+							&section->global_tie_snav,
+							&section->global_tie_offset_x,
+							&section->global_tie_offset_y,
+							&section->global_tie_offset_z_m,
+							&section->global_tie_xsigma,
+							&section->global_tie_ysigma,
+							&section->global_tie_zsigma);
+					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
+							&mtodeglon,&mtodeglat);
+					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
+					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
+					if (section->global_tie_snav != MBNA_SELECT_NONE)
+						section->global_tie_status = MBNA_TIE_XYZ;
+					else
+						section->global_tie_status = MBNA_TIE_NONE;
+/* if (section->global_tie_snav != MBNA_SELECT_NONE)
+fprintf(stderr,"READ GLOBALTIE: %d %lf %lf %lf %lf %lf %lf\n",
+section->global_tie_snav,
+section->global_tie_offset_x,
+section->global_tie_offset_y,
+section->global_tie_offset_z_m,
+section->global_tie_xsigma,
+section->global_tie_ysigma,
+section->global_tie_zsigma); */
+					}
+				else
+					{
+					section->global_tie_snav = MBNA_TIE_NONE;
+					section->global_tie_snav = MBNA_SELECT_NONE;
+					section->global_tie_offset_x = 0.0;
+					section->global_tie_offset_y = 0.0;
+					section->global_tie_offset_z_m = 0.0;
+					section->global_tie_xsigma = 0.0;
+					section->global_tie_ysigma = 0.0;
+					section->global_tie_zsigma = 0.0;
+					}
+
 				section->global_start_ping = project.num_pings;
 				section->global_start_snav = project.num_snavs - section->continuity;
 				file->num_snavs += section->num_pings;
@@ -2366,19 +2521,22 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
 			}
 
 		/* count the number of blocks */
-		project.num_blocks = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (i==0 || file->sections[0].continuity == MB_NO)
-		    	{
-			project.num_blocks++;
+		if (version_id < 306)
+			{
+			project.num_blocks = 0;
+			for (i=0;i<project.num_files;i++)
+				{
+				file = &project.files[i];
+				if (i==0 || file->sections[0].continuity == MB_NO)
+					{
+					project.num_blocks++;
+					}
+				file->block = project.num_blocks - 1;
+				file->block_offset_x = 0.0;
+				file->block_offset_y = 0.0;
+				file->block_offset_z = 0.0;
+				}
 			}
-		    file->block = project.num_blocks - 1;
-		    file->block_offset_x = 0.0;
-		    file->block_offset_y = 0.0;
-		    file->block_offset_z = 0.0;
-		    }
 
 		/* read crossings */
  		project.num_crossings_analyzed = 0;
@@ -2391,7 +2549,7 @@ fprintf(stderr, "read failed on snav: %s\n", buffer);
 			/* read each crossing */
 			crossing = &project.crossings[i];
 			if (status == MB_SUCCESS
-				&& ((100*versionmajor + versionminor) >= 106))
+				&& version_id >= 106)
 				{
 				if (status == MB_SUCCESS
 					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
@@ -2411,7 +2569,7 @@ fprintf(stderr, "read failed on crossing: %s\n", buffer);
 						}
 				}
 			else if (status == MB_SUCCESS
-				&& ((100*versionmajor + versionminor) >= 102))
+				&& version_id >= 102)
 				{
 				crossing->overlap = 0;
 				if (status == MB_SUCCESS
@@ -2462,7 +2620,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
 
 			/* reorder crossing to be early file first older file second if
 				file version prior to 3.00 */
-			if (versionmajor < 3)
+			if (version_id < 300)
 				{
 				idummy = crossing->file_id_1;
 				jdummy = crossing->section_1;
@@ -2478,7 +2636,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
 				{
 				/* read each tie */
 				tie = &crossing->ties[j];
-				if (status == MB_SUCCESS && ((100*versionmajor + versionminor) > 301))
+				if (status == MB_SUCCESS && version_id >= 302)
 					{
 					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 						|| (nscan = sscanf(buffer,"TIE %d %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
@@ -2500,7 +2658,7 @@ fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
 fprintf(stderr, "read failed on tie: %s\n", buffer);
 						}
 					}
-				else if (status == MB_SUCCESS && ((100*versionmajor + versionminor) > 103))
+				else if (status == MB_SUCCESS && version_id >= 104)
 					{
 					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 						|| (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
@@ -2547,7 +2705,7 @@ fprintf(stderr, "read failed on tie: %s\n", buffer);
 
 				/* reorder crossing to be early file first older file second if
 					file version prior to 3.00 */
-				if (versionmajor < 3)
+				if (version_id < 300)
 					{
 					idummy = tie->snav_1;
 					dummy = tie->snav_1_time_d;
@@ -2564,7 +2722,7 @@ fprintf(stderr, "read failed on tie: %s\n", buffer);
 					}
 
 				/* for version 2.0 or later read covariance */
-				if (status == MB_SUCCESS && ((100*versionmajor + versionminor) >= 200))
+				if (status == MB_SUCCESS && version_id >= 200)
 					{
 					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
 						|| (nscan = sscanf(buffer,"COV %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
@@ -3554,6 +3712,16 @@ section->distance, distance, project.section_length);*/
 				section->depthmin = 0.0;
 				section->depthmax = 0.0;
 				section->contoursuptodate = MB_NO;
+				section->global_tie_status = MBNA_TIE_NONE;
+				section->global_tie_snav = MBNA_SELECT_NONE;
+				section->global_tie_offset_x = 0.0;
+				section->global_tie_offset_y = 0.0;
+				section->global_tie_offset_x_m = 0.0;
+				section->global_tie_offset_y_m = 0.0;
+				section->global_tie_offset_z_m = 0.0;
+				section->global_tie_xsigma = 0.0;
+				section->global_tie_ysigma = 0.0;
+				section->global_tie_zsigma = 0.0;
 				new_segment = MB_NO;
 
 				/* open output section file */
@@ -5024,7 +5192,7 @@ int mbnavadjust_naverr_specific(int new_crossing, int new_tie)
 			    mbna_snav_2_time_d = tie->snav_2_time_d;
 			    mbna_offset_x = tie->offset_x;
 			    mbna_offset_y = tie->offset_y;
-			    mbna_offset_z = tie->offset_y_m;
+			    mbna_offset_z = tie->offset_z_m;
 /* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
 			    }
 			else
@@ -10074,6 +10242,8 @@ mbnavadjust_invertnav()
 	struct mbna_file *file1;
 	struct mbna_file *file2;
 	struct mbna_section *section;
+	struct mbna_section *section1;
+	struct mbna_section *section2;
 	struct mbna_crossing *crossing;
 	struct mbna_tie *tie;
 	int	nnav;
@@ -10082,24 +10252,25 @@ mbnavadjust_invertnav()
 	int	ncols = 0;
 	int	ntie = 0;
 	int	nfixed = 0;
+	int	nglobal = 0;
+	int	nmisfit = 0;
 	double	*x = NULL;
 	double	*xx = NULL;
 	double	*xa = NULL;
 	int	*nxs = NULL;
 	double	*xs = NULL;
 	double	*xw = NULL;
-	double	misfit_initial;
-	double	misfit, misfit_ties;
+	double	misfit, misfit_initial, misfit_ties_initial, misfit_norm_initial, misfit_ties, misfit_norm;
 	double	offsetx, offsety, offsetz, offsetr;
-	double	offsetsigma;
-	double	weight;
+	double	projected_offset;
+	double	xyweight, zweight;
 	double	dtime_d;
 	int	done, iter;
 	int	nseq, nseqlast;
 	int	nchange;
 	int	ndx, ndx2;
 	int	icrossing, jtie;
-	int	isection, isnav, inav;
+	int	ifile, isection, isnav, inav;
 	int	nc1, nc2, nc3;
 	int	i, j, k;
 
@@ -10180,7 +10351,7 @@ mbnavadjust_invertnav()
 		}
 
 
-	/* invert if there is a project and all crossings have been analyzed */
+	/* invert if there is a project and enough crossings have been analyzed */
     	if (project.open == MB_YES
     		&& project.num_crossings > 0
 		&& (project.num_crossings_analyzed >= 10
@@ -10201,9 +10372,11 @@ mbnavadjust_invertnav()
 		/* figure out the average offsets between connected sets of files
 			- invert for x y z offsets for the blocks */
 
-		/* calculate the initial misfit */
+		/* calculate the initial misfit, count number of crossing ties and global ties */
 		ntie = 0;
+		nglobal = 0;
 		misfit_initial = 0.0;
+		nmisfit = 0;
 		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 		    {
 		    crossing = &project.crossings[icrossing];
@@ -10213,13 +10386,44 @@ mbnavadjust_invertnav()
 			for (j=0;j<crossing->num_ties;j++)
 				{
 				tie = (struct mbna_tie *) &crossing->ties[j];
-				misfit_initial += tie->offset_x_m * tie->offset_x_m;
-				misfit_initial += tie->offset_y_m * tie->offset_y_m;
-				misfit_initial += tie->offset_z_m * tie->offset_z_m;
+				if (tie->status != MBNA_TIE_Z)
+					{
+					misfit_initial += tie->offset_x_m * tie->offset_x_m;
+					misfit_initial += tie->offset_y_m * tie->offset_y_m;
+					nmisfit += 2;
+					}
+				if (tie->status != MBNA_TIE_XY)
+					{
+					misfit_initial += tie->offset_z_m * tie->offset_z_m;
+					nmisfit++;
+					}
 				}
 			}
 		    }
-		misfit_initial = sqrt(misfit_initial) / ntie;
+		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (isection=0;isection<file->num_sections;isection++)
+			{
+			section = &file->sections[isection];
+			if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				nglobal++;
+				if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					misfit_initial += section->global_tie_offset_x_m * section->global_tie_offset_x_m;
+					misfit_initial += section->global_tie_offset_y_m * section->global_tie_offset_y_m;
+					nmisfit += 2;
+					}
+				if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					misfit_initial += section->global_tie_offset_z_m * section->global_tie_offset_z_m;
+					nmisfit++;
+					}
+				}
+			}
+		    }
+		misfit_initial = sqrt(misfit_initial) / nmisfit;
 		perturbationsizeold = misfit_initial;
 
 		/* count the number of fixed files */
@@ -10275,7 +10479,6 @@ mbnavadjust_invertnav()
 			    }
 
 			/* loop over crossings getting set ties */
-			ntie = 0;
 			for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 			    {
 			    crossing = &project.crossings[icrossing];
@@ -10294,7 +10497,6 @@ mbnavadjust_invertnav()
 				{
 				/* get tie */
 				tie = (struct mbna_tie *) &crossing->ties[j];
-				ntie++;
 
 				/* get current offset vector including reduction of block solution */
 				if (tie->status != MBNA_TIE_Z)
@@ -10436,6 +10638,41 @@ icrossing,j,nc1,nc2,offsetx,offsety,offsetz); */
 				    }
 				}
 			    }
+			    
+			/* loop over all global ties */
+			for (ifile=0;ifile<project.num_files;ifile++)
+			    {
+			    file = &project.files[ifile];
+			    for (isection=0;isection<file->num_sections;isection++)
+				{
+				section = &file->sections[isection];
+				if (section->global_tie_status != MBNA_TIE_NONE)
+				    {
+				    /* get block id for snav point */
+				    nc1 = file->block;
+    
+				    /* get current offset vector including reduction of block solution */
+				    if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					offsetx = section->global_tie_offset_x_m - (x[3*nc1]   + xx[3*nc1]);
+					offsety = section->global_tie_offset_y_m - (x[3*nc1+1] + xx[3*nc1+1]);
+					
+					xx[3*nc1]   += 0.5 * offsetx;
+					xx[3*nc1+1] += 0.5 * offsety;
+					}
+				    if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					offsetz = section->global_tie_offset_z_m - (x[3*nc1+2] + xx[3*nc1+2]);
+					xx[3*nc1+2] += 0.5 * offsetz;
+					}
+
+//fprintf(stderr,"STAGE 1 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  x: %f %f %f     xx: %f %f %f     offset: %f %f %f\n",
+//section->global_tie_status,ifile,isection,section->global_tie_snav,
+//x[3*nc1],x[3*nc1+1],x[3*nc1+2],xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
+//offsetx,offsety,offsetz);
+				    }
+				}
+			    }
 
 			/* calculate 2-norm of perturbation */
 			perturbationsize = 0.0;
@@ -10451,22 +10688,22 @@ icrossing,j,nc1,nc2,offsetx,offsety,offsetz); */
 			    x[i] += xx[i];
 			    }
 
-			 /* check for convergence */
-			 perturbationchange = perturbationsize - perturbationsizeold;
-			 convergencecriterea = fabs(perturbationchange) / misfit_initial;
-			 if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
+			/* check for convergence */
+			perturbationchange = perturbationsize - perturbationsizeold;
+			convergencecriterea = fabs(perturbationchange) / misfit_initial;
+			if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
 		    	     done = MB_YES;
 /* fprintf(stderr,"BLOCK INVERT: iter:%d ntie:%d misfit_initial:%f misfit_ties:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
 iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,convergencecriterea,done);*/
 
-			 if (done == MB_NO)
+			if (done == MB_NO)
 		             {
 			     perturbationsizeold = perturbationsize;
 			     iter++;
 			     }
-			 }
+			}
 
-		    /* if there are no fixed blocks contributing to ties,
+		    /* if there are no fixed blocks contributing to ties or global ties,
 		    	then get average offsets of blocks not flagged as bad
 			to provide a static offset to move final model to be more consistent
 			with the good blocks than the poorly navigated blocks */
@@ -10474,7 +10711,7 @@ iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,converg
 		    block_offset_avg_y = 0.0;
 		    block_offset_avg_z = 0.0;
 		    navg = 0;
-		    if (nfixed == 0)
+		    if (nfixed == 0 && nglobal == 0)
 		    	{
 			for (i=0;i<project.num_blocks;i++)
 			    {
@@ -10503,13 +10740,13 @@ iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,converg
 /* fprintf(stderr,"Average block offsets: x:%f y:%f z:%f  Used %d of %d blocks\n",
 block_offset_avg_x,block_offset_avg_y,block_offset_avg_z,navg,project.num_blocks); */
 
-		    /* output solution */
-		    fprintf(stderr,"\nAverage offsets: %f %f %f\n",block_offset_avg_x,block_offset_avg_y,block_offset_avg_z);
-		    for (i=0;i<ncols/3;i++)
-			{
-			fprintf(stderr, "Survey block:%d  offsets: %f %f %f\n",
-				    i, x[3*i], x[3*i+1], x[3*i+2]);
-			}
+/* output solution */
+/* fprintf(stderr,"\nAverage offsets: %f %f %f\n",block_offset_avg_x,block_offset_avg_y,block_offset_avg_z);
+for (i=0;i<ncols/3;i++)
+{
+fprintf(stderr, "Survey block:%d  offsets: %f %f %f\n",
+	    i, x[3*i], x[3*i+1], x[3*i+2]);
+} */
 
 		    /* extract results */
 		    for (i=0;i<project.num_files;i++)
@@ -10531,83 +10768,6 @@ i,file->block,file->block_offset_x,file->block_offset_y,file->block_offset_z); *
 		/* Initialize arrays, solution, perturbation                      */
 		/*----------------------------------------------------------------*/
 
-		/* calculate initial weighted misfit */
-		misfit_initial = 0.0;
-		ntie = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-
-		    /* use only set crossings */
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    for (j=0;j<crossing->num_ties;j++)
-			{
-			/* get tie */
-			tie = (struct mbna_tie *) &crossing->ties[j];
-
-			/* get absolute id for first snav point */
-			file1 = &project.files[crossing->file_id_1];
-			section = &file1->sections[crossing->section_1];
-			nc1 = section->snav_invert_id[tie->snav_1];
-
-			/* get absolute id for second snav point */
-			file2 = &project.files[crossing->file_id_2];
-			section = &file2->sections[crossing->section_2];
-			nc2 = section->snav_invert_id[tie->snav_2];
-/* if (nc1 > nsnav - 1 || nc2 > nsnav -1
-|| nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
-
-			/* get observed offset vector including reduction of block solution */
-			if (tie->status != MBNA_TIE_Z)
-			    {
-			    offsetx = tie->offset_x_m - (file2->block_offset_x - file1->block_offset_x);
-			    offsety = tie->offset_y_m - (file2->block_offset_y - file1->block_offset_y);
-			    }
-			else
-			    {
-			    offsetx = 0.0;
-			    offsety = 0.0;
-			    }
-			if (tie->status != MBNA_TIE_XY)
-			    {
-			    offsetz = tie->offset_z_m - (file2->block_offset_z - file1->block_offset_z);
-			    }
-			else
-			    {
-			    offsetz = 0.0;
-			    }
-
-			/* get long axis misfit */
-			misfit = mbna_offsetweight / tie->sigmar1
-						* (offsetx * tie->sigmax1[0]
-							+ offsety * tie->sigmax1[1]
-							+ offsetz * tie->sigmax1[2]);
-			misfit_initial += misfit * misfit;
-/* fprintf(stderr,"Initial Misfit: %d %f %f\n", ntie, misfit, misfit_initial);*/
-
-			/* get horizontal axis misfit */
-			misfit = mbna_offsetweight / tie->sigmar2
-						* (offsetx * tie->sigmax2[0]
-							+ offsety * tie->sigmax2[1]
-							+ offsetz * tie->sigmax2[2]);
-			misfit_initial += misfit * misfit;
-/* fprintf(stderr,"Initial Misfit: %d %f %f\n", ntie, misfit, misfit_initial);*/
-
-			/* get semi-vertical axis misfit */
-			misfit = mbna_offsetweight / tie->sigmar3
-						* (offsetx * tie->sigmax3[0]
-							+ offsety * tie->sigmax3[1]
-							+ offsetz * tie->sigmax3[2]);
-			misfit_initial += misfit * misfit;
-/* fprintf(stderr,"Initial Misfit: %d %f %f\n\n", ntie, misfit, misfit_initial);*/
-
-			ntie++;
-			}
-		    }
-		misfit_initial = sqrt(misfit_initial) / ntie;
-/* fprintf(stderr,"ntie:%d misfit_initial:%f\n",ntie,misfit_initial);*/
-
 		/* count dimension of solution guess vector */
 		nnav = 0;
 		nsnav = 0;
@@ -10620,7 +10780,8 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 			nsnav += section->num_snav - section->continuity;
 			for (isnav=0;isnav<section->num_snav;isnav++)
 			    {
-			    if (section->snav_num_ties[isnav] > 0)
+			    if (section->snav_num_ties[isnav] > 0
+				|| section->global_tie_snav == isnav)
 				{
 				section->snav_invert_id[isnav] = nnav;
 				nnav++;
@@ -10634,6 +10795,8 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
 		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
 		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xa,&error);
+		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xs,&error);
+		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xw,&error);
 		inav = 0;
 		for (i=0;i<project.num_files;i++)
 		    {
@@ -10643,7 +10806,8 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 			section = &file->sections[j];
 			for (isnav=0;isnav<section->num_snav;isnav++)
 			    {
-			    if (section->snav_num_ties[isnav] > 0)
+			    if (section->snav_num_ties[isnav] > 0
+				|| section->global_tie_snav == isnav)
 				{
 				x[ndf * inav] = 0.0;
 				x[ndf * inav + 1] = 0.0;
@@ -10660,12 +10824,125 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 			}
 		    }
 
+		/* calculate initial normalized misfit */
+		misfit_ties_initial = 0.0;
+		misfit_norm_initial = 0.0;
+		nmisfit = 0;
+		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
+		    {
+		    crossing = &project.crossings[icrossing];
+
+		    /* use only set crossings */
+		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
+		    for (j=0;j<crossing->num_ties;j++)
+			{
+			/* get tie */
+			tie = (struct mbna_tie *) &crossing->ties[j];
+
+			/* get absolute id for first snav point */
+			file1 = &project.files[crossing->file_id_1];
+			section1 = &file1->sections[crossing->section_1];
+			nc1 = section1->snav_invert_id[tie->snav_1];
+
+			/* get absolute id for second snav point */
+			file2 = &project.files[crossing->file_id_2];
+			section2 = &file2->sections[crossing->section_2];
+			nc2 = section2->snav_invert_id[tie->snav_2];
+if (nc1 > nsnav - 1 || nc2 > nsnav -1
+|| nc1 < 0 || nc2 < 0)
+fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
+
+			/* get offset after removal of block solution */
+			offsetx = tie->offset_x_m - (file2->block_offset_x - file1->block_offset_x);
+			offsety = tie->offset_y_m - (file2->block_offset_y - file1->block_offset_y);
+			offsetz = tie->offset_z_m - (file2->block_offset_z - file1->block_offset_z);
+
+			if (tie->status != MBNA_TIE_Z)
+			    {
+			    /* get long axis misfit */
+			    misfit = (offsetx * tie->sigmax1[0]
+					    + offsety * tie->sigmax1[1]
+					    + offsetz * tie->sigmax1[2]);
+			    misfit_ties_initial += misfit * misfit;
+			    misfit_norm_initial += misfit * misfit / tie->sigmar1 / tie->sigmar1;
+			    nmisfit++;
+
+			    /* get horizontal axis misfit */
+			    misfit = (offsetx * tie->sigmax2[0]
+					    + offsety * tie->sigmax2[1]
+					    + offsetz * tie->sigmax2[2]);
+			    misfit_ties_initial += misfit * misfit;
+			    misfit_norm_initial += misfit * misfit / tie->sigmar2 / tie->sigmar2;
+			    nmisfit++;
+			    }
+
+			if (tie->status != MBNA_TIE_XY)
+			    {
+			    /* get semi-vertical axis misfit */
+			    misfit = (offsetx * tie->sigmax3[0]
+					    + offsety * tie->sigmax3[1]
+					    + offsetz * tie->sigmax3[2]);
+			    misfit_ties_initial += misfit * misfit;
+			    misfit_norm_initial += misfit * misfit / tie->sigmar3 / tie->sigmar3;
+			    nmisfit++;
+			    }
+			}
+		    }
+		for (ifile=0;ifile<project.num_files;ifile++)
+		    {
+		    /* get file */
+		    file = &project.files[ifile];
+		    for (isection=0;isection<file->num_sections;isection++)
+			{
+			/* get section */
+			section = &file->sections[isection];
+			if (section->global_tie_status != MBNA_TIE_NONE)
+			    {
+			    /* get absolute id for snav point */
+			    nc1 = section->snav_invert_id[section->global_tie_snav];
+if (nc1 > nsnav - 1 || nc1 < 0)
+fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
+
+			    /* get offset after removal of block solution */
+			    offsetx = section->global_tie_offset_x_m - file->block_offset_x;
+			    offsety = section->global_tie_offset_y_m - file->block_offset_y;
+			    offsetz = section->global_tie_offset_z_m - file->block_offset_z;
+	    
+			    if (section->global_tie_status != MBNA_TIE_Z)
+				{
+				/* get x axis misfit */
+				misfit = offsetx;
+				misfit_ties_initial += misfit * misfit;
+				misfit_norm_initial += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
+				nmisfit++;
+
+				/* get y axis misfit */
+				misfit = offsety;
+				misfit_ties_initial += misfit * misfit;
+				misfit_norm_initial += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
+				nmisfit++;
+				}
+
+			    if (section->global_tie_status != MBNA_TIE_XY)
+				{
+				/* get z axis misfit */
+				misfit = offsetz;
+				misfit_ties_initial += misfit * misfit;
+				misfit_norm_initial += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
+				nmisfit++;
+				}
+			    }
+			}
+		    }
+		misfit_ties_initial = sqrt(misfit_ties_initial) / nmisfit;
+		misfit_norm_initial = sqrt(misfit_norm_initial) / nmisfit;
+
 		/*----------------------------------------------------------------*/
 		/* Step 2 - construct "average" model satisfying ties with        */
 		/*     fixed data (if needed) - this gets pulled out of the       */
 		/*     data along with the average block offsets.                 */
 		/*----------------------------------------------------------------*/
-		if (nfixed > 0)
+		if (nfixed > 0 || nglobal > 0)
 		    {
 		    /* set message dialog on */
 		    sprintf(message,"Getting average offsets relative to fixed data...");
@@ -10673,8 +10950,6 @@ fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);*/
 
 		    /* allocate some extra arrays */
 		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, nnav * sizeof(int), (void **)&nxs,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xs,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xw,&error);
 		    for (inav=0;inav<nnav;inav++)
 		    	{
 			nxs[inav] = 0;
@@ -10910,32 +11185,216 @@ i,j,isnav,inav,nseqlast,nseq,file->status,nxs[inav],nxs[inav+1]); */
 				}
 			    }
 			}
-
-		    /* construct average offset model */
-		    for (inav=0;inav<nnav;inav++)
-			{
-			if (xw[ndf * inav] > 0.0)
-			    {
-			    xa[ndf * inav] += xs[ndf * inav] / xw[ndf * inav];
-			    xa[ndf * inav + 1] += xs[ndf * inav + 1] / xw[ndf * inav + 1];
-			    xa[ndf * inav + 2] += xs[ndf * inav + 2] / xw[ndf * inav + 2];
-			    }
-/*fprintf(stderr,"inav:%d xw:%f xa:%f %f %f\n",inav,xw[ndf * inav],xa[ndf * inav],xa[ndf * inav + 1],xa[ndf * inav + 2]);*/
-			}
-
-		    /* save solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
+			
+		    /* loop over all global ties */
+		    for (ifile=0;ifile<project.num_files;ifile++)
 			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
+			file = &project.files[ifile];
+			for (isection=0;isection<file->num_sections;isection++)
 			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
+			    section = &file->sections[isection];
+			    if (section->global_tie_status != MBNA_TIE_NONE)
 				{
-				if (section->snav_num_ties[isnav] > 0)
+				/* get absolute id for snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+
+			        /* get current offset vector including reduction of block solution */
+				offsetx = section->global_tie_offset_x_m - xa[3*nc1];
+				offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
+				offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
+/*fprintf(stderr,"STAGE 2 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  tie: %f %f %f  model offset: %f %f %f\n",
+section->global_tie_status,ifile,isection,section->global_tie_snav,
+section->global_tie_offset_x_m,section->global_tie_offset_y_m,section->global_tie_offset_z_m,
+offsetx,offsety,offsetz); */
+
+				/* figure out how far each tied nav point is from the global tie point */
+		    		for (inav=0;inav<nnav;inav++)
+				    nxs[inav] = 0;
+
+				/* first set the global tied nav point */
+				nxs[nc1] = 1;
+
+				/* now loop over all nav points repeatedly */
+				done = MB_NO;
+				while (done == MB_NO)
 				    {
-				    k = section->snav_invert_id[isnav];
+				    nchange = 0;
+
+				    /* run forward through the data */
+				    inav = 0;
+				    nseq = 0;
+			    	    nseqlast = 0;
+				    for (i=0;i<project.num_files;i++)
+					{
+					file1 = &project.files[i];
+					for (j=0;j<file1->num_sections;j++)
+					    {
+					    section1 = &file1->sections[j];
+					    if (section1->continuity == MB_NO)
+			    	    		nseq = 0;
+					    for (isnav=0;isnav<section1->num_snav;isnav++)
+						{
+						if (section1->snav_num_ties[isnav] > 0)
+						    {
+						    if (inav > 0 && nseq > 0 && file1->status != MBNA_FILE_FIXEDNAV
+						    	&& nxs[inav-1] > 0 && (nxs[inav-1] < nxs[inav] - 1 || nxs[inav] == 0))
+						    	{
+							nxs[inav] = nxs[inav-1] + 1;
+							nchange++;
+							}
+
+						    /* increment sequence counters */
+						    nseqlast = nseq;
+						    nseq++;
+						    inav++;
+						    }
+						}
+					    }
+					}
+
+				    /* run backward through the data */
+			    	    nseq = 0;
+			    	    nseqlast = 0;
+				    for (i=project.num_files-1;i>=0;i--)
+					{
+					file1 = &project.files[i];
+					for (j=file1->num_sections-1;j>=0;j--)
+					    {
+					    section1 = &file1->sections[j];
+					    for (isnav=section1->num_snav-1;isnav>=0;isnav--)
+						{
+						if (section1->snav_num_ties[isnav] > 0)
+						    {
+						    inav--;
+						    if (inav >= 0 && nseqlast > 0 && file1->status != MBNA_FILE_FIXEDNAV
+						    	&& nxs[inav+1] > 0 && (nxs[inav+1] < nxs[inav] - 1 || nxs[inav] == 0))
+						    	{
+							nxs[inav] = nxs[inav+1] + 1;
+							nchange++;
+							}
+
+						    /* increment sequence counters */
+						    nseqlast = nseq;
+						    nseq++;
+						    }
+						}
+					    if (section1->continuity == MB_NO)
+			    	    		nseq = 0;
+					    }
+					}
+
+				    /* run through ties */
+				    for (i=0;i<project.num_crossings;i++)
+					{
+					/* use only set crossings */
+					if (project.crossings[i].status == MBNA_CROSSING_STATUS_SET)
+					for (j=0;j<project.crossings[i].num_ties;j++)
+					    {
+					    /* get tie */
+					    tie = (struct mbna_tie *) &project.crossings[i].ties[j];
+
+					    /* get absolute id for first snav point */
+					    file1 = &project.files[project.crossings[i].file_id_1];
+					    section1 = &file1->sections[project.crossings[i].section_1];
+					    nc1 = section1->snav_invert_id[tie->snav_1];
+
+					    /* get absolute id for second snav point */
+					    file2 = &project.files[project.crossings[i].file_id_2];
+					    section2 = &file2->sections[project.crossings[i].section_2];
+					    nc2 = section2->snav_invert_id[tie->snav_2];
+
+					    /* check for nav points needing closeness setting */
+					    if (nxs[nc1] > 0 && nxs[nc2] == 0)
+					    	{
+						if (file2->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc2] = nxs[nc1] + 1;
+						    nchange++;
+						    }
+						}
+					    else if (nxs[nc1] > 0 && nxs[nc2] > nxs[nc1] + 1)
+					    	{
+						if (file2->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc2] = nxs[nc1] + 1;
+						    nchange++;
+						    }
+						}
+					    else if (nxs[nc2] > 0 && nxs[nc1] == 0)
+					    	{
+						if (file1->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc1] = nxs[nc2] + 1;
+						    nchange++;
+						    }
+						}
+					    else if (nxs[nc2] > 0 && nxs[nc1] > nxs[nc2] + 1)
+					    	{
+						if (file1->status != MBNA_FILE_FIXEDNAV)
+						    {
+						    nxs[nc1] = nxs[nc2] + 1;
+						    nchange++;
+						    }
+						}
+					    }
+					}
+
+				    /* check for done */
+			    	    if (nchange == 0)
+				    	done = MB_YES;
+				    }
+
+				/* now loop over the data adding the offset with weighting inversely set by the
+					"distance" from each nav point to the offset point */
+				for (inav=0;inav<nnav;inav++)
+				    {
+				    if (nxs[inav] > 0)
+				    	{
+					if (section->global_tie_status != MBNA_TIE_Z)
+					    {
+					    xs[ndf * inav]     += offsetx / (nxs[inav] * nxs[inav]);
+					    xs[ndf * inav + 1] += offsety / (nxs[inav] * nxs[inav]);
+					    xw[ndf * inav]     += 1.0 / (nxs[inav] * nxs[inav]);
+					    xw[ndf * inav + 1] += 1.0 / (nxs[inav] * nxs[inav]);
+					    }
+					if (section->global_tie_status != MBNA_TIE_XY)
+					    {
+					    xs[ndf * inav + 2] += offsetz / (nxs[inav] * nxs[inav]);
+					    xw[ndf * inav + 2] += 1.0 / (nxs[inav] * nxs[inav]);
+					    }
+					}
+				    }
+				}
+			    }
+			}
+
+		    /* construct average offset model */
+		    for (inav=0;inav<nnav;inav++)
+			{
+			if (xw[ndf * inav] > 0.0)
+			    xa[ndf * inav] += xs[ndf * inav] / xw[ndf * inav];
+			if (xw[ndf * inav + 1] > 0.0)
+			    xa[ndf * inav + 1] += xs[ndf * inav + 1] / xw[ndf * inav + 1];
+			if (xw[ndf * inav + 2] > 0.0)
+			    xa[ndf * inav + 2] += xs[ndf * inav + 2] / xw[ndf * inav + 2];
+//fprintf(stderr,"XA CALC:  xs: %f %f %f  xw: %f %f %f  xa: %f %f %f\n",
+//xs[ndf*inav],xs[ndf*inav+1],xs[ndf*inav+2],xw[ndf*inav],xw[ndf*inav+1],xw[ndf*inav+2],xa[ndf*inav],xa[ndf*inav+1],xa[ndf*inav+2]);
+			}
+
+		    /* save solution */
+		    k = 0;
+		    for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			for (j=0;j<file->num_sections;j++)
+			    {
+			    section = &file->sections[j];
+			    for (isnav=0;isnav<section->num_snav;isnav++)
+				{
+				if (section->snav_num_ties[isnav] > 0
+				    || section->global_tie_snav == isnav)
+				    {
+				    k = section->snav_invert_id[isnav];
 				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
 /* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k]:%f xa[3*k]:%f mbna_mtodeglon:%f section->snav_lon_offset[isnav]:%f\n",
 i,j,isnav,k,x[3*k],xa[3*k],mbna_mtodeglon,section->snav_lon_offset[isnav]); */
@@ -10945,8 +11404,6 @@ i,j,isnav,k,x[3*k+1],xa[3*k+1],mbna_mtodeglat,section->snav_lat_offset[isnav]);
 				    section->snav_z_offset[isnav] = (x[3*k+2] + xa[3*k+2]);
 /* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k+2]:%f xa[3*k+2]:%f section->snav_z_offset[isnav]:%f\n\n",
 i,j,isnav,k,x[3*k+2],xa[3*k+2],section->snav_z_offset[isnav]); */
-fprintf(stderr,"i:%d j:%d isnav:%d k:%d xa: %f %f %f  x: %f %f %f\n",i,j,isnav,k,
-xa[3*k],xa[3*k+1],xa[3*k+2],x[3*k],x[3*k+1],x[3*k+2]);
 				    }
 				}
 			    }
@@ -10976,8 +11433,7 @@ xa[3*k],xa[3*k+1],xa[3*k+2],x[3*k],x[3*k+1],x[3*k+2]);
 		    if (project.modelplot == MB_YES && iter % 25 == 0)
 		    	mbnavadjust_modelplot_plot();
 
-
-		    /* loop over all ties, working only with ties including fixed sections */
+		    /* output goodness of fit for ties including fixed sections */
 		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 			{
 			crossing = &project.crossings[icrossing];
@@ -11007,16 +11463,53 @@ xa[3*k],xa[3*k+1],xa[3*k+2],x[3*k],x[3*k+1],x[3*k+2]);
 				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]);
 				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]);
 				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]);
-fprintf(stderr,"STAGE 2 RESULT: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
-icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
+//fprintf(stderr,"STAGE 2 RESULT - CROSSING TIE: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
+//icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
+				}
+			    }
+			}
+
+		    /* output goodness of fit for global ties */
+		    for (ifile=0;ifile<project.num_files;ifile++)
+			{
+			file = &project.files[ifile];
+			for (isection=0;isection<file->num_sections;isection++)
+			    {
+			    /* get section */
+			    section = (struct mbna_section *) &file->sections[isection];
+			    
+			    /* only work with set global ties */
+			    if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				/* get absolute id for first snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+
+//fprintf(stderr,"STAGE 2 RESULT - GLOBAL TIE: %2.2d:%2.2d:%2.2d  tie: \n",
+//ifile,isection,section->global_tie_snav);
+//if (section->global_tie_status != MBNA_TIE_Z)
+//fprintf(stderr,"x: %f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
+//if (section->global_tie_status != MBNA_TIE_XY)
+//fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
+//fprintf(stderr,"  model offset: ");
+
+			        /* get current offset vector including reduction of block solution */
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    offsetx = section->global_tie_offset_x_m - xa[3*nc1];
+				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
+//fprintf(stderr,"x: %f y:%f ",offsetx,offsety);
+				    }
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
+//fprintf(stderr,"z:%f ",offsetz);	
+				    }
 				}
 			    }
 			}
 
 		    /* deallocate arrays */
 		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&nxs,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xs,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xw,&error);
 		    }
 
 
@@ -11027,14 +11520,16 @@ icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
 		/* loop until convergence */
 		done = MB_NO;
 		iter = 0;
-		perturbationsizeold = misfit_initial;
+		perturbationsizeold = misfit_ties_initial;
 		mbna_smoothweight = pow(10.0, project.smoothing) * mbna_offsetweight;
 		while (done == MB_NO)
 		    {
-		    /* zero solution */
+		    /* zero smoothed adjustment vector solution */
 		    for (i=0;i<ncols;i++)
 			{
 			xx[i] = 0.0;
+			xs[i] = 0.0;
+			xw[i] = 0.0;
 			}
 
 		    /* loop over each crossing, applying offsets evenly to both points */
@@ -11051,13 +11546,13 @@ icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
 
 			    /* get absolute id for first snav point */
 			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
+			    section1 = &file1->sections[crossing->section_1];
+			    nc1 = section1->snav_invert_id[tie->snav_1];
 
 			    /* get absolute id for second snav point */
 			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
+			    section2 = &file2->sections[crossing->section_2];
+			    nc2 = section2->snav_invert_id[tie->snav_2];
 if (file1->sections[crossing->section_1].snav_time_d[tie->snav_1] == file2->sections[crossing->section_2].snav_time_d[tie->snav_2])
 fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d   %d:%d:%d  DIFF:%f\n",
 	crossing->file_id_1,crossing->section_1,tie->snav_1,
@@ -11068,10 +11563,8 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    /* get current offset vector including reduction of block solution */
 			    if (tie->status != MBNA_TIE_Z)
 			        {
-				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1])
-			    		    - (x[3*nc2] + xx[3*nc2] - x[3*nc1] - xx[3*nc1]);
-				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1])
-			    		    - (x[3*nc2+1] + xx[3*nc2+1] - x[3*nc1+1] - xx[3*nc1+1]);
+				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]) - (x[3*nc2] - x[3*nc1]);
+				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]) - (x[3*nc2+1] - x[3*nc1+1]);
 				}
 			    else
 			        {
@@ -11080,8 +11573,7 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				}
 			    if (tie->status != MBNA_TIE_XY)
 			        {
-				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2])
-			    		    - (x[3*nc2+2] + xx[3*nc2+2] - x[3*nc1+2] - xx[3*nc1+2]);
+				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]) - (x[3*nc2+2] - x[3*nc1+2]);
 				}
 			    else
 			        {
@@ -11094,50 +11586,66 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				- weight inversely by size of error for that component */
 
 			    /* deal with long axis */
-			    offsetsigma = offsetx * tie->sigmax1[0]
-			    		+ offsety * tie->sigmax1[1]
-					+ offsetz * tie->sigmax1[2];
-			    if (fabs(offsetsigma) > 0.0)
-			    	weight = MAX(mbna_offsetweight / tie->sigmar1, 1.0);
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				projected_offset = offsetx * tie->sigmax1[0]
+						+ offsety * tie->sigmax1[1]
+						+ offsetz * tie->sigmax1[2];
+			    else
+				projected_offset = offsetx * tie->sigmax1[0]
+						+ offsety * tie->sigmax1[1];
+			    if (fabs(tie->sigmar1) > 0.0)
+			    	{
+				xyweight = sqrt(mbna_offsetweight / tie->sigmar1);
+				zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar1);
+				}
 			    else
-			    	weight = 1.0;
+			    	{
+				xyweight = 0.0;
+			    	zweight = 0.0;
+				}
+//zweight = 0.0;
 
 			    /* deal with fixed, good, or poor status of sections */
 			    if (file1->status == file2->status)
 			    	{
 				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];				    
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11145,44 +11653,50 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    	{
 				if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11190,44 +11704,50 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11236,36 +11756,41 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11274,49 +11799,55 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax1[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11324,98 +11855,130 @@ fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax1[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax1[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax1[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax1[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
 				    }
 				}
+			    xw[3*nc1]   += xyweight;
+			    xw[3*nc1+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc1+2] += zweight;
+			    xw[3*nc2]   += xyweight;
+			    xw[3*nc2+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc2+2] += zweight;
 /* fprintf(stderr,"long axis:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
+nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
+nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
 
 			    /* deal with horizontal axis */
-			    offsetsigma = offsetx * tie->sigmax2[0]
-			    		+ offsety * tie->sigmax2[1]
-					+ offsetz * tie->sigmax2[2];
-			    if (offsetsigma > 0.0)
-			    	weight = MAX(mbna_offsetweight / tie->sigmar2, 1.0);
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				projected_offset = offsetx * tie->sigmax2[0]
+						+ offsety * tie->sigmax2[1]
+						+ offsetz * tie->sigmax2[2];
+			    else
+				projected_offset = offsetx * tie->sigmax2[0]
+						+ offsety * tie->sigmax2[1];
+			    if (fabs(tie->sigmar2) > 0.0)
+			    	{
+				xyweight = sqrt(mbna_offsetweight / tie->sigmar2);
+			    	zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar2);
+				}
 			    else
-			    	weight = 1.0;
+			    	{
+				xyweight = 0.0;
+			    	zweight = 0.0;
+				}
+//zweight = 0.0;
 
 			    /* deal with fixed, good, or poor status of sections */
 			    if (file1->status == file2->status)
 			    	{
 				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11423,44 +11986,52 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11468,44 +12039,52 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11514,36 +12093,42 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11552,49 +12137,57 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    xs[3*nc1]   +=  0.0;
+				    xs[3*nc1+1] +=  0.0;
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax2[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
+				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11602,98 +12195,143 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax2[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax2[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax2[1];
+				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
+				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc1+2] +=  0.0;
+				    xs[3*nc2]   +=  0.0;
+				    xs[3*nc2+1] +=  0.0;
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax2[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
 				    }
 				}
+			    xw[3*nc1]   += xyweight;
+			    xw[3*nc1+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc1+2] += zweight;
+			    xw[3*nc2]   += xyweight;
+			    xw[3*nc2+1] += xyweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				xw[3*nc2+2] += zweight;
 /* fprintf(stderr,"horizontal:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
+nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
+nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
 
 			    /* deal with semi-vertical axis */
-			    offsetsigma = offsetx * tie->sigmax3[0]
-			    		+ offsety * tie->sigmax3[1]
-					+ offsetz * tie->sigmax3[2];
-			    if (offsetsigma > 0.0)
-			    	weight = MAX(mbna_offsetweight / tie->sigmar3, 1.0);
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				projected_offset = offsetx * tie->sigmax3[0]
+						+ offsety * tie->sigmax3[1]
+						+ offsetz * tie->sigmax3[2];
+			    else
+				projected_offset = offsetz * tie->sigmax3[2];
+			    if (fabs(tie->sigmar3) > 0.0)
+			    	{
+				xyweight = sqrt(mbna_offsetweight / tie->sigmar3);
+			    	zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / tie->sigmar3);
+				}
 			    else
-			    	weight = 1.0;
+			    	{
+				xyweight = 0.0;
+			    	zweight = 0.0;
+				}
+//xyweight = 0.0;
+//zweight = 1.0;
 
 			    /* deal with fixed, good, or poor status of sections */
 			    if (file1->status == file2->status)
 			    	{
 				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file1->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11701,44 +12339,68 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11746,44 +12408,68 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -0.995 * weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  0.005 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
-				    xx[3*nc1]   += -0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.005 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11792,36 +12478,54 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
+				    xs[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11830,49 +12534,73 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -0.5 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.5 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -0.005 * weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  0.995 * weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
 				    /*
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDZNAV)
 				    {
 				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc1]   +=  0.0;
+				        xs[3*nc1+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc1+2] += -weight * offsetsigma * tie->sigmax3[2];
-				    xx[3*nc2]   +=  weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  weight * offsetsigma * tie->sigmax3[1];
+				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				}
@@ -11880,69 +12608,186 @@ nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
 			    	{
 				if (file2->status == MBNA_FILE_GOODNAV)
 				    {
-				    xx[3*nc1]   += -0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.5 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.5 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.5 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_POORNAV)
 				    {
-				    xx[3*nc1]   += -0.005 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -0.005 * weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
 				    */
-				    xx[3*nc2]   +=  0.995 * weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc2+1] +=  0.995 * weight * offsetsigma * tie->sigmax3[1];
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
+				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
+				    xs[3*nc2+2] +=  0.0;
 				    */
 				    }
 				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
 				    {
-				    xx[3*nc1]   += -weight * offsetsigma * tie->sigmax3[0];
-				    xx[3*nc1+1] += -weight * offsetsigma * tie->sigmax3[1];
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
+					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
+					}
 				    /*
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
+				    xs[3*nc1+2] +=  0.0;
+				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+					{
+				        xs[3*nc2]   +=  0.0;
+				        xs[3*nc2+1] +=  0.0;
+				        }
 				    */
-				    xx[3*nc2+2] +=  weight * offsetsigma * tie->sigmax3[2];
+				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
 				    }
 				}
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				{
+				xw[3*nc1]   += xyweight;
+				xw[3*nc1+1] += xyweight;
+				}
+			    xw[3*nc1+2] += zweight;
+			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
+				{
+				xw[3*nc2]   += xyweight;
+				xw[3*nc2+1] += xyweight;
+				}
+			    xw[3*nc2+2] += zweight;
 /* fprintf(stderr,"semi-vertical:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-nc2,xx[3*nc2],xx[3*nc2+1],xx[3*nc2+2]);*/
-
-/* fprintf(stderr,"icrossing:%d j:%d tie->offset_x_m:%f x[3*%d]:%f x[3*%d]:%f offsetx:%f xx[3*%d]:%f xx[3*%d]:%f\n",
-icrossing,j,tie->offset_x_m,nc2,x[3*nc2],nc1,x[3*nc1],offsetx,nc2,xx[3*nc2],nc1,xx[3*nc1]);
-fprintf(stderr,"icrossing:%d j:%d tie->offset_y_m:%f x[3*%d+1]:%f x[3*%d+1]:%f offsety:%f xx[3*%d+1]:%f xx[3*%d+1]:%f\n",
-icrossing,j,tie->offset_y_m,nc2,x[3*nc2+1],nc1,x[3*nc1+1],offsety,nc2,xx[3*nc2+1],nc1,xx[3*nc1+1]);
-fprintf(stderr,"icrossing:%d j:%d tie->offset_z_m:%f x[3*%d+2]:%f x[3*%d+2]:%f offsetz:%f xx[3*%d+2]:%f xx[3*%d+2]:%f\n\n",
-icrossing,j,tie->offset_z_m,nc2,x[3*nc2+2],nc1,x[3*nc1+2],offsetz,nc2,xx[3*nc2+2],nc1,xx[3*nc1+2]);*/
+nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
+nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
+
+			    }
+			}
+
+		    /* loop over all global ties applying offsets to the affected points */
+		    for (ifile=0;ifile<project.num_files;ifile++)
+			{
+			file = &project.files[ifile];
+
+			for (isection=0;isection<file->num_sections;isection++)
+			    {
+			    /* use only set global ties */
+			    section = &file->sections[isection];
+			    if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				/* get absolute id for first snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+				
+				/* get current offset vector including reduction of block solution */
+				offsetx = 0.0;
+				offsety = 0.0;
+				offsetz = 0.0;
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    offsetx = section->global_tie_offset_x_m - xa[3*nc1] - x[3*nc1];
+				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1] - x[3*nc1+1];
+				    }
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2] - x[3*nc1+2];
+				    }
+				offsetr = sqrt(offsetx * offsetx + offsety * offsety + offsetz * offsetz);
+				
+				/* global ties have a simple error ellipse oriented on the axes */
+				
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    /* deal with x-axis */
+				    projected_offset = offsetx;
+				    if (fabs(section->global_tie_xsigma) > 0.0)
+					xyweight = sqrt(mbna_offsetweight / section->global_tie_xsigma);
+				    else
+					xyweight = 0.0;
+//fprintf(stderr,"GLOBAL X: xyweight:%f mbna_offsetweight:%f xsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_xsigma);
+				    xs[3*nc1]   += xyweight * projected_offset;
+				    xw[3*nc1]   += xyweight;
+					
+				    /* deal with y-axis */
+				    projected_offset = offsety;
+				    if (fabs(section->global_tie_ysigma) > 0.0)
+					xyweight = sqrt(mbna_offsetweight / section->global_tie_ysigma);
+				    else
+					xyweight = 0.0;
+//fprintf(stderr,"GLOBAL Y: xyweight:%f mbna_offsetweight:%f zsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_ysigma);
+				    xs[3*nc1+1] += xyweight * projected_offset;
+				    xw[3*nc1+1] += xyweight;
+				    }
+				    
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    /* deal with z-axis */
+				    projected_offset = offsetz;
+				    if (fabs(section->global_tie_zsigma) > 0.0)
+					zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / section->global_tie_zsigma);
+				    else
+					zweight = 0.0;
+//fprintf(stderr,"GLOBAL Z: zweight:%f mbna_offsetweight:%f sigma:%f\n",zweight,mbna_offsetweight,section->global_tie_zsigma);
+				    xs[3*nc1+2] += zweight * projected_offset;
+				    xw[3*nc1+2] += zweight;
+				    }
+/* fprintf(stderr,"STAGE 3 GLOBAL TIE: %2d:%2d:%2d  status:%d  nc1:%d  tie: ",ifile,isection,section->global_tie_snav,section->global_tie_status,nc1);
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
+fprintf(stderr," xa: ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xa[3*nc1],xa[3*nc1+1]);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xa[3*nc1+2]);
+fprintf(stderr," x: ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",x[3*nc1],x[3*nc1+1]);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",x[3*nc1+2]);
+fprintf(stderr," xx: ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xs[3*nc1],xs[3*nc1+1]);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xs[3*nc1+2]);
+fprintf(stderr," (off-xa-x-xx): ");
+if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",offsetx,offsety);
+if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",offsetz);
+fprintf(stderr,"\n");*/
+				}
 			    }
 			}
 
-		    /* now loop over all points applying smoothing */
+
+		    /* now loop over all points applying smoothing to the xx[] vector */
 		    nseq = 0;
 		    ndx = 0;
 		    ndx2 = 0;
-		    for (i=0;i<project.num_files;i++)
+		    for (ifile=0;ifile<project.num_files;ifile++)
 			{
-			file = &project.files[i];
+			file = &project.files[ifile];
 			if (file->status != MBNA_FILE_FIXEDNAV)
 			for (isection=0;isection<file->num_sections;isection++)
 			    {
@@ -11952,7 +12797,8 @@ icrossing,j,tie->offset_z_m,nc2,x[3*nc2+2],nc1,x[3*nc1+2],offsetz,nc2,xx[3*nc2+2
 			    for (isnav=0;isnav<section->num_snav;isnav++)
 				{
 				/* work only with points that are tied */
-				if (section->snav_num_ties[isnav] > 0)
+				if (section->snav_num_ties[isnav] > 0
+				    || (section->global_tie_status != MBNA_TIE_NONE && section->global_tie_snav == isnav))
 				    {
 				    /* get ids for tied nav points */
 				    if (nseq > 1)
@@ -11973,23 +12819,27 @@ icrossing,j,tie->offset_z_m,nc2,x[3*nc2+2],nc1,x[3*nc1+2],offsetz,nc2,xx[3*nc2+2
 				    if (nseq > 0 && dtime_d > 0.0)
 					{
 			    		/* get current offset vector */
-					offsetx = (x[3*nc3]   + xx[3*nc3]   + xa[3*nc3]   - x[3*nc2]   - xx[3*nc2]   - xa[3*nc2]);
-					offsety = (x[3*nc3+1] + xx[3*nc3+1] + xa[3*nc3+1] - x[3*nc2+1] - xx[3*nc2+1] - xa[3*nc2+1]);
-					offsetz = (x[3*nc3+2] + xx[3*nc3+2] + xa[3*nc3+2] - x[3*nc2+2] - xx[3*nc2+2] - xa[3*nc2+2]);
+					offsetx = (x[3*nc3]   - x[3*nc2]);
+					offsety = (x[3*nc3+1] - x[3*nc2+1]);
+					offsetz = (x[3*nc3+2] - x[3*nc2+2]);
 
 					/* add remaining offsets to both points */
-					weight = 0.5 * MIN(mbna_smoothweight / dtime_d, 1.0);
-					xx[3*nc2]   +=  weight * offsetx;
-					xx[3*nc2+1] +=  weight * offsety;
-					xx[3*nc2+2] +=  weight * offsetz;
-					xx[3*nc3]   += -weight * offsetx;
-					xx[3*nc3+1] += -weight * offsety;
-					xx[3*nc3+2] += -weight * offsetz;
+					xyweight = mbna_smoothweight / dtime_d;
+					zweight = mbna_smoothweight / dtime_d;
+					xs[3*nc2]   +=  0.5 * xyweight * offsetx;
+					xs[3*nc2+1] +=  0.5 * xyweight * offsety;
+					xs[3*nc2+2] +=  0.5 * zweight * offsetz;
+					xs[3*nc3]   += -0.5 * xyweight * offsetx;
+					xs[3*nc3+1] += -0.5 * xyweight * offsety;
+					xs[3*nc3+2] += -0.5 * zweight * offsetz;
+					xw[3*nc2]   += xyweight;
+					xw[3*nc2+1] += xyweight;
+					xw[3*nc2+2] += zweight;
+					xw[3*nc3]   += xyweight;
+					xw[3*nc3+1] += xyweight;
+					xw[3*nc3+2] += zweight;
 
 					ndx++;
-/* fprintf(stderr,"1st Derivative: nc2:%d offsets:%f %f %f  weight:%f perturbation:%f %f %f\n",
-nc2,offsetx,offsety,offsetz,weight,
-0.5 * weight * offsetx,0.5 * weight * offsety,0.5 * weight * offsetz);*/
 					}
 
 				    /* add second derivative constraint if nseq > 2  AND dtime_d > 0.0 */
@@ -11997,29 +12847,31 @@ nc2,offsetx,offsety,offsetz,weight,
 				    if (nseq > 1 && dtime_d > 0.0)
 					{
 			    		/* get current offset vector */
-					offsetx = (x[3*nc1] + xx[3*nc1]
-							- 2.0 * (x[3*nc2] + xx[3*nc2])
-							+ x[3*nc3] + xx[3*nc3]);
-					offsety = (x[3*nc1+1] + xx[3*nc1+1]
-							- 2.0 * (x[3*nc2+1] + xx[3*nc2+1])
-							+ x[3*nc3+1] + xx[3*nc3+1]);
-					offsetz = (x[3*nc1+2] + xx[3*nc1+2]
-							- 2.0 * (x[3*nc2+2] + xx[3*nc2+2])
-							+ x[3*nc3+2] + xx[3*nc3+2]);
+					offsetx = x[3*nc1]   - 2.0 * x[3*nc2]   + x[3*nc3];
+					offsety = x[3*nc1+1] - 2.0 * x[3*nc2+1] + x[3*nc3+1];
+					offsetz = x[3*nc1+2] - 2.0 * x[3*nc2+2] + x[3*nc3+2];
 
 					/* add remaining offsets to both points, or just one if one is fixed (weight 2nd derivative 1/4th of first derivative)*/
-					weight = 0.125 * MIN(mbna_smoothweight / dtime_d, 1.0);
-					xx[3*nc1]   += -0.5 * weight * offsetx;
-					xx[3*nc1+1] += -0.5 * weight * offsety;
-					xx[3*nc1+2] += -0.5 * weight * offsetz;
-					xx[3*nc2]   +=  weight * offsetx;
-					xx[3*nc2+1] +=  weight * offsety;
-					xx[3*nc2+2] +=  weight * offsetz;
-					xx[3*nc3]   += -0.5 * weight * offsetx;
-					xx[3*nc3+1] += -0.5 * weight * offsety;
-					xx[3*nc3+2] += -0.5 * weight * offsetz;
-/* fprintf(stderr,"2nd Derivative: nc2:%d offsets:%f %f %f  weight:%f perturbation:%f %f %f\n",
-nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offsety,0.25 * weight * offsetz);*/
+					xyweight = mbna_smoothweight / dtime_d / dtime_d;
+					zweight = mbna_smoothweight / dtime_d / dtime_d;
+					xs[3*nc1]   += -xyweight * offsetx;
+					xs[3*nc1+1] += -xyweight * offsety;
+					xs[3*nc1+2] += -zweight * offsetz;
+					xs[3*nc2]   +=  2.0 * xyweight * offsetx;
+					xs[3*nc2+1] +=  2.0 * xyweight * offsety;
+					xs[3*nc2+2] +=  2.0 * zweight * offsetz;
+					xs[3*nc3]   += -xyweight * offsetx;
+					xs[3*nc3+1] += -xyweight * offsety;
+					xs[3*nc3+2] += -zweight * offsetz;
+					xw[3*nc1]   += xyweight;
+					xw[3*nc1+1] += xyweight;
+					xw[3*nc1+2] += zweight;
+					xw[3*nc2]   += xyweight;
+					xw[3*nc2+1] += xyweight;
+					xw[3*nc2+2] += zweight;
+					xw[3*nc3]   += xyweight;
+					xw[3*nc3+1] += xyweight;
+					xw[3*nc3+2] += zweight;
 
 					ndx2++;
 					}
@@ -12031,10 +12883,14 @@ nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offse
 			    }
 			}
 
-		    /* calculate 2-norm of perturbation */
+		    /* calculate perturbation and 2-norm of perturbation */
 		    perturbationsize = 0.0;
 		    for (i=0;i<ncols;i++)
 			{
+			if (xw[i] > 0.0)
+				xx[i] = xs[i] / xw[i];
+			else
+				xx[i] = 0.0;
 			perturbationsize += xx[i] * xx[i];
 			}
 		    perturbationsize = sqrt(perturbationsize) / ncols;
@@ -12048,9 +12904,10 @@ nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offse
 /* fprintf(stderr,"x:%f\n",x[i]);*/
 			}
 
-		    /* calculate weighted misfit */
+		    /* calculate misfit */
 		    misfit_ties = 0.0;
-		    ntie = 0;
+		    misfit_norm = 0.0;
+		    nmisfit = 0;
 		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
 			{
 			crossing = &project.crossings[icrossing];
@@ -12061,58 +12918,113 @@ nc2,offsetx,offsety,offsetz,weight,0.25 * weight * offsetx,0.25 * weight * offse
 			    {
 			    /* get tie */
 			    tie = (struct mbna_tie *) &crossing->ties[j];
-			    ntie++;
 
 			    /* get absolute id for first snav point */
 			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
+			    section1 = &file1->sections[crossing->section_1];
+			    nc1 = section1->snav_invert_id[tie->snav_1];
 
 			    /* get absolute id for second snav point */
 			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
+			    section2 = &file2->sections[crossing->section_2];
+			    nc2 = section2->snav_invert_id[tie->snav_2];
 if (nc1 > nsnav - 1 || nc2 > nsnav -1
 || nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD snav ID: %d %d %d\n", nc1, nc2, nsnav);
+fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
 
-			    /* get observed offset vector including reduction of block solution */
+			    /* get observed offset vector including removal of block solution */
 			    offsetx = (x[3*nc2] + xa[3*nc2] - x[3*nc1] - xa[3*nc1]) - tie->offset_x_m;
 			    offsety = (x[3*nc2+1] + xa[3*nc2+1] - x[3*nc1+1] - xa[3*nc1+1]) - tie->offset_y_m;
 			    offsetz = (x[3*nc2+2] + xa[3*nc2+2] - x[3*nc1+2] - xa[3*nc1+2]) - tie->offset_z_m;
 
-			    /* get long axis misfit */
-			    misfit = mbna_offsetweight / tie->sigmar1
-						    * (offsetx * tie->sigmax1[0]
-							    + offsety * tie->sigmax1[1]
-							    + offsetz * tie->sigmax1[2]);
-			    misfit_ties += misfit * misfit;
-
-			    /* get horizontal axis misfit */
-			    misfit = mbna_offsetweight / tie->sigmar2
-						    * (offsetx * tie->sigmax2[0]
-							    + offsety * tie->sigmax2[1]
-							    + offsetz * tie->sigmax2[2]);
-			    misfit_ties += misfit * misfit;
+			    if (tie->status != MBNA_TIE_Z)
+				{
+				/* get long axis misfit */
+				misfit = (offsetx * tie->sigmax1[0]
+						+ offsety * tie->sigmax1[1]
+						+ offsetz * tie->sigmax1[2]);
+				misfit_ties += misfit * misfit;
+				misfit_norm += misfit * misfit / tie->sigmar1 / tie->sigmar1;
+				nmisfit++;
+    
+				/* get horizontal axis misfit */
+				misfit = (offsetx * tie->sigmax2[0]
+						+ offsety * tie->sigmax2[1]
+						+ offsetz * tie->sigmax2[2]);
+				misfit_ties += misfit * misfit;
+				misfit_norm += misfit * misfit / tie->sigmar2 / tie->sigmar2;
+				nmisfit++;
+				}
 
-			    /* get semi-vertical axis misfit */
-			    misfit = mbna_offsetweight / tie->sigmar3
-						    * (offsetx * tie->sigmax3[0]
-							    + offsety * tie->sigmax3[1]
-							    + offsetz * tie->sigmax3[2]);
-			    misfit_ties += misfit * misfit;
+			    if (tie->status != MBNA_TIE_XY)
+				{
+				/* get semi-vertical axis misfit */
+				misfit = (offsetx * tie->sigmax3[0]
+						+ offsety * tie->sigmax3[1]
+						+ offsetz * tie->sigmax3[2]);
+				misfit_ties += misfit * misfit;
+				misfit_norm += misfit * misfit / tie->sigmar3 / tie->sigmar3;
+				nmisfit++;
+				}
+			    }
+			}
+		    for (ifile=0;ifile<project.num_files;ifile++)
+			{
+			/* get file */
+			file = &project.files[ifile];
+			for (isection=0;isection<file->num_sections;isection++)
+			    {
+			    /* get section */
+			    section = &file->sections[isection];
+			    if (section->global_tie_status != MBNA_TIE_NONE)
+				{
+				/* get absolute id for snav point */
+				nc1 = section->snav_invert_id[section->global_tie_snav];
+if (nc1 > nsnav - 1 || nc1 < 0)
+fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
+
+				/* get observed offset vector including removal of block solution */
+				offsetx = (x[3*nc1] + xa[3*nc1]) - section->global_tie_offset_x_m;
+				offsety = (x[3*nc1+1] + xa[3*nc1+1]) - section->global_tie_offset_y_m;
+				offsetz = (x[3*nc1+2] + xa[3*nc1+2]) - section->global_tie_offset_z_m;
+		
+				if (section->global_tie_status != MBNA_TIE_Z)
+				    {
+				    /* get x axis misfit */
+				    misfit = offsetx;
+				    misfit_ties += misfit * misfit;
+				    misfit_norm += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
+				    nmisfit++;
+    
+				    /* get y axis misfit */
+				    misfit = offsety;
+				    misfit_ties += misfit * misfit;
+				    misfit_norm += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
+				    nmisfit++;
+				    }
+    
+				if (section->global_tie_status != MBNA_TIE_XY)
+				    {
+				    /* get z axis misfit */
+				    misfit = offsetz;
+				    misfit_ties += misfit * misfit;
+				    misfit_norm += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
+				    nmisfit++;
+				    }
+				}
 			    }
 			}
-		    misfit_ties = sqrt(misfit_ties) / ntie;
+		    misfit_ties = sqrt(misfit_ties) / nmisfit;
+		    misfit_norm = sqrt(misfit_norm) / nmisfit;
 
 		    /* check for convergence */
 		    perturbationchange = perturbationsize - perturbationsizeold;
-		    convergencecriterea = fabs(perturbationchange) / misfit_initial;
+		    convergencecriterea = fabs(perturbationchange) / misfit_ties_initial;
 		    if (convergencecriterea < MBNA_CONVERGENCE || convergencecriterea > 10000.0 || iter > MBNA_INTERATION_MAX)
 		    	done = MB_YES;
 
-/* fprintf(stderr,"MODEL INVERT: iter:%d ntie:%d misfit_initial:%f misfit_ties:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,convergencecriterea,done); */
+fprintf(stderr,"MODEL INVERT: iter:%d nmisfit:%d misfit_initial:%f misfit_ties_initial:%f misfit_ties:%f misfit_norm_initial:%f misfit_norm:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
+iter,nmisfit,misfit_initial,misfit_ties_initial,misfit_ties,misfit_norm_initial,misfit_norm,perturbationsize,perturbationchange,convergencecriterea,done);
 
 		    if (done == MB_NO)
 		        {
@@ -12130,7 +13042,8 @@ iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,converg
 			    section = &file->sections[j];
 			    for (isnav=0;isnav<section->num_snav;isnav++)
 				{
-				if (section->snav_num_ties[isnav] > 0)
+				if (section->snav_num_ties[isnav] > 0
+				    || section->global_tie_snav == isnav)
 				    {
 				    k = section->snav_invert_id[isnav];
 				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
@@ -12240,6 +13153,37 @@ offset_x,offset_y,offset_z,tie->inversion_offset_x_m,tie->inversion_offset_y_m,t
 			}
 		    }
 
+		/* get global tie results */
+		sprintf(message, " > Global Tie Offsets (m):  id  observed  solution  error\n");
+		do_info_add(message, MB_NO);
+		for (ifile=0;ifile<project.num_files;ifile++)
+		    {
+		    file = &project.files[ifile];
+		    for (isection=0;isection<file->num_sections;isection++)
+			{
+			section = &file->sections[isection];
+			if (section->global_tie_status != MBNA_TIE_NONE)
+			    {
+			    offset_x =  section->snav_lon_offset[section->global_tie_snav];
+			    offset_y =  section->snav_lat_offset[section->global_tie_snav];
+			    offset_z =  section->snav_z_offset[section->global_tie_snav];
+			    
+			    sprintf(message, " >     %2.2d:%2.2d:%2.2d %d   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f\n",
+				ifile,isection,section->global_tie_snav,section->global_tie_status,
+				section->global_tie_offset_x_m,
+				section->global_tie_offset_y_m,
+				section->global_tie_offset_z_m,
+				offset_x / mbna_mtodeglon,
+				offset_y / mbna_mtodeglat,
+				offset_z,
+				(offset_x / mbna_mtodeglon - section->global_tie_offset_x_m),
+				(offset_y / mbna_mtodeglat - section->global_tie_offset_y_m),
+				(offset_z - section->global_tie_offset_z_m));
+			    do_info_add(message, MB_NO);
+			    }
+			}
+		    }
+
 		/* write updated project */
 		project.inversion = MBNA_INVERSION_CURRENT;
 		mbnavadjust_write_project();
@@ -12248,6 +13192,8 @@ offset_x,offset_y,offset_z,tie->inversion_offset_x_m,tie->inversion_offset_y_m,t
 		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
 		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
 		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xa,&error);
+		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xs,&error);
+		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xw,&error);
 
 		/* turn off message dialog */
 		do_message_off();
@@ -12670,7 +13616,8 @@ mbnavadjust_interpolatesolution()
 		for (isnav=0;isnav<section->num_snav;isnav++)
 		    {
 		    /* deal with constrained snav points */
-		    if (section->snav_num_ties[isnav] > 0)
+		    if (section->snav_num_ties[isnav] > 0
+			|| section->global_tie_snav == isnav)
 			{
 			/* if no previous tie set apply current offset to intervening snav points */
 			if (previoustie == MB_NO)
@@ -12987,7 +13934,7 @@ mbnavadjust_modelplot_setzoom()
 	if ((mbna_modelplot_zoom_x1 >= 0 || mbna_modelplot_zoom_x2 >= 0)
 	    && mbna_modelplot_zoom_x1 != mbna_modelplot_zoom_x2)
 		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
 			{
 			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
 			xo = 5 * MBNA_MODELPLOT_X_SPACE;
@@ -13010,19 +13957,42 @@ mbnavadjust_modelplot_setzoom()
 				mbna_modelplot_zoom = MB_NO;
 			}
 
-		else
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
-			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itiestart = MAX(0,itiestart);
-			itieend = MIN(mbna_num_ties_plot-1, itieend);
-			if (itieend > itiestart)
-				{
-				mbna_modelplot_tiezoom = MB_YES;
-				mbna_modelplot_tiestartzoom = itiestart;
-				mbna_modelplot_tieendzoom = itieend;
+			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
+			xo = 5 * MBNA_MODELPLOT_X_SPACE;
+			xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
+
+			ipingstart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
+					+ mbna_modelplot_start;
+			ipingstart = MIN(MAX(ipingstart, 0), project.num_pings - 1);
+			ipingend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
+					+ mbna_modelplot_start;
+			ipingend = MIN(MAX(ipingend, 0), project.num_pings - 1);
+
+			if (ipingend > ipingstart)
+				{
+				mbna_modelplot_zoom = MB_YES;
+				mbna_modelplot_startzoom = ipingstart;
+				mbna_modelplot_endzoom = ipingend;
+				}
+			else
+				mbna_modelplot_zoom = MB_NO;
+			}
+
+		else
+			{
+			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
+					/ mbna_modelplot_xscale;
+			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
+					/ mbna_modelplot_xscale;
+			itiestart = MAX(0,itiestart);
+			itieend = MIN(mbna_num_ties_plot-1, itieend);
+			if (itieend > itiestart)
+				{
+				mbna_modelplot_tiezoom = MB_YES;
+				mbna_modelplot_tiestartzoom = itiestart;
+				mbna_modelplot_tieendzoom = itieend;
 				}
 			else
 				mbna_modelplot_tiezoom = MB_NO;
@@ -13035,7 +14005,13 @@ mbnavadjust_modelplot_setzoom()
 	/* reset zoom to off otherwise */
 	else
 		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+			{
+			mbna_modelplot_zoom = MB_NO;
+			mbna_modelplot_start = 0;
+			mbna_modelplot_end = project.num_pings - 1;
+			}
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
 			mbna_modelplot_zoom = MB_NO;
 			mbna_modelplot_start = 0;
@@ -13086,13 +14062,17 @@ mbnavadjust_modelplot_pick(int x, int y)
     		&& project.inversion != MBNA_INVERSION_NONE
 		&& project.modelplot == MB_YES)
     		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+			{
+			mbnavadjust_modelplot_pick_timeseries(x, y);
+			}
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
-			mbnavadjust_modelplot_pick_sequential(x, y);
+			mbnavadjust_modelplot_pick_perturbation(x, y);
 			}
 		else
 			{
-			mbnavadjust_modelplot_pick_tielist(x, y);
+			mbnavadjust_modelplot_pick_tieoffsets(x, y);
 			}
 		}
 
@@ -13112,10 +14092,10 @@ mbnavadjust_modelplot_pick(int x, int y)
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_pick_sequential(int x, int y)
+mbnavadjust_modelplot_pick_timeseries(int x, int y)
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_sequential";
+	char	*function_name = "mbnavadjust_modelplot_pick_timeseries";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -13146,7 +14126,7 @@ mbnavadjust_modelplot_pick_sequential(int x, int y)
 		&& project.modelplot == MB_YES)
     		{
 		rangemin = 10000000;
-fprintf(stderr,"mbnavadjust_modelplot_pick_sequential: %d %d\n",x,y);
+fprintf(stderr,"mbnavadjust_modelplot_pick_timeseries: %d %d\n",x,y);
 		/* search by looping over crossings */
 		for (i=0;i<project.num_crossings;i++)
 		    {
@@ -13335,10 +14315,233 @@ fprintf(stderr,"mbnavadjust_modelplot_pick_sequential: %d %d\n",x,y);
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_pick_tielist(int x, int y)
+mbnavadjust_modelplot_pick_perturbation(int x, int y)
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_pick_perturbation";
+	int	status = MB_SUCCESS;
+	struct mbna_file *file;
+	struct mbna_section *section;
+	struct mbna_crossing *crossing;
+	struct mbna_tie *tie;
+	int	range;
+	int	rangemin;
+	int	pick_crossing;
+	int	pick_tie;
+	int	pick_file;
+	int	pick_section;
+	int	pick_snav;
+	int	ntieselect;
+	int	i, j, ix, iy, iping;
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		fprintf(stderr,"dbg2       x:           %d\n",x);
+		fprintf(stderr,"dbg2       y:           %d\n",y);
+		}
+
+	/* find nearest snav pt with tie */
+    	if (project.open == MB_YES
+    		&& project.inversion != MBNA_INVERSION_NONE
+		&& project.modelplot == MB_YES)
+    		{
+		rangemin = 10000000;
+fprintf(stderr,"mbnavadjust_modelplot_pick_perturbation: %d %d\n",x,y);
+		/* search by looping over crossings */
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+
+		    /* loop over all ties for this crossing */
+		    for (j=0;j<crossing->num_ties;j++)
+		    	{
+			tie = &(crossing->ties[j]);
+
+			/* handle first snav point */
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+
+			if (section->show_in_modelplot == MB_YES)
+				{
+				iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+				}
+
+			/* handle second snav point */
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+
+			if (section->show_in_modelplot == MB_YES)
+				{
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_2;
+					pick_section = crossing->section_2;
+					pick_snav = tie->snav_2;
+					}
+
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_2;
+					pick_section = crossing->section_2;
+					pick_snav = tie->snav_2;
+					}
+
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_2;
+					pick_section = crossing->section_2;
+					pick_snav = tie->snav_2;
+					}
+				}
+			}
+		    }
+
+		/* deal with successful pick */
+		if (rangemin < 10000000)
+			{
+			/* count the number of ties associated with the selected snav point */
+			ntieselect = 0;
+			for (i=0;i<project.num_crossings;i++)
+			    {
+			    crossing = &(project.crossings[i]);
+
+			    /* loop over all ties for this crossing */
+			    for (j=0;j<crossing->num_ties;j++)
+		    		{
+				tie = &(crossing->ties[j]);
+
+				/* handle first snav point */
+				file = &project.files[crossing->file_id_1];
+				section = &file->sections[crossing->section_1];
+				if (pick_file == crossing->file_id_1
+					&& pick_section == crossing->section_1
+					&& pick_snav == tie->snav_1)
+					ntieselect++;
+
+				/* handle second snav point */
+				file = &project.files[crossing->file_id_2];
+				section = &file->sections[crossing->section_2];
+				if (pick_file == crossing->file_id_2
+					&& pick_section == crossing->section_2
+					&& pick_snav == tie->snav_2)
+					ntieselect++;
+				}
+			    }
+
+			/* if only one tie go ahead and select it and open it in naverr */
+			if (ntieselect == 1)
+				{
+			    	mbna_crossing_select = pick_crossing;
+			    	mbna_tie_select = pick_tie;
+				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
+				mbna_modelplot_picksection = MBNA_SELECT_NONE;
+				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
+
+				/* bring up naverr window if required */
+				if (mbna_naverr_load == MB_NO)
+				    {
+				    do_naverr_init();
+				    }
+
+				/* else if naverr window is up, load selected crossing */
+				else
+				    {
+				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
+				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
+				    do_update_naverr();
+				    do_update_status();
+				    }
+				}
+
+			/* else if multiple ties */
+			else if (ntieselect > 1)
+				{
+				mbna_modelplot_pickfile = pick_file;
+				mbna_modelplot_picksection = pick_section;
+				mbna_modelplot_picksnav = pick_snav;
+
+				}
+			}
+		}
+
+	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_pick_tieoffsets(int x, int y)
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_tielist";
+	char	*function_name = "mbnavadjust_modelplot_pick_tieoffsets";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -13498,10 +14701,10 @@ mbnavadjust_modelplot_middlepick(int x, int y)
     		&& project.inversion != MBNA_INVERSION_NONE
 		&& project.modelplot == MB_YES)
 		{
-		/* middle pick for sequential plot is either choosing one of multiple available
+		/* middle pick for timeseries plot is either choosing one of multiple available
 			ties from a tied crossing (left button) pick, or if that is not the
 			situation, picking the nearest untied crossing */
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
 			{
 			/* first snav pick had multiple ties - now pick which one to use */
 			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
@@ -13596,7 +14799,7 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 						    pick_section = crossing->section_1;
 						    pick_snav = tie->snav_1;
 						    }
-	    fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
 					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
 					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
@@ -13609,7 +14812,7 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 						    pick_section = crossing->section_1;
 						    pick_snav = tie->snav_1;
 						    }
-	    fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
 					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
 					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
@@ -13622,7 +14825,7 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 						    pick_section = crossing->section_1;
 						    pick_snav = tie->snav_1;
 						    }
-	fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);
+	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 					    }
 					}
 				    }
@@ -13782,78 +14985,145 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 			    }
 			}
 
-		/* middle pick for tie (block) plot is choosing which survey vs survey group (block)
-			to plot by itself */
-		else
+		/* middle pick for perturbation plot is either choosing one of multiple available
+			ties from a tied crossing (left button) pick, or if that is not the
+			situation, picking the nearest untied crossing */
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
 			{
-			rangemin = 10000000;
-
-			/* search by looping over crossings */
-			for (i=0;i<project.num_crossings;i++)
+			/* first snav pick had multiple ties - now pick which one to use */
+			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
 			    {
-			    crossing = &(project.crossings[i]);
+			    rangemin = 10000000;
 
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
+			    for (i=0;i<project.num_crossings;i++)
 				{
-				tie = &(crossing->ties[j]);
+				/* check if this crossing includes the picked snav */
+				crossing = &(project.crossings[i]);
 
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
+				/* check first snav */
+				if (crossing->file_id_1 == mbna_modelplot_pickfile
+					&& crossing->section_1 == mbna_modelplot_picksection)
+				    {
+				    /* loop over the ties */
+				    for (j=0;j<crossing->num_ties;j++)
+					{
+					tie = &(crossing->ties[j]);
+					if (tie->snav_1 == mbna_modelplot_picksnav)
+					    {
+					    file = &project.files[crossing->file_id_2];
+					    section = &file->sections[crossing->section_2];
+					    iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
 
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
+					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_2;
+						    pick_section = crossing->section_2;
+						    pick_snav = tie->snav_2;
+						    }
+	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
+					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_2;
+						    pick_section = crossing->section_2;
+						    pick_snav = tie->snav_2;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
 
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
+					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_2;
+						    pick_section = crossing->section_2;
+						    pick_snav = tie->snav_2;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+					    }
 					}
+				    }
 
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
+				/* check second snav */
+				if (crossing->file_id_2 == mbna_modelplot_pickfile
+					&& crossing->section_2 == mbna_modelplot_picksection)
+				    {
+				    /* loop over the ties */
+				    for (j=0;j<crossing->num_ties;j++)
 					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
+					tie = &(crossing->ties[j]);
+					if (tie->snav_2 == mbna_modelplot_picksnav)
+					    {
+					    file = &project.files[crossing->file_id_1];
+					    section = &file->sections[crossing->section_1];
+					    iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_1;
+						    pick_section = crossing->section_1;
+						    pick_snav = tie->snav_1;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+
+					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_1;
+						    pick_section = crossing->section_1;
+						    pick_snav = tie->snav_1;
+						    }
+	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+
+					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
+					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+					    if (range < rangemin)
+						    {
+						    rangemin = range;
+						    pick_crossing = i;
+						    pick_tie = j;
+						    pick_file = crossing->file_id_1;
+						    pick_section = crossing->section_1;
+						    pick_snav = tie->snav_1;
+						    }
+	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
+					    }
 					}
+				    }
 				}
-			    }
 
-			/* deal with successful pick */
-			if (rangemin < 10000000)
+			    /* deal with successful pick */
+			    if (rangemin < 10000000)
 				{
-				crossing = &(project.crossings[pick_crossing]);
+				/* select tie and open it in naverr */
 				mbna_crossing_select = pick_crossing;
 				mbna_tie_select = pick_tie;
 				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
 				mbna_modelplot_picksection = MBNA_SELECT_NONE;
 				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-				mbna_modelplot_blocksurvey1 = project.files[crossing->file_id_1].block;
-				mbna_modelplot_blocksurvey2 = project.files[crossing->file_id_2].block;
-				mbna_modelplot_tiezoom = MB_NO;
 
 				/* bring up naverr window if required */
 				if (mbna_naverr_load == MB_NO)
@@ -13870,111 +15140,1207 @@ mbnavadjust_modelplot_middlepick(int x, int y)
 				    do_update_status();
 				    }
 				}
-			}
-		}
+			    }
+
+			/* else pick closest untied crossing */
+			else
+			    {
+			    rangemin = 10000000;
+
+			    /* search by looping over crossings */
+			    for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* check only untied crossings */
+				if (crossing->num_ties == 0)
+				    {
+				    file = &project.files[crossing->file_id_1];
+				    section = &file->sections[crossing->section_1];
+
+				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_1;
+					    pick_section = crossing->section_1;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_1;
+					    pick_section = crossing->section_1;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_1;
+					    pick_section = crossing->section_1;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    /* handle second snav point */
+				    file = &project.files[crossing->file_id_2];
+				    section = &file->sections[crossing->section_2];
+
+				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_2;
+					    pick_section = crossing->section_2;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_2;
+					    pick_section = crossing->section_2;
+					    pick_snav = section->num_snav/2;
+					    }
+
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
+				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				    if (range < rangemin)
+					    {
+					    rangemin = range;
+					    pick_crossing = i;
+					    pick_tie = MBNA_SELECT_NONE;
+					    pick_file = crossing->file_id_2;
+					    pick_section = crossing->section_2;
+					    pick_snav = section->num_snav/2;
+					    }
+				    }
+				}
+
+			    /* deal with successful pick */
+			    if (rangemin < 10000000)
+				{
+				mbna_crossing_select = pick_crossing;
+				mbna_tie_select = MBNA_SELECT_NONE;
+				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
+				mbna_modelplot_picksection = MBNA_SELECT_NONE;
+				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
+
+				/* bring up naverr window if required */
+				if (mbna_naverr_load == MB_NO)
+				    {
+				    do_naverr_init();
+				    }
+
+				/* else if naverr window is up, load selected crossing */
+				else
+				    {
+				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
+				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
+				    do_update_naverr();
+				    do_update_status();
+				    }
+				}
+			    }
+			}
+
+		/* middle pick for tie offsets plot is choosing which survey vs survey group (block)
+			to plot by itself */
+		else
+			{
+			rangemin = 10000000;
+
+			/* search by looping over crossings */
+			for (i=0;i<project.num_crossings;i++)
+			    {
+			    crossing = &(project.crossings[i]);
+
+			    /* loop over all ties for this crossing */
+			    for (j=0;j<crossing->num_ties;j++)
+				{
+				tie = &(crossing->ties[j]);
+
+				/* handle first snav point */
+				file = &project.files[crossing->file_id_1];
+				section = &file->sections[crossing->section_1];
+
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
+
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
+				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
+				if (range < rangemin)
+					{
+					rangemin = range;
+					pick_crossing = i;
+					pick_tie = j;
+					pick_file = crossing->file_id_1;
+					pick_section = crossing->section_1;
+					pick_snav = tie->snav_1;
+					}
+				}
+			    }
+
+			/* deal with successful pick */
+			if (rangemin < 10000000)
+				{
+				crossing = &(project.crossings[pick_crossing]);
+				mbna_crossing_select = pick_crossing;
+				mbna_tie_select = pick_tie;
+				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
+				mbna_modelplot_picksection = MBNA_SELECT_NONE;
+				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
+				mbna_modelplot_blocksurvey1 = project.files[crossing->file_id_1].block;
+				mbna_modelplot_blocksurvey2 = project.files[crossing->file_id_2].block;
+				mbna_modelplot_tiezoom = MB_NO;
+
+				/* bring up naverr window if required */
+				if (mbna_naverr_load == MB_NO)
+				    {
+				    do_naverr_init();
+				    }
+
+				/* else if naverr window is up, load selected crossing */
+				else
+				    {
+				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
+				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
+				    do_update_naverr();
+				    do_update_status();
+				    }
+				}
+			}
+		}
+
+	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_clearblock()
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_clearblock";
+	int	status = MB_SUCCESS;
+	struct mbna_crossing *crossing;
+	int	block1, block2;
+	int	i, j;
+/*fprintf(stderr,"Called %s\n",function_name);*/
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		}
+
+	/* only proceed if model plot is active and a crossing is selected */
+    	if (project.open == MB_YES
+		&& project.modelplot == MB_YES
+		&& mbna_current_crossing != MBNA_SELECT_NONE)
+    		{
+		/* delete all ties associated with the same pair of surveys as the currently selected crossing */
+		crossing = &(project.crossings[mbna_current_crossing]);
+		block1 = project.files[crossing->file_id_1].block;
+		block2 = project.files[crossing->file_id_2].block;
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+		    if (crossing->num_ties > 0
+		    	&& ((project.files[crossing->file_id_1].block == block1
+		    		&& project.files[crossing->file_id_2].block == block2)
+			    || (project.files[crossing->file_id_1].block == block2
+		    		&& project.files[crossing->file_id_2].block == block1)))
+			{
+			for (j=crossing->num_ties-1;j>=0;j--)
+			    {
+			    mbnavadjust_deletetie(i, j, MBNA_CROSSING_STATUS_NONE);
+			    }
+			}
+		    }
+		}
+
+ 	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_plot()
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_plot";
+	int	status = MB_SUCCESS;
+/*fprintf(stderr,"Called %s\n",function_name);*/
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		}
+
+	/* plot model if an inversion has been performed */
+    	if (project.open == MB_YES
+    		&& project.inversion != MBNA_INVERSION_NONE
+		&& project.modelplot == MB_YES)
+    		{
+		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
+			{
+			mbnavadjust_modelplot_plot_timeseries();
+			}
+		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
+			{
+			mbnavadjust_modelplot_plot_perturbation();
+			}
+		else
+			{
+			mbnavadjust_modelplot_plot_tieoffsets();
+			}
+		}
+
+ 	/* print output debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
+			function_name);
+		fprintf(stderr,"dbg2  Return values:\n");
+		fprintf(stderr,"dbg2       error:       %d\n",error);
+		fprintf(stderr,"dbg2  Return status:\n");
+		fprintf(stderr,"dbg2       status:      %d\n",status);
+		}
+
+	return(status);
+}
+/*--------------------------------------------------------------------*/
+
+int
+mbnavadjust_modelplot_plot_timeseries()
+{
+	/* local variables */
+	char	*function_name = "mbnavadjust_modelplot_plot_timeseries";
+	int	status = MB_SUCCESS;
+	struct mbna_file *file;
+	struct mbna_section *section;
+	struct mbna_crossing *crossing;
+	struct mbna_tie *tie;
+	double	lon_offset_min;
+	double	lon_offset_max;
+	double	lat_offset_min;
+	double	lat_offset_max;
+	double	z_offset_min;
+	double	z_offset_max;
+	double	xymax, yzmax;
+	int	plot_width;
+	int	plot_height;
+	int	first, iping;
+	char	label[STRING_MAX];
+	int	stringwidth, stringascent, stringdescent;
+	int	pixel;
+	int	ixo, iyo, ix, iy;
+	int	i, j, isnav;
+	int	imodelplot_start, imodelplot_end;
+//fprintf(stderr,"Called %s\n",function_name);
+
+ 	/* print input debug statements */
+	if (mbna_verbose >= 2)
+		{
+		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
+			function_name);
+		}
+
+	/* plot model if an inversion has been performed */
+    	if (project.open == MB_YES
+    		&& project.inversion != MBNA_INVERSION_NONE
+		&& project.modelplot == MB_YES)
+    		{
+		/* first loop over files setting all plot flags off for both files and sections */
+		first = MB_YES;
+		mbna_modelplot_count = 0;
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			file->show_in_modelplot = MB_NO;
+			for (j=0;j<file->num_sections;j++)
+				{
+				section = &file->sections[j];
+				section->show_in_modelplot = MB_NO;
+				}
+			}
+
+		/* now loop over files setting file or section plot flags on as necessary */
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+
+			/* check if this file will be plotted */
+			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
+				{
+				if (file->block == mbna_survey_select)
+					{
+					file->show_in_modelplot = MB_YES;
+					}
+				}
+
+			/* check if this file will be plotted */
+			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
+				{
+				if (i == mbna_file_select)
+					{
+					file->show_in_modelplot = MB_YES;
+					}
+				}
+
+			/* check if each section in this file will be plotted */
+			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
+				{
+				for (j=0;j<file->num_sections;j++)
+					{
+					section = &file->sections[j];
+					if (i == mbna_file_select && j == mbna_section_select)
+						{
+						section->show_in_modelplot = MB_YES;
+						}
+					}
+				}
+
+			/* else every file will be plotted */
+			else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
+				{
+				file->show_in_modelplot = MB_YES;
+				}
+			}
+
+		/* if view mode is with survey loop over all crossings */
+		if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* if either file is part of the selected survey
+					then set plot flags on for both files */
+				if (project.files[crossing->file_id_1].block == mbna_survey_select
+				    || project.files[crossing->file_id_2].block == mbna_survey_select)
+					{
+					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
+					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+		/* else if view mode is with file loop over all crossings */
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* if either file is selected
+					then set plot flags on for both files */
+				if (crossing->file_id_1 == mbna_file_select || crossing->file_id_2 == mbna_file_select)
+					{
+					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
+					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+		/* else if view mode is with section loop over all crossings */
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				crossing = &(project.crossings[i]);
+
+				/* if either section is selected
+					then set plot flags on for both files */
+				if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
+				    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
+					{
+					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
+					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+		/* finally loop over files again setting all section plot flags on for files with plot flags on */
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			if (file->show_in_modelplot == MB_YES)
+				{
+				for (j=0;j<file->num_sections;j++)
+					{
+					section = &file->sections[j];
+					section->show_in_modelplot = MB_YES;
+					}
+				}
+			}
+
+
+		/* get min maxes by looping over files and sections checking for sections to be plotted */
+		first = MB_YES;
+		mbna_modelplot_count = 0;
+ 		for (i=0;i<project.num_files;i++)
+			{
+			file = &project.files[i];
+			for (j=0;j<file->num_sections;j++)
+				{
+				section = &file->sections[j];
+
+				/* if this section will be plotted use the snav values */
+				if (section->show_in_modelplot == MB_YES)
+					{
+					section->modelplot_start_count = mbna_modelplot_count;
+					for (isnav=0;isnav<section->num_snav;isnav++)
+						{
+						if (mbna_modelplot_zoom == MB_NO
+						    || (mbna_modelplot_count >= mbna_modelplot_startzoom && mbna_modelplot_count <= mbna_modelplot_endzoom))
+						    {
+							if (first == MB_YES)
+								{
+								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon;
+								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon;
+								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat;
+								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat;
+								z_offset_min = section->snav_z_offset[isnav];
+								z_offset_max = section->snav_z_offset[isnav];
+								first = MB_NO;
+								}
+							else
+								{
+								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon);
+								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon);
+								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat);
+								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat);
+								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav]);
+								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav]);
+								}
+							}
+						}
+					mbna_modelplot_count += section->snav_id[section->num_snav-1];
+					}
+				}
+			}
+
+		/* set plot bounds */
+		if (mbna_modelplot_zoom == MB_YES)
+			{
+			mbna_modelplot_start = mbna_modelplot_startzoom;
+			mbna_modelplot_end = mbna_modelplot_endzoom;
+			}
+		else
+			{
+			mbna_modelplot_start = 0;
+			mbna_modelplot_end = mbna_modelplot_count - 1;
+			}
+
+		/* get scaling */
+		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
+		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
+		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
+		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
+		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
+		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
+		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
+		xymax = MAX(fabs(lat_offset_min),xymax);
+		xymax = MAX(fabs(lat_offset_max),xymax);
+		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
+		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
+		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
+		yzmax = MAX(yzmax,0.5);
+		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
+
+		/* clear screens for first plot */
+		xg_fillrectangle(pmodp_xgid, 0, 0,
+				modp_borders[1], modp_borders[3],
+				pixel_values[mbna_color_background], XG_SOLIDLINE);
+
+		/* plot the bounds */
+		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
+
+		/* plot title */
+		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
+			{
+			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
+			{
+			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
+			{
+			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
+			{
+			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
+			{
+			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
+				mbna_survey_select, mbna_file_select, mbna_section_select);
+			}
+		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
+			{
+			sprintf(label, "Display All Data");
+			}
+
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		/* plot labels */
+		sprintf(label, "East-West Offset (meters) vs. Ping Count");
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_start);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth / 2;
+		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_end);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
+		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 0.0);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lon + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", -1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+
+		sprintf(label, "North-South Offset (meters) vs. Ping Count");
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_start);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth / 2;
+		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_end);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
+		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 0.0);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lat + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", -1.1 * xymax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+
+		sprintf(label, "Vertical Offset (meters) vs. Ping Count");
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
+		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_start);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth / 2;
+		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%d", mbna_modelplot_end);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
+		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 1.1 * yzmax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", 0.0);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_z + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		sprintf(label,"%.2f", -1.1 * yzmax);
+		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
+		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
+		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
+		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+
+		/* set clipping */
+		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
+
+		/* loop over all crossings and plot and plot those without ties in green */
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+		    if (crossing->num_ties== 0)
+		    	{
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
+				}
+			}
+		    }
+
+		/* Now plot the east-west offsets */
+		ixo = 0;
+		iyo = 0;
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[isnav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[isnav] / mbna_mtodeglon);
+				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
+				    else if (i > 0 || j > 0)
+					{
+					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
+						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
+					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    ixo = ix;
+				    iyo = iy;
+				    }
+				}
+			}
+		    }
+
+		/* Now plot the north-south offsets */
+		ixo = 0;
+		iyo = 0;
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[isnav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[isnav] / mbna_mtodeglat);
+				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
+				    else if (i > 0 || j > 0)
+					{
+					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
+						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
+					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    ixo = ix;
+				    iyo = iy;
+				    }
+				}
+			}
+		    }
+
+		/* Now plot the vertical offsets */
+		ixo = 0;
+		iyo = 0;
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[isnav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[isnav]);
+				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
+				    else if (i > 0 || j > 0)
+					{
+					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
+						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
+					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    ixo = ix;
+				    iyo = iy;
+				    }
+				}
+			}
+		    }
+
+		/* loop over all crossings and plot ties */
+		for (i=0;i<project.num_crossings;i++)
+		    {
+		    crossing = &(project.crossings[i]);
+		    for (j=0;j<crossing->num_ties;j++)
+		    	{
+			tie = &(crossing->ties[j]);
+
+			if (tie->inversion_status == MBNA_INVERSION_CURRENT)
+				pixel = pixel_values[mbna_color_foreground];
+			else
+				pixel = pixel_values[BLUE];
+
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
+				}
+			}
+		    }
+
+		/* Loop over all files plotting global ties */
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    
+				    if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					/* east-west offsets */
+					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon);
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					
+					/* north-south offsets */
+					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat);
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    
+				    if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					/* vertical offsets */
+					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->global_tie_snav]);
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    }
+				}
+			}
+		    }
+
+		/* plot current tie in red */
+		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
+			{
+			crossing = &(project.crossings[mbna_current_crossing]);
+			tie = &(crossing->ties[mbna_current_tie]);
+
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+			}
+
+		/* or if tie not selected then plot current crossing in red */
+		else if (mbna_current_crossing != MBNA_SELECT_NONE)
+			{
+			crossing = &(project.crossings[mbna_current_crossing]);
+
+			file = &project.files[crossing->file_id_1];
+			section = &file->sections[crossing->section_1];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+
+			file = &project.files[crossing->file_id_2];
+			section = &file->sections[crossing->section_2];
+			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
+
+			if (section->show_in_modelplot == MB_YES
+			    && (mbna_modelplot_zoom == MB_NO
+				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+				{
+				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
+				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+				}
+			}
+
+		/* if a modelplot pick did not resolve a single tie, plot the options for a second pick */
+		if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
+			{
+			for (i=0;i<project.num_crossings;i++)
+				{
+				/* check if this crossing includes the picked snav */
+				crossing = &(project.crossings[i]);
+
+				/* check first snav */
+				if (crossing->file_id_1 == mbna_modelplot_pickfile
+					&& crossing->section_1 == mbna_modelplot_picksection)
+					{
+					/* loop over the ties */
+					for (j=0;j<crossing->num_ties;j++)
+						{
+						tie = &(crossing->ties[j]);
+						if (crossing->file_id_1 == mbna_modelplot_pickfile
+						    && crossing->section_1 == mbna_modelplot_picksection
+						    && tie->snav_1 == mbna_modelplot_picksnav)
+							{
+							file = &project.files[crossing->file_id_1];
+							section = &file->sections[crossing->section_1];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
 
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
+							file = &project.files[crossing->file_id_2];
+							section = &file->sections[crossing->section_2];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
 
-	return(status);
-}
-/*--------------------------------------------------------------------*/
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
+							}
+						}
+					}
 
-int
-mbnavadjust_modelplot_clearblock()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_clearblock";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	int	block1, block2;
-	int	i, j;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+				/* check second snav */
+				if (crossing->file_id_2 == mbna_modelplot_pickfile
+					&& crossing->section_2 == mbna_modelplot_picksection)
+					{
+					/* loop over the ties */
+					for (j=0;j<crossing->num_ties;j++)
+						{
+						tie = &(crossing->ties[j]);
+						if (crossing->file_id_2 == mbna_modelplot_pickfile
+						    && crossing->section_2 == mbna_modelplot_picksection
+						    && tie->snav_2 == mbna_modelplot_picksnav)
+							{
+							file = &project.files[crossing->file_id_2];
+							section = &file->sections[crossing->section_2];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
 
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
 
-	/* only proceed if model plot is active and a crossing is selected */
-    	if (project.open == MB_YES
-		&& project.modelplot == MB_YES
-		&& mbna_current_crossing != MBNA_SELECT_NONE)
-    		{
-		/* delete all ties associated with the same pair of surveys as the currently selected crossing */
-		crossing = &(project.crossings[mbna_current_crossing]);
-		block1 = project.files[crossing->file_id_1].block;
-		block2 = project.files[crossing->file_id_2].block;
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties > 0
-		    	&& ((project.files[crossing->file_id_1].block == block1
-		    		&& project.files[crossing->file_id_2].block == block2)
-			    || (project.files[crossing->file_id_1].block == block2
-		    		&& project.files[crossing->file_id_2].block == block1)))
-			{
-			for (j=crossing->num_ties-1;j>=0;j--)
-			    {
-			    mbnavadjust_deletetie(i, j, MBNA_CROSSING_STATUS_NONE);
-			    }
+							file = &project.files[crossing->file_id_1];
+							section = &file->sections[crossing->section_1];
+							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
+
+							if (section->show_in_modelplot == MB_YES
+							    && (mbna_modelplot_zoom == MB_NO
+								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
+								{
+								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
+								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+								}
+							}
+						}
+					}
+				}
 			}
-		    }
-		}
 
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
+		/* plot zoom if active */
+		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
+			{
+			imodelplot_start = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
+			imodelplot_start = MIN(MAX(imodelplot_start, 0), project.num_pings - 1);
+			imodelplot_end = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
+			imodelplot_end = MIN(MAX(imodelplot_end, 0), project.num_pings - 1);
 
-	return(status);
-}
-/*--------------------------------------------------------------------*/
+			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_start - mbna_modelplot_start));
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
 
-int
-mbnavadjust_modelplot_plot()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot";
-	int	status = MB_SUCCESS;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_end - mbna_modelplot_start));
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
+			}
 
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
+		/* reset clipping */
+		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
 
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		if (project.modelplot_style == MBNA_MODELPLOT_SEQUENTIAL)
-			{
-			mbnavadjust_modelplot_plot_sequential();
-			}
-		else
-			{
-			mbnavadjust_modelplot_plot_tielist();
-			}
 		}
 
  	/* print output debug statements */
@@ -13990,13 +16356,14 @@ mbnavadjust_modelplot_plot()
 
 	return(status);
 }
+
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_plot_sequential()
+mbnavadjust_modelplot_plot_perturbation()
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_sequential";
+	char	*function_name = "mbnavadjust_modelplot_plot_perturbation";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -14018,7 +16385,7 @@ mbnavadjust_modelplot_plot_sequential()
 	int	ixo, iyo, ix, iy;
 	int	i, j, isnav;
 	int	imodelplot_start, imodelplot_end;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+//fprintf(stderr,"Called %s\n",function_name);
 
  	/* print input debug statements */
 	if (mbna_verbose >= 2)
@@ -14178,22 +16545,22 @@ mbnavadjust_modelplot_plot_sequential()
 						    {
 							if (first == MB_YES)
 								{
-								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								z_offset_min = section->snav_z_offset[isnav];
-								z_offset_max = section->snav_z_offset[isnav];
+								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
+								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
+								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
+								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
+								z_offset_min = section->snav_z_offset[isnav] - file->block_offset_z;
+								z_offset_max = section->snav_z_offset[isnav] - file->block_offset_z;
 								first = MB_NO;
 								}
 							else
 								{
-								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav]);
-								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav]);
+								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
+								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
+								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
+								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
+								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav] - file->block_offset_z);
+								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav] - file->block_offset_z);
 								}
 							}
 						}
@@ -14404,11 +16771,11 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
 				}
 
@@ -14421,11 +16788,11 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
 				}
 			}
@@ -14446,7 +16813,7 @@ mbnavadjust_modelplot_plot_sequential()
 				    {
 				    iping = section->modelplot_start_count + section->snav_id[isnav];
 				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[isnav] / mbna_mtodeglon);
+				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x));
 				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
 					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
 				    else if (i > 0 || j > 0)
@@ -14477,7 +16844,7 @@ mbnavadjust_modelplot_plot_sequential()
 				    {
 				    iping = section->modelplot_start_count + section->snav_id[isnav];
 				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[isnav] / mbna_mtodeglat);
+				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y));
 				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
 					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
 				    else if (i > 0 || j > 0)
@@ -14508,7 +16875,7 @@ mbnavadjust_modelplot_plot_sequential()
 				    {
 				    iping = section->modelplot_start_count + section->snav_id[isnav];
 				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[isnav]);
+				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[isnav] - file->block_offset_z));
 				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
 					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
 				    else if (i > 0 || j > 0)
@@ -14546,11 +16913,11 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
 				}
 
@@ -14563,16 +16930,58 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
 				}
 			}
 		    }
 
+		/* Loop over all files plotting global ties */
+ 		for (i=0;i<project.num_files;i++)
+		    {
+		    file = &project.files[i];
+		    for (j=0;j<file->num_sections;j++)
+			{
+			section = &file->sections[j];
+			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
+				{
+				for (isnav=0;isnav<section->num_snav;isnav++)
+				    {
+				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
+				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
+				    
+				    if (section->global_tie_status != MBNA_TIE_Z)
+					{
+					/* east-west offsets */
+					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon - file->block_offset_x));
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					
+					/* north-south offsets */
+					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat - file->block_offset_y));
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    
+				    if (section->global_tie_status != MBNA_TIE_XY)
+					{
+					/* vertical offsets */
+					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->global_tie_snav] - file->block_offset_z));
+					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
+					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
+					}
+				    }
+				}
+			}
+		    }
+
 		/* plot current tie in red */
 		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
 			{
@@ -14588,13 +16997,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14608,13 +17017,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14634,13 +17043,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14654,13 +17063,13 @@ mbnavadjust_modelplot_plot_sequential()
 				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 				{
 				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
+				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
+				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
+				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
 				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
 				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 				}
@@ -14695,13 +17104,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14715,13 +17124,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14750,13 +17159,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14770,13 +17179,13 @@ mbnavadjust_modelplot_plot_sequential()
 								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
 								{
 								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
+								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
+								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
+								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
 								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
 								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
 								}
@@ -14827,10 +17236,10 @@ mbnavadjust_modelplot_plot_sequential()
 /*--------------------------------------------------------------------*/
 
 int
-mbnavadjust_modelplot_plot_tielist()
+mbnavadjust_modelplot_plot_tieoffsets()
 {
 	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_tielist";
+	char	*function_name = "mbnavadjust_modelplot_plot_tieoffsets";
 	int	status = MB_SUCCESS;
 	struct mbna_file *file;
 	struct mbna_section *section;
@@ -14858,7 +17267,7 @@ mbnavadjust_modelplot_plot_tielist()
 	int	plot_index;
 	int	isurvey1, isurvey2;
 	int	i, j;
-/*fprintf(stderr,"Called %s\n",function_name);*/
+//fprintf(stderr,"Called %s\n",function_name);
 
  	/* print input debug statements */
 	if (mbna_verbose >= 2)
diff --git a/src/mbnavadjust/mbnavadjustmerge.c b/src/mbnavadjust/mbnavadjustmerge.c
index de7c51a..4d0c2c8 100644
--- a/src/mbnavadjust/mbnavadjustmerge.c
+++ b/src/mbnavadjust/mbnavadjustmerge.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavadjustmerge.c	4/14/2014
- *    $Id: mbnavadjustmerge.c 2209 2014-11-04 08:54:21Z caress $
+ *    $Id: mbnavadjustmerge.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -24,7 +24,7 @@
  */
 
 /* source file version string */
-static char version_id[] = "$Id: mbnavadjustmerge.c 2209 2014-11-04 08:54:21Z caress $";
+static char version_id[] = "$Id: mbnavadjustmerge.c 2239 2015-05-07 00:51:42Z caress $";
 
 /* standard include files */
 #include <stdio.h>
@@ -51,22 +51,29 @@ static char version_id[] = "$Id: mbnavadjustmerge.c 2209 2014-11-04 08:54:21Z ca
 #define MBNAVADJUSTMERGE_MODE_MODIFY 	4
 #define NUMBER_MODS_MAX			1000
 #define MOD_MODE_NONE 			0
-#define MOD_MODE_ADD_CROSSING 		1
-#define MOD_MODE_SET_TIE 		2
-#define MOD_MODE_SET_TIE_XYZ		3
-#define MOD_MODE_SET_TIE_XY		4
-#define MOD_MODE_SET_TIE_Z		5
-#define MOD_MODE_SET_TIES_XYZ_FILE	6
-#define MOD_MODE_SET_TIES_XY_FILE	7
-#define MOD_MODE_SET_TIES_Z_FILE	8
-#define MOD_MODE_SET_TIES_XYZ_SURVEY	9
-#define MOD_MODE_SET_TIES_XY_SURVEY	10
-#define MOD_MODE_SET_TIES_Z_SURVEY	11
-#define MOD_MODE_SET_TIES_XYZ_BLOCK	12
-#define MOD_MODE_SET_TIES_XY_BLOCK	13
-#define MOD_MODE_SET_TIES_Z_BLOCK	14
-#define MOD_MODE_SET_TIES_ZOFFSET_BLOCK	15
-#define MOD_MODE_SKIP_UNSET_CROSSINGS	16
+#define MOD_MODE_SET_GLOBAL_TIE 	1
+#define MOD_MODE_SET_GLOBAL_TIE_XYZ	2
+#define MOD_MODE_SET_GLOBAL_TIE_XY	3
+#define MOD_MODE_SET_GLOBAL_TIE_Z	4
+#define MOD_MODE_UNSET_GLOBAL_TIE	5
+#define MOD_MODE_ADD_CROSSING 		6
+#define MOD_MODE_SET_TIE 		7
+#define MOD_MODE_SET_TIE_XYZ		8
+#define MOD_MODE_SET_TIE_XY		9
+#define MOD_MODE_SET_TIE_Z		10
+#define MOD_MODE_UNSET_TIE		11
+#define MOD_MODE_SET_TIES_XYZ_FILE	12
+#define MOD_MODE_SET_TIES_XY_FILE	13
+#define MOD_MODE_SET_TIES_Z_FILE	14
+#define MOD_MODE_SET_TIES_XYZ_SURVEY	15
+#define MOD_MODE_SET_TIES_XY_SURVEY	16
+#define MOD_MODE_SET_TIES_Z_SURVEY	17
+#define MOD_MODE_SET_TIES_XYZ_BLOCK	18
+#define MOD_MODE_SET_TIES_XY_BLOCK	19
+#define MOD_MODE_SET_TIES_Z_BLOCK	20
+#define MOD_MODE_SET_TIES_ZOFFSET_BLOCK	21
+#define MOD_MODE_SKIP_UNSET_CROSSINGS	22
+#define MOD_MODE_INSERT_DISCONTINUITY   23
 
 struct mbnavadjust_mod
 	{
@@ -74,12 +81,17 @@ struct mbnavadjust_mod
 	int	survey1;
 	int	file1;
 	int	section1;
+	int	snav1;
 	int	survey2;
 	int	file2;
 	int	section2;
+	int	snav2;
 	double	xoffset;
 	double	yoffset;
 	double	zoffset;
+	double	xsigma;
+	double	ysigma;
+	double	zsigma;
 	};
 
 /*--------------------------------------------------------------------*/
@@ -88,13 +100,21 @@ int main (int argc, char **argv)
 {
 	char program_name[] = "mbnavadjustmerge";
 	char help_message[] =  "mbnavadjustmerge merges two existing mbnavadjust projects.\n";
-	char usage_message[] = "mbnavadjustmerge --verbose --help\n"
-				"\t--input=project_path [--input=project_path --output=project_path\n"
+	char usage_message[] = "mbnavadjustmerge --input=project_path \n"
+				"\t[--input=project_path --output=project_path\n"
+				"\t--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]\n"
+				"\t--set-global-tie-xyz=file:section[:snav]\n"
+				"\t--set-global-tie-xyonly=file:section[:snav]\n"
+				"\t--set-global-tie-zonly=file:section[:snav]\n"
+				"\t--unset-global-tie=file:section\n"
 				"\t--add-crossing=file1:section1/file2:section2\n"
+				"\t--set-tie=file1/file2/xoffset/yoffset/zoffset\n"
 				"\t--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset\n"
+				"\t--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset/xsigma/ysigma/zsigma\n"
 				"\t--set-tie-xyz=file1:section1/file2:section2\n"
 				"\t--set-tie-xyonly=file1:section1/file2:section2\n"
 				"\t--set-tie-zonly=file1:section1/file2:section2\n"
+				"\t--unset-tie=file1:section1/file2:section2\n"
 				"\t--set-ties-xyz-with-file=file\n"
 				"\t--set-ties-xyonly-with-file=file\n"
 				"\t--set-ties-zonly-with-file=file\n"
@@ -105,7 +125,9 @@ int main (int argc, char **argv)
 				"\t--set-ties-xyonly-by-block=survey1/survey2\n"
 				"\t--set-ties-zonly-by-block=survey1/survey2\n"
 				"\t--set-ties-zoffset-by-block=survey1/survey2/zoffset\n"
-				"\t--skip-unset-crossings ]\n";
+				"\t--skip-unset-crossings\n"
+				"\t--insert-discontinuity=file:section\n"
+				"\t--verbose --help]\n";
 	extern char *optarg;
 	int	option_index;
 	int	errflg = 0;
@@ -129,11 +151,17 @@ int main (int argc, char **argv)
 		{"help",			no_argument, 		NULL, 		0},
 		{"input",			required_argument, 	NULL, 		0},
 		{"output",			required_argument, 	NULL, 		0},
+		{"set-global-tie",		required_argument, 	NULL, 		0},
+		{"set-global-tie-xyz",		required_argument, 	NULL, 		0},
+		{"set-global-tie-xyonly",	required_argument, 	NULL, 		0},
+		{"set-global-tie-zonly",	required_argument, 	NULL, 		0},
+		{"unset-global-tie",		required_argument, 	NULL, 		0},
 		{"add-crossing",		required_argument, 	NULL, 		0},
 		{"set-tie",			required_argument, 	NULL, 		0},
 		{"set-tie-xyz",			required_argument, 	NULL, 		0},
 		{"set-tie-xyonly",		required_argument, 	NULL, 		0},
 		{"set-tie-zonly",		required_argument, 	NULL, 		0},
+		{"unset-tie",			required_argument, 	NULL, 		0},
 		{"set-ties-xyz-with-file",	required_argument, 	NULL, 		0},
 		{"set-ties-xyonly-with-file",	required_argument, 	NULL, 		0},
 		{"set-ties-zonly-with-file",	required_argument, 	NULL, 		0},
@@ -145,6 +173,7 @@ int main (int argc, char **argv)
 		{"set-ties-zonly-by-block",	required_argument, 	NULL, 		0},
 		{"set-ties-zoffset-by-block",	required_argument, 	NULL, 		0},
 		{"skip-unset-crossings",	no_argument, 		NULL, 		0},
+		{"insert-discontinuity",	required_argument, 	NULL, 		0},
 		{NULL,				0, 			NULL, 		0}
 		};
 		
@@ -182,6 +211,7 @@ int main (int argc, char **argv)
 	memset(project_inputbase_path, 0, sizeof(mb_path));
 	memset(project_inputadd_path, 0, sizeof(mb_path));
 	memset(project_output_path, 0, sizeof(mb_path));
+	memset(mods, 0, NUMBER_MODS_MAX * sizeof(struct mbnavadjust_mod));
 
 	/* process argument list */
 	while ((c = getopt_long(argc, argv, "", options, &option_index)) != -1)
@@ -240,6 +270,211 @@ int main (int argc, char **argv)
 				}
 				
 			/*-------------------------------------------------------
+			 * set global tie 
+				--set-global-tie=file:section:snav/xoffset/yoffset/zoffset/xsigma/ysigma/zsigma
+				--set-global-tie=file:section/xoffset/yoffset/zoffset/xsigma/ysigma/zsigma
+				--set-global-tie=file:section:snav/xoffset/yoffset/zoffset 
+				--set-global-tie=file:section/xoffset/yoffset/zoffset */
+			else if (strcmp("set-global-tie", options[option_index].name) == 0)
+				{
+				if (num_mods < NUMBER_MODS_MAX)
+					{
+					if ((nscan = sscanf(optarg, "%d:%d:%d/%lf/%lf/%lf/%lf/%lf/%lf",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].snav1,
+						       &mods[num_mods].xoffset,
+						       &mods[num_mods].yoffset,
+						       &mods[num_mods].zoffset,
+						       &mods[num_mods].xsigma,
+						       &mods[num_mods].ysigma,
+						       &mods[num_mods].zsigma)) == 9)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
+						num_mods++;
+						}
+					else if ((nscan = sscanf(optarg, "%d:%d/%lf/%lf/%lf/%lf/%lf/%lf",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].xoffset,
+						       &mods[num_mods].yoffset,
+						       &mods[num_mods].zoffset,
+						       &mods[num_mods].xsigma,
+						       &mods[num_mods].ysigma,
+						       &mods[num_mods].zsigma)) == 8)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
+						mods[num_mods].snav1 = 0;
+						num_mods++;
+						}
+					else if ((nscan = sscanf(optarg, "%d:%d:%d/%lf/%lf/%lf",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].snav1,
+						       &mods[num_mods].xoffset,
+						       &mods[num_mods].yoffset,
+						       &mods[num_mods].zoffset)) == 6)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
+						mods[num_mods].xsigma = 10.0;
+						mods[num_mods].ysigma = 10.0;
+						mods[num_mods].zsigma = 0.5;
+						num_mods++;
+						}
+					else if ((nscan = sscanf(optarg, "%d:%d/%lf/%lf/%lf",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].xoffset,
+						       &mods[num_mods].yoffset,
+						       &mods[num_mods].zoffset)) == 5)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
+						mods[num_mods].snav1 = 0;
+						mods[num_mods].xsigma = 10.0;
+						mods[num_mods].ysigma = 10.0;
+						mods[num_mods].zsigma = 0.5;
+						num_mods++;
+						}
+					else
+						{
+						fprintf(stderr,"Failure to parse --set-global-tie=%s\n\tmod command ignored\n\n",
+							optarg);	
+						}
+					}
+				else
+					{
+					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
+							optarg);	
+					}
+				}
+				
+			/*-------------------------------------------------------
+			 * set global tie mode
+				--set-global-tie-xyz=file:section:snav
+				--set-global-tie-xyonly=file:section:snav
+				--set-global-tie-zonly=file:section:snav  
+				--unset-global-tie=file:section  */
+			else if (strcmp("set-global-tie-xyz", options[option_index].name) == 0)
+				{
+				if (num_mods < NUMBER_MODS_MAX)
+					{
+					if ((nscan = sscanf(optarg, "%d:%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].snav1)) == 3)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XYZ;
+						num_mods++;
+						}
+					else if ((nscan = sscanf(optarg, "%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1)) == 2)
+						{
+						mods[num_mods].snav1 = 0;
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XYZ;
+						num_mods++;
+						}
+					else
+						{
+						fprintf(stderr,"Failure to parse --set-global-tie-xyz=%s\n\tmod command ignored\n\n",
+							optarg);	
+						}
+					}
+				else
+					{
+					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
+							optarg);	
+					}
+				}
+			else if (strcmp("set-global-tie-xyonly", options[option_index].name) == 0)
+				{
+				if (num_mods < NUMBER_MODS_MAX)
+					{
+					if ((nscan = sscanf(optarg, "%d:%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].snav1)) == 3)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XY;
+						num_mods++;
+						}
+					else if ((nscan = sscanf(optarg, "%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1)) == 2)
+						{
+						mods[num_mods].snav1 = 0;
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XY;
+						num_mods++;
+						}
+					else
+						{
+						fprintf(stderr,"Failure to parse --set-global-tie-xy=%s\n\tmod command ignored\n\n",
+							optarg);	
+						}
+					}
+				else
+					{
+					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
+							optarg);	
+					}
+				}
+			else if (strcmp("set-global-tie-zonly", options[option_index].name) == 0)
+				{
+				if (num_mods < NUMBER_MODS_MAX)
+					{
+					if ((nscan = sscanf(optarg, "%d:%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].snav1)) == 3)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_Z;
+						num_mods++;
+						}
+					else if ((nscan = sscanf(optarg, "%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1)) == 2)
+						{
+						mods[num_mods].snav1 = 0;
+						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_Z;
+						num_mods++;
+						}
+					else
+						{
+						fprintf(stderr,"Failure to parse --set-global-tie-z=%s\n\tmod command ignored\n\n",
+							optarg);	
+						}
+					}
+				else
+					{
+					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
+							optarg);	
+					}
+				}
+			else if (strcmp("unset-global-tie", options[option_index].name) == 0)
+				{
+				if (num_mods < NUMBER_MODS_MAX)
+					{
+					if ((nscan = sscanf(optarg, "%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1)) == 2)
+						{
+						mods[num_mods].mode = MOD_MODE_UNSET_GLOBAL_TIE;
+						num_mods++;
+						}
+					else
+						{
+						fprintf(stderr,"Failure to parse --set-global-tie-z=%s\n\tmod command ignored\n\n",
+							optarg);	
+						}
+					}
+				else
+					{
+					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
+							optarg);	
+					}
+				}
+				
+			/*-------------------------------------------------------
 			 * add crossing 
 				--add-crossing=file1:section1/file2:section2 */
 			else if (strcmp("add-crossing", options[option_index].name) == 0)
@@ -279,14 +514,27 @@ int main (int argc, char **argv)
 			
 			/*-------------------------------------------------------
 			 * set tie offset values - add tie if needed
-				--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset
-					(xoffset, yoffset, or zoffset can be left unchanged
-					by putting */
+				--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset */
 			else if (strcmp("set-tie", options[option_index].name) == 0)
 				{
 				if (num_mods < NUMBER_MODS_MAX)
 					{
-					if ((nscan = sscanf(optarg, "%d:%d/%d:%d/%lf/%lf/%lf",
+					if ((nscan = sscanf(optarg, "%d:%d/%d:%d/%lf/%lf/%lf/%lf/%lf/%lf",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].file2,
+						       &mods[num_mods].section2,
+						       &mods[num_mods].xoffset,
+						       &mods[num_mods].yoffset,
+						       &mods[num_mods].zoffset,
+						       &mods[num_mods].xsigma,
+						       &mods[num_mods].ysigma,
+						       &mods[num_mods].zsigma)) == 10)
+						{
+						mods[num_mods].mode = MOD_MODE_SET_TIE;
+						num_mods++;
+						}
+					else if ((nscan = sscanf(optarg, "%d:%d/%d:%d/%lf/%lf/%lf",
 						       &mods[num_mods].file1,
 						       &mods[num_mods].section1,
 						       &mods[num_mods].file2,
@@ -295,6 +543,9 @@ int main (int argc, char **argv)
 						       &mods[num_mods].yoffset,
 						       &mods[num_mods].zoffset)) == 7)
 						{
+						mods[num_mods].xsigma = 10.0;
+						mods[num_mods].ysigma = 10.0;
+						mods[num_mods].zsigma = 1.0;
 						mods[num_mods].mode = MOD_MODE_SET_TIE;
 						num_mods++;
 						}
@@ -307,6 +558,9 @@ int main (int argc, char **argv)
 						{
 						mods[num_mods].section1 = 0;
 						mods[num_mods].section2 = 0;
+						mods[num_mods].xsigma = 10.0;
+						mods[num_mods].ysigma = 10.0;
+						mods[num_mods].zsigma = 1.0;
 						mods[num_mods].mode = MOD_MODE_SET_TIE;
 						num_mods++;
 						}
@@ -430,6 +684,31 @@ int main (int argc, char **argv)
 							optarg);	
 					}
 				}
+			else if (strcmp("unset-tie", options[option_index].name) == 0)
+				{
+				if (num_mods < NUMBER_MODS_MAX)
+					{
+					if ((nscan = sscanf(optarg, "%d:%d/%d:%d",
+						       &mods[num_mods].file1,
+						       &mods[num_mods].section1,
+						       &mods[num_mods].file2,
+						       &mods[num_mods].section2)) == 4)
+						{
+						mods[num_mods].mode = MOD_MODE_UNSET_TIE;
+						num_mods++;
+						}
+					else
+						{
+						fprintf(stderr,"Failure to parse --set-tie-z=%s\n\tmod command ignored\n\n",
+							optarg);	
+						}
+					}
+				else
+					{
+					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-tie-z=%s command ignored\n\n",
+							optarg);	
+					}
+				}
 			
 			/*-------------------------------------------------------
 			 * set mode of all ties with a file
@@ -688,6 +967,26 @@ int main (int argc, char **argv)
 					fprintf(stderr,"Maximum number of mod commands reached:\n\tskip-unset-crossings command ignored\n\n");	
 					}
 				}
+				
+			/*-------------------------------------------------------
+			 * Insert discontinuity immediately before the file and section specified
+				--insert-discontinuity */
+			else if (strcmp("insert-discontinuity", options[option_index].name) == 0)
+				{
+				if (num_mods < NUMBER_MODS_MAX)
+					{
+					if ((nscan = sscanf(optarg, "%d:%d",
+						       &mods[num_mods].file1, &mods[num_mods].section1)) == 2)
+						{
+						mods[num_mods].mode = MOD_MODE_INSERT_DISCONTINUITY;
+						num_mods++;
+						}
+					}
+				else
+					{
+					fprintf(stderr,"Maximum number of mod commands reached:\n\tskip-unset-crossings command ignored\n\n");	
+					}
+				}
 			
 			break;
 		case '?':
@@ -730,11 +1029,12 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       num_mods:                   %d\n",num_mods);
 		for (i=0;i<num_mods;i++)
 			{
-			fprintf(stderr,"dbg2       mods[%d]: %d  %d %d %d   %d %d %d  %f %f %f\n",
+			fprintf(stderr,"dbg2       mods[%d]: %d  %d %d %d   %d %d %d  %f %f %f  %f %f %f\n",
 				i, mods[i].mode,
 				mods[i].survey1, mods[i].file1, mods[i].section1,
 				mods[i].survey1, mods[i].file1, mods[i].section1,
-				mods[i].xoffset, mods[i].yoffset, mods[i].zoffset);
+				mods[i].xoffset, mods[i].yoffset, mods[i].zoffset,
+				mods[i].xsigma, mods[i].ysigma, mods[i].zsigma);
 			}
 		}
 
@@ -1170,6 +1470,155 @@ int main (int argc, char **argv)
 		{
 		switch (mods[imod].mode)
 			{
+			case MOD_MODE_SET_GLOBAL_TIE:
+fprintf(stderr,"\nCommand set-global-tie=%4.4d:%4.4d:%4.4d/%.3f/%.3f/%.3f/%.3f/%.3f/%.3f\n",
+mods[imod].file1,mods[imod].section1,mods[imod].snav2,
+mods[imod].xoffset,mods[imod].yoffset,mods[imod].zoffset,
+mods[imod].xsigma,mods[imod].ysigma,mods[imod].zsigma);
+
+				
+				/* if this file, section, and snav exists apply the global tie as XYZ
+					if the file and section exist but the snav does not then
+					unset the global tie */
+				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
+					{
+					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
+					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
+						{
+						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
+						mb_coor_scale(verbose,0.5 * (section1->latmin + section1->latmax),
+								&mtodeglon,&mtodeglat);
+						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
+							{
+							section1->global_tie_status = MBNA_TIE_XYZ;
+							section1->global_tie_snav = mods[imod].snav1;
+							section1->global_tie_offset_x = mods[imod].xoffset * mtodeglon;
+							section1->global_tie_offset_y = mods[imod].yoffset * mtodeglat;
+							section1->global_tie_offset_x_m = mods[imod].xoffset;
+							section1->global_tie_offset_y_m = mods[imod].yoffset;
+							section1->global_tie_offset_z_m = mods[imod].zoffset;
+							section1->global_tie_xsigma = mods[imod].xsigma;
+							section1->global_tie_ysigma = mods[imod].ysigma;
+							section1->global_tie_zsigma = mods[imod].zsigma;
+							}
+						else
+							{
+							section1->global_tie_status = MBNA_TIE_NONE;
+							section1->global_tie_snav = MBNA_SELECT_NONE;
+							section1->global_tie_offset_x = 0.0;
+							section1->global_tie_offset_y = 0.0;;
+							section1->global_tie_offset_x_m = 0.0;
+							section1->global_tie_offset_y_m = 0.0;;
+							section1->global_tie_offset_z_m = 0.0;;
+							section1->global_tie_xsigma = 0.0;;
+							section1->global_tie_ysigma = 0.0;;
+							section1->global_tie_zsigma = 0.0;;
+							}
+						}
+					}
+				break;
+				
+			case MOD_MODE_SET_GLOBAL_TIE_XYZ:
+fprintf(stderr,"\nCommand set-global-tie-xyz=%4.4d:%4.4d:%4.4d\n",
+mods[imod].file1,mods[imod].section1,mods[imod].snav2);
+
+				
+				/* if this file, section, and snav exists apply the global tie as XYZ
+					if the file and section exist but the snav does not then
+					unset the global tie */
+				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
+					{
+					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
+					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
+						{
+						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
+						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
+							{
+							section1->global_tie_status = MBNA_TIE_XYZ;
+							section1->global_tie_snav = mods[imod].snav1;
+							}
+						else
+							{
+							section1->global_tie_status = MBNA_TIE_NONE;
+							section1->global_tie_snav = MBNA_SELECT_NONE;
+							}
+						}
+					}
+				break;
+				
+			case MOD_MODE_SET_GLOBAL_TIE_XY:
+fprintf(stderr,"\nCommand set-global-tie-xyonly=%4.4d:%4.4d:%4.4d\n",
+mods[imod].file1,mods[imod].section1,mods[imod].snav2);
+
+				
+				/* if this file, section, and snav exists apply the global tie as XY-only
+					if the file and section exist but the snav does not then
+					unset the global tie */
+				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
+					{
+					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
+					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
+						{
+						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
+						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
+							{
+							section1->global_tie_status = MBNA_TIE_XY;
+							section1->global_tie_snav = mods[imod].snav1;
+							}
+						else
+							{
+							section1->global_tie_status = MBNA_TIE_NONE;
+							section1->global_tie_snav = MBNA_SELECT_NONE;
+							}
+						}
+					}
+				break;
+				
+			case MOD_MODE_SET_GLOBAL_TIE_Z:
+fprintf(stderr,"\nCommand set-global-tie-zonly=%4.4d:%4.4d:%4.4d\n",
+mods[imod].file1,mods[imod].section1,mods[imod].snav2);
+
+				
+				/* if this file, section, and snav exists apply the global tie as Z-only
+					if the file and section exist but the snav does not then
+					unset the global tie */
+				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
+					{
+					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
+					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
+						{
+						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
+						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
+							{
+							section1->global_tie_status = MBNA_TIE_Z;
+							section1->global_tie_snav = mods[imod].snav1;
+							}
+						else
+							{
+							section1->global_tie_status = MBNA_TIE_NONE;
+							section1->global_tie_snav = MBNA_SELECT_NONE;
+							}
+						}
+					}
+				break;
+				
+			case MOD_MODE_UNSET_GLOBAL_TIE:
+fprintf(stderr,"\nCommand unset-global-tie=%4.4d:%4.4d\n",
+mods[imod].file1,mods[imod].section1);
+
+				
+				/* if this file and section exists unset the global tie */
+				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
+					{
+					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
+					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
+						{
+						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
+						section1->global_tie_status = MBNA_TIE_NONE;
+						}
+					}
+				break;
+				
 			case MOD_MODE_ADD_CROSSING:
 fprintf(stderr,"\nCommand add-crossing=%4.4d:%4.4d/%4.4d:%4.4d\n",mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2);
 				
@@ -1230,9 +1679,10 @@ file2->block, crossing->file_id_2, crossing->section_2);
 				break;
 			
 			case MOD_MODE_SET_TIE:
-fprintf(stderr,"\nCommand set-tie=%4.4d:%4.4d/%4.4d:%4.4d/%.3f/%.3f/%.3f\n",
+fprintf(stderr,"\nCommand set-tie=%4.4d:%4.4d/%4.4d:%4.4d/%.3f/%.3f/%.3f/%.3f/%.3f/%.3f\n",
 mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2,
-mods[imod].xoffset,mods[imod].yoffset,mods[imod].zoffset);
+mods[imod].xoffset,mods[imod].yoffset,mods[imod].zoffset,
+mods[imod].xsigma,mods[imod].ysigma,mods[imod].zsigma);
 				
 				/* check to see if this crossing already exists */
 				found = MB_NO;
@@ -1338,15 +1788,15 @@ file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2);
 					tie->offset_x_m = mods[imod].xoffset;
 					tie->offset_y_m = mods[imod].yoffset;
 					tie->offset_z_m = mods[imod].zoffset;
-					tie->sigmar1 = 10.0;
+					tie->sigmar1 = mods[imod].xsigma;
 					tie->sigmax1[0] = 1.0;
 					tie->sigmax1[1] = 0.0;
 					tie->sigmax1[2] = 0.0;
-					tie->sigmar2 = 10.0;
+					tie->sigmar2 = mods[imod].ysigma;
 					tie->sigmax2[0] = 0.0;
 					tie->sigmax2[1] = 1.0;
 					tie->sigmax2[2] = 0.0;
-					tie->sigmar3 = 10.0;
+					tie->sigmar3 = mods[imod].zsigma;
 					tie->sigmax3[0] = 0.0;
 					tie->sigmax3[1] = 0.0;
 					tie->sigmax3[2] = 1.0;
@@ -1510,6 +1960,44 @@ tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
 					
 				break;
 			
+			case MOD_MODE_UNSET_TIE:
+fprintf(stderr,"\nCommand unset-tie=%4.4d:%4.4d/%4.4d:%4.4d\n",
+mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2);
+				
+				/* check to see if this crossing already exists */
+				found = MB_NO;
+				for (icrossing=0;icrossing<project_output.num_crossings && found == MB_NO;icrossing++)
+					{
+					crossing = &(project_output.crossings[icrossing]);
+					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
+					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
+					if (crossing->file_id_2 == mods[imod].file1 && crossing->file_id_1 == mods[imod].file2
+						&& crossing->section_2 == mods[imod].section1 && crossing->section_1 == mods[imod].section2)
+						{
+						found = MB_YES;
+						current_crossing = icrossing;
+						}
+					else if (crossing->file_id_1 == mods[imod].file1 && crossing->file_id_2 == mods[imod].file2
+						&& crossing->section_1 == mods[imod].section1 && crossing->section_2 == mods[imod].section2)
+						{
+						found = MB_YES;
+						current_crossing = icrossing;
+						}
+					}
+					
+				/* unset the ties associated with this crossing */
+				if (found == MB_YES && crossing->num_ties > 0)
+					{
+					crossing->num_ties = 0;
+
+fprintf(stderr,"Unset tie:   %d  %2.2d:%4.4d:%4.4d   %2.2d:%4.4d:%4.4d\n",
+current_crossing,
+file1->block, crossing->file_id_1, crossing->section_1,
+file2->block, crossing->file_id_2, crossing->section_2);
+					}
+					
+				break;
+			
 			case MOD_MODE_SET_TIES_XYZ_FILE:
 fprintf(stderr,"\nCommand set-ties-xyz-with-file=%4.4d\n", mods[imod].file1);
 
@@ -1785,23 +2273,38 @@ tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
 			case MOD_MODE_SKIP_UNSET_CROSSINGS:
 fprintf(stderr,"\nCommand skip-unset-crossings\n");
 
-				
-			for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-				{
-				crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-				file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-				file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-				if (crossing->num_ties == 0)
+				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
 					{
-					crossing->status = MBNA_CROSSING_STATUS_SKIP;
+					crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
+					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
+					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
+					if (crossing->num_ties == 0)
+						{
+						crossing->status = MBNA_CROSSING_STATUS_SKIP;
 fprintf(stderr,"Set crossing status to skip:   %d  %2.2d:%4.4d:%4.4d   %2.2d:%4.4d:%4.4d\n",
 icrossing,
 file1->block, crossing->file_id_1, crossing->section_1,
 file2->block, crossing->file_id_2, crossing->section_2);
+						}
 					}
-				}
+				break;
+
+			case MOD_MODE_INSERT_DISCONTINUITY:
+fprintf(stderr,"\nCommand insert-discontinuity=%2.2d:%2.2d\n", mods[imod].file1, mods[imod].section1);
 				
-			break;
+				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
+					{
+					file1 = &(project_output.files[mods[imod].file1]);
+					section1 = &(file1->sections[mods[imod].section1]);
+					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections
+						&& section1->continuity == MB_YES)
+						{
+						section1->continuity = MB_NO;
+fprintf(stderr,"Set discontinuity before survey:file:section :   %2.2d:%4.4d:%4.4d\n",
+file1->block, mods[imod].file1, mods[imod].section1);
+						}
+					}
+				break;
 
 			}
 		}
diff --git a/src/mbnavedit/Makefile.am b/src/mbnavedit/Makefile.am
index fbc6361..7a865d3 100644
--- a/src/mbnavedit/Makefile.am
+++ b/src/mbnavedit/Makefile.am
@@ -4,11 +4,8 @@ AM_CFLAGS = ${libnetcdf_CFLAGS}
 
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      -I${top_srcdir}/src/mbaux \
-	      ${libnetcdf_CPPFLAGS} \
-	      ${motif_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I${top_srcdir}/src/gsf
-endif
+	      -I${top_srcdir}/src/gsf \
+	      ${libmotif_CPPFLAGS} 
 
 AM_LDFLAGS = 
 
@@ -16,8 +13,10 @@ LIBS = ${top_builddir}/src/mbio/libmbio.la \
 	${top_builddir}/src/mbaux/libmbaux.la \
        ${top_builddir}/src/mbaux/libmbxgr.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} \
+       ${libmotif_LIBS} \
        $(LIBM)
 
 mbnavedit_SOURCES = mbnavedit.c mbnavedit_creation.c mbnavedit_util.c mbnavedit_callbacks.c \
 	mbnavedit_prog.c mbnavedit_creation.h mbnavedit_extrawidgets.h mbnavedit.h
+
+
diff --git a/src/mbnavedit/Makefile.in b/src/mbnavedit/Makefile.in
index ee2cfe2..708724d 100644
--- a/src/mbnavedit/Makefile.in
+++ b/src/mbnavedit/Makefile.in
@@ -79,7 +79,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = mbnavedit$(EXEEXT)
- at BUILD_GSF_TRUE@am__append_1 = -I${top_srcdir}/src/gsf
 subdir = src/mbnavedit
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -194,8 +193,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -210,7 +207,7 @@ LIBS = ${top_builddir}/src/mbio/libmbio.la \
 	${top_builddir}/src/mbaux/libmbaux.la \
        ${top_builddir}/src/mbaux/libmbxgr.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} \
+       ${libmotif_LIBS} \
        $(LIBM)
 
 LIBTOOL = @LIBTOOL@
@@ -218,6 +215,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -281,19 +279,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -306,8 +311,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -322,8 +325,11 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	${libnetcdf_CPPFLAGS} ${motif_CPPFLAGS} $(am__append_1)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
+	      ${libmotif_CPPFLAGS} 
+
 AM_LDFLAGS = 
 mbnavedit_SOURCES = mbnavedit.c mbnavedit_creation.c mbnavedit_util.c mbnavedit_callbacks.c \
 	mbnavedit_prog.c mbnavedit_creation.h mbnavedit_extrawidgets.h mbnavedit.h
diff --git a/src/mbnavedit/Makefile.template b/src/mbnavedit/Makefile.template
deleted file mode 100644
index 0b9fbea..0000000
--- a/src/mbnavedit/Makefile.template
+++ /dev/null
@@ -1,94 +0,0 @@
-#     The MB-system:	Makefile.template  6/23/95
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 1995-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbnavedit directory level
-# Author:	D. W. Caress
-# Date:		June 23, 1995
-#
-# $Log: Makefile.template,v $
-#
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of Motif include files:
-MOTIFINCDIR = /usr/include/Xm
-MOTIFLIBS = -lXm -lXt -lX11
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -DIRIX
-LFLAGS =  -lmalloc -lm -lsun -g
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the executable and man page
-all: $(BINDIR)/mbnavedit
-
-### link the executable
-$(BINDIR)/mbnavedit: mbnavedit.o \
-		mbnavedit_creation.o \
-		mbnavedit_callbacks.o \
-		mbnavedit_util.o \
-		mbnavedit_prog.o \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbxgr.a \
-		$(LIBDIR)/libmbio.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbnavedit.o \
-		mbnavedit_creation.o \
-		mbnavedit_callbacks.o \
-		mbnavedit_util.o \
-		mbnavedit_prog.o \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbxgr.a \
-		$(LIBDIR)/libmbio.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LIBDIR)/libsapi.a \
-		$(MOTIFLIBS) $(LFLAGS) \
-		-o $(BINDIR)/mbnavedit
-
-### compile the source files
-mbnavedit.o: mbnavedit.c mbnavedit_creation.h mbnavedit.h \
-	mbnavedit_extrawidgets.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbnavedit.c
-mbnavedit_creation.o: mbnavedit_creation.c mbnavedit_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbnavedit_creation.c
-mbnavedit_callbacks.o: mbnavedit_callbacks.c mbnavedit.h mbnavedit_creation.h \
-	mbnavedit_extrawidgets.h ../mbaux/mb_xgraphics.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -I$(MOTIFINCDIR) -c mbnavedit_callbacks.c
-mbnavedit_util.o: mbnavedit_util.c mbnavedit_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbnavedit_util.c
-mbnavedit_prog.o: mbnavedit_prog.c mbnavedit.h ../mbio/mb_format.h \
-		../mbio/mb_io.h ../mbio/mb_status.h ../mbio/mb_define.h \
-		../mbaux/mb_aux.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -I$(MOTIFINCDIR) -c mbnavedit_prog.c
-
-clean:
-	rm -f core *.o
diff --git a/src/mbnavedit/mbnavedit.c b/src/mbnavedit/mbnavedit.c
index 496c829..0e50202 100644
--- a/src/mbnavedit/mbnavedit.c
+++ b/src/mbnavedit/mbnavedit.c
@@ -94,7 +94,7 @@ int main( int argc, char **argv)
      * Initialize Xt.
      */
 
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
 
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbnavedit/mbnavedit.h b/src/mbnavedit/mbnavedit.h
index f41ed3a..408f9d4 100644
--- a/src/mbnavedit/mbnavedit.h
+++ b/src/mbnavedit/mbnavedit.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavedit.h	6/24/95
- *    $Id: mbnavedit.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbnavedit.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -22,60 +22,6 @@
  * Date:	June 24,  1995
  * Date:	August 28, 2000 (New version - no buffered i/o)
  *
- * $Log: mbnavedit.h,v $
- * Revision 5.6  2009/03/10 05:11:22  caress
- * Added Gaussian mean smoothing to MBnavedit.
- *
- * Revision 5.5  2005/06/04 04:45:50  caress
- * Added feature to apply longitude and latitude offsets to the navigation.
- *
- * Revision 5.4  2004/05/21 23:33:03  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.3  2003/04/17 21:09:06  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2001/01/22 07:47:40  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:30:08  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:56:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/09/30  07:03:14  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  2000/09/30  07:02:34  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  2000/08/28  22:45:11  caress
- * About to kick off new version.
- *
- * Revision 4.5  1999/04/09 22:34:08  caress
- * Added time interval plot.
- *
- * Revision 4.4  1997/04/21  17:07:38  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1996/08/26  17:33:29  caress
- * Release 4.4 revision.
- *
- * Revision 4.3  1996/08/26  17:33:29  caress
- * Release 4.4 revision.
- *
- * Revision 4.2  1996/04/05  20:07:02  caress
- * Added GUI mode so done means quit for real. Also changed done and
- * quit handling in browse mode so that the program doesn't read the
- * entire data file before closing it.
- *
- * Revision 4.1  1995/08/17  14:59:39  caress
- * Revision for release 4.3.
- *
- * Revision 4.0  1995/08/07  18:33:22  caress
- * First cut.
- *
  *
  */
 
@@ -178,7 +124,8 @@ void  do_parse_datalist( char *file, int form);
 void do_editlistselection( Widget w, XtPointer client_data, XtPointer call_data);
 void do_filelist_remove( Widget w, XtPointer client_data, XtPointer call_data);
 void do_load_specific_file(int i_file);
-void do_set_controls();
+void do_build_filelist(void);
+void do_set_controls(void);
 void do_nextbuffer( Widget w, XtPointer client_data, XtPointer call_data);
 void do_done( Widget w, XtPointer client_data, XtPointer call_data);
 void do_start( Widget w, XtPointer client_data, XtPointer call_data);
@@ -221,11 +168,13 @@ void do_button_use_smg( Widget w, XtPointer client_data, XtPointer call_data);
 void do_button_use_cmg( Widget w, XtPointer client_data, XtPointer call_data);
 void do_toggle_output_on( Widget w, XtPointer client_data, XtPointer call_data);
 void do_toggle_output_off( Widget w, XtPointer client_data, XtPointer call_data);
+void do_toggle_output_on_filelist( Widget w, XtPointer client_data, XtPointer call_data);
+void do_toggle_output_off_filelist( Widget w, XtPointer client_data, XtPointer call_data);
 void do_fileselection_cancel( Widget w, XtPointer client_data, XtPointer call_data);
-void do_filebutton_on();
-void do_filebutton_off();
+void do_filebutton_on(void);
+void do_filebutton_off(void);
 void do_fileselection_ok( Widget w, XtPointer client_data, XtPointer call_data);
-void do_checkuseprevious();
+void do_checkuseprevious(void);
 void do_useprevious_yes( Widget w, XtPointer client_data, XtPointer call_data);
 void do_useprevious_no( Widget w, XtPointer client_data, XtPointer call_data);
 void do_load(int useprevious);
@@ -244,43 +193,43 @@ void do_scroll( Widget w, XtPointer client_data, XtPointer call_data);
 void do_revert( Widget w, XtPointer client_data, XtPointer call_data);
 void do_showall( Widget w, XtPointer client_data, XtPointer call_data);
 void do_set_interval( Widget w, XtPointer client_data, XtPointer call_data);
-int do_unset_interval();
+int do_unset_interval(void);
 void do_toggle_vru( Widget w, XtPointer client_data, XtPointer call_data);
 void mbnavedit_bell(int length);
 void mbnavedit_get_position(int *win_x, int *win_y, unsigned int *mask_return);
-void mbnavedit_pickcursor();
-void mbnavedit_selectcursor();
-void mbnavedit_deselectcursor();
-void mbnavedit_selectallcursor();
-void mbnavedit_deselectallcursor();
-void mbnavedit_setintervalcursor();
+void mbnavedit_pickcursor(void);
+void mbnavedit_selectcursor(void);
+void mbnavedit_deselectcursor(void);
+void mbnavedit_selectallcursor(void);
+void mbnavedit_deselectallcursor(void);
+void mbnavedit_setintervalcursor(void);
 int do_wait_until_viewed(XtAppContext app);
-int do_mbnavedit_settimer();
+int do_mbnavedit_settimer(void);
 int do_mbnavedit_workfunction(XtPointer client_data);
 int do_message_on(char *message);
-int do_message_off();
+int do_message_off(void);
 int do_error_dialog(char *s1, char *s2, char *s3);
 void set_label_string(Widget w, String str);
 void set_label_multiline_string(Widget w, String str);
 void get_text_string(Widget w, String str);
 
-int mbnavedit_init_globals();
+int mbnavedit_init_globals(void);
 int mbnavedit_init(int argc, char **argv, int *startup_file);
 int mbnavedit_set_graphics(void *xgid, int ncol, unsigned int *pixels);
 int mbnavedit_action_open(int useprevious);
 int mbnavedit_open_file(int useprevious);
-int mbnavedit_close_file();
+int mbnavedit_close_file(void);
 int mbnavedit_dump_data(int hold);
-int mbnavedit_load_data();
-int mbnavedit_clear_screen();
+int mbnavedit_load_data(void);
+int mbnavedit_clear_screen(void);
 int mbnavedit_action_next_buffer(int *quit);
-int mbnavedit_action_offset();
-int mbnavedit_action_close();
+int mbnavedit_action_offset(void);
+int mbnavedit_action_close(void);
 int mbnavedit_action_done(int *quit);
-int mbnavedit_action_quit();
+int mbnavedit_action_quit(void);
 int mbnavedit_action_step(int step);
-int mbnavedit_action_start();
-int mbnavedit_action_end();
+int mbnavedit_action_start(void);
+int mbnavedit_action_end(void);
 int mbnavedit_action_mouse_pick(int xx, int yy);
 int mbnavedit_action_mouse_select(int xx, int yy);
 int mbnavedit_action_mouse_deselect(int xx, int yy);
@@ -288,23 +237,23 @@ int mbnavedit_action_mouse_selectall(int xx, int yy);
 int mbnavedit_action_mouse_deselectall(int xx, int yy);
 int mbnavedit_action_deselect_all(int type);
 int mbnavedit_action_set_interval(int xx, int yy, int which);
-int mbnavedit_action_use_dr();
-int mbnavedit_action_use_smg();
-int mbnavedit_action_use_cmg();
-int mbnavedit_action_interpolate();
-int mbnavedit_action_interpolaterepeats();
-int mbnavedit_action_revert();
-int mbnavedit_action_flag();
-int mbnavedit_action_unflag();
-int mbnavedit_action_fixtime();
-int mbnavedit_action_deletebadtime();
-int mbnavedit_action_showall();
+int mbnavedit_action_use_dr(void);
+int mbnavedit_action_use_smg(void);
+int mbnavedit_action_use_cmg(void);
+int mbnavedit_action_interpolate(void);
+int mbnavedit_action_interpolaterepeats(void);
+int mbnavedit_action_revert(void);
+int mbnavedit_action_flag(void);
+int mbnavedit_action_unflag(void);
+int mbnavedit_action_fixtime(void);
+int mbnavedit_action_deletebadtime(void);
+int mbnavedit_action_showall(void);
 int mbnavedit_get_smgcmg(int i);
-int mbnavedit_get_model();
-int mbnavedit_get_gaussianmean();
-int mbnavedit_get_dr();
-int mbnavedit_get_inversion();
-int mbnavedit_plot_all();
+int mbnavedit_get_model(void);
+int mbnavedit_get_gaussianmean(void);
+int mbnavedit_get_dr(void);
+int mbnavedit_get_inversion(void);
+int mbnavedit_plot_all(void);
 int mbnavedit_plot_tint(int iplot);
 int mbnavedit_plot_lon(int iplot);
 int mbnavedit_plot_lat(int iplot);
@@ -321,6 +270,12 @@ int mbnavedit_plot_speed_value(int iplot, int iping);
 int mbnavedit_plot_heading_value(int iplot, int iping);
 int mbnavedit_plot_draft_value(int iplot, int iping);
 
-XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+void BxPopdownCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void BxExitCB(Widget w, XtPointer client, XtPointer call);
+void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
 
 /*--------------------------------------------------------------------*/
diff --git a/src/mbnavedit/mbnavedit_callbacks.c b/src/mbnavedit/mbnavedit_callbacks.c
index cb00a1e..385a0af 100644
--- a/src/mbnavedit/mbnavedit_callbacks.c
+++ b/src/mbnavedit/mbnavedit_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavedit_callbacks.c	6/24/95
- *    $Id: mbnavedit_callbacks.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbnavedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -21,108 +21,6 @@
  * Date:	June 24,  1995
  * Date:	August 28, 2000 (New version - no buffered i/o)
  *
- * $Log: mbnavedit_callbacks.c,v $
- * Revision 5.16  2009/03/10 05:11:22  caress
- * Added Gaussian mean smoothing to MBnavedit.
- *
- * Revision 5.15  2009/03/09 16:58:31  caress
- * Release 5.1.2beta01
- *
- * Revision 5.14  2008/07/20 15:32:14  caress
- * Lengthened filename char arrays to prevent possible overflows.
- *
- * Revision 5.13  2008/05/16 23:05:05  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.12  2006/02/16 21:15:07  caress
- * Made smooth inversion weights work as small as 0.01 in the interface. Redimensioned some strings too.
- *
- * Revision 5.11  2006/01/24 19:19:24  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.10  2005/06/04 04:45:50  caress
- * Added feature to apply longitude and latitude offsets to the navigation.
- *
- * Revision 5.9  2005/03/25 04:35:56  caress
- * Added capability to interpolate over repeated values.
- *
- * Revision 5.8  2004/05/21 23:33:03  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.7  2003/04/17 21:09:06  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2001/07/20 00:34:00  caress
- * Release 5.0.beta03
- *
- * Revision 5.5  2001/06/30  17:41:04  caress
- * Release 5.0.beta01
- *
- * Revision 5.4  2001/04/06  22:16:01  caress
- * Fixed unflagging.
- *
- * Revision 5.3  2001/03/22  21:10:37  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.2  2001/01/22  07:47:40  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:30:08  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:56:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.14  2000/10/11  01:05:17  caress
- * Convert to ANSI C
- *
- * Revision 4.13  2000/09/30  07:03:14  caress
- * Snapshot for Dale.
- *
- * Revision 4.12  2000/09/30  07:02:34  caress
- * Snapshot for Dale.
- *
- * Revision 4.11  2000/08/28  22:45:11  caress
- * About to kick off new version.
- *
- * Revision 4.10  1999/09/15 21:01:04  caress
- * Version label now set from mb_format.h
- *
- * Revision 4.9  1999/04/14  04:33:10  caress
- * Final (?) version 4.6 release
- *
- * Revision 4.8  1999/04/09  22:34:08  caress
- * Added time interval plot.
- *
- * Revision 4.7  1998/10/05  19:17:39  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/09/15  19:10:20  caress
- * Real Version 4.5
- *
- * Revision 4.5  1997/04/22  19:25:57  caress
- * Fixed startup mode.
- *
- * Revision 4.4  1997/04/21  17:07:38  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1997/04/16  21:40:29  caress
- * Version for MB-System 4.5.
- *
- * Revision 4.3  1996/04/05  20:07:02  caress
- * Added GUI mode so done means quit for real. Also changed done and
- * quit handling in browse mode so that the program doesn't read the
- * entire data file before closing it.
- *
- * Revision 4.2  1995/09/28  18:01:01  caress
- * Improved handling of .mbxxx file suffix convention.
- *
- * Revision 4.1  1995/08/17  14:58:12  caress
- * Revision for release 4.3.
- *
- * Revision 4.0  1995/08/07  18:33:22  caress
- * First cut.
- *
  *
  */
 
@@ -186,11 +84,20 @@
 #endif
 #endif
 
+#ifndef FIXED
+#define FIXED "fixed"
+#endif
+
 Widget		BxFindTopShell PROTOTYPE((Widget));
 WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
 
 /*--------------------------------------------------------------------*/
-#define xgfont "-misc-fixed-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
+
+/* id variables */
+static char svn_id[] = "$Id: mbnavedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
+static char program_name[] = "MBnavedit";
+
+#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
 #define EV_MASK (ButtonPressMask | KeyPressMask | KeyReleaseMask | ExposureMask)
 
 /* XG variable declarations */
@@ -626,6 +533,13 @@ do_mbnavedit_init(int argc, char **argv)
 
     /* Setup the font for just the "canvas" screen. */
     fontStruct = XLoadQueryFont(display, xgfont);
+    if (fontStruct == NULL)
+        {
+	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
+        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
+	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+	exit(-1);
+        }
     XSetFont(display,gc,fontStruct->fid);
 
     XSelectInput(display, can_xid, EV_MASK );
diff --git a/src/mbnavedit/mbnavedit_creation.c b/src/mbnavedit/mbnavedit_creation.c
index 769c34e..dee0e61 100644
--- a/src/mbnavedit/mbnavedit_creation.c
+++ b/src/mbnavedit/mbnavedit_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
@@ -293,7 +304,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 390); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -321,7 +332,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 180); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -364,7 +375,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 41); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_file = XmCreateCascadeButton(menuBar_file,
             (char *)"cascadeButton_file",
@@ -397,7 +408,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_file = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_file",
@@ -422,7 +433,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_filelist",
@@ -450,7 +461,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 110); ac++;
@@ -483,7 +494,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_unflag = XmCreatePushButton(bulletinBoard,
             (char *)"pushButton_unflag",
@@ -511,7 +522,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_flag = XmCreatePushButton(bulletinBoard,
             (char *)"pushButton_flag",
@@ -550,7 +561,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(menuBar_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_controls = XmCreateCascadeButton(menuBar_controls,
             (char *)"cascadeButton_controls",
@@ -583,7 +594,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls_timespan = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_controls_timespan",
@@ -607,7 +618,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls_modeling = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_controls_modeling",
@@ -631,7 +642,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls_timeinterpolation = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_controls_timeinterpolation",
@@ -655,7 +666,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls_deletebadtimetag = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_controls_deletebadtimetag",
@@ -679,7 +690,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_controls_offset = XmCreatePushButton(pulldownMenu_controls,
             (char *)"pushButton_controls_offset",
@@ -708,7 +719,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -739,7 +750,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -770,7 +781,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 360); ac++;
         XtSetArg(args[ac], XmNy, 50); ac++;
@@ -799,7 +810,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNx, 20); ac++;
@@ -829,7 +840,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNx, 20); ac++;
@@ -859,7 +870,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -890,7 +901,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNstringDirection, XmSTRING_DIRECTION_L_TO_R); ac++;
@@ -921,7 +932,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 480); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -949,7 +960,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 760); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -977,7 +988,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 320); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -1005,7 +1016,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 250); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -1033,7 +1044,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 840); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -1061,7 +1072,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 920); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -1089,7 +1100,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -1118,7 +1129,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 670); ac++;
@@ -1147,7 +1158,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 580); ac++;
@@ -1176,7 +1187,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 270); ac++;
@@ -1205,7 +1216,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -1262,7 +1273,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNwidth, 51); ac++;
@@ -1290,7 +1301,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNwidth, 64); ac++;
@@ -1318,7 +1329,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNwidth, 78); ac++;
@@ -1345,7 +1356,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1373,7 +1384,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1401,7 +1412,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 20); ac++;
@@ -1431,7 +1442,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1462,7 +1473,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1492,7 +1503,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 20); ac++;
@@ -1522,7 +1533,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1553,7 +1564,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1584,7 +1595,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1615,7 +1626,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1646,7 +1657,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1677,7 +1688,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1708,7 +1719,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
@@ -1739,7 +1750,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
         XtSetArg(args[ac], XmNstringDirection, XmSTRING_DIRECTION_L_TO_R); ac++;
@@ -1820,7 +1831,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 260); ac++;
@@ -1858,7 +1869,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 190); ac++;
         XtSetArg(args[ac], XmNy, 420); ac++;
@@ -1886,7 +1897,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 240); ac++;
@@ -1913,7 +1924,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 250); ac++;
         XtSetArg(args[ac], XmNy, 290); ac++;
@@ -1940,7 +1951,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 60); ac++;
         XtSetArg(args[ac], XmNy, 290); ac++;
@@ -1967,7 +1978,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 120); ac++;
@@ -1994,7 +2005,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 160); ac++;
@@ -2021,7 +2032,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 90); ac++;
@@ -2048,7 +2059,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 190); ac++;
@@ -2086,7 +2097,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -2114,7 +2125,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 40); ac++;
@@ -2141,7 +2152,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -2198,7 +2209,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 360); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_pleasewait = XmCreateLabel(bulletinBoard_message,
             (char *)"label_pleasewait",
@@ -2226,7 +2237,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 360); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_message = XmCreateLabel(bulletinBoard_message,
             (char *)"label_message",
@@ -2276,7 +2287,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_two = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_two",
@@ -2304,7 +2315,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_one = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_one",
@@ -2332,7 +2343,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_three = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_three",
@@ -2359,7 +2370,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_error = XmCreatePushButton(bulletinBoard_error,
             (char *)"pushButton_error",
@@ -2405,7 +2416,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 290); ac++;
@@ -2445,7 +2456,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_output, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(radioBox_output, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNwidth, 161); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
@@ -2471,7 +2482,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_output, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(radioBox_output, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNwidth, 161); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
@@ -2491,7 +2502,7 @@ CreatemainWindow(Widget parent)
 
     ac = 0;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+        BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     XtSetArg(args[ac], XmNx, 140); ac++;
     XtSetArg(args[ac], XmNy, 480); ac++;
@@ -2512,7 +2523,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 20); ac++;
@@ -2541,13 +2552,13 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNlistVisibleItemCount, 13); ac++;
         XtSetArg(args[ac], XmNtextFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNlabelFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNbuttonFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1",
+            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
         XtSetArg(args[ac], XmNnoResize, True); ac++;
@@ -2622,7 +2633,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_timestepping_dismiss = XmCreatePushButton(bulletinBoard_timestepping,
             (char *)"pushButton_timestepping_dismiss",
@@ -2647,7 +2658,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 440); ac++;
@@ -2669,7 +2680,7 @@ CreatemainWindow(Widget parent)
 
     ac = 0;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
     XtSetArg(args[ac], XmNx, 180); ac++;
@@ -2692,7 +2703,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -2721,7 +2732,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 440); ac++;
@@ -2749,7 +2760,7 @@ CreatemainWindow(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
         XtSetArg(args[ac], XmNstringDirection, XmSTRING_DIRECTION_L_TO_R); ac++;
@@ -2780,7 +2791,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -2855,7 +2866,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 470); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_meantimewindow = XmCreateScale(bulletinBoard_modeling,
             (char *)"scale_meantimewindow",
@@ -2894,7 +2905,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_modeling_apply = XmCreatePushButton(bulletinBoard_modeling,
             (char *)"pushButton_modeling_apply",
@@ -2934,7 +2945,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_modeling_acceleration = XmCreateLabel(bulletinBoard_modeling,
             (char *)"label_modeling_acceleration",
@@ -2962,7 +2973,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_modeling_speed = XmCreateLabel(bulletinBoard_modeling,
             (char *)"label_modeling_speed",
@@ -2990,7 +3001,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 220); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_modeling_inversion = XmCreateLabel(bulletinBoard_modeling,
             (char *)"label_modeling_inversion",
@@ -3011,7 +3022,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 140); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textField_modeling_acceleration = XmCreateTextField(bulletinBoard_modeling,
         (char *)"textField_modeling_acceleration",
@@ -3025,7 +3036,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 140); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textField_modeling_speed = XmCreateTextField(bulletinBoard_modeling,
         (char *)"textField_modeling_speed",
@@ -3045,7 +3056,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_modeling_dismiss = XmCreatePushButton(bulletinBoard_modeling,
             (char *)"pushButton_modeling_dismiss",
@@ -3090,7 +3101,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 470); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_driftlat = XmCreateScale(bulletinBoard_modeling,
             (char *)"scale_driftlat",
@@ -3124,7 +3135,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 470); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         scale_driftlon = XmCreateScale(bulletinBoard_modeling,
             (char *)"scale_driftlon",
@@ -3164,7 +3175,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_modeling_mode = XmCreateLabel(bulletinBoard_modeling,
             (char *)"label_modeling_mode",
@@ -3203,7 +3214,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 48); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_modeling_off = XmCreateToggleButton(radioBox_modeling,
             (char *)"toggleButton_modeling_off",
@@ -3229,7 +3240,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 135); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_modeling_meanfilter = XmCreateToggleButton(radioBox_modeling,
             (char *)"toggleButton_modeling_meanfilter",
@@ -3255,7 +3266,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 143); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_modeling_dr = XmCreateToggleButton(radioBox_modeling,
             (char *)"toggleButton_modeling_dr",
@@ -3281,7 +3292,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 93); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_modeling_inversion = XmCreateToggleButton(radioBox_modeling,
             (char *)"toggleButton_modeling_inversion",
@@ -3343,7 +3354,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 480); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_useprevious = XmCreateLabel(bulletinBoard_useprevious,
             (char *)"label_useprevious",
@@ -3370,7 +3381,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_useprevious_no = XmCreatePushButton(bulletinBoard_useprevious,
             (char *)"pushButton_useprevious_no",
@@ -3398,7 +3409,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_useprevious_yes = XmCreatePushButton(bulletinBoard_useprevious,
             (char *)"pushButton_useprevious_yes",
@@ -3448,7 +3459,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 70); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_timeinterpolation = XmCreateLabel(bulletinBoard_timeinterpolation,
             (char *)"label_timeinterpolation",
@@ -3475,7 +3486,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 130); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_timeinterpolation_dismiss = XmCreatePushButton(bulletinBoard_timeinterpolation,
             (char *)"pushButton_timeinterpolation_dismiss",
@@ -3503,7 +3514,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 130); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_timeinterpolation_apply = XmCreatePushButton(bulletinBoard_timeinterpolation,
             (char *)"pushButton_timeinterpolation_apply",
@@ -3554,7 +3565,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 70); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_deletetimetag = XmCreateLabel(bulletinBoard_deletebadtimetag,
             (char *)"label_deletetimetag",
@@ -3581,7 +3592,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 130); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_deletebadtimetag_dismiss = XmCreatePushButton(bulletinBoard_deletebadtimetag,
             (char *)"pushButton_deletebadtimetag_dismiss",
@@ -3609,7 +3620,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 130); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_deletebadtimetag_apply = XmCreatePushButton(bulletinBoard_deletebadtimetag,
             (char *)"pushButton_deletebadtimetag_apply",
@@ -3671,7 +3682,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 118); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_offset_dismiss = XmCreatePushButton(form_offset,
             (char *)"pushButton_offset_dismiss",
@@ -3699,7 +3710,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_offset_apply = XmCreatePushButton(form_offset,
             (char *)"pushButton_offset_apply",
@@ -3721,7 +3732,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 149); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_offset, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textField_lat_offset = XmCreateTextField(form_offset,
         (char *)"textField_lat_offset",
@@ -3735,7 +3746,7 @@ CreatemainWindow(Widget parent)
     XtSetArg(args[ac], XmNwidth, 149); ac++;
     XtSetArg(args[ac], XmNheight, 40); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_offset, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     textField_lon_offset = XmCreateTextField(form_offset,
         (char *)"textField_lon_offset",
@@ -3756,7 +3767,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 230); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_offset_lat = XmCreateLabel(form_offset,
             (char *)"label_offset_lat",
@@ -3784,7 +3795,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 220); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_offset_lon = XmCreateLabel(form_offset,
             (char *)"label_offset_lon",
@@ -3846,7 +3857,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 104); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist_remove = XmCreatePushButton(form_filelist,
             (char *)"pushButton_filelist_remove",
@@ -3875,7 +3886,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist_edit = XmCreatePushButton(form_filelist,
             (char *)"pushButton_filelist_edit",
@@ -3903,7 +3914,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         setting_output_label_filelist = XmCreateLabel(form_filelist,
             (char *)"setting_output_label_filelist",
@@ -3944,7 +3955,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 116); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_output_on_filelist = XmCreateToggleButton(setting_output_filelist,
             (char *)"toggleButton_output_on_filelist",
@@ -3969,7 +3980,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNwidth, 116); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_output_off_filelist = XmCreateToggleButton(setting_output_filelist,
             (char *)"toggleButton_output_off_filelist",
@@ -3998,7 +4009,7 @@ CreatemainWindow(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_filelist_dismiss = XmCreatePushButton(form_filelist,
             (char *)"pushButton_filelist_dismiss",
@@ -4028,7 +4039,7 @@ CreatemainWindow(Widget parent)
 
     ac = 0;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(scrolledWindow_filelist, (char *)"-*-courier-*-r-*-*-*-90-*-*-*-*-iso8859-1",
+        BX_CONVERT(scrolledWindow_filelist, (char *)"-*-"MONO"-*-r-*-*-*-90-*-*-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     XtSetArg(args[ac], XmNselectionPolicy, XmSINGLE_SELECT); ac++;
     XtSetArg(args[ac], XmNwidth, 339); ac++;
diff --git a/src/mbnavedit/mbnavedit_extrawidgets.h b/src/mbnavedit/mbnavedit_extrawidgets.h
index 558ba22..3c0935e 100644
--- a/src/mbnavedit/mbnavedit_extrawidgets.h
+++ b/src/mbnavedit/mbnavedit_extrawidgets.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavedit_extrawidgets.h	8/7/95
- *    $Id: mbnavedit_extrawidgets.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbnavedit_extrawidgets.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -21,28 +21,6 @@
  * Author:	D. W. Caress
  * Date:	June 24,  1995
  *
- * $Log: mbnavedit_extrawidgets.h,v $
- * Revision 5.2  2009/03/10 05:11:22  caress
- * Added Gaussian mean smoothing to MBnavedit.
- *
- * Revision 5.1  2003/04/17 21:09:06  caress
- * Release 5.0.beta30
- *
- * Revision 5.0  2000/12/01 22:56:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  07:03:14  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1997/04/21  17:07:38  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1995/08/07  18:33:22  caress
- * First cut.
- *
- * Revision 4.0  1995/08/07  18:33:22  caress
- * First cut.
- *
  *
  */
 
diff --git a/src/mbnavedit/mbnavedit_prog.c b/src/mbnavedit/mbnavedit_prog.c
index 85c1d17..7f4c35e 100644
--- a/src/mbnavedit/mbnavedit_prog.c
+++ b/src/mbnavedit/mbnavedit_prog.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavedit_prog.c	6/23/95
- *    $Id: mbnavedit_prog.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbnavedit_prog.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,157 +23,6 @@
  * Date:	June 23,  1995
  * Date:	August 28, 2000 (New version - no buffered i/o)
  *
- * $Log: mbnavedit_prog.c,v $
- * Revision 5.24  2009/03/10 05:11:22  caress
- * Added Gaussian mean smoothing to MBnavedit.
- *
- * Revision 5.23  2009/03/09 16:58:31  caress
- * Release 5.1.2beta01
- *
- * Revision 5.22  2008/07/20 15:32:14  caress
- * Lengthened filename char arrays to prevent possible overflows.
- *
- * Revision 5.21  2008/05/16 23:05:05  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.20  2007/10/08 16:17:00  caress
- * Repeated positions are now automatically flagged for modeling or smooth inversion.
- *
- * Revision 5.19  2006/02/16 21:15:07  caress
- * Made smooth inversion weights work as small as 0.01 in the interface. Redimensioned some strings too.
- *
- * Revision 5.18  2006/01/24 19:19:24  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.17  2006/01/06 18:24:13  caress
- * Working towards 5.0.8
- *
- * Revision 5.16  2005/11/05 00:58:10  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.15  2005/06/04 04:45:50  caress
- * Added feature to apply longitude and latitude offsets to the navigation.
- *
- * Revision 5.14  2005/03/25 04:35:55  caress
- * Added capability to interpolate over repeated values.
- *
- * Revision 5.13  2004/12/18 01:36:40  caress
- * Working towards release 5.0.6.
- *
- * Revision 5.12  2004/05/21 23:33:03  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.11  2003/07/02 18:13:13  caress
- * Release 5.0.0
- *
- * Revision 5.10  2003/04/17 21:09:06  caress
- * Release 5.0.beta30
- *
- * Revision 5.9  2002/10/02 23:54:07  caress
- * Release 5.0.beta24
- *
- * Revision 5.8  2001/08/02 01:51:39  caress
- * Fixed call to mb_pr_ function.
- *
- * Revision 5.7  2001/07/20  00:34:00  caress
- * Release 5.0.beta03
- *
- * Revision 5.6  2001/06/30 17:41:04  caress
- * Release 5.0.beta01
- *
- * Revision 5.5  2001/06/03  07:06:25  caress
- * Release 5.0.beta01
- *
- * Revision 5.4  2001/04/06 22:16:01  caress
- * Fixed unflagging.
- *
- * Revision 5.3  2001/03/22  21:10:37  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.2  2001/01/22  07:47:40  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:30:08  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:56:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.22  2000/10/11  01:05:17  caress
- * Convert to ANSI C
- *
- * Revision 4.21  2000/09/30  07:03:14  caress
- * Snapshot for Dale.
- *
- * Revision 4.20  2000/09/30  07:02:34  caress
- * Snapshot for Dale.
- *
- * Revision 4.19  2000/08/28  22:45:11  caress
- * About to kick off new version.
- *
- * Revision 4.18  1999/12/11 04:42:03  caress
- * Moved xgraphics.c to src/xgraphics
- *
- * Revision 4.17  1999/11/12  21:25:21  caress
- * Fixed start date shown below plots
- *
- * Revision 4.16  1999/07/16  19:22:56  caress
- * Smaller window with new dialogs for Linux.
- *
- * Revision 4.15  1999/04/14 04:33:10  caress
- * Final (?) version 4.6 release
- *
- * Revision 4.14  1999/04/09  22:34:08  caress
- * Added time interval plot.
- *
- * Revision 4.13  1999/02/04  23:54:13  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.12  1998/12/18  01:40:25  caress
- * MB-System version 4.6beta5
- *
- * Revision 4.11  1998/10/09  18:43:08  caress
- * MB-System version 4.6beta.
- *
- * Revision 4.10  1997/09/15  19:10:20  caress
- * Real Version 4.5
- *
- * Revision 4.9  1997/04/22  19:25:57  caress
- * Fixed startup mode.
- *
- * Revision 4.8  1997/04/21  17:07:38  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.8  1997/04/16  21:40:29  caress
- * Version for MB-System 4.5.
- *
- * Revision 4.7  1996/08/26  17:33:15  caress
- * Release 4.4 revision.
- *
- * Revision 4.6  1996/04/22  13:22:24  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/05  20:07:02  caress
- * Added GUI mode so done means quit for real. Also changed done and
- * quit handling in browse mode so that the program doesn't read the
- * entire data file before closing it.
- *
- * Revision 4.4  1995/11/02  19:22:45  caress
- *  Fixed mb_error calls.
- *
- * Revision 4.3  1995/09/28  18:01:01  caress
- * Improved handling of .mbxxx file suffix convention.
- *
- * Revision 4.2  1995/09/18  22:40:44  caress
- * Fixed bug that caused "select all" function to miss last data
- * point on plots of entire data set.
- *
- * Revision 4.1  1995/08/17  14:58:12  caress
- * Revision for release 4.3.
- *
- * Revision 4.0  1995/08/07  18:33:22  caress
- * First cut.
- *
  *
  */
 
@@ -274,7 +123,7 @@ struct mbnavedit_plot_struct
 	};
 
 /* id variables */
-static char rcs_id[] = "$Id: mbnavedit_prog.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbnavedit_prog.c 2247 2015-05-29 21:28:28Z caress $";
 static char program_name[] = "MBNAVEDIT";
 static char help_message[] =  "MBNAVEDIT is an interactive navigation editor for swath sonar data.\n\tIt can work with any data format supported by the MBIO library.\n";
 static char usage_message[] = "mbnavedit [-Byr/mo/da/hr/mn/sc -D  -Eyr/mo/da/hr/mn/sc \n\t-Fformat -Ifile -Ooutfile -X -V -H]";
@@ -3134,7 +2983,7 @@ int mbnavedit_action_use_smg()
 		/* recalculate model */
 		if (speedheading_change == MB_YES
 			&& model_mode == MODEL_MODE_DR)
-			mbnavedit_get_model(i);
+			mbnavedit_get_model();
 
 		/* clear the screen */
 		status = mbnavedit_clear_screen();
@@ -3212,7 +3061,7 @@ int mbnavedit_action_use_cmg()
 		/* recalculate model */
 		if (speedheading_change == MB_YES
 			&& model_mode == MODEL_MODE_DR)
-			mbnavedit_get_model(i);
+			mbnavedit_get_model();
 
 		/* clear the screen */
 		status = mbnavedit_clear_screen();
diff --git a/src/mbvelocitytool/Makefile.am b/src/mbvelocitytool/Makefile.am
index a6e9775..e9614f6 100644
--- a/src/mbvelocitytool/Makefile.am
+++ b/src/mbvelocitytool/Makefile.am
@@ -4,11 +4,9 @@ AM_CFLAGS = ${libnetcdf_CFLAGS}
 
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
 	      ${libnetcdf_CPPFLAGS} \
-	      ${motif_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I${top_srcdir}/src/gsf
-endif
+	      ${libmotif_CPPFLAGS}
 
 AM_LDFLAGS = 
 
@@ -16,7 +14,7 @@ LIBS = ${top_builddir}/src/mbio/libmbio.la \
        ${top_builddir}/src/mbaux/libmbaux.la \
        ${top_builddir}/src/mbaux/libmbxgr.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} \
+       ${libmotif_LIBS} \
        $(LIBM)
 
 mbvelocitytool_SOURCES = mbvelocity_bxutils.c mbvelocity.c mbvelocity_callbacks.c \
diff --git a/src/mbvelocitytool/Makefile.in b/src/mbvelocitytool/Makefile.in
index e280e82..71b35f4 100644
--- a/src/mbvelocitytool/Makefile.in
+++ b/src/mbvelocitytool/Makefile.in
@@ -79,7 +79,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = mbvelocitytool$(EXEEXT)
- at BUILD_GSF_TRUE@am__append_1 = -I${top_srcdir}/src/gsf
 subdir = src/mbvelocitytool
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -194,8 +193,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -210,7 +207,7 @@ LIBS = ${top_builddir}/src/mbio/libmbio.la \
        ${top_builddir}/src/mbaux/libmbaux.la \
        ${top_builddir}/src/mbaux/libmbxgr.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} \
+       ${libmotif_LIBS} \
        $(LIBM)
 
 LIBTOOL = @LIBTOOL@
@@ -218,6 +215,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -281,19 +279,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -306,8 +311,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -322,8 +325,12 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	${libnetcdf_CPPFLAGS} ${motif_CPPFLAGS} $(am__append_1)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
+	      ${libnetcdf_CPPFLAGS} \
+	      ${libmotif_CPPFLAGS}
+
 AM_LDFLAGS = 
 mbvelocitytool_SOURCES = mbvelocity_bxutils.c mbvelocity.c mbvelocity_callbacks.c \
         mbvelocity_creation.c mbvelocity_prog.c mbvelocity_creation.h mbvelocity.h
diff --git a/src/mbvelocitytool/Makefile.template b/src/mbvelocitytool/Makefile.template
deleted file mode 100644
index dcc0c04..0000000
--- a/src/mbvelocitytool/Makefile.template
+++ /dev/null
@@ -1,93 +0,0 @@
-#     The MB-system:	Makefile.template  8/2/94
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 1993-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbvelocitytool directory level
-# Author:	D. W. Caress
-# Date:		September 14, 1994
-#
-# $Log: Makefile.template,v $
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of Motif include files:
-MOTIFINCDIR = /usr/include/Xm
-MOTIFLIBS = -lXm -lXt -lX11
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -DIRIX
-LFLAGS =  -lmalloc -lm -lsun -g
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the executable, .uid file, and man page
-all: $(BINDIR)/mbvelocitytool
-
-### link the executable
-$(BINDIR)/mbvelocitytool: mbvelocity.o \
-		mbvelocity_callbacks.o \
-		mbvelocity_creation.o \
-		mbvelocity_bxutils.o \
-		mbvelocity_prog.o \
-		$(LIBDIR)/libmbio.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libmbbsio.a \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbxgr.a
-	$(CC) $(CFLAGS) mbvelocity.o \
-		mbvelocity_callbacks.o \
-		mbvelocity_creation.o \
-		mbvelocity_bxutils.o \
-		mbvelocity_prog.o \
-		$(LIBDIR)/libmbio.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libmbbsio.a \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbaux.a \
-		$(LIBDIR)/libmbxgr.a \
-		$(MOTIFLIBS) $(LFLAGS) \
-		-o $(BINDIR)/mbvelocitytool
-
-### compile the source files
-mbvelocity.o: mbvelocity.c mbvelocity.h mbvelocity_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbvelocity.c
-mbvelocity_callbacks.o: mbvelocity_callbacks.c mbvelocity.h ../mbaux/mb_xgraphics.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -I$(MOTIFINCDIR) -c mbvelocity_callbacks.c
-mbvelocity_creation.o: mbvelocity_creation.c mbvelocity.h mbvelocity_creation.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbvelocity_creation.c
-mbvelocity_bxutils.o: mbvelocity_bxutils.c
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbvelocity_bxutils.c
-mbvelocity_prog.o: mbvelocity_prog.c mbvelocity.h ../mbio/mb_format.h \
-		../mbio/mb_io.h ../mbio/mb_status.h ../mbio/mb_define.h \
-                ../mbaux/mb_aux.h
-	$(CC) $(CFLAGS) -I../mbio -I../mbaux -c mbvelocity_prog.c
-
-clean:
-	rm -f core *.o
diff --git a/src/mbvelocitytool/mbvelocity.c b/src/mbvelocitytool/mbvelocity.c
index 0c3b87b..109e4fd 100644
--- a/src/mbvelocitytool/mbvelocity.c
+++ b/src/mbvelocitytool/mbvelocity.c
@@ -59,6 +59,11 @@ extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
  */
 extern void do_quit(Widget, XtPointer, XtPointer);
 
+/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
+#ifdef WIN32
+#	undef BOOL
+#endif
+
 /* Begin user code block <globals> */
 
 #include "mb_define.h"
@@ -96,7 +101,7 @@ int main( int argc, char **argv)
      * Initialize Xt.
      */
 
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
 
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbvelocitytool/mbvelocity.h b/src/mbvelocitytool/mbvelocity.h
index 103ea0f..c7fbf2f 100644
--- a/src/mbvelocitytool/mbvelocity.h
+++ b/src/mbvelocitytool/mbvelocity.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbvelocity.h	10/15/2009
- *    $Id: mbvelocity.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbvelocity.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c); 2009-2014 by
+ *    Copyright (c); 2009-2015 by
  *    David W. Caress (caress at mbari.org);
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -25,9 +25,6 @@
  * Author:	D. W. Caress
  * Date:	October 15, 2009
  *
- * $Log: $
- *
- *
  */
 
 /*--------------------------------------------------------------------*/
@@ -74,7 +71,7 @@ struct mbvt_ping_struct
 
 /* function prototypes */
 void do_mbvelocity_init(int argc, char **argv);
-void do_set_controls();
+void do_set_controls(void);
 void do_velrange( Widget w, XtPointer client_data, XtPointer call_data);
 void do_velcenter( Widget w, XtPointer client_data, XtPointer call_data);
 void do_process_mb( Widget w, XtPointer client_data, XtPointer call_data);
@@ -96,14 +93,14 @@ void do_io_mode_open_svp_edit( Widget w, XtPointer client_data, XtPointer call_d
 void do_expose( Widget w, XtPointer client_data, XtPointer call_data);
 int do_wait_until_viewed(XtAppContext app);
 int do_message_on(char *message);
-int do_message_off();
+int do_message_off(void);
 int do_error_dialog(char *s1, char *s2, char *s3);
 void set_label_string(Widget w, String str);
 void set_label_multiline_string(Widget w, String str);
 void get_text_string(Widget w, String str);
 
 int mbvt_init(int argc, char **argv);
-int mbvt_quit();
+int mbvt_quit(void);
 int mbvt_set_graphics(void *xgid, int *brdr, int ncol, unsigned int *pixels);
 int mbvt_get_values(int *s_edit, int *s_ndisplay, double *s_maxdepth,
 	double *s_velrange, double *s_velcenter, double *s_resrange,
@@ -112,14 +109,14 @@ int mbvt_set_values(int s_edit, int s_ndisplay,
 		double s_maxdepth, double s_velrange, double s_velcenter,
 		double s_resrange, int s_anglemode);
 int mbvt_open_edit_profile(char *file);
-int mbvt_new_edit_profile();
+int mbvt_new_edit_profile(void);
 int mbvt_save_edit_profile(char *file);
 int mbvt_save_swath_profile(char *file);
 int mbvt_save_residuals(char *file);
 int mbvt_open_display_profile(char *file);
 int mbvt_get_display_names(int *nlist, char *list[MAX_PROFILES]);
 int mbvt_delete_display_profile(int select);
-int mbvt_plot();
+int mbvt_plot(void);
 int mbvt_action_select_node(int x, int y);
 int mbvt_action_mouse_up(int x, int y);
 int mbvt_action_drag_node(int x, int y);
@@ -127,9 +124,15 @@ int mbvt_action_add_node(int x, int y);
 int mbvt_action_delete_node(int x, int y);
 int mbvt_get_format(char *file, int *form);
 int mbvt_open_swath_file(char *file, int form, int *numload);
-int mbvt_deallocate_swath();
-int mbvt_process_multibeam();
+int mbvt_deallocate_swath(void);
+int mbvt_process_multibeam(void);
+
 
-XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void BxExitCB(Widget w, XtPointer client, XtPointer call);
+void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
 
 /*--------------------------------------------------------------------*/
diff --git a/src/mbvelocitytool/mbvelocity_callbacks.c b/src/mbvelocitytool/mbvelocity_callbacks.c
index 036e402..22662aa 100644
--- a/src/mbvelocitytool/mbvelocity_callbacks.c
+++ b/src/mbvelocitytool/mbvelocity_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbvelocity_callbacks.c	4/7/97
- *    $Id: mbvelocity_callbacks.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbvelocity_callbacks.c 2252 2015-07-01 19:35:37Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -25,56 +25,6 @@
  * Date:	April 8, 1993
  * Date:	April 7, 1997  GUI recast
  *
- * $Log: mbvelocity_callbacks.c,v $
- * Revision 5.7  2006/01/24 19:20:45  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.6  2003/04/17 21:11:18  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/08/21 00:51:54  caress
- * Fixed label displays for command line loading.
- *
- * Revision 5.4  2002/04/06 02:53:15  caress
- * Release 5.0.beta16
- *
- * Revision 5.3  2001/06/02 00:10:04  caress
- * Now use mb_get_format()
- *
- * Revision 5.2  2001/03/22  21:12:42  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.1  2001/01/22  07:51:19  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:56:47  caress
- * First cut at Version 5.0.
- *
- * Revision 4.6  2000/10/11  01:06:03  caress
- * Convert to ANSI C
- *
- * Revision 4.5  2000/09/30  07:05:18  caress
- * Snapshot for Dale.
- *
- * Revision 4.4  1999/09/15  21:01:47  caress
- * Version label now set from mb_format.h
- *
- * Revision 4.3  1998/10/05  19:18:58  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/09/15  19:10:50  caress
- * Real Version 4.5
- *
- * Revision 4.1  1997/04/22  19:25:26  caress
- * Fixed startup mode.
- *
- * Revision 4.0  1997/04/21  17:16:20  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1997/04/16  21:36:42  caress
- * Complete rewrite of mbvelocitytool without uid file.
- *
- *
  */
 /*
  * README: This file is appended to at file generation time.
@@ -143,19 +93,27 @@
 #endif
 #endif
 
+#ifndef FIXED
+#define FIXED "fixed"
+#endif
+
 Widget		BxFindTopShell PROTOTYPE((Widget));
 WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
 
 
 /*--------------------------------------------------------------------*/
 
+/* id variables */
+static char svn_id[] = "$Id: mbvelocity_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
+static char program_name[] = "MBvelocitytool";
+
 /* additional widgets */
 Widget	fileSelectionList;
 Widget	fileSelectionText;
 
 /* global defines and variables */
 #define EV_MASK (ButtonPressMask | KeyPressMask | KeyReleaseMask | ExposureMask )
-#define xgfont "-misc-fixed-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
+#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
 
 XtAppContext	app_context;
 Display		*display;
@@ -549,6 +507,13 @@ do_mbvelocity_init(int argc, char **argv)
 
     /* Setup the font for just the "canvas" screen. */
     fontStruct = XLoadQueryFont(display, xgfont);
+    if (fontStruct == NULL)
+        {
+	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
+        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
+	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+	exit(-1);
+        }
     XSetFont(display,gc,fontStruct->fid);
 
     XSelectInput(display, can_xid, EV_MASK );
diff --git a/src/mbvelocitytool/mbvelocity_creation.c b/src/mbvelocitytool/mbvelocity_creation.c
index d69d11c..7228402 100644
--- a/src/mbvelocitytool/mbvelocity_creation.c
+++ b/src/mbvelocitytool/mbvelocity_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
@@ -214,7 +225,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_mode = XmCreatePushButton(input_screen,
             (char *)"pushButton_mode",
@@ -242,7 +253,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_plotscaling = XmCreatePushButton(input_screen,
             (char *)"pushButton_plotscaling",
@@ -292,7 +303,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 73); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(menuBar_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(menuBar_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         cascadeButton_file = XmCreateCascadeButton(menuBar_file,
             (char *)"cascadeButton_file",
@@ -325,7 +336,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_open_svp_display = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_open_svp_display",
@@ -353,7 +364,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_open_svp_edit = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_open_svp_edit",
@@ -381,7 +392,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_new_svp_edit = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_new_svp_edit",
@@ -405,7 +416,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_save_svp = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_save_svp",
@@ -440,7 +451,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_open_mb = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_open_mb",
@@ -476,7 +487,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNsensitive, False); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_save_svpfile = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_save_svpfile",
@@ -500,7 +511,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_save_residuals = XmCreatePushButton(pulldownMenu_file,
             (char *)"pushButton_save_residuals",
@@ -532,7 +543,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_about = XmCreatePushButton(input_screen,
             (char *)"pushButton_about",
@@ -560,7 +571,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_quit = XmCreatePushButton(input_screen,
             (char *)"pushButton_quit",
@@ -588,7 +599,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_process = XmCreatePushButton(input_screen,
             (char *)"pushButton_process",
@@ -633,7 +644,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNy, 40); ac++;
         XtSetArg(args[ac], XmNwidth, 1010); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_status_display = XmCreateLabel(input_screen,
             (char *)"label_status_display",
@@ -660,7 +671,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNy, 60); ac++;
         XtSetArg(args[ac], XmNwidth, 1010); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_status_edit = XmCreateLabel(input_screen,
             (char *)"label_status_edit",
@@ -687,7 +698,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNy, 80); ac++;
         XtSetArg(args[ac], XmNwidth, 1010); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_status_mb = XmCreateLabel(input_screen,
             (char *)"label_status_mb",
@@ -732,7 +743,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 260); ac++;
@@ -770,7 +781,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 200); ac++;
         XtSetArg(args[ac], XmNy, 410); ac++;
@@ -798,7 +809,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 240); ac++;
@@ -825,7 +836,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 250); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -852,7 +863,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 70); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -879,7 +890,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 120); ac++;
@@ -906,7 +917,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 160); ac++;
@@ -933,7 +944,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 90); ac++;
@@ -960,7 +971,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 190); ac++;
@@ -998,7 +1009,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -1026,7 +1037,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 40); ac++;
@@ -1053,7 +1064,7 @@ Createwindow_mbvelocity(Widget parent)
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -1110,7 +1121,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 360); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_pleasewait = XmCreateLabel(bulletinBoard_message,
             (char *)"label_pleasewait",
@@ -1138,7 +1149,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 360); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_message = XmCreateLabel(bulletinBoard_message,
             (char *)"label_message",
@@ -1186,7 +1197,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNy, 490); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_fileselect, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_fileselect, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_mbformat = XmCreateLabel(bulletinBoard_fileselect,
             (char *)"label_mbformat",
@@ -1217,7 +1228,7 @@ Createwindow_mbvelocity(Widget parent)
     XtSetArg(args[ac], XmNy, 490); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_fileselect, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+        BX_CONVERT(bulletinBoard_fileselect, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
         XmRFontList, 0, &argok)); if (argok) ac++;
     textField_mbformat = XmCreateTextField(bulletinBoard_fileselect,
         (char *)"textField_mbformat",
@@ -1277,7 +1288,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_two = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_two",
@@ -1305,7 +1316,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_one = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_one",
@@ -1333,7 +1344,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 290); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_error_three = XmCreateLabel(bulletinBoard_error,
             (char *)"label_error_three",
@@ -1360,7 +1371,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_error = XmCreatePushButton(bulletinBoard_error,
             (char *)"pushButton_error",
@@ -1409,7 +1420,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_vel_center_max = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_vel_center_max",
@@ -1434,7 +1445,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 90); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_velcenter = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_velcenter",
@@ -1464,7 +1475,7 @@ Createwindow_mbvelocity(Widget parent)
     XtSetArg(args[ac], XmNwidth, 270); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_velcenter = XmCreateScale(bulletinBoard_scaling,
         (char *)"slider_velcenter",
@@ -1485,7 +1496,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_scaling_dismiss = XmCreatePushButton(bulletinBoard_scaling,
             (char *)"pushButton_scaling_dismiss",
@@ -1514,7 +1525,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_res_range_max = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_res_range_max",
@@ -1551,7 +1562,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 270); ac++;
         XtSetArg(args[ac], XmNheight, 39); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         slider_residual_range = XmCreateScale(bulletinBoard_scaling,
             (char *)"slider_residual_range",
@@ -1577,7 +1588,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 130); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_residual_range = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_residual_range",
@@ -1605,7 +1616,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_vel_range_max = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_vel_range_max",
@@ -1635,7 +1646,7 @@ Createwindow_mbvelocity(Widget parent)
     XtSetArg(args[ac], XmNwidth, 270); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_velrange = XmCreateScale(bulletinBoard_scaling,
         (char *)"slider_velrange",
@@ -1654,7 +1665,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 50); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_velrange = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_velrange",
@@ -1682,7 +1693,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_max_depth_max = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_max_depth_max",
@@ -1712,7 +1723,7 @@ Createwindow_mbvelocity(Widget parent)
     XtSetArg(args[ac], XmNwidth, 270); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
         XmRFontList, 0, &argok)); if (argok) ac++;
     slider_maxdepth = XmCreateScale(bulletinBoard_scaling,
         (char *)"slider_maxdepth",
@@ -1731,7 +1742,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         label_max_depth = XmCreateLabel(bulletinBoard_scaling,
             (char *)"label_max_depth",
@@ -1803,7 +1814,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 287); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(radioBox_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(radioBox_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_mode_ok = XmCreateToggleButton(radioBox_mode,
             (char *)"toggleButton_mode_ok",
@@ -1829,7 +1840,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 287); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(radioBox_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(radioBox_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_mode_snell = XmCreateToggleButton(radioBox_mode,
             (char *)"toggleButton_mode_snell",
@@ -1855,7 +1866,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 287); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(radioBox_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(radioBox_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         toggleButton_mode_null = XmCreateToggleButton(radioBox_mode,
             (char *)"toggleButton_mode_null",
@@ -1883,7 +1894,7 @@ Createwindow_mbvelocity(Widget parent)
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
+            BX_CONVERT(bulletinBoard_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
             XmRFontList, 0, &argok)); if (argok) ac++;
         pushButton_mode_dismiss = XmCreatePushButton(bulletinBoard_mode,
             (char *)"pushButton_mode_dismiss",
diff --git a/src/mbvelocitytool/mbvelocity_prog.c b/src/mbvelocitytool/mbvelocity_prog.c
index c3e2b33..d097d29 100644
--- a/src/mbvelocitytool/mbvelocity_prog.c
+++ b/src/mbvelocitytool/mbvelocity_prog.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:    mbvelocitytool.c        6/6/93
- *    $Id: mbvelocity_prog.c 2210 2014-11-10 19:53:01Z caress $
+ *    $Id: mbvelocity_prog.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -24,171 +24,6 @@
  * Author:      D. W. Caress
  * Date:        June 6, 1993
  *
- * $Log: mbvelocity_prog.c,v $
- * Revision 5.19  2009/03/02 18:59:05  caress
- * Moving towards 5.1.2beta1.
- *
- * Revision 5.18  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.17  2008/07/20 15:31:33  caress
- * Lengthened filename char arrays to prevent possible overflows.
- *
- * Revision 5.16  2006/09/11 18:55:53  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.15  2006/01/24 19:20:45  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.14  2005/11/05 01:06:40  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.13  2004/10/06 19:06:56  caress
- * Release 5.0.5 update.
- *
- * Revision 5.12  2003/04/17 21:11:18  caress
- * Release 5.0.beta30
- *
- * Revision 5.11  2002/08/21 00:51:54  caress
- * Fixed label displays for command line loading.
- *
- * Revision 5.10  2002/07/25 19:06:27  caress
- * Release 5.0.beta21
- *
- * Revision 5.9  2002/07/20 20:46:57  caress
- * Release 5.0.beta20
- *
- * Revision 5.8  2002/04/06 02:53:15  caress
- * Release 5.0.beta16
- *
- * Revision 5.7  2001/11/20 20:41:13  caress
- * Fixed use of -I option.
- *
- * Revision 5.6  2001/07/20  16:09:36  caress
- * Fixed bug w/ *numload.
- *
- * Revision 5.5  2001/07/20  00:34:28  caress
- * Release 5.0.beta03
- *
- * Revision 5.4  2001/06/02  00:10:04  caress
- * Now use mb_get_format()
- *
- * Revision 5.3  2001/04/06  22:16:40  caress
- * Fixed bug.
- *
- * Revision 5.2  2001/03/22  21:12:42  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.1  2001/01/22  07:51:19  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:56:47  caress
- * First cut at Version 5.0.
- *
- * Revision 4.23  2000/10/11  01:06:03  caress
- * Convert to ANSI C
- *
- * Revision 4.22  2000/09/30  07:05:18  caress
- * Snapshot for Dale.
- *
- * Revision 4.21  1999/02/04  23:54:54  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.20  1998/10/09  18:46:59  caress
- * MB-System version 4.6beta
- *
- * Revision 4.19  1997/09/16  21:44:24  caress
- * Removed draft option as it is no longer needed.
- *
- * Revision 4.18  1997/09/15  19:10:50  caress
- * Real Version 4.5
- *
- * Revision 4.17  1997/07/25  14:27:30  caress
- * Version 4.5beta2.
- *
- * Revision 4.16  1997/04/21  17:09:54  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.16  1997/04/16  21:35:31  caress
- * Complete rewrite of mbvelocitytool without uid file.
- *
- * Revision 4.15  1996/08/26  17:34:23  caress
- * Release 4.4 revision.
- *
- * Revision 4.14  1996/04/22 13:22:47  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.13  1996/02/16  18:27:11  caress
- * Changed labels from Water Velocity to Water Sound Velocity.
- *
- * Revision 4.12 1996/02/12  18:09:25  caress
- * Added command line arguments to specify input files at startup time.
- *
- * Revision 4.11  1996/01/26  21:25:34 caress
- * Version 4.3 distribution.
- *
- * Revision 4.10  1995/10/02 22:25:20  caress
- * Added -D option.
- *
- * Revision 4.9  1995/09/28 18:03:58  caress
- * Improved handling of .mbxxx file suffix convention.
- *
- * Revision 4.8  1995/06/06  12:57:17  caress
- * Fixed mb_close() call.
- *
- * Revision 4.7  1995/05/12  17:27:40  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok nonzero: error
- *
- * Revision 4.6  1995/03/17  15:23:00  caress
- * Changed size of new editable profiles to
- * 30 nodes.
- *
- * Revision 4.5  1995/03/06  19:41:22  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/02/14 18:26:46  caress
- * Moved the widgets around, made the format defaults work, and made
- * the program recognize the MB-System file suffix convention.
- *
- * Revision 4.3  1994/11/24  01:54:08  caress
- * Some fixes related to gradient raytracing version.
- *
- * Revision 4.2 1994/11/18  18:58:19  caress
- * First gradient raytracing version.
- *
- * Revision 4.1  1994/11/10  01:16:07  caress
- * Set program to do raytracing for every ping rather than once at beginning.
- *
- * Revision 4.0  1994/10/21  12:43:44  caress
- * Release V4.0
- *
- * Revision 4.2 1994/04/12  01:13:24  caress
- * First cut at translation from hsvelocitytool. The new program
- * mbvelocitytool will deal with all supported multibeam data
- * including travel time observations.
- *
- * Revision 4.1  1994/03/12  01:50:30  caress
- * Added declarations of ctime and/or getenv for compatability
- * with SGI compilers.
- *
- * Revision 4.0  1994/03/05  23:49:05  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:53:26  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/27  00:17:23  caress
- * First cut at new version.
- *
- * Revision 1.2  1993/11/05  16:21:57  caress
- * The graphical representation of the editable velocity profile
- * now shows the layered model actually used for the raytracing.
- *
- * Revision 1.1 1993/08/16  23:28:30  caress
- * Initial revision
- *
  *
  */
 
@@ -216,7 +51,7 @@
 #include "mbvelocity.h"
 
 /* id variables */
-static char rcs_id[] = "$Id: mbvelocity_prog.c 2210 2014-11-10 19:53:01Z caress $";
+static char rcs_id[] = "$Id: mbvelocity_prog.c 2239 2015-05-07 00:51:42Z caress $";
 static char program_name[] = "MBVELOCITYTOOL";
 static char help_message[] = "MBVELOCITYTOOL is an interactive water velocity profile editor  \nused to examine multiple water velocity profiles and to create  \nnew water velocity profiles which can be used for the processing  \nof multibeam sonar data.  In general, this tool is used to  \nexamine water velocity profiles obtained from XBTs, CTDs, or  \ndatabases, and to construct new profiles consistent with these  \nvarious sources of information.";
 static char usage_message[] = "mbvelocitytool [-Byr/mo/da/hr/mn/sc -Eyr/mo/da/hr/mn/sc \n\t-Fformat -Ifile -Ssvpfile -Wsvpfile -V -H]";
@@ -347,7 +182,9 @@ int	pixel_values[256];
 
 /* system function declarations */
 char	*ctime();
+#ifndef WIN32
 char	*getenv();
+#endif
 
 /*--------------------------------------------------------------------*/
 /* Initialize the 'mbio' struct                                       */
diff --git a/src/mbview/MB3DNavList.c b/src/mbview/MB3DNavList.c
index 59902df..615e3ee 100644
--- a/src/mbview/MB3DNavList.c
+++ b/src/mbview/MB3DNavList.c
@@ -14,6 +14,21 @@
  * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
  *
  */
+
+/* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
+/* End user code block <file_comments> */
+
 #include <Xm/Xm.h>
 #include <Xm/Form.h>
 #include <Xm/Label.h>
@@ -128,7 +143,7 @@ MB3DNavListCreate ( MB3DNavListDataPtr class_in, Widget parent, String name, Arg
         XtSetArg(args[ac], XmNwidth, 390); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_navlist_label = XmCreateLabel(class_in->MB3DNavList,
             (char *)"mbview_navlist_label",
@@ -155,7 +170,7 @@ MB3DNavListCreate ( MB3DNavListDataPtr class_in, Widget parent, String name, Arg
         XtSetArg(args[ac], XmNwidth, 210); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_navlist_delete = XmCreatePushButton(class_in->MB3DNavList,
             (char *)"mbview_pushButton_navlist_delete",
@@ -183,7 +198,7 @@ MB3DNavListCreate ( MB3DNavListDataPtr class_in, Widget parent, String name, Arg
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_navlist_dismiss = XmCreatePushButton(class_in->MB3DNavList,
             (char *)"mbview_pushButton_navlist_dismiss",
@@ -216,7 +231,7 @@ MB3DNavListCreate ( MB3DNavListDataPtr class_in, Widget parent, String name, Arg
     XtSetArg(args[ac], XmNwidth, 390); ac++;
     XtSetArg(args[ac], XmNheight, 150); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_scrolledWindow_navlist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_scrolledWindow_navlist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_list_navlist = XmCreateList(class_in->mbview_scrolledWindow_navlist,
         (char *)"mbview_list_navlist",
diff --git a/src/mbview/MB3DRouteList.c b/src/mbview/MB3DRouteList.c
index 1f31eee..e43af40 100644
--- a/src/mbview/MB3DRouteList.c
+++ b/src/mbview/MB3DRouteList.c
@@ -14,6 +14,21 @@
  * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
  *
  */
+
+/* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
+/* End user code block <file_comments> */
+
 #include <Xm/Xm.h>
 #include <Xm/Form.h>
 #include <Xm/Label.h>
@@ -128,7 +143,7 @@ MB3DRouteListCreate ( MB3DRouteListDataPtr class_in, Widget parent, String name,
         XtSetArg(args[ac], XmNwidth, 390); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_routelist_label = XmCreateLabel(class_in->MB3DRouteList,
             (char *)"mbview_routelist_label",
@@ -155,7 +170,7 @@ MB3DRouteListCreate ( MB3DRouteListDataPtr class_in, Widget parent, String name,
         XtSetArg(args[ac], XmNwidth, 170); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_routelist_delete = XmCreatePushButton(class_in->MB3DRouteList,
             (char *)"mbview_pushButton_routelist_delete",
@@ -183,7 +198,7 @@ MB3DRouteListCreate ( MB3DRouteListDataPtr class_in, Widget parent, String name,
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_routelist_dismiss = XmCreatePushButton(class_in->MB3DRouteList,
             (char *)"mbview_pushButton_routelist_dismiss",
@@ -216,7 +231,7 @@ MB3DRouteListCreate ( MB3DRouteListDataPtr class_in, Widget parent, String name,
     XtSetArg(args[ac], XmNwidth, 390); ac++;
     XtSetArg(args[ac], XmNheight, 150); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_scrolledWindow_routelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_scrolledWindow_routelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_list_routelist = XmCreateList(class_in->mbview_scrolledWindow_routelist,
         (char *)"mbview_list_routelist",
diff --git a/src/mbview/MB3DSiteList.c b/src/mbview/MB3DSiteList.c
index 702a607..2641928 100644
--- a/src/mbview/MB3DSiteList.c
+++ b/src/mbview/MB3DSiteList.c
@@ -14,6 +14,22 @@
  * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
  *
  */
+
+/* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
+/* End user code block <file_comments> */
+
+
 #include <Xm/Xm.h>
 #include <Xm/Form.h>
 #include <Xm/PushB.h>
@@ -127,7 +143,7 @@ MB3DSiteListCreate ( MB3DSiteListDataPtr class_in, Widget parent, String name, A
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_sitelist_dismiss = XmCreatePushButton(class_in->MB3DSiteList,
             (char *)"mbview_pushButton_sitelist_dismiss",
@@ -155,7 +171,7 @@ MB3DSiteListCreate ( MB3DSiteListDataPtr class_in, Widget parent, String name, A
         XtSetArg(args[ac], XmNwidth, 170); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_sitelist_delete = XmCreatePushButton(class_in->MB3DSiteList,
             (char *)"mbview_pushButton_sitelist_delete",
@@ -184,7 +200,7 @@ MB3DSiteListCreate ( MB3DSiteListDataPtr class_in, Widget parent, String name, A
         XtSetArg(args[ac], XmNwidth, 390); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_sitelist_label = XmCreateLabel(class_in->MB3DSiteList,
             (char *)"mbview_sitelist_label",
@@ -216,7 +232,7 @@ MB3DSiteListCreate ( MB3DSiteListDataPtr class_in, Widget parent, String name, A
     XtSetArg(args[ac], XmNwidth, 390); ac++;
     XtSetArg(args[ac], XmNheight, 180); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_scrolledWindow_sitelist, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_scrolledWindow_sitelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_list_sitelist = XmCreateList(class_in->mbview_scrolledWindow_sitelist,
         (char *)"mbview_list_sitelist",
diff --git a/src/mbview/MB3DView.c b/src/mbview/MB3DView.c
index 45604f8..8160690 100644
--- a/src/mbview/MB3DView.c
+++ b/src/mbview/MB3DView.c
@@ -14,6 +14,21 @@
  * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
  *
  */
+
+/* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
+/* End user code block <file_comments> */
+
 #include <Xm/Xm.h>
 #include <Xm/BulletinB.h>
 #include <Xm/PushB.h>
@@ -214,7 +229,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 60); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_clearpicks = XmCreatePushButton(class_in->MB3DView,
             (char *)"mbview_pushButton_clearpicks",
@@ -242,7 +257,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_reset = XmCreatePushButton(class_in->MB3DView,
             (char *)"mbview_pushButton_reset",
@@ -283,7 +298,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rmove = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rmove",
@@ -309,7 +324,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rrotate = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rrotate",
@@ -335,7 +350,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rviewpoint = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rviewpoint",
@@ -361,7 +376,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rshade = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rshade",
@@ -387,7 +402,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rarea = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rarea",
@@ -415,7 +430,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 125); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rsite = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rsite",
@@ -443,7 +458,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 125); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rroute = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rroute",
@@ -471,7 +486,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 125); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rnav = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rnav",
@@ -499,7 +514,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 125); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rnavfile = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
             (char *)"mbview_toggleButton_mode_rnavfile",
@@ -533,7 +548,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 160); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_status = XmCreateLabel(class_in->MB3DView,
             (char *)"mbview_label_status",
@@ -560,7 +575,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_fullrez = XmCreatePushButton(class_in->MB3DView,
             (char *)"mbview_pushButton_fullrez",
@@ -594,7 +609,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 160); ac++;
         XtSetArg(args[ac], XmNheight, 160); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_pickinfo = XmCreateLabel(class_in->MB3DView,
             (char *)"mbview_label_pickinfo",
@@ -633,7 +648,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_cascadeButton_view = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
             (char *)"mbview_cascadeButton_view",
@@ -666,7 +681,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_display_2D = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_display_2D",
@@ -690,7 +705,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_display_3D = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_display_3D",
@@ -721,7 +736,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_data_primary = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_data_primary",
@@ -745,7 +760,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_data_primaryslope = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_data_primaryslope",
@@ -769,7 +784,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_data_secondary = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_data_secondary",
@@ -800,7 +815,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_histogram = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_histogram",
@@ -831,7 +846,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_none = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_overlay_none",
@@ -855,7 +870,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_illumination = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_overlay_illumination",
@@ -879,7 +894,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_slope = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_overlay_slope",
@@ -903,7 +918,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_secondary = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_overlay_secondary",
@@ -934,7 +949,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_contour = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_overlay_contour",
@@ -958,7 +973,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_site = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_site",
@@ -982,7 +997,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_route = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_route",
@@ -1006,7 +1021,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_nav = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_nav",
@@ -1030,7 +1045,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_navdrape = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_navdrape",
@@ -1054,7 +1069,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_vector = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_vector",
@@ -1085,7 +1100,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_colortable_haxby = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_colortable_haxby",
@@ -1109,7 +1124,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_colortable_bright = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_colortable_bright",
@@ -1133,7 +1148,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_colortable_muted = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_colortable_muted",
@@ -1157,7 +1172,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_colortable_gray = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_colortable_gray",
@@ -1181,7 +1196,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_colortable_flat = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_colortable_flat",
@@ -1205,7 +1220,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_colortable_sealevel1 = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_colortable_sealevel1",
@@ -1229,7 +1244,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_colortable_sealevel2 = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_colortable_sealevel2",
@@ -1260,7 +1275,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_profile = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
             (char *)"mbview_toggleButton_profile",
@@ -1292,7 +1307,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_cascadeButton_controls = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
             (char *)"mbview_cascadeButton_controls",
@@ -1325,7 +1340,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_colorbounds = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_colorbounds",
@@ -1349,7 +1364,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_2dview = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_2dview",
@@ -1373,7 +1388,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_3dview = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_3dview",
@@ -1397,7 +1412,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_shadeparms = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_shadeparms",
@@ -1421,7 +1436,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_resolution = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_resolution",
@@ -1445,7 +1460,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_projections = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_projections",
@@ -1469,7 +1484,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_sitelist = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_sitelist",
@@ -1493,7 +1508,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_routelist = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_routelist",
@@ -1517,7 +1532,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_navlist = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
             (char *)"mbview_pushButton_navlist",
@@ -1549,7 +1564,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_cascadeButton_mouse = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
             (char *)"mbview_cascadeButton_mouse",
@@ -1583,7 +1598,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_move = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_move",
@@ -1608,7 +1623,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_rotate = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_rotate",
@@ -1633,7 +1648,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_viewpoint = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_viewpoint",
@@ -1658,7 +1673,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_shade = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_shade",
@@ -1683,7 +1698,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_area = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_area",
@@ -1707,7 +1722,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_site = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_site",
@@ -1731,7 +1746,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_route = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_route",
@@ -1755,7 +1770,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_nav = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_nav",
@@ -1779,7 +1794,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_mode_navfile = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
             (char *)"mbview_toggleButton_mode_navfile",
@@ -1811,7 +1826,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_cascadeButton_action = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
             (char *)"mbview_cascadeButton_action",
@@ -1844,7 +1859,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_help_about = XmCreatePushButton(class_in->mbview_pulldownMenu_action,
             (char *)"mbview_pushButton_help_about",
@@ -1876,7 +1891,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_cascadeButton_dismiss = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
             (char *)"mbview_cascadeButton_dismiss",
@@ -1909,7 +1924,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_dismiss, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_pulldownMenu_dismiss, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_dismiss = XmCreatePushButton(class_in->mbview_pulldownMenu_dismiss,
             (char *)"mbview_pushButton_dismiss",
@@ -1947,7 +1962,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 160); ac++;
         XtSetArg(args[ac], XmNheight, 80); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_mouse = XmCreateLabel(class_in->MB3DView,
             (char *)"mbview_label_mouse",
@@ -2035,7 +2050,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 270); ac++;
         XtSetArg(args[ac], XmNheight, 62); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_scale_profile_width = XmCreateScale(class_in->mbview_form_profile,
             (char *)"mbview_scale_profile_width",
@@ -2072,7 +2087,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 270); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_scale_profile_slope = XmCreateScale(class_in->mbview_form_profile,
             (char *)"mbview_scale_profile_slope",
@@ -2131,7 +2146,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 270); ac++;
         XtSetArg(args[ac], XmNheight, 130); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_profile_label_info = XmCreateLabel(class_in->mbview_form_profile,
             (char *)"mbview_profile_label_info",
@@ -2163,7 +2178,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 270); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_scale_profile_exager = XmCreateScale(class_in->mbview_form_profile,
             (char *)"mbview_scale_profile_exager",
@@ -2192,7 +2207,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 32); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_profile_pushButton_dismiss = XmCreatePushButton(class_in->mbview_form_profile,
             (char *)"mbview_profile_pushButton_dismiss",
@@ -2244,7 +2259,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_displayprojection = XmCreateLabel(class_in->mbview_bulletinBoard_projection,
             (char *)"mbview_label_displayprojection",
@@ -2281,7 +2296,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_geographic = XmCreateToggleButton(class_in->mbview_radioBox_projection,
             (char *)"mbview_toggleButton_geographic",
@@ -2307,7 +2322,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_utm = XmCreateToggleButton(class_in->mbview_radioBox_projection,
             (char *)"mbview_toggleButton_utm",
@@ -2333,7 +2348,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_spheroid = XmCreateToggleButton(class_in->mbview_radioBox_projection,
             (char *)"mbview_toggleButton_spheroid",
@@ -2366,7 +2381,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 190); ac++;
         XtSetArg(args[ac], XmNheight, 220); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_projection = XmCreateLabel(class_in->mbview_bulletinBoard_projection,
             (char *)"mbview_label_projection",
@@ -2393,7 +2408,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 130); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_projection_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_projection,
             (char *)"mbview_pushButton_projection_dismiss",
@@ -2452,7 +2467,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_2dzoom = XmCreateTextField(class_in->mbview_bulletinBoard_2dparms,
         (char *)"mbview_textField_view_2dzoom",
@@ -2473,7 +2488,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 60); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_2dzoom = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
             (char *)"mbview_label_view_2dzoom",
@@ -2494,7 +2509,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_2doffsety = XmCreateTextField(class_in->mbview_bulletinBoard_2dparms,
         (char *)"mbview_textField_view_2doffsety",
@@ -2515,7 +2530,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_2doffsety = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
             (char *)"mbview_label_view_2doffsety",
@@ -2547,7 +2562,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_2doffsetx = XmCreateTextField(class_in->mbview_bulletinBoard_2dparms,
         (char *)"mbview_textField_view_2doffsetx",
@@ -2568,7 +2583,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_2doffsetx = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
             (char *)"mbview_label_view_2doffsetx",
@@ -2596,7 +2611,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_2d_offset = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
             (char *)"mbview_label_2d_offset",
@@ -2623,7 +2638,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_view_2d_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_2dparms,
             (char *)"mbview_pushButton_view_2d_apply",
@@ -2651,7 +2666,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 70); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_view_2d_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_2dparms,
             (char *)"mbview_pushButton_view_2d_dismiss",
@@ -2710,7 +2725,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_model_3dzoom = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_model_3dzoom",
@@ -2731,7 +2746,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_model_3dzoom = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_model_3dzoom",
@@ -2763,7 +2778,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_3dzoom = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_view_3dzoom",
@@ -2784,7 +2799,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_3dzoom = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_view_3dzoom",
@@ -2805,7 +2820,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_3doffsety = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_view_3doffsety",
@@ -2826,7 +2841,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_3doffsety = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_view_3doffsety",
@@ -2858,7 +2873,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_3doffsetx = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_view_3doffsetx",
@@ -2879,7 +2894,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 60); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_3doffsetx = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_view_3doffsetx",
@@ -2907,7 +2922,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_offset = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_view_offset",
@@ -2928,7 +2943,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_elevation = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_view_elevation",
@@ -2949,7 +2964,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_elevation = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_view_elevation",
@@ -2981,7 +2996,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_view_azimuth = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_view_azimuth",
@@ -3002,7 +3017,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view_azimuth = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_view_azimuth",
@@ -3030,7 +3045,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_view = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_view",
@@ -3051,7 +3066,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_model_elevation = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_model_elevation",
@@ -3065,7 +3080,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_model_azimuth = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_model_azimuth",
@@ -3086,7 +3101,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_model_elevation = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_model_elevation",
@@ -3114,7 +3129,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_model_azimuth = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_model_azimuth",
@@ -3142,7 +3157,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_model = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_model",
@@ -3180,7 +3195,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_view_3d_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_pushButton_view_3d_apply",
@@ -3209,7 +3224,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_exager = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_label_exager",
@@ -3230,7 +3245,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_exageration = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
         (char *)"mbview_textField_exageration",
@@ -3250,7 +3265,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_view_3d_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_3dparms,
             (char *)"mbview_pushButton_view_3d_dismiss",
@@ -3320,7 +3335,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_overlay_center = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
         (char *)"mbview_textField_overlay_center",
@@ -3341,7 +3356,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_overlay_center = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_overlay_center",
@@ -3369,7 +3384,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_overlayshade = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_overlayshade",
@@ -3407,7 +3422,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_shade_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_overlay_shade,
             (char *)"mbview_toggleButton_overlay_shade_ctoh",
@@ -3432,7 +3447,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_shade_htoc = XmCreateToggleButton(class_in->mbview_radioBox_overlay_shade,
             (char *)"mbview_toggleButton_overlay_shade_htoc",
@@ -3453,7 +3468,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_overlay_amp = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
         (char *)"mbview_textField_overlay_amp",
@@ -3474,7 +3489,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_overlay_amp = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_overlay_amp",
@@ -3506,7 +3521,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_slope_amp = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
         (char *)"mbview_textField_slope_amp",
@@ -3527,7 +3542,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_slope_amp = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_slope_amp",
@@ -3555,7 +3570,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_slopeshade = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_slopeshade",
@@ -3576,7 +3591,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_illum_azi = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
         (char *)"mbview_textField_illum_azi",
@@ -3590,7 +3605,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_illum_amp = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
         (char *)"mbview_textField_illum_amp",
@@ -3611,7 +3626,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 140); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_illum_azi = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_illum_azi",
@@ -3639,7 +3654,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_illum_amp = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_illum_amp",
@@ -3667,7 +3682,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_illumination = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_illumination",
@@ -3705,7 +3720,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_shadeparms_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_pushButton_shadeparms_apply",
@@ -3734,7 +3749,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 150); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_illum_elev = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_label_illum_elev",
@@ -3755,7 +3770,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_illum_elev = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
         (char *)"mbview_textField_illum_elev",
@@ -3775,7 +3790,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_shadeparms_dismiss2 = XmCreatePushButton(class_in->mbview_bulletinBoard_shadeparms,
             (char *)"mbview_pushButton_shadeparms_dismiss2",
@@ -3835,7 +3850,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-times-bold-r-*-*-*- [...]
+            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-"SERI [...]
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
@@ -3863,7 +3878,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*- [...]
+            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold- [...]
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 280); ac++;
@@ -3890,7 +3905,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-times-bold-r-*-*-*-240-*-*- [...]
+            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold- [...]
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 70); ac++;
         XtSetArg(args[ac], XmNy, 340); ac++;
@@ -3917,7 +3932,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*- [...]
+            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold- [...]
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 230); ac++;
         XtSetArg(args[ac], XmNy, 340); ac++;
@@ -3955,7 +3970,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*- [...]
+            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold- [...]
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 120); ac++;
@@ -3993,7 +4008,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-times-bold-r-*-*-*-240-*-*- [...]
+            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold- [...]
             XmRFontList, 0, &argok)); if (argok) ac++;
         XtSetArg(args[ac], XmNx, 10); ac++;
         XtSetArg(args[ac], XmNy, 10); ac++;
@@ -4024,7 +4039,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_about_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_about,
             (char *)"mbview_pushButton_about_dismiss",
@@ -4090,7 +4105,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 400); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_message = XmCreateLabel(class_in->mbview_bulletinBoard_message,
             (char *)"mbview_label_message",
@@ -4118,7 +4133,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 400); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_thanks = XmCreateLabel(class_in->mbview_bulletinBoard_message,
             (char *)"mbview_label_thanks",
@@ -4190,7 +4205,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_scale_navmediumresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
             (char *)"mbview_scale_navmediumresolution",
@@ -4225,7 +4240,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_scale_navlowresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
             (char *)"mbview_scale_navlowresolution",
@@ -4264,7 +4279,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 270); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_navrenderdecimation = XmCreateLabel(class_in->mbview_bulletinBoard_resolution,
             (char *)"mbview_label_navrenderdecimation",
@@ -4291,7 +4306,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 270); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_gridrenderres = XmCreateLabel(class_in->mbview_bulletinBoard_resolution,
             (char *)"mbview_label_gridrenderres",
@@ -4325,7 +4340,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_scale_mediumresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
             (char *)"mbview_scale_mediumresolution",
@@ -4360,7 +4375,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_scale_lowresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
             (char *)"mbview_scale_lowresolution",
@@ -4388,7 +4403,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_resolution_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_resolution,
             (char *)"mbview_pushButton_resolution_dismiss",
@@ -4476,7 +4491,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_overlaymode,
             (char *)"mbview_toggleButton_overlay_ctoh",
@@ -4501,7 +4516,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_overlay_htoc = XmCreateToggleButton(class_in->mbview_radioBox_overlaymode,
             (char *)"mbview_toggleButton_overlay_htoc",
@@ -4522,7 +4537,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_overlaymax = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
         (char *)"mbview_textField_overlaymax",
@@ -4543,7 +4558,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_overlaymax = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_overlaymax",
@@ -4564,7 +4579,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_overlaymin = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
         (char *)"mbview_textField_overlaymin",
@@ -4585,7 +4600,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_overlaymin = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_overlaymin",
@@ -4613,7 +4628,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_overlaybounds = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_overlaybounds",
@@ -4662,7 +4677,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_slope_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_slopemode,
             (char *)"mbview_toggleButton_slope_ctoh",
@@ -4687,7 +4702,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_slope_htoc = XmCreateToggleButton(class_in->mbview_radioBox_slopemode,
             (char *)"mbview_toggleButton_slope_htoc",
@@ -4708,7 +4723,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_slopemax = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
         (char *)"mbview_textField_slopemax",
@@ -4729,7 +4744,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_slopemax = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_slopemax",
@@ -4750,7 +4765,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_slopemin = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
         (char *)"mbview_textField_slopemin",
@@ -4771,7 +4786,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_slopemin = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_slopemin",
@@ -4799,7 +4814,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 200); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_slopebounds = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_slopebounds",
@@ -4837,7 +4852,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_data_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_colormode,
             (char *)"mbview_toggleButton_data_ctoh",
@@ -4862,7 +4877,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 109); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_toggleButton_data_htoc = XmCreateToggleButton(class_in->mbview_radioBox_colormode,
             (char *)"mbview_toggleButton_data_htoc",
@@ -4883,7 +4898,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_datamax = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
         (char *)"mbview_textField_datamax",
@@ -4897,7 +4912,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_datamin = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
         (char *)"mbview_textField_datamin",
@@ -4918,7 +4933,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_colormax = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_colormax",
@@ -4946,7 +4961,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_colormin = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_colormin",
@@ -4974,7 +4989,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 180); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_colorbounds = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_colorbounds",
@@ -5012,7 +5027,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 100); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_colorbounds_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_pushButton_colorbounds_apply",
@@ -5041,7 +5056,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 230); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_label_contour = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_label_contour",
@@ -5062,7 +5077,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
     XtSetArg(args[ac], XmNwidth, 110); ac++;
     XtSetArg(args[ac], XmNheight, 30); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbview_textField_contours = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
         (char *)"mbview_textField_contours",
@@ -5082,7 +5097,7 @@ MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList a
         XtSetArg(args[ac], XmNwidth, 110); ac++;
         XtSetArg(args[ac], XmNheight, 50); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbview_pushButton_colorbounds_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_colorbounds,
             (char *)"mbview_pushButton_colorbounds_dismiss",
diff --git a/src/mbview/MBpedit.c b/src/mbview/MBpedit.c
index 5f055cc..c83381c 100644
--- a/src/mbview/MBpedit.c
+++ b/src/mbview/MBpedit.c
@@ -14,6 +14,21 @@
  * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
  *
  */
+
+/* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
+/* End user code block <file_comments> */
+
 #include <Xm/Xm.h>
 #include <Xm/Form.h>
 #include <Xm/BulletinB.h>
@@ -211,7 +226,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_flag_view = XmCreatePushButton(class_in->mbpingedit_controls,
             (char *)"mbpingedit_pushButton_flag_view",
@@ -251,7 +266,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 48); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_menuBar_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_menuBar_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_cascadeButton_view = XmCreateCascadeButton(class_in->mbpingedit_menuBar_view,
             (char *)"mbpingedit_cascadeButton_view",
@@ -284,7 +299,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_view_waterfall = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_view_waterfall",
@@ -308,7 +323,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_view_alongtrack = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_view_alongtrack",
@@ -332,7 +347,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_view_acrosstrack = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_view_acrosstrack",
@@ -364,7 +379,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_flagged_on = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_flagged_on",
@@ -389,7 +404,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_detects = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_detects",
@@ -421,7 +436,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_wideplot = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_wideplot",
@@ -446,7 +461,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_time = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_time",
@@ -470,7 +485,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_interval = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_interval",
@@ -494,7 +509,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_lon = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_lon",
@@ -518,7 +533,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_latitude = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_latitude",
@@ -543,7 +558,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_heading = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_heading",
@@ -567,7 +582,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_speed = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_speed",
@@ -591,7 +606,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_depth = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_depth",
@@ -615,7 +630,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_altitude = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_altitude",
@@ -639,7 +654,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_sonardepth = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_sonardepth",
@@ -663,7 +678,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_roll = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_roll",
@@ -687,7 +702,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_pitch = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_pitch",
@@ -711,7 +726,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_show_heave = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
             (char *)"mbpingedit_toggleButton_show_heave",
@@ -743,7 +758,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_unflag_all = XmCreatePushButton(class_in->mbpingedit_controls,
             (char *)"mbpingedit_pushButton_unflag_all",
@@ -771,7 +786,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_unflag_view = XmCreatePushButton(class_in->mbpingedit_controls,
             (char *)"mbpingedit_pushButton_unflag_view",
@@ -810,7 +825,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_menuBar_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_menuBar_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_cascadeButton_controls = XmCreateCascadeButton(class_in->mbpingedit_menuBar_controls,
             (char *)"mbpingedit_cascadeButton_controls",
@@ -843,7 +858,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_goto = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
             (char *)"mbpingedit_pushButton_goto",
@@ -867,7 +882,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_buffer = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
             (char *)"mbpingedit_pushButton_buffer",
@@ -891,7 +906,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_annotation = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
             (char *)"mbpingedit_pushButton_annotation",
@@ -915,7 +930,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_filters = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
             (char *)"mbpingedit_pushButton_filters",
@@ -947,7 +962,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_reverse_keys = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_controls,
             (char *)"mbpingedit_toggleButton_reverse_keys",
@@ -972,7 +987,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_reverse_mouse = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_controls,
             (char *)"mbpingedit_toggleButton_reverse_mouse",
@@ -1004,7 +1019,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_next = XmCreatePushButton(class_in->mbpingedit_controls,
             (char *)"mbpingedit_pushButton_next",
@@ -1032,7 +1047,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_dismiss = XmCreatePushButton(class_in->mbpingedit_controls,
             (char *)"mbpingedit_pushButton_dismiss",
@@ -1060,7 +1075,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_forward = XmCreatePushButton(class_in->mbpingedit_controls,
             (char *)"mbpingedit_pushButton_forward",
@@ -1088,7 +1103,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_reverse = XmCreatePushButton(class_in->mbpingedit_controls,
             (char *)"mbpingedit_pushButton_reverse",
@@ -1116,7 +1131,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_mbpingedit_scale_x_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_mbpingedit_scale_x_label",
@@ -1145,7 +1160,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
     XtSetArg(args[ac], XmNwidth, 260); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbpingedit_slider_mbpingedit_scale_x = XmCreateScale(class_in->mbpingedit_controls,
         (char *)"mbpingedit_slider_mbpingedit_scale_x",
@@ -1167,7 +1182,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 60); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_mbpingedit_scale_x_max_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_mbpingedit_scale_x_max_label",
@@ -1194,7 +1209,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 90); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_mbpingedit_scale_y_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_mbpingedit_scale_y_label",
@@ -1224,7 +1239,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
     XtSetArg(args[ac], XmNwidth, 260); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbpingedit_slider_mbpingedit_scale_y = XmCreateScale(class_in->mbpingedit_controls,
         (char *)"mbpingedit_slider_mbpingedit_scale_y",
@@ -1246,7 +1261,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_mbpingedit_scale_y_max_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_mbpingedit_scale_y_max_label",
@@ -1273,7 +1288,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_number_pings_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_number_pings_label",
@@ -1302,7 +1317,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
     XtSetArg(args[ac], XmNwidth, 290); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbpingedit_slider_number_pings = XmCreateScale(class_in->mbpingedit_controls,
         (char *)"mbpingedit_slider_number_pings",
@@ -1324,7 +1339,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_num_pings_max_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_num_pings_max_label",
@@ -1351,7 +1366,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 90); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_number_step_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_number_step_label",
@@ -1380,7 +1395,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
     XtSetArg(args[ac], XmNwidth, 290); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbpingedit_slider_number_step = XmCreateScale(class_in->mbpingedit_controls,
         (char *)"mbpingedit_slider_number_step",
@@ -1402,7 +1417,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 50); ac++;
         XtSetArg(args[ac], XmNheight, 20); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_number_max_step_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_slider_number_max_step_label",
@@ -1429,7 +1444,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 120); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_setting_mode_label = XmCreateLabel(class_in->mbpingedit_controls,
             (char *)"mbpingedit_setting_mode_label",
@@ -1470,7 +1485,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 75); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_togglebutton_toggle = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
             (char *)"mbpingedit_togglebutton_toggle",
@@ -1494,7 +1509,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_togglebutton_pick = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
             (char *)"mbpingedit_togglebutton_pick",
@@ -1518,7 +1533,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_togglebutton_erase = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
             (char *)"mbpingedit_togglebutton_erase",
@@ -1542,7 +1557,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_togglebutton_restore = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
             (char *)"mbpingedit_togglebutton_restore",
@@ -1568,7 +1583,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 62); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_togglebutton_grab = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
             (char *)"mbpingedit_togglebutton_grab",
@@ -1594,7 +1609,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 54); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_togglebutton_info = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
             (char *)"mbpingedit_togglebutton_info",
@@ -1663,7 +1678,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 77); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_annotation_dismiss = XmCreatePushButton(class_in->mbpingedit_form_annotation,
             (char *)"mbpingedit_pushButton_annotation_dismiss",
@@ -1691,7 +1706,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_y_max_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
             (char *)"mbpingedit_slider_y_max_interval_label",
@@ -1720,7 +1735,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
     XtSetArg(args[ac], XmNwidth, 270); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbpingedit_slider_y_interval = XmCreateScale(class_in->mbpingedit_form_annotation,
         (char *)"mbpingedit_slider_y_interval",
@@ -1741,7 +1756,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 50); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_y_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
             (char *)"mbpingedit_slider_y_interval_label",
@@ -1769,7 +1784,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 65); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_x_max_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
             (char *)"mbpingedit_slider_x_max_interval_label",
@@ -1798,7 +1813,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
     XtSetArg(args[ac], XmNwidth, 270); ac++;
     XtSetArg(args[ac], XmNheight, 34); ac++;
     XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+        BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
         XmRFontList, 0, &argok)); if (argok) ac++;
     class_in->mbpingedit_slider_x_interval = XmCreateScale(class_in->mbpingedit_form_annotation,
         (char *)"mbpingedit_slider_x_interval",
@@ -1819,7 +1834,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_slider_x_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
             (char *)"mbpingedit_slider_x_interval_label",
@@ -1911,7 +1926,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_median_local_ltrack = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_median_local_ltrack",
@@ -1945,7 +1960,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_median_local_xtrack = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_median_local_xtrack",
@@ -1991,7 +2006,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_cutangleend = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_cutangleend",
@@ -2025,7 +2040,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_cutanglestart = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_cutanglestart",
@@ -2053,7 +2068,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 80); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_filters_cutangle = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_toggleButton_filters_cutangle",
@@ -2098,7 +2113,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_cutdistanceend = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_cutdistanceend",
@@ -2132,7 +2147,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_cutdistancestart = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_cutdistancestart",
@@ -2160,7 +2175,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_filters_cutdistance = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_toggleButton_filters_cutdistance",
@@ -2203,7 +2218,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_cutbeamend = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_cutbeamend",
@@ -2235,7 +2250,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_cutbeamstart = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_cutbeamstart",
@@ -2263,7 +2278,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_filters_cutbeam = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_toggleButton_filters_cutbeam",
@@ -2306,7 +2321,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_wrongside = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_wrongside",
@@ -2334,7 +2349,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_filters_wrongside = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_toggleButton_filters_wrongside",
@@ -2367,7 +2382,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 260); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_scale_filters_medianspike = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_scale_filters_medianspike",
@@ -2395,7 +2410,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 60); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_toggleButton_filters_medianspike = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
             (char *)"mbpingedit_toggleButton_filters_medianspike",
@@ -2422,7 +2437,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_filters_reset = XmCreatePushButton(class_in->mbpingedit_form_filters,
             (char *)"mbpingedit_pushButton_filters_reset",
@@ -2450,7 +2465,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_filters_apply = XmCreatePushButton(class_in->mbpingedit_form_filters,
             (char *)"mbpingedit_pushButton_filters_apply",
@@ -2478,7 +2493,7 @@ MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 90); ac++;
         XtSetArg(args[ac], XmNheight, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->mbpingedit_pushButton_filters_dismiss = XmCreatePushButton(class_in->mbpingedit_form_filters,
             (char *)"mbpingedit_pushButton_filters_dismiss",
diff --git a/src/mbview/Makefile.am b/src/mbview/Makefile.am
index 97b1d84..4242472 100644
--- a/src/mbview/Makefile.am
+++ b/src/mbview/Makefile.am
@@ -8,13 +8,11 @@ AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
        -I${top_srcdir}/src/mbaux \
        -I${top_srcdir}/src/mr1pr \
        -I${top_srcdir}/src/surf \
+       -I${top_srcdir}/src/gsf \
        ${libgmt_CPPFLAGS} \
        ${libnetcdf_CPPFLAGS} \
-       ${motif_CPPFLAGS} \
-       ${GL_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I${top_srcdir}/src/gsf
-endif
+       ${libmotif_CPPFLAGS} \
+       ${libopengl_CPPFLAGS}
 
 libmbview_la_CFLAGS = -DMBVIEW_LIBRARY
 libmbview_la_LDFLAGS = -no-undefined -version-info 0:0:0
@@ -30,5 +28,5 @@ libmbview_la_LIBADD = \
        ${top_builddir}/src/mbio/libmbio.la \
        ${top_builddir}/src/mbaux/libmbaux.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} ${GL_LIBS} \
+       ${libmotif_LIBS} ${libopengl_LIBS} \
        ${XDR_LIB}
diff --git a/src/mbview/Makefile.in b/src/mbview/Makefile.in
index ff8ee1c..7d7d23e 100644
--- a/src/mbview/Makefile.in
+++ b/src/mbview/Makefile.in
@@ -79,7 +79,6 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
- at BUILD_GSF_TRUE@am__append_1 = -I${top_srcdir}/src/gsf
 subdir = src/mbview
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp $(include_HEADERS)
@@ -241,8 +240,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -259,6 +256,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -322,19 +320,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -347,8 +352,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -365,10 +368,16 @@ top_srcdir = @top_srcdir@
 lib_LTLIBRARIES = libmbview.la
 include_HEADERS = mbview.h
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	-I${top_srcdir}/src/mr1pr -I${top_srcdir}/src/surf \
-	${libgmt_CPPFLAGS} ${libnetcdf_CPPFLAGS} ${motif_CPPFLAGS} \
-	${GL_CPPFLAGS} $(am__append_1)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+       -I${top_srcdir}/src/mbaux \
+       -I${top_srcdir}/src/mr1pr \
+       -I${top_srcdir}/src/surf \
+       -I${top_srcdir}/src/gsf \
+       ${libgmt_CPPFLAGS} \
+       ${libnetcdf_CPPFLAGS} \
+       ${libmotif_CPPFLAGS} \
+       ${libopengl_CPPFLAGS}
+
 libmbview_la_CFLAGS = -DMBVIEW_LIBRARY
 libmbview_la_LDFLAGS = -no-undefined -version-info 0:0:0
 libmbview_la_SOURCES = \
@@ -384,7 +393,7 @@ libmbview_la_LIBADD = \
        ${top_builddir}/src/mbio/libmbio.la \
        ${top_builddir}/src/mbaux/libmbaux.la \
        ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${motif_LIBS} ${GL_LIBS} \
+       ${libmotif_LIBS} ${libopengl_LIBS} \
        ${XDR_LIB}
 
 all: all-am
diff --git a/src/mbview/Makefile.template b/src/mbview/Makefile.template
deleted file mode 100644
index 0b7d348..0000000
--- a/src/mbview/Makefile.template
+++ /dev/null
@@ -1,174 +0,0 @@
-#     The MB-system:	Makefile.template  7/27/2003
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2003-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/mbview directory level
-# Author:	D. W. Caress
-# Date:		August 31, 2002
-#
-# $Log: Makefile.template,v $
-#
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of GMT libraries, binaries, and include files:
-GMTLIBDIR = /sw/lib
-GMTINCDIR = /sw/include
-NETCDFINCDIR = /sw/include
-#
-# Locations of Motif include files and libraries:
-MOTIFINCDIR = /sw/include
-MOTIFLIBS = -L/sw/lib -L/usr/X11R6/lib -lXm -lXt -lX11
-#
-# Locations of OpenGL libraries:
-OPENGLLIBS = -lGLU -lGL
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -I/usr/include/X11R6 -DDARWIN -DGMT3_3
-LFLAGS = -lm -L/usr/local/netcdf/lib -lnetcdf
-ARCHIVE = ar rcv
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the executable and man page
-all: $(INCDIR)/mbview.h $(LIBDIR)/libmbview.a
-
-### make the library
-$(LIBDIR)/libmbview.a:	MB3DView.o \
-		MB3DSiteList.o\
-		MB3DRouteList.o\
-		MB3DNavList.o\
-		mbview_callbacks.o\
-		mbview_process.o \
-		mbview_plot.o \
-		mbview_primary.o \
-		mbview_secondary.o \
-		mbview_pick.o \
-		mbview_profile.o \
-		mbview_site.o \
-		mbview_route.o\
-		mbview_nav.o \
-		mbview_vector.o \
-                mbview_bxutils.o \
-		mb_glwdrawa.o \
-		Mb3dsdg.o \
-		mb3dsoundings_callbacks.o \
-		MBpedit.o \
-		mbpingedit_callbacks.o
-	$(ARCHIVE) $(LIBDIR)/libmbview.a \
-		MB3DView.o \
-		MB3DSiteList.o\
-		MB3DRouteList.o\
-		MB3DNavList.o\
-		mbview_callbacks.o \
-		mbview_process.o \
-		mbview_plot.o \
-		mbview_primary.o \
-		mbview_secondary.o \
-		mbview_pick.o \
-		mbview_profile.o \
-		mbview_site.o \
-		mbview_route.o\
-		mbview_nav.o \
-		mbview_vector.o \
-                mbview_bxutils.o \
-		mb_glwdrawa.o \
-		Mb3dsdg.o \
-		mb3dsoundings_callbacks.o \
-		MBpedit.o \
-		mbpingedit_callbacks.o
-	ranlib $(LIBDIR)/libmbview.a
-
-### link the executables
-
-### compile the source files
-MB3DView.o: MB3DView.c MB3DView.h mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c MB3DView.c
-MB3DSiteList.o: MB3DSiteList.c MB3DSiteList.h mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c MB3DSiteList.c
-MB3DRouteList.o: MB3DRouteList.c MB3DRouteList.h mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c MB3DRouteList.c
-MB3DNavList.o: MB3DNavList.c MB3DNavList.h mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c MB3DNavList.c
-mbview_callbacks.o: mbview_callbacks.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_callbacks.c
-mbview_process.o: mbview_process.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_process.c
-mbview_plot.o: mbview_plot.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_plot.c
-mbview_primary.o: mbview_primary.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_primary.c
-mbview_secondary.o: mbview_secondary.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_secondary.c
-mbview_pick.o: mbview_pick.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_pick.c
-mbview_profile.o: mbview_profile.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_profile.c
-mbview_site.o: mbview_site.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_site.c
-mbview_route.o: mbview_route.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_route.c
-mbview_nav.o: mbview_nav.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_nav.c
-mbview_vector.o: mbview_vector.c mbview.h mbviewprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -c mbview_vector.c
-mbview_bxutils.o: mbview_bxutils.c
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mbview_bxutils.c
-mb_glwdrawa.o: mb_glwdrawa.c mb_glwdrawa.h mb_glwdrawap.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -c mb_glwdrawa.c
-Mb3dsdg.o: Mb3dsdg.c Mb3dsdg.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -I$(NETCDFINCDIR) -I$(GMTINCDIR) -c Mb3dsdg.c
-mb3dsoundings_callbacks.o: mb3dsoundings_callbacks.c Mb3dsdg.h mb3dsoundingsprivate.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -I$(NETCDFINCDIR) -I$(GMTINCDIR) -c mb3dsoundings_callbacks.c
-MBpedit.o: MBpedit.c MBpedit.h
-	$(CC) $(CFLAGS) -I../mbio -I$(MOTIFINCDIR) -I$(NETCDFINCDIR) -I$(GMTINCDIR) -c MBpedit.c
-mbpingedit_callbacks.o: mbpingedit_callbacks.c Mb3dsdg.h mbpingeditprivate.h \
-        ../mbio/mb_define.h ../mbio/mb_status.h ../mbio/mb_format.h
-	$(CC) $(CFLAGS) -DMBVIEW_LIBRARY -I../mbio -I$(MOTIFINCDIR) -I$(NETCDFINCDIR) -I$(GMTINCDIR) -c mbpingedit_callbacks.c
-
-## copy the include files to the include file directory
-$(INCDIR)/mbview.h:	mbview.h
-	cp mbview.h $(INCDIR)/mbview.h
-	chmod 664 $(INCDIR)/mbview.h
-
-### copy the man page to the man page directory
-
-clean:
-	rm -f *.o
diff --git a/src/mbview/Mb3dsdg.c b/src/mbview/Mb3dsdg.c
index d0c6b52..f2e6acc 100644
--- a/src/mbview/Mb3dsdg.c
+++ b/src/mbview/Mb3dsdg.c
@@ -14,6 +14,21 @@
  * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
  *
  */
+
+/* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
+/* End user code block <file_comments> */
+
 #include <Xm/Xm.h>
 #include <Xm/Form.h>
 #include <Xm/PushB.h>
@@ -181,7 +196,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 170); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_reset = XmCreatePushButton(class_in->Mb3dsdg,
             (char *)"pushButton_reset",
@@ -201,7 +216,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
     {
         XmString    tmp0;
 
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"TIme Lag (seconds)",
+        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Time Lag (seconds)",
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNminimum, -100); ac++;
@@ -215,7 +230,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 170); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->scale_timelag = XmCreateScale(class_in->Mb3dsdg,
             (char *)"scale_timelag",
@@ -241,7 +256,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNx, 650); ac++;
         XtSetArg(args[ac], XmNy, 40); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_panzoom1 = XmCreateToggleButton(class_in->Mb3dsdg,
             (char *)"toggleButton_mouse_panzoom1",
@@ -268,7 +283,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNy, 10); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_rotate1 = XmCreateToggleButton(class_in->Mb3dsdg,
             (char *)"toggleButton_mouse_rotate1",
@@ -302,7 +317,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 170); ac++;
         XtSetArg(args[ac], XmNheight, 80); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->label_mousemode = XmCreateLabel(class_in->Mb3dsdg,
             (char *)"label_mousemode",
@@ -335,7 +350,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 165); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->scale_headingbias = XmCreateScale(class_in->Mb3dsdg,
             (char *)"scale_headingbias",
@@ -369,7 +384,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 190); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->scale_pitchbias = XmCreateScale(class_in->Mb3dsdg,
             (char *)"scale_pitchbias",
@@ -403,7 +418,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 170); ac++;
         XtSetArg(args[ac], XmNheight, 63); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->scale_rollbias = XmCreateScale(class_in->Mb3dsdg,
             (char *)"scale_rollbias",
@@ -436,7 +451,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 540); ac++;
         XtSetArg(args[ac], XmNheight, 30); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->label_status = XmCreateLabel(class_in->Mb3dsdg,
             (char *)"label_status",
@@ -475,7 +490,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 71); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->cascadeButton_view = XmCreateCascadeButton(class_in->menuBar,
             (char *)"cascadeButton_view",
@@ -508,7 +523,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_view_boundingbox = XmCreateToggleButton(class_in->pulldownMenu_view,
             (char *)"toggleButton_view_boundingbox",
@@ -539,7 +554,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_view_flagged = XmCreateToggleButton(class_in->pulldownMenu_view,
             (char *)"toggleButton_view_flagged",
@@ -570,7 +585,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_view_noconnect = XmCreateToggleButton(class_in->pulldownMenu_view,
             (char *)"toggleButton_view_noconnect",
@@ -594,7 +609,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_view_connectgood = XmCreateToggleButton(class_in->pulldownMenu_view,
             (char *)"toggleButton_view_connectgood",
@@ -618,7 +633,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_view_connectall = XmCreateToggleButton(class_in->pulldownMenu_view,
             (char *)"toggleButton_view_connectall",
@@ -649,7 +664,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_view_scalewithflagged = XmCreateToggleButton(class_in->pulldownMenu_view,
             (char *)"toggleButton_view_scalewithflagged",
@@ -681,7 +696,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 71); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->cascadeButton_mouse = XmCreateCascadeButton(class_in->menuBar,
             (char *)"cascadeButton_mouse",
@@ -714,7 +729,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_rotate = XmCreateToggleButton(class_in->pulldownMenu_mouse,
             (char *)"toggleButton_mouse_rotate",
@@ -738,7 +753,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_panzoom = XmCreateToggleButton(class_in->pulldownMenu_mouse,
             (char *)"toggleButton_mouse_panzoom",
@@ -770,7 +785,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 71); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->cascadeButton_action = XmCreateCascadeButton(class_in->menuBar,
             (char *)"cascadeButton_action",
@@ -803,7 +818,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_applybias = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_applybias",
@@ -827,7 +842,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_colorsoundingsblack = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_colorsoundingsblack",
@@ -851,7 +866,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_colorsoundingsred = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_colorsoundingsred",
@@ -875,7 +890,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_colorsoundingsyellow = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_colorsoundingsyellow",
@@ -899,7 +914,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_colorsoundingsgreen = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_colorsoundingsgreen",
@@ -923,7 +938,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_colorsoundingsbluegreen = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_colorsoundingsbluegreen",
@@ -947,7 +962,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_colorsoundingsblue = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_colorsoundingsblue",
@@ -971,7 +986,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_action_colorsoundingspurple = XmCreatePushButton(class_in->pulldownMenu_action,
             (char *)"pushButton_action_colorsoundingspurple",
@@ -1003,7 +1018,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 71); ac++;
         XtSetArg(args[ac], XmNheight, 24); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->cascadeButton_dismiss = XmCreateCascadeButton(class_in->menuBar,
             (char *)"cascadeButton_dismiss",
@@ -1036,7 +1051,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_dismiss, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->pulldownMenu_dismiss, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->pushButton_dismiss = XmCreatePushButton(class_in->pulldownMenu_dismiss,
             (char *)"pushButton_dismiss",
@@ -1098,7 +1113,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 83); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_toggle = XmCreateToggleButton(class_in->radioBox_soundingsmode,
             (char *)"toggleButton_mouse_toggle",
@@ -1124,7 +1139,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 83); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_pick = XmCreateToggleButton(class_in->radioBox_soundingsmode,
             (char *)"toggleButton_mouse_pick",
@@ -1150,7 +1165,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 83); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_erase = XmCreateToggleButton(class_in->radioBox_soundingsmode,
             (char *)"toggleButton_mouse_erase",
@@ -1176,7 +1191,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 83); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_restore = XmCreateToggleButton(class_in->radioBox_soundingsmode,
             (char *)"toggleButton_mouse_restore",
@@ -1202,7 +1217,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 83); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_grab = XmCreateToggleButton(class_in->radioBox_soundingsmode,
             (char *)"toggleButton_mouse_grab",
@@ -1228,7 +1243,7 @@ Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList arg
         XtSetArg(args[ac], XmNwidth, 83); ac++;
         XtSetArg(args[ac], XmNheight, 28); ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
         class_in->toggleButton_mouse_info = XmCreateToggleButton(class_in->radioBox_soundingsmode,
             (char *)"toggleButton_mouse_info",
diff --git a/src/mbview/mb3dsoundings_callbacks.c b/src/mbview/mb3dsoundings_callbacks.c
index 8a50f46..c356ad9 100644
--- a/src/mbview/mb3dsoundings_callbacks.c
+++ b/src/mbview/mb3dsoundings_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb3dsoundings_callbacks.c		5/25/2007
- *    $Id: mb3dsoundings_callbacks.c 2189 2014-06-04 22:54:58Z caress $
+ *    $Id: mb3dsoundings_callbacks.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -56,9 +56,16 @@
 #include "MB3DView.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -80,7 +87,7 @@ static Cardinal 	ac;
 static Arg      	args[256];
 static char		value_text[MB_PATH_MAXLINE];
 
-static char rcs_id[]="$Id: mb3dsoundings_callbacks.c 2189 2014-06-04 22:54:58Z caress $";
+static char rcs_id[]="$Id: mb3dsoundings_callbacks.c 2239 2015-05-07 00:51:42Z caress $";
 
 /* function prototypes */
 /*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mb3dsoundings_creation.c b/src/mbview/mb3dsoundings_creation.c
index 83818b4..4314c98 100644
--- a/src/mbview/mb3dsoundings_creation.c
+++ b/src/mbview/mb3dsoundings_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
diff --git a/src/mbview/mb3dsoundings_main.c b/src/mbview/mb3dsoundings_main.c
index 6bcd552..7a8a1fc 100644
--- a/src/mbview/mb3dsoundings_main.c
+++ b/src/mbview/mb3dsoundings_main.c
@@ -79,7 +79,7 @@ int main( int argc, char **argv)
      * Initialize Xt.
      */
 
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
 
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbview/mb3dsoundingsprivate.h b/src/mbview/mb3dsoundingsprivate.h
index cd1b58c..0423257 100644
--- a/src/mbview/mb3dsoundingsprivate.h
+++ b/src/mbview/mb3dsoundingsprivate.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb3dsoundingsprivate.h	9/24/2003
- *    $Id: mb3dsoundingsprivate.h 2189 2014-06-04 22:54:58Z caress $
+ *    $Id: mb3dsoundingsprivate.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -17,22 +17,6 @@
  * Author:	D. W. Caress
  * Date:	May 25,  2007
  *
- * $Log: mb3dsoundingsprivate.h,v $
- * Revision 5.4  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.3  2007/11/16 17:26:56  caress
- * Progress on MBeditviz
- *
- * Revision 5.2  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.1  2007/07/03 17:35:54  caress
- * Working on MBeditviz.
- *
- * Revision 5.0  2007/06/17 23:16:14  caress
- * Added MBeditviz.
- *
  *
  */
 
@@ -102,7 +86,7 @@ struct mb3dsoundings_world_struct
     int			init;
 
     /* function pointers */
-    void (*mb3dsoundings_dismiss_notify)();
+    void (*mb3dsoundings_dismiss_notify)(void);
     void (*mb3dsoundings_edit_notify)(int ifile, int iping, int ibeam, char beamflag, int flush);
     void (*mb3dsoundings_info_notify)(int ifile, int iping, int ibeam, char *infostring);
     void (*mb3dsoundings_bias_notify)(double rollbias, double pitchbias, double headingbias, double timelag);
@@ -121,7 +105,11 @@ struct mb3dsoundings_world_struct
     Window		xid;
     XVisualInfo 	*vi;
     int			glx_init;
+#ifdef WIN32
+    HGLRC		glx_context;
+#else
     GLXContext		glx_context;
+#endif
     int			message_on;
 
     /* mode parameters */
@@ -257,10 +245,11 @@ extern char	*mb3dsoundings_colorname[MBS_NUM_COLORS];
 /*--------------------------------------------------------------------*/
 
 int mb3dsoundings_startup(int verbose, Widget parent, XtAppContext app, int *error);
-int mb3dsoundings_updategui();
-int mb3dsoundings_updatestatus();
-int mb3dsoundings_reset();
-int mb3dsoundings_reset_glx();
+int mb3dsoundings_updatecursor(void);
+int mb3dsoundings_updategui(void);
+int mb3dsoundings_updatestatus(void);
+int mb3dsoundings_reset(void);
+int mb3dsoundings_reset_glx(void);
 void do_mb3dsdg_resize( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_mouse_pick( Widget w, XtPointer client_data, XtPointer call_data);
@@ -288,6 +277,7 @@ void do_mb3dsdg_view_flagged( Widget w, XtPointer client_data, XtPointer call_da
 void do_mb3dsdg_view_noprofile( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_view_goodprofile( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_view_allprofile( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mb3dsdg_resetview( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_action_applybias( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_action_colorsoundingsblack( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_action_colorsoundingsred( Widget w, XtPointer client_data, XtPointer call_data);
@@ -301,13 +291,20 @@ void do_mb3dsdg_view_scalewithflagged( Widget w, XtPointer client_data, XtPointe
 void do_mb3dsdg_view_reset( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_mouse_panzoom( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mb3dsdg_mouse_rotate( Widget w, XtPointer client_data, XtPointer call_data);
-int mb3dsoundings_updatemodetoggles();
-int mb3dsoundings_bad_ping();
-int mb3dsoundings_good_ping();
-int mb3dsoundings_left_ping();
-int mb3dsoundings_right_ping();
-int mb3dsoundings_flag_view();
-int mb3dsoundings_unflag_view();
-int mb3dsoundings_zero_ping();
+int mb3dsoundings_updatemodetoggles(void);
+int mb3dsoundings_bad_ping(void);
+int mb3dsoundings_good_ping(void);
+int mb3dsoundings_left_ping(void);
+int mb3dsoundings_right_ping(void);
+int mb3dsoundings_flag_view(void);
+int mb3dsoundings_unflag_view(void);
+int mb3dsoundings_zero_ping(void);
+
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void BxExitCB(Widget w, XtPointer client, XtPointer call);
+void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
 
 /*--------------------------------------------------------------------*/
diff --git a/src/mbview/mb_glwdrawa.c b/src/mbview/mb_glwdrawa.c
index 60e2ca1..be76230 100644
--- a/src/mbview/mb_glwdrawa.c
+++ b/src/mbview/mb_glwdrawa.c
@@ -1,6 +1,6 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_glwdrawa.c	5/22/2007
- *    $Id: mb_glwdrawa.c 1770 2009-10-19 17:16:39Z caress $
+ *    $Id: mb_glwdrawa.c 2239 2015-05-07 00:51:42Z caress $
  *
  *    Altered from original code for MB-System by
  *    David W. Caress (caress at mbari.org)
@@ -76,7 +76,15 @@
  */
 #include <X11/IntrinsicP.h>
 #include <X11/StringDefs.h>
-#include <GL/glx.h>
+
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include <GL/gl.h>
 #include <Xm/PrimitiveP.h>
 #include "mb_glwdrawap.h"
@@ -359,6 +367,24 @@ static void warning(Widget w,char* string){
   }
 
 
+#ifdef WIN32
+#	define GLX_BUFFER_SIZE 2
+#	define GLX_LEVEL 3
+#	define GLX_RGBA 4
+#	define GLX_DOUBLEBUFFER 5
+#	define GLX_STEREO 6
+#	define GLX_AUX_BUFFERS 7
+#	define GLX_RED_SIZE 8
+#	define GLX_GREEN_SIZE 9
+#	define GLX_BLUE_SIZE 10
+#	define GLX_ALPHA_SIZE 11
+#	define GLX_DEPTH_SIZE 12
+#	define GLX_STENCIL_SIZE 13
+#	define GLX_ACCUM_RED_SIZE 14
+#	define GLX_ACCUM_GREEN_SIZE 15
+#	define GLX_ACCUM_BLUE_SIZE 16
+#	define GLX_ACCUM_ALPHA_SIZE 17
+#endif
 
 /* Initialize the attribList based on the attributes */
 static void createAttribList(mbGLwDrawingAreaWidget w){
diff --git a/src/mbview/mb_glwdrawa.h b/src/mbview/mb_glwdrawa.h
index 8542ff9..d8a30de 100644
--- a/src/mbview/mb_glwdrawa.h
+++ b/src/mbview/mb_glwdrawa.h
@@ -1,6 +1,6 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_glwdrawa.h	5/22/2007
- *    $Id: mb_glwdrawa.h 1770 2009-10-19 17:16:39Z caress $
+ *    $Id: mb_glwdrawa.h 2239 2015-05-07 00:51:42Z caress $
  *
  *    Altered from original code for MB-System by
  *    David W. Caress (caress at mbari.org)
@@ -67,7 +67,9 @@
 #ifndef _mbGLwDrawA_h
 #define _mbGLwDrawA_h
 
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include <GL/gl.h>
 
 /****************************************************************
@@ -162,7 +164,7 @@
 
 #define mbglwMDrawingAreaWidgetClass    mbglwM2DrawingAreaWidgetClass
 #define mbglwMDrawingAreaClassRec   mbglwM2DrawingAreaClassRec
-#define mbGLwCreateMDrawingArea     mbGLwCreateM2DrawingArea
+//#define mbGLwCreateMDrawingArea     mbGLwCreateM2DrawingArea
 
 typedef struct _mbGLwMDrawingAreaClassRec	*mbGLwMDrawingAreaWidgetClass;
 typedef struct _mbGLwMDrawingAreaRec	*mbGLwMDrawingAreaWidget;
@@ -185,13 +187,25 @@ typedef struct
   mbGLwDrawingAreaCallbackStruct;
 
 /* front ends to glXMakeCurrent and glXSwapBuffers */
+#ifdef WIN32
+extern void mbGLwDrawingAreaMakeCurrent(Widget w,HGLRC hglrc);
+#else
 extern void mbGLwDrawingAreaMakeCurrent(Widget w,GLXContext ctx);
+#endif
 extern void mbGLwDrawingAreaSwapBuffers(Widget w);
 
-#ifdef _NO_PROTO
-GLAPI Widget mbGLwCreateMDrawingArea();
+#ifdef WIN32
+#	ifdef _NO_PROTO
+	//WINGDIAPI Widget mbGLwCreateMDrawingArea();	/* It's defined in mb_glwdrawa.c */
+#	else
+	//WINGDIAPI Widget mbGLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount);
+#	endif
 #else
-GLAPI Widget mbGLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount);
+#	ifdef _NO_PROTO
+	GLAPI Widget mbGLwCreateMDrawingArea();
+#	else
+	GLAPI Widget mbGLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount);
+#	endif
 #endif
 
 #endif
diff --git a/src/mbview/mb_glwdrawap.h b/src/mbview/mb_glwdrawap.h
index a62dafd..721eb31 100644
--- a/src/mbview/mb_glwdrawap.h
+++ b/src/mbview/mb_glwdrawap.h
@@ -1,6 +1,6 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb_glwdrawap.c	5/22/2007
- *    $Id: mb_glwdrawap.h 2063 2013-05-22 00:05:57Z caress $
+ *    $Id: mb_glwdrawap.h 2239 2015-05-07 00:51:42Z caress $
  *
  *    Altered from original code for MB-System by
  *    David W. Caress (caress at mbari.org)
@@ -70,7 +70,11 @@
 #include "mb_glwdrawa.h"
 
 typedef struct _mbGLwDrawingAreaClassPart {
+#ifdef WIN32
+  char* extension;
+#else
   caddr_t extension;
+#endif
   } mbGLwDrawingAreaClassPart;
 
 
diff --git a/src/mbview/mbpingedit.c b/src/mbview/mbpingedit.c
index 0e8ed11..809007c 100644
--- a/src/mbview/mbpingedit.c
+++ b/src/mbview/mbpingedit.c
@@ -83,7 +83,7 @@ int main( int argc, char **argv)
      * Initialize Xt. 
      */
     
-    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); 
+    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); 
     
     /*
      * The applicationShell is created as an unrealized
diff --git a/src/mbview/mbpingedit_callbacks.c b/src/mbview/mbpingedit_callbacks.c
index e575309..3800107 100644
--- a/src/mbview/mbpingedit_callbacks.c
+++ b/src/mbview/mbpingedit_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbpingedit_callbacks.c		11/13/2007
- *    $Id: mbpingedit_callbacks.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbpingedit_callbacks.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -55,9 +55,16 @@
 #include "Mb3dsdg.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -75,7 +82,7 @@
 
 /* local variables */
 
-static char rcs_id[]="$Id: mbpingedit_callbacks.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbpingedit_callbacks.c 2239 2015-05-07 00:51:42Z caress $";
 
 /* function prototypes */
 /*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbpingedit_creation.c b/src/mbview/mbpingedit_creation.c
index 10a68ea..9ec74c4 100644
--- a/src/mbview/mbpingedit_creation.c
+++ b/src/mbview/mbpingedit_creation.c
@@ -17,6 +17,17 @@
 
 
 /* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
 /* End user code block <file_comments> */
 
 #include <Xm/Xm.h>
diff --git a/src/mbview/mbpingeditprivate.h b/src/mbview/mbpingeditprivate.h
index 8fabc7c..8a48e51 100644
--- a/src/mbview/mbpingeditprivate.h
+++ b/src/mbview/mbpingeditprivate.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb3dsoundingsprivate.h	11/19/2007
- *    $Id: mbpingeditprivate.h 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbpingeditprivate.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -17,17 +17,6 @@
  * Author:	D. W. Caress
  * Date:	November 11,  2007
  *
- * $Log: mbpingeditprivate.h,v $
- * Revision 5.1  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.0  2007/11/16 17:48:07  caress
- * Working to add an MBedit-like ping edit interface to MBeditviz
- *
- * Revision 1.1  2007/11/16 17:47:31  caress
- * Working to add an MBedit-like ping edit interface to MBeditviz
- *
- *
  */
 
 /*--------------------------------------------------------------------*/
@@ -96,7 +85,7 @@ struct mbpingedit_world_struct
     int			init;
 
     /* function pointers */
-    void (*mbpingedit_dismiss_notify)();
+    void (*mbpingedit_dismiss_notify)(void);
     void (*mbpingedit_edit_notify)(int ifile, int iping, int ibeam, char beamflag, int flush);
     void (*mbpingedit_info_notify)(int ifile, int iping, int ibeam, char *infostring);
 
@@ -112,7 +101,11 @@ struct mbpingedit_world_struct
     Window		xid;
     XVisualInfo 	*vi;
     int			glx_init;
+#ifdef WIN32
+    HGLRC		glx_context;
+#else
     GLXContext		glx_context;
+#endif
     int			message_on;
 
     /* mode parameters */
@@ -245,5 +238,34 @@ void do_mbpingedit_reverse_mouse( Widget w, XtPointer client_data, XtPointer cal
 void do_mbpingedit_mode_pick( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbpingedit_expose( Widget w, XtPointer client_data, XtPointer call_data);
 void do_mbpingedit_unflag_view( Widget w, XtPointer client_data, XtPointer call_data);
+int mbpingedit_startup(int verbose, Widget parent, XtAppContext app, int *error);
+void do_mbpingedit_mode_toggle( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_show_detects( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_next_buffer( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_scale_x( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_scale_y( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_check_median_ltrack( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_check_median_xtrack( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_mode_grab( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_mode_erase( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_show_flagged( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_reverse( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_number_step( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_set_filters( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_view_mode( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_reset_filters( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_x_interval( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_y_interval( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_mode_info( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_unflag_all( Widget w, XtPointer client_data, XtPointer call_data);
+void do_mbpingedit_flag_view( Widget w, XtPointer client_data, XtPointer call_data);
+
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void BxExitCB(Widget w, XtPointer client, XtPointer call);
+void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
 
 /*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview.h b/src/mbview/mbview.h
index eb2b3aa..71150a8 100644
--- a/src/mbview/mbview.h
+++ b/src/mbview/mbview.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbview.h	10/9/2002
- *    $Id: mbview.h 2201 2014-08-21 00:49:46Z caress $
+ *    $Id: mbview.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c); 2002-2014 by
+ *    Copyright (c); 2002-2015 by
  *    David W. Caress (caress at mbari.org);
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -17,84 +17,6 @@
  * Author:	D. W. Caress
  * Date:	October 10,  2002
  *
- * $Log: mbview.h,v $
- * Revision 5.23  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.22  2008/09/11 20:17:33  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.21  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.20  2007/11/16 17:26:56  caress
- * Progress on MBeditviz
- *
- * Revision 5.19  2007/10/17 20:35:05  caress
- * Release 5.1.1beta11
- *
- * Revision 5.18  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.17  2007/07/03 17:35:54  caress
- * Working on MBeditviz.
- *
- * Revision 5.16  2007/06/17 23:27:31  caress
- * Added NBeditviz.
- *
- * Revision 5.15  2006/09/11 18:55:53  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.14  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.13  2006/04/26 22:06:39  caress
- * Improved profile view feature and enabled export of profile data.
- *
- * Revision 5.12  2006/04/11 19:17:04  caress
- * Added a profile capability.
- *
- * Revision 5.11  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.10  2005/08/09 16:32:59  caress
- * Working on portability and on survey planning.
- *
- * Revision 5.9  2005/02/18 07:32:56  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.8  2005/02/17 07:35:08  caress
- * Moving towards 5.0.6 release.
- *
- * Revision 5.7  2005/02/08 22:37:40  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.5  2004/09/16 21:44:40  caress
- * Many changes over the summer.
- *
- * Revision 5.4  2004/07/27 19:50:28  caress
- * Improving route planning capability.
- *
- * Revision 5.3  2004/05/21 23:40:40  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.2  2004/02/24 22:52:29  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.1  2004/01/06 21:11:03  caress
- * Added pick region capability.
- *
- * Revision 5.0  2003/12/02 20:38:31  caress
- * Making version number 5.0
- *
- * Revision 1.3  2003/11/25 01:43:18  caress
- * MBview version generated during EW0310.
- *
- * Revision 1.1  2003/09/23 21:29:00  caress
- * Adding first cut on mbview to cvs.
- *
- *
  */
 
 /*--------------------------------------------------------------------*/
@@ -547,7 +469,7 @@ struct mbview_struct {
 	void (*mbview_pickroute_notify)(size_t id);
 	void (*mbview_picknav_notify)(size_t id);
 	void (*mbview_pickvector_notify)(size_t id);
-	void (*mbview_sensitivity_notify)();
+	void (*mbview_sensitivity_notify)(void);
 
 	/* active flag */
 	int	active;
@@ -1063,7 +985,7 @@ int mbview_addvector(int verbose, size_t instance,
 			int *error);
 int mbview_enableviewvectors(int verbose, size_t instance,
 			int *error);
-int mbview_pick_vec_select(size_t instance, int select, int which, int xpixel, int ypixel);
+int mbview_pick_vector_select(size_t instance, int select, int which, int xpixel, int ypixel);
 int mbview_vector_delete(size_t instance, int ivec);
 int mbview_drawvectorpick(size_t instance);
 int mbview_drawvector(size_t instance, int rez);
diff --git a/src/mbview/mbview_callbacks.c b/src/mbview/mbview_callbacks.c
index 1259746..17c194b 100644
--- a/src/mbview/mbview_callbacks.c
+++ b/src/mbview/mbview_callbacks.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbview_callbacks.c	10/7/2002
- *    $Id: mbview_callbacks.c 2204 2014-09-06 02:34:58Z caress $
+ *    $Id: mbview_callbacks.c 2251 2015-07-01 01:02:06Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -17,79 +17,6 @@
  * Author:	D. W. Caress
  * Date:	October 7, 2002
  *
- * $Log: mbview_callbacks.c,v $
- * Revision 5.21  2008/09/11 20:17:33  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.20  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.19  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.18  2007/10/31 18:42:37  caress
- * Fixed bug in importing navigation.
- *
- * Revision 5.17  2007/10/17 20:35:05  caress
- * Release 5.1.1beta11
- *
- * Revision 5.16  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.15  2007/07/03 17:35:54  caress
- * Working on MBeditviz.
- *
- * Revision 5.14  2007/06/17 23:27:30  caress
- * Added NBeditviz.
- *
- * Revision 5.13  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.12  2006/04/26 22:06:39  caress
- * Improved profile view feature and enabled export of profile data.
- *
- * Revision 5.11  2006/04/11 19:17:04  caress
- * Added a profile capability.
- *
- * Revision 5.10  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.9  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.8  2005/02/18 07:32:55  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.7  2005/02/17 07:35:08  caress
- * Moving towards 5.0.6 release.
- *
- * Revision 5.6  2005/02/08 22:37:40  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.4  2004/09/16 21:44:39  caress
- * Many changes over the summer.
- *
- * Revision 5.3  2004/05/21 23:40:39  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.2  2004/02/24 22:52:28  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.1  2004/01/06 21:11:04  caress
- * Added pick region capability.
- *
- * Revision 5.0  2003/12/02 20:38:31  caress
- * Making version number 5.0
- *
- * Revision 1.4  2003/11/25 22:02:25  caress
- * Fixed problem with display of mouse mode buttons.
- *
- * Revision 1.3  2003/11/25 01:43:18  caress
- * MBview version generated during EW0310.
- *
- * Revision 1.1  2003/09/23 21:29:01  caress
- * Adding first cut on mbview to cvs.
- *
  *
  */
 
@@ -106,6 +33,20 @@
  *
  */
 
+/* Begin user code block <file_comments> */
+
+#ifndef SANS
+#define SANS "helvetica"
+#endif
+#ifndef SERIF
+#define SERIF "times"
+#endif
+#ifndef MONO
+#define MONO "courier"
+#endif
+
+/* End user code block <file_comments> */
+
 /*
  * Standard includes for builtins.
  */
@@ -139,9 +80,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -162,7 +110,7 @@ static Cardinal 	ac;
 static Arg      	args[256];
 static char		value_text[MB_PATH_MAXLINE];
 
-static char rcs_id[]="$Id: mbview_callbacks.c 2204 2014-09-06 02:34:58Z caress $";
+static char rcs_id[]="$Id: mbview_callbacks.c 2251 2015-07-01 01:02:06Z caress $";
 
 /* function prototypes */
 /*------------------------------------------------------------------------------*/
@@ -3054,7 +3002,7 @@ int mbview_addaction(int verbose, size_t instance,
                 XmRXmString, 0, &argok);
         XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
         XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(view->mb3dview.mbview_pulldownMenu_action, "-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
+            BX_CONVERT(view->mb3dview.mbview_pulldownMenu_action, "-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
             XmRFontList, 0, &argok)); if (argok) ac++;
 	XtSetArg(args[ac], XmNuserData, (XtPointer)instance); ac++;
         view->pushButton_action[view->naction] = (Widget) XmCreatePushButton(view->mb3dview.mbview_pulldownMenu_action,
@@ -5105,7 +5053,7 @@ do_mbview_dismiss( Widget w, XtPointer client_data, XtPointer call_data)
 	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
 	XtGetValues(w, args, ac);
 
-if (mbv_verbose >= 0)
+if (mbv_verbose >= 2)
 fprintf(stderr,"do_mbview_dismiss: instance:%zu\n", instance);
 
 	/* get view */
diff --git a/src/mbview/mbview_nav.c b/src/mbview/mbview_nav.c
index f22c697..e25eac1 100644
--- a/src/mbview/mbview_nav.c
+++ b/src/mbview/mbview_nav.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_nav.c	10/28/2003
- *    $Id: mbview_nav.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mbview_nav.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -48,9 +48,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -66,7 +73,7 @@
 /* local variables */
 static char		value_string[MB_PATH_MAXLINE];
 
-static char rcs_id[]="$Id: mbview_nav.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[]="$Id: mbview_nav.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_getnavcount(int verbose, size_t instance,
diff --git a/src/mbview/mbview_pick.c b/src/mbview/mbview_pick.c
index 38c9916..348daf2 100644
--- a/src/mbview/mbview_pick.c
+++ b/src/mbview/mbview_pick.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_pick.c	9/29/2003
- *    $Id: mbview_pick.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_pick.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -106,9 +106,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -125,7 +132,7 @@
 static char		value_text[MB_PATH_MAXLINE];
 static char		value_list[MB_PATH_MAXLINE];
 
-static char rcs_id[]="$Id: mbview_pick.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_pick.c 2239 2015-05-07 00:51:42Z caress $";
 
 
 /*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_plot.c b/src/mbview/mbview_plot.c
index 3761db6..193ad3b 100644
--- a/src/mbview/mbview_plot.c
+++ b/src/mbview/mbview_plot.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_plot.c	9/26/2003
- *    $Id: mbview_plot.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_plot.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -96,9 +96,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -115,7 +122,7 @@
 static Cardinal 	ac;
 static Arg      	args[256];
 
-static char rcs_id[]="$Id: mbview_plot.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_plot.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_reset_glx(size_t instance)
diff --git a/src/mbview/mbview_primary.c b/src/mbview/mbview_primary.c
index 0983995..1879d9b 100644
--- a/src/mbview/mbview_primary.c
+++ b/src/mbview/mbview_primary.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_primary.c	9/25/2003
- *    $Id: mbview_primary.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_primary.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -20,35 +20,6 @@
  * Note:	This code was broken out of mbview_callbacks.c, which was
  *		begun on October 7, 2002
  *
- * $Log: mbview_primary.c,v $
- * Revision 5.8  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.7  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.6  2007/06/17 23:27:30  caress
- * Added NBeditviz.
- *
- * Revision 5.5  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.4  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.3  2005/02/18 07:32:55  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.2  2005/02/08 22:37:42  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.0  2003/12/02 20:38:33  caress
- * Making version number 5.0
- *
- * Revision 1.2  2003/11/25 01:43:18  caress
- * MBview version generated during EW0310.
- *
- *
  */
 /*------------------------------------------------------------------------------*/
 
@@ -78,9 +49,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -94,7 +72,7 @@
 /*------------------------------------------------------------------------------*/
 
 /* local variables */
-static char rcs_id[]="$Id: mbview_primary.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_primary.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_setprimarygrid(int verbose, size_t instance,
@@ -251,7 +229,7 @@ int mbview_updateprimarygrid(int verbose, size_t instance,
 
 {
 	/* local variables */
-	char	*function_name = "mbview_setprimarygrid";
+	char	*function_name = "mbview_updateprimarygrid";
 	int	status = MB_SUCCESS;
 	struct mbview_world_struct *view;
 	struct mbview_struct *data;
@@ -342,7 +320,7 @@ int mbview_updateprimarygridcell(int verbose, size_t instance,
 
 {
 	/* local variables */
-	char	*function_name = "mbview_setprimarygrid";
+	char	*function_name = "mbview_updateprimarygridcell";
 	int	status = MB_SUCCESS;
 	struct mbview_world_struct *view;
 	struct mbview_struct *data;
diff --git a/src/mbview/mbview_process.c b/src/mbview/mbview_process.c
index 481b7c6..edffb65 100644
--- a/src/mbview/mbview_process.c
+++ b/src/mbview/mbview_process.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_process.c	9/25/2003
- *    $Id: mbview_process.c 2201 2014-08-21 00:49:46Z caress $
+ *    $Id: mbview_process.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -105,9 +105,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -121,7 +128,7 @@
 /*------------------------------------------------------------------------------*/
 
 /* local variables */
-static char rcs_id[]="$Id: mbview_process.c 2201 2014-08-21 00:49:46Z caress $";
+static char rcs_id[]="$Id: mbview_process.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_projectdata(size_t instance)
diff --git a/src/mbview/mbview_profile.c b/src/mbview/mbview_profile.c
index 4d18a6b..853c50c 100644
--- a/src/mbview/mbview_profile.c
+++ b/src/mbview/mbview_profile.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_profile.c	3/8/2006
- *    $Id: mbview_profile.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_profile.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2006-2014 by
+ *    Copyright (c) 2006-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -55,9 +55,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -83,7 +90,7 @@ static Cardinal 	ac = 0;
 static Arg      	args[256];
 static char		value_text[MB_PATH_MAXLINE];
 
-static char rcs_id[]="$Id: mbview_profile.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_profile.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_getprofilecount(int verbose, size_t instance,
diff --git a/src/mbview/mbview_route.c b/src/mbview/mbview_route.c
index 29b26fd..96e0c89 100644
--- a/src/mbview/mbview_route.c
+++ b/src/mbview/mbview_route.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_route.c	9/25/2003
- *    $Id: mbview_route.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_route.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -116,9 +116,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -134,7 +141,7 @@
 /* local variables */
 static char		value_string[MB_PATH_MAXLINE];
 
-static char rcs_id[]="$Id: mbview_route.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_route.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_getroutecount(int verbose, size_t instance,
diff --git a/src/mbview/mbview_secondary.c b/src/mbview/mbview_secondary.c
index 81cb71e..2ad6406 100644
--- a/src/mbview/mbview_secondary.c
+++ b/src/mbview/mbview_secondary.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_secondary.c	9/25/2003
- *    $Id: mbview_secondary.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_secondary.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -86,9 +86,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -103,7 +110,7 @@
 
 /* local variables */
 static char		value_text[MB_PATH_MAXLINE];
-static char rcs_id[]="$Id: mbview_secondary.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_secondary.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_setsecondarygrid(int verbose, size_t instance,
diff --git a/src/mbview/mbview_site.c b/src/mbview/mbview_site.c
index e89f64c..e672265 100644
--- a/src/mbview/mbview_site.c
+++ b/src/mbview/mbview_site.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_site.c	9/25/2003
- *    $Id: mbview_site.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_site.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -85,9 +85,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -110,7 +117,7 @@ extern char	*mbsystem_library_name;
 /* local variables */
 static char	value_string[MB_PATH_MAXLINE];
 
-static char rcs_id[]="$Id: mbview_site.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_site.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_getsitecount(int verbose, size_t instance,
diff --git a/src/mbview/mbview_vector.c b/src/mbview/mbview_vector.c
index 99c1e86..a08e8da 100644
--- a/src/mbview/mbview_vector.c
+++ b/src/mbview/mbview_vector.c
@@ -1,8 +1,8 @@
 /*------------------------------------------------------------------------------
  *    The MB-system:	mbview_vector.c	1/11/2012
- *    $Id: mbview_vector.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbview_vector.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2012-2014 by
+ *    Copyright (c) 2012-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -49,9 +49,16 @@
 #include "MB3DNavList.h"
 
 /* OpenGL include files */
+#ifdef WIN32
+#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 #include <GL/glu.h>
-#include <GL/glx.h>
+#ifndef WIN32
+#	include <GL/glx.h>
+#endif
 #include "mb_glwdrawa.h"
 
 /* MBIO include files */
@@ -65,7 +72,7 @@
 /*------------------------------------------------------------------------------*/
 
 /* local variables */
-static char rcs_id[]="$Id: mbview_vector.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[]="$Id: mbview_vector.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*------------------------------------------------------------------------------*/
 int mbview_getvectorcount(int verbose, size_t instance,
diff --git a/src/mbview/mbviewprivate.h b/src/mbview/mbviewprivate.h
index 66f19b7..59b7b76 100644
--- a/src/mbview/mbviewprivate.h
+++ b/src/mbview/mbviewprivate.h
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbviewprivate.h	9/24/2003
- *    $Id: mbviewprivate.h 2201 2014-08-21 00:49:46Z caress $
+ *    $Id: mbviewprivate.h 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -17,56 +17,6 @@
  * Author:	D. W. Caress
  * Date:	September 24,  2003
  *
- * $Log: mbviewprivate.h,v $
- * Revision 5.14  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.13  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.12  2007/06/17 23:27:31  caress
- * Added NBeditviz.
- *
- * Revision 5.11  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.10  2006/04/11 19:17:04  caress
- * Added a profile capability.
- *
- * Revision 5.9  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.8  2005/08/09 16:33:00  caress
- * Working on portability and on survey planning.
- *
- * Revision 5.7  2005/02/18 07:32:57  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.6  2005/02/08 22:37:43  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.4  2004/07/15 19:26:45  caress
- * Improvements to survey planning.
- *
- * Revision 5.3  2004/05/21 23:40:40  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.2  2004/02/24 22:52:30  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.1  2004/01/06 21:11:04  caress
- * Added pick region capability.
- *
- * Revision 5.0  2003/12/02 20:38:34  caress
- * Making version number 5.0
- *
- * Revision 1.3  2003/11/25 22:14:03  caress
- * Fixed problem with display of mouse mode buttons.
- *
- * Revision 1.2  2003/11/25 02:52:55  caress
- * MBview version generated during EW0310.
- *
- *
  *
  */
 
@@ -183,7 +133,11 @@ struct mbview_world_struct
     Window		xid;
     XVisualInfo 	*vi;
     int			glx_init;
+#ifdef WIN32
+    HGLRC		glx_context;
+#else
     GLXContext		glx_context;
+#endif
     int			message_on;
     int			plot_recursion;
     int			plot_done;
@@ -194,7 +148,11 @@ struct mbview_world_struct
     Widget		prglwmda;
     XVisualInfo 	*prvi;
     int			prglx_init;
+#ifdef WIN32
+    HGLRC		prglx_context;
+#else
     GLXContext		prglx_context;
+#endif
     float 		praspect_ratio;
 
     /* cursors */
@@ -537,7 +495,7 @@ int mbview_setviewcontrols(int verbose, size_t instance,
 int mbview_open(int verbose, size_t instance, int *error);
 int mbview_update(int verbose, size_t instance, int *error);
 int mbview_update_sensitivity(int verbose, size_t instance, int *error);
-int mbview_action_sensitivityall();
+int mbview_action_sensitivityall(void);
 int mbview_action_sensitivity(size_t instance);
 int mbview_set_widgets(int verbose, size_t instance, int *error);
 int mbview_addaction(int verbose, size_t instance,
@@ -650,9 +608,9 @@ int do_mbview_message_off(size_t instance);
 void set_mbview_label_string(Widget w, String str);
 void set_mbview_label_multiline_string(Widget w, String str);
 void get_mbview_text_string(Widget w, String str);
-void do_mbview_xevents();
+void do_mbview_xevents(void);
 int do_mbview_setbackgroundwork(size_t instance);
-int do_mbview_settimer();
+int do_mbview_settimer(void);
 int do_mbview_workfunction(XtPointer client_data);
 
 /* mbview_primary.c function prototypes */
@@ -965,7 +923,7 @@ int mbview_nav_delete(size_t instance, int inav);
 int mbview_navpicksize(size_t instance);
 int mbview_drawnavpick(size_t instance);
 int mbview_drawnav(size_t instance, int rez);
-int mbview_updatenavlist();
+int mbview_updatenavlist(void);
 
 /* mbview_route.c function prototypes */
 int mbview_getroutecount(int verbose, size_t instance,
@@ -1055,7 +1013,7 @@ int mbview_route_add(size_t instance, int inew, int jnew, int waypoint,
 int mbview_route_delete(size_t instance, int iroute, int ipoint);
 int mbview_route_setdistance(size_t instance, int working_route);
 int mbview_drawroute(size_t instance, int rez);
-int mbview_updateroutelist();
+int mbview_updateroutelist(void);
 
 /* mbview_site.c function prototypes */
 int mbview_getsitecount(int verbose, size_t instance,
@@ -1105,7 +1063,7 @@ int mbview_pick_site_add(size_t instance, int which, int xpixel, int ypixel);
 int mbview_pick_site_delete(size_t instance, int xpixel, int ypixel);
 int mbview_site_delete(size_t instance, int isite);
 int mbview_drawsite(size_t instance, int rez);
-int mbview_updatesitelist();
+int mbview_updatesitelist(void);
 
 /* mbview_profile.c function prototypes */
 int mbview_getprofilecount(int verbose, size_t instance,
@@ -1159,6 +1117,11 @@ int mbview_destroy_prglx(size_t instance);
 int mbview_plotprofile(size_t instance);
 int mbview_profile_text(size_t instance);
 
-XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
+void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
+void BxManageCB(Widget w, XtPointer client, XtPointer call);
+void BxPopupCB(Widget w, XtPointer client, XtPointer call);
+XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
+void BxExitCB(Widget w, XtPointer client, XtPointer call);
+void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
 
 /*--------------------------------------------------------------------*/
diff --git a/src/otps/Makefile.am b/src/otps/Makefile.am
index d1224e0..cca69fa 100644
--- a/src/otps/Makefile.am
+++ b/src/otps/Makefile.am
@@ -2,10 +2,9 @@ bin_PROGRAMS = mbotps
 
 AM_CFLAGS = ${libnetcdf_CFLAGS}
 
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio ${libnetcdf_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I${top_srcdir}/src/gsf
-endif
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+		-I${top_srcdir}/src/gsf \
+		${libnetcdf_CPPFLAGS}
 
 AM_LDFLAGS = 
 
diff --git a/src/otps/Makefile.in b/src/otps/Makefile.in
index acb48f0..22da09c 100644
--- a/src/otps/Makefile.in
+++ b/src/otps/Makefile.in
@@ -79,7 +79,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = mbotps$(EXEEXT)
- at BUILD_GSF_TRUE@am__append_1 = -I${top_srcdir}/src/gsf
 subdir = src/otps
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -193,8 +192,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -214,6 +211,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -277,19 +275,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -302,8 +307,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -318,8 +321,10 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio ${libnetcdf_CPPFLAGS} \
-	$(am__append_1)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+		-I${top_srcdir}/src/gsf \
+		${libnetcdf_CPPFLAGS}
+
 AM_LDFLAGS = 
 mbotps_SOURCES = mbotps.c
 nodist_mbotps_SOURCES = otps.h
diff --git a/src/otps/Makefile.template b/src/otps/Makefile.template
deleted file mode 100644
index 57091eb..0000000
--- a/src/otps/Makefile.template
+++ /dev/null
@@ -1,76 +0,0 @@
-#     The MB-system:	Makefile.template  5/23/94
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2009-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system in the src/gmt directory level
-# Author:	D. W. Caress
-# Date:		July 31, 2009
-#
-# $Log: Makefile.template,v $
-#
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of GMT libraries, binaries, and include files:
-OTPSDIR = /Users/caress/sandbox/tides/OTPSnc
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -O2
-LFLAGS = -lm
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the MB-system macros and man pages
-all:	$(BINDIR)/mbotps
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### link or copy the executables
-$(BINDIR)/mbotps: mbotps.o \
-		$(LIBDIR)/libmbio.a  \
-		$(LIBDIR)/libmbaux.a  \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a  \
-		$(LIBDIR)/libmbbsio.a
-	$(CC) $(CFLAGS) mbotps.o \
-		$(LIBDIR)/libmbio.a \
-		$(LIBDIR)/libmbaux.a \
-		$(PROJLIB) \
-		$(GSFLIB) \
-		$(LIBDIR)/libsapi.a \
-		$(LIBDIR)/libmbbsio.a  \
-		$(LFLAGS) -o $(BINDIR)/mbotps
-
-### compile the source files
-mbotps.o:	mbotps.c ../mbio/mb_status.h ../mbio/mb_define.h otps.h
-	$(CC) -c $(CFLAGS) -I../mbio mbotps.c
-
-otps.h:	Makefile
-	echo "	char *otps_location = "'"$(OTPSDIR)"'";" > otps.h
diff --git a/src/otps/mbotps.c b/src/otps/mbotps.c
index d8a5bda..448ce93 100644
--- a/src/otps/mbotps.c
+++ b/src/otps/mbotps.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbotps.c	7/30/2009
- *    $Id: mbotps.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mbotps.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2009-2014 by
+ *    Copyright (c) 2009-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -77,7 +77,7 @@ char	*getenv();
 
 int main (int argc, char **argv)
 {
-	static char rcs_id[] = "$Id: mbotps.c 2215 2014-11-29 22:21:19Z caress $";
+	static char rcs_id[] = "$Id: mbotps.c 2227 2015-02-05 21:12:31Z caress $";
 	static char program_name[] = "mbotps";
 	static char help_message[] =  "MBotps predicts tides using methods and data derived from the OSU Tidal Prediction Software (OTPS) distributions.";
 	static char usage_message[] = "mbotps [-Atideformat -Byear/month/day/hour/minute/second -Dinterval\n\t-Eyear/month/day/hour/minute/second -Fformat\n"
diff --git a/src/otps/otps.h b/src/otps/otps.h
deleted file mode 100644
index 5642cbe..0000000
--- a/src/otps/otps.h
+++ /dev/null
@@ -1 +0,0 @@
-char *otps_location = "/usr/local/OTPS2";
diff --git a/src/proj/Makefile.in b/src/proj/Makefile.in
index db3da38..6111785 100644
--- a/src/proj/Makefile.in
+++ b/src/proj/Makefile.in
@@ -263,8 +263,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -281,6 +279,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -344,19 +343,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -369,8 +375,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/proj/Makefile.template b/src/proj/Makefile.template
deleted file mode 100644
index 34fc2d4..0000000
--- a/src/proj/Makefile.template
+++ /dev/null
@@ -1,1028 +0,0 @@
-#     The MB-system:	Makefile.template  7/16/2002
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2002-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/surf directory level
-# Author:	D. W. Caress
-# Date:		July 16, 2002
-#
-# $Log: Makefile.template,v $
-#
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-MANDIR = ../../man
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-LFLAGS = -lm
-CFLAGS = -g -DIRIX
-ARCHIVE = ar rcv
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the proj library, executables, man pages,
-### and associated include files
-all:	$(LIBDIR)/libproj.a \
-	$(INCDIR)/proj_api.h \
-	$(BINDIR)/proj \
-	$(BINDIR)/geod \
-	$(MANDIR)/man1/proj.1 \
-	$(MANDIR)/man1/geod.1 \
-	$(MANDIR)/man3/pj_init.3
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### link or copy the executables
-$(BINDIR)/geod: geod.o \
-		$(LIBDIR)/libproj.a
-	$(CC) $(CFLAGS) geod.o \
-		$(LIBDIR)/libproj.a \
-		$(LFLAGS) -o $(BINDIR)/geod
-$(BINDIR)/proj: proj.o \
-		$(LIBDIR)/libproj.a
-	$(CC) $(CFLAGS) proj.o \
-		$(LIBDIR)/libproj.a \
-		$(LFLAGS) -o $(BINDIR)/proj
-
-### put together the library
-$(LIBDIR)/libproj.a: \
-		PJ_aea.o \
-		PJ_aeqd.o \
-		PJ_airy.o \
-		PJ_aitoff.o \
-		PJ_august.o \
-		PJ_bacon.o \
-		PJ_bipc.o \
-		PJ_boggs.o \
-		PJ_bonne.o \
-		PJ_cass.o \
-		PJ_cc.o \
-		PJ_cea.o \
-		PJ_chamb.o \
-		PJ_collg.o \
-		PJ_crast.o \
-		PJ_denoy.o \
-		PJ_eck1.o \
-		PJ_eck2.o \
-		PJ_eck3.o \
-		PJ_eck4.o \
-		PJ_eck5.o \
-		PJ_eqc.o \
-		PJ_eqdc.o \
-		PJ_fahey.o \
-		PJ_fouc_s.o \
-		PJ_gall.o \
-		PJ_geos.o \
-		PJ_gins8.o \
-		PJ_gn_sinu.o \
-		PJ_gnom.o \
-		PJ_goode.o \
-		PJ_gstmerc.o \
-		PJ_hammer.o \
-		PJ_hatano.o \
-		PJ_healpix.o \
-		PJ_igh.o \
-		PJ_imw_p.o \
-		PJ_isea.o \
-		PJ_krovak.o \
-		PJ_labrd.o \
-		PJ_laea.o \
-		PJ_lagrng.o \
-		PJ_larr.o \
-		PJ_lask.o \
-		PJ_lcc.o \
-		PJ_lcca.o \
-		PJ_loxim.o \
-		PJ_lsat.o \
-		PJ_mbt_fps.o \
-		PJ_mbtfpp.o \
-		PJ_mbtfpq.o \
-		PJ_merc.o \
-		PJ_mill.o \
-		PJ_mod_ster.o \
-		PJ_moll.o \
-		PJ_natearth.o \
-		PJ_nell.o \
-		PJ_nell_h.o \
-		PJ_nocol.o \
-		PJ_nsper.o \
-		PJ_nzmg.o \
-		PJ_ob_tran.o \
-		PJ_ocea.o \
-		PJ_oea.o \
-		PJ_omerc.o \
-		PJ_ortho.o \
-		PJ_poly.o \
-		PJ_putp2.o \
-		PJ_putp3.o \
-		PJ_putp4p.o \
-		PJ_putp5.o \
-		PJ_putp6.o \
-		PJ_robin.o \
-		PJ_rpoly.o \
-		PJ_sconics.o \
-		PJ_somerc.o \
-		PJ_stere.o \
-		PJ_sterea.o \
-		PJ_sts.o \
-		PJ_tcc.o \
-		PJ_tcea.o \
-		PJ_tmerc.o \
-		PJ_tpeqd.o \
-		PJ_urm5.o \
-		PJ_urmfps.o \
-		PJ_vandg.o \
-		PJ_vandg2.o \
-		PJ_vandg4.o \
-		PJ_wag2.o \
-		PJ_wag3.o \
-		PJ_wag7.o \
-		PJ_wink1.o \
-		PJ_wink2.o \
-		aasincos.o \
-		adjlon.o \
-		bch2bps.o \
-		bchgen.o \
-		biveval.o \
-		dmstor.o \
- 		emess.o \
-		gen_cheb.o \
-		geocent.o \
-		geod_for.o \
-		geod_inv.o \
-		geod_set.o \
-		mk_cheby.o \
-		nad_cvt.o \
-		nad_init.o \
-		nad_intr.o \
-		p_series.o \
-		pj_apply_gridshift.o \
-		pj_apply_vgridshift.o \
-		pj_auth.o \
-		pj_ctx.o \
-		pj_datum_set.o \
-		pj_datums.o \
-		pj_deriv.o \
-		pj_ell_set.o \
-		pj_ellps.o \
-		pj_errno.o \
-		pj_factors.o \
-		pj_fwd.o \
-		pj_gauss.o \
-		pj_geocent.o \
-		pj_gridinfo.o \
-		pj_gridlist.o \
-		pj_init.o \
-		pj_initcache.o \
-		pj_inv.o \
-		pj_latlong.o \
-		pj_list.o \
-		pj_log.o \
-		pj_malloc.o \
-		pj_mlfn.o \
-		pj_msfn.o \
-		pj_mutex.o \
-		pj_open_lib.o \
-		pj_param.o \
-		pj_phi2.o \
-		pj_pr_list.o \
-		pj_qsfn.o \
-		pj_release.o \
-		pj_strerrno.o \
-		pj_transform.o \
-		pj_tsfn.o \
-		pj_units.o \
-		pj_utils.o \
-		pj_zpoly1.o \
-		proj_etmerc.o \
-		proj_mdist.o \
-		proj_rouss.o \
-		rtodms.o \
-		vector1.o
-	$(ARCHIVE) $(LIBDIR)/libproj.a \
-		PJ_aea.o \
-		PJ_aeqd.o \
-		PJ_airy.o \
-		PJ_aitoff.o \
-		PJ_august.o \
-		PJ_bacon.o \
-		PJ_bipc.o \
-		PJ_boggs.o \
-		PJ_bonne.o \
-		PJ_cass.o \
-		PJ_cc.o \
-		PJ_cea.o \
-		PJ_chamb.o \
-		PJ_collg.o \
-		PJ_crast.o \
-		PJ_denoy.o \
-		PJ_eck1.o \
-		PJ_eck2.o \
-		PJ_eck3.o \
-		PJ_eck4.o \
-		PJ_eck5.o \
-		PJ_eqc.o \
-		PJ_eqdc.o \
-		PJ_fahey.o \
-		PJ_fouc_s.o \
-		PJ_gall.o \
-		PJ_geos.o \
-		PJ_gins8.o \
-		PJ_gn_sinu.o \
-		PJ_gnom.o \
-		PJ_goode.o \
-		PJ_gstmerc.o \
-		PJ_hammer.o \
-		PJ_hatano.o \
-		PJ_healpix.o \
-		PJ_igh.o \
-		PJ_imw_p.o \
-		PJ_isea.o \
-		PJ_krovak.o \
-		PJ_labrd.o \
-		PJ_laea.o \
-		PJ_lagrng.o \
-		PJ_larr.o \
-		PJ_lask.o \
-		PJ_lcc.o \
-		PJ_lcca.o \
-		PJ_loxim.o \
-		PJ_lsat.o \
-		PJ_mbt_fps.o \
-		PJ_mbtfpp.o \
-		PJ_mbtfpq.o \
-		PJ_merc.o \
-		PJ_mill.o \
-		PJ_mod_ster.o \
-		PJ_moll.o \
-		PJ_natearth.o \
-		PJ_nell.o \
-		PJ_nell_h.o \
-		PJ_nocol.o \
-		PJ_nsper.o \
-		PJ_nzmg.o \
-		PJ_ob_tran.o \
-		PJ_ocea.o \
-		PJ_oea.o \
-		PJ_omerc.o \
-		PJ_ortho.o \
-		PJ_poly.o \
-		PJ_putp2.o \
-		PJ_putp3.o \
-		PJ_putp4p.o \
-		PJ_putp5.o \
-		PJ_putp6.o \
-		PJ_robin.o \
-		PJ_rpoly.o \
-		PJ_sconics.o \
-		PJ_somerc.o \
-		PJ_stere.o \
-		PJ_sterea.o \
-		PJ_sts.o \
-		PJ_tcc.o \
-		PJ_tcea.o \
-		PJ_tmerc.o \
-		PJ_tpeqd.o \
-		PJ_urm5.o \
-		PJ_urmfps.o \
-		PJ_vandg.o \
-		PJ_vandg2.o \
-		PJ_vandg4.o \
-		PJ_wag2.o \
-		PJ_wag3.o \
-		PJ_wag7.o \
-		PJ_wink1.o \
-		PJ_wink2.o \
-		aasincos.o \
-		adjlon.o \
-		bch2bps.o \
-		bchgen.o \
-		biveval.o \
-		dmstor.o \
- 		emess.o \
-		gen_cheb.o \
-		geocent.o \
-		geod_for.o \
-		geod_inv.o \
-		geod_set.o \
-		mk_cheby.o \
-		nad_cvt.o \
-		nad_init.o \
-		nad_intr.o \
-		p_series.o \
-		pj_apply_gridshift.o \
-		pj_apply_vgridshift.o \
-		pj_auth.o \
-		pj_ctx.o \
-		pj_datum_set.o \
-		pj_datums.o \
-		pj_deriv.o \
-		pj_ell_set.o \
-		pj_ellps.o \
-		pj_errno.o \
-		pj_factors.o \
-		pj_fwd.o \
-		pj_gauss.o \
-		pj_geocent.o \
-		pj_gridinfo.o \
-		pj_gridlist.o \
-		pj_init.o \
-		pj_initcache.o \
-		pj_inv.o \
-		pj_latlong.o \
-		pj_list.o \
-		pj_log.o \
-		pj_malloc.o \
-		pj_mlfn.o \
-		pj_msfn.o \
-		pj_mutex.o \
-		pj_open_lib.o \
-		pj_param.o \
-		pj_phi2.o \
-		pj_pr_list.o \
-		pj_qsfn.o \
-		pj_release.o \
-		pj_strerrno.o \
-		pj_transform.o \
-		pj_tsfn.o \
-		pj_units.o \
-		pj_utils.o \
-		pj_zpoly1.o \
-		proj_etmerc.o \
-		proj_mdist.o \
-		proj_rouss.o \
-		rtodms.o \
-		vector1.o
-	ranlib $(LIBDIR)/libproj.a
-
-### compile the source files
-PJ_aea.o:	PJ_aea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_aea.c
-PJ_aeqd.o:	PJ_aeqd.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_aeqd.c
-PJ_airy.o:	PJ_airy.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_airy.c
-PJ_aitoff.o:	PJ_aitoff.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_aitoff.c
-PJ_august.o:	PJ_august.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_august.c
-PJ_bacon.o:	PJ_bacon.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_bacon.c
-PJ_bipc.o:	PJ_bipc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_bipc.c
-PJ_boggs.o:	PJ_boggs.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_boggs.c
-PJ_bonne.o:	PJ_bonne.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_bonne.c
-PJ_cass.o:	PJ_cass.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_cass.c
-PJ_cc.o:	PJ_cc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_cc.c
-PJ_cea.o:	PJ_cea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_cea.c
-PJ_chamb.o:	PJ_chamb.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_chamb.c
-PJ_collg.o:	PJ_collg.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_collg.c
-PJ_crast.o:	PJ_crast.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_crast.c
-PJ_denoy.o:	PJ_denoy.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_denoy.c
-PJ_eck1.o:	PJ_eck1.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_eck1.c
-PJ_eck2.o:	PJ_eck2.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_eck2.c
-PJ_eck3.o:	PJ_eck3.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_eck3.c
-PJ_eck4.o:	PJ_eck4.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_eck4.c
-PJ_eck5.o:	PJ_eck5.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_eck5.c
-PJ_eqc.o:	PJ_eqc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_eqc.c
-PJ_eqdc.o:	PJ_eqdc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_eqdc.c
-PJ_fahey.o:	PJ_fahey.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_fahey.c
-PJ_fouc_s.o:	PJ_fouc_s.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_fouc_s.c
-PJ_gall.o:	PJ_gall.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_gall.c
-PJ_geos.o:	PJ_geos.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_geos.c
-PJ_gins8.o:	PJ_gins8.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_gins8.c
-PJ_gn_sinu.o:	PJ_gn_sinu.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_gn_sinu.c
-PJ_gnom.o:	PJ_gnom.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_gnom.c
-PJ_goode.o:	PJ_goode.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_goode.c
-PJ_gstmerc.o:	PJ_gstmerc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_gstmerc.c
-PJ_hammer.o:	PJ_hammer.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_hammer.c
-PJ_hatano.o:	PJ_hatano.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_hatano.c
-PJ_healpix.o:	PJ_healpix.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_healpix.c
-PJ_igh.o:	PJ_igh.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_igh.c
-PJ_imw_p.o:	PJ_imw_p.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_imw_p.c
-PJ_isea.o:	PJ_isea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_isea.c
-PJ_krovak.o:	PJ_krovak.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_krovak.c
-PJ_labrd.o:	PJ_labrd.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_labrd.c
-PJ_laea.o:	PJ_laea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_laea.c
-PJ_lagrng.o:	PJ_lagrng.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_lagrng.c
-PJ_larr.o:	PJ_larr.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_larr.c
-PJ_lask.o:	PJ_lask.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_lask.c
-PJ_lcc.o:	PJ_lcc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_lcc.c
-PJ_lcca.o:	PJ_lcca.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_lcca.c
-PJ_loxim.o:	PJ_loxim.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_loxim.c
-PJ_lsat.o:	PJ_lsat.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_lsat.c
-PJ_mbt_fps.o:	PJ_mbt_fps.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_mbt_fps.c
-PJ_mbtfpp.o:	PJ_mbtfpp.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_mbtfpp.c
-PJ_mbtfpq.o:	PJ_mbtfpq.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_mbtfpq.c
-PJ_merc.o:	PJ_merc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_merc.c
-PJ_mill.o:	PJ_mill.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_mill.c
-PJ_mod_ster.o:	PJ_mod_ster.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_mod_ster.c
-PJ_moll.o:	PJ_moll.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_moll.c
-PJ_natearth.o:	PJ_natearth.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_natearth.c
-PJ_nell.o:	PJ_nell.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_nell.c
-PJ_nell_h.o:	PJ_nell_h.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_nell_h.c
-PJ_nocol.o:	PJ_nocol.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_nocol.c
-PJ_nsper.o:	PJ_nsper.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_nsper.c
-PJ_nzmg.o:	PJ_nzmg.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_nzmg.c
-PJ_ob_tran.o:	PJ_ob_tran.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_ob_tran.c
-PJ_ocea.o:	PJ_ocea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_ocea.c
-PJ_oea.o:	PJ_oea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_oea.c
-PJ_omerc.o:	PJ_omerc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_omerc.c
-PJ_ortho.o:	PJ_ortho.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_ortho.c
-PJ_poly.o:	PJ_poly.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_poly.c
-PJ_putp2.o:	PJ_putp2.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_putp2.c
-PJ_putp3.o:	PJ_putp3.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_putp3.c
-PJ_putp4p.o:	PJ_putp4p.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_putp4p.c
-PJ_putp5.o:	PJ_putp5.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_putp5.c
-PJ_putp6.o:	PJ_putp6.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_putp6.c
-PJ_robin.o:	PJ_robin.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_robin.c
-PJ_rpoly.o:	PJ_rpoly.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_rpoly.c
-PJ_sconics.o:	PJ_sconics.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_sconics.c
-PJ_somerc.o:	PJ_somerc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_somerc.c
-PJ_stere.o:	PJ_stere.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_stere.c
-PJ_sterea.o:	PJ_sterea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_sterea.c
-PJ_sts.o:	PJ_sts.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_sts.c
-PJ_tcc.o:	PJ_tcc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_tcc.c
-PJ_tcea.o:	PJ_tcea.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_tcea.c
-PJ_tmerc.o:	PJ_tmerc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_tmerc.c
-PJ_tpeqd.o:	PJ_tpeqd.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_tpeqd.c
-PJ_urm5.o:	PJ_urm5.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_urm5.c
-PJ_urmfps.o:	PJ_urmfps.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_urmfps.c
-PJ_vandg.o:	PJ_vandg.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_vandg.c
-PJ_vandg2.o:	PJ_vandg2.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_vandg2.c
-PJ_vandg4.o:	PJ_vandg4.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_vandg4.c
-PJ_wag2.o:	PJ_wag2.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_wag2.c
-PJ_wag3.o:	PJ_wag3.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_wag3.c
-PJ_wag7.o:	PJ_wag7.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_wag7.c
-PJ_wink1.o:	PJ_wink1.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_wink1.c
-PJ_wink2.o:	PJ_wink2.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. PJ_wink2.c
-aasincos.o:	aasincos.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. aasincos.c
-adjlon.o:	adjlon.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. adjlon.c
-bch2bps.o:	bch2bps.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. bch2bps.c
-bchgen.o:	bchgen.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. bchgen.c
-biveval.o:	biveval.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. biveval.c
-cs2cs.o:	cs2cs.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. cs2cs.c
-dmstor.o:	dmstor.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. dmstor.c
-emess.o:	emess.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. emess.c
-gen_cheb.o:	gen_cheb.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. gen_cheb.c
-geocent.o:	geocent.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. geocent.c
-geod.o:	geod.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. geod.c
-geod_for.o:	geod_for.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. geod_for.c
-geod_inv.o:	geod_inv.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. geod_inv.c
-geod_set.o:	geod_set.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. geod_set.c
-mk_cheby.o:	mk_cheby.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. mk_cheby.c
-multistresstest.o:	multistresstest.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. multistresstest.c
-nad2bin.o:	nad2bin.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. nad2bin.c
-nad_cvt.o:	nad_cvt.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. nad_cvt.c
-nad_init.o:	nad_init.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. nad_init.c
-nad_intr.o:	nad_intr.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. nad_intr.c
-p_series.o:	p_series.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. p_series.c
-pj_apply_gridshift.o:	pj_apply_gridshift.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_apply_gridshift.c
-pj_apply_vgridshift.o:	pj_apply_vgridshift.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_apply_vgridshift.c
-pj_auth.o:	pj_auth.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_auth.c
-pj_ctx.o:	pj_ctx.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_ctx.c
-pj_datum_set.o:	pj_datum_set.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_datum_set.c
-pj_datums.o:	pj_datums.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_datums.c
-pj_deriv.o:	pj_deriv.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_deriv.c
-pj_ell_set.o:	pj_ell_set.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_ell_set.c
-pj_ellps.o:	pj_ellps.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_ellps.c
-pj_errno.o:	pj_errno.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_errno.c
-pj_factors.o:	pj_factors.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_factors.c
-pj_fwd.o:	pj_fwd.c emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_fwd.c
-pj_gauss.o:	pj_gauss.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_gauss.c
-pj_geocent.o:	pj_geocent.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_geocent.c
-pj_gridinfo.o:	pj_gridinfo.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_gridinfo.c
-pj_gridlist.o:	pj_gridlist.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_gridlist.c
-pj_init.o:	pj_init.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_init.c
-pj_initcache.o:	pj_initcache.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_initcache.c
-pj_inv.o:	pj_inv.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_inv.c
-pj_latlong.o:	pj_latlong.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_latlong.c
-pj_list.o:	pj_list.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_list.c
-pj_log.o:	pj_log.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_log.c
-pj_malloc.o:	pj_malloc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_malloc.c
-pj_mlfn.o:	pj_mlfn.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_mlfn.c
-pj_msfn.o:	pj_msfn.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_msfn.c
-pj_mutex.o:	pj_mutex.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_mutex.c
-pj_open_lib.o:	pj_open_lib.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_open_lib.c
-pj_param.o:	pj_param.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_param.c
-pj_phi2.o:	pj_phi2.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_phi2.c
-pj_pr_list.o:	pj_pr_list.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_pr_list.c
-pj_qsfn.o:	pj_qsfn.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_qsfn.c
-pj_release.o:	pj_release.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_release.c
-pj_strerrno.o:	pj_strerrno.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_strerrno.c
-pj_transform.o:	pj_transform.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_transform.c
-pj_tsfn.o:	pj_tsfn.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_tsfn.c
-pj_units.o:	pj_units.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_units.c
-pj_utils.o:	pj_utils.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_utils.c
-pj_zpoly1.o:	pj_zpoly1.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. pj_zpoly1.c
-proj.o:	proj.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. proj.c
-proj_etmerc.o:	proj_etmerc.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. proj_etmerc.c
-proj_mdist.o:	proj_mdist.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. proj_mdist.c
-proj_rouss.o:	proj_rouss.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. proj_rouss.c
-rtodms.o:	rtodms.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. rtodms.c
-vector1.o:	vector1.c \
-		emess.h  geocent.h  geodesic.h \
-		pj_list.h  proj_api.h  projects.h
-	$(CC) -c $(CFLAGS) -I. vector1.c
-
-### copy the include files to the include file directory
-$(INCDIR)/proj_api.h:	proj_api.h
-	cp proj_api.h $(INCDIR)/proj_api.h
-	chmod 664 $(INCDIR)/proj_api.h
-
-### copy the man pages to the man directory
-$(MANDIR)/man1/geod.1:	geod.1 $(MANDIR)/man1
-	cp geod.1 $(MANDIR)/man1/geod.1
-	chmod 664 $(MANDIR)/man1/geod.1
-$(MANDIR)/man1/proj.1:	proj.1 $(MANDIR)/man1
-	cp proj.1 $(MANDIR)/man1/proj.1
-	chmod 664 $(MANDIR)/man1/proj.1
-$(MANDIR)/man3/pj_init.3:	pj_init.3 $(MANDIR)/man3
-	cp pj_init.3 $(MANDIR)/man3/pj_init.3
-	chmod 664 $(MANDIR)/man3/pj_init.3
-$(MANDIR)/man1:	$(MANDIR)
-	mkdir $(MANDIR)/man1
-$(MANDIR)/man3:	$(MANDIR)
-	mkdir $(MANDIR)/man3
-$(MANDIR):
-	mkdir $(MANDIR)
diff --git a/src/ps/Makefile.in b/src/ps/Makefile.in
index 861f5ba..ac5ba84 100644
--- a/src/ps/Makefile.in
+++ b/src/ps/Makefile.in
@@ -170,8 +170,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -188,6 +186,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -251,19 +250,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -276,8 +282,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/ps/Makefile.template b/src/ps/Makefile.template
deleted file mode 100644
index 2b1483c..0000000
--- a/src/ps/Makefile.template
+++ /dev/null
@@ -1,40 +0,0 @@
-#     The MB-system:	Makefile.template  5/21/2013
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2013-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/ps directory level
-# Author:	D. W. Caress
-# Date:		May 21, 2013
-#
-# $Log: Makefile.template,v $
-#
-#
-
-### sets locations of vital objects
-PSDIR = ../../share/doc/mbsystem/ps
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all copies the ps files to the share/doc/mbsystem/ps file directory
-all:	$(PSDIR)
-	cp *.ps $(PSDIR)
-	chmod 664 $(PSDIR)/*.ps
-$(PSDIR):
-	mkdir $(PSDIR)
-
-
-### make clean removes the object files
-clean:
-	rm -r -f $(PSDIR)
diff --git a/src/ps/mb7k2jstar.ps b/src/ps/mb7k2jstar.ps
index ba8549d..4b25d2d 100644
--- a/src/ps/mb7k2jstar.ps
+++ b/src/ps/mb7k2jstar.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:14 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mb7k2ss.ps b/src/ps/mb7k2ss.ps
index 3468b18..1ae48eb 100644
--- a/src/ps/mb7k2ss.ps
+++ b/src/ps/mb7k2ss.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:14 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -569,7 +569,7 @@ output \214lenames will be sequentially numbered. The)-.1 F F1<ad54>
 1.303(to lay out the sidescan on the sea\215oor)3.803 F 3.803(.T)-.55 G
 1.303(he output)-3.803 F(appears as follo)108 168 Q(ws:)-.25 E
 (Program mb7k2ss)128 180 Q -1.11(Ve)144 192 S
-(rsion $Id: mb7k2ss.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mb7k2ss.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)144 204 Q(ersion 5.1.1beta5)-1.11 E(Data records to e)144
 228 Q(xtract:)-.15 E(Lo)156.5 240 Q 2.5(wS)-.25 G(idescan)-2.5 E
 (Sidescan port and starboard e)156.5 252 Q(xchanged)-.15 E
diff --git a/src/ps/mb7kpreprocess.ps b/src/ps/mb7kpreprocess.ps
index 9b8c2de..79a91dd 100644
--- a/src/ps/mb7kpreprocess.ps
+++ b/src/ps/mb7kpreprocess.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:14 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbabsorption.ps b/src/ps/mbabsorption.ps
index 44e3c70..ae7850a 100644
--- a/src/ps/mbabsorption.ps
+++ b/src/ps/mbabsorption.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -369,7 +369,7 @@ F .155(depth of 1000 meters \(on an A)108 136.8 R(UV)-.55 E 2.656(,f)
 (mbabsorption \255D1000 \255F200 \255P8 \255S35 \255T4 \255V)144 220.8 Q
 (The output will be:)108 232.8 Q(Program MBabsorption)110.5 244.8 Q
 -1.11(Ve)110.5 256.8 S
-(rsion $Id: mbabsorption.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbabsorption.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)110.5 268.8 Q(ersion 5.1.1beta15)-1.11 E(Input P)110.5
 292.8 Q(arameters:)-.15 E(Frequenc)123 304.8 Q 17.5(y: 200.000000)-.15 F
 (kHz)2.5 E -.7(Te)123 316.8 S 12.5(mperature: 4.000000).7 F(de)2.5 E 2.5
diff --git a/src/ps/mbareaclean.ps b/src/ps/mbareaclean.ps
index c7518b6..092305c 100644
--- a/src/ps/mbareaclean.ps
+++ b/src/ps/mbareaclean.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -504,7 +504,7 @@ reshold is 0.1 \(or 10%\) of the sonar altitude, and the)108 480 R(mini\
 mum number of sounding required for \214ltering is 10. The results look\
  lik)108 492 Q(e:)-.1 E(Program MB)110.5 516 Q(AREA)-.35 E(CLEAN)-.4 E
 -1.11(Ve)110.5 528 S
-(rsion $Id: mbareaclean.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbareaclean.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)110.5 540 Q(ersion 5.0.beta29)-1.11 E(Area of interest:)
 110.5 552 Q
 (Minimum Longitude: \255122.425560 Maximum Longitude: \255122.419740)123
diff --git a/src/ps/mbauvloglist.ps b/src/ps/mbauvloglist.ps
index 03f0c64..46be21c 100644
--- a/src/ps/mbauvloglist.ps
+++ b/src/ps/mbauvloglist.ps
@@ -1,11 +1,11 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
 %%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 6
+%%Pages: 7
 %%PageOrder: Ascend
 %%DocumentMedia: Default 612 792 0 () ()
 %%Orientation: Portrait
@@ -236,7 +236,8 @@ BP
 (UV mission log \214le.)-.55 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbauvloglist \255I)
 108 177.6 Q/F3 10/Times-Italic at 0 SF(\214le)A F0([)2.5 E F2<ad46>A F3
-(printformat)A F2<ad4c>2.5 E F3(lon\215ip)A F2<ad4f>2.5 E F3(list)A F2
+(printformat)A F2<ad4c>2.5 E F3(lon\215ip)A F2<ad4d>2.5 E F3(mode)A F2
+<ad4e>2.5 E F3(nav\214le)A F2<ad4f>2.5 E F3(list)A F2
 <ad5020ad5320ad5620ad48>2.5 E F0(])2.5 E F1(DESCRIPTION)72 206.4 Q F0
 .462(MBauvloglist reads an MB)108 218.4 R .462(ARI A)-.35 F .462(UV mis\
 sion log \214le and lists speci\214ed \214elds in tab-delimited te)-.55
@@ -282,337 +283,415 @@ F0 .557(option alone to print out a list of the)3.057 F 1.207
 F .418(desired order of columns. The)108 518.4 R F2<ad46>2.917 E F0 .417
 (option can be used to set the printing format. Otherwise, the def)2.917
 F .417(ault for)-.1 F(-)-.2 E
-(mat speci\214ed in the log header will be used.)108 530.4 Q
-(As of August 2009, the contents of the MB)108 554.4 Q(ARI Mapping A)
--.35 E(UV missions logs are:)-.55 E(DropW)108 578.4 Q
-(eight.log Contents:)-.8 E(timeT)110.5 590.4 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(short WDT)110.5 602.4 Q
-(imer %d ,Count Do)-.35 E(wn T)-.25 E(imer ,Seconds)-.35 E(short BWT)
-110.5 614.4 Q(imer %d ,Burn W)-.35 E(ire T)-.4 E(imer ,Seconds)-.35 E
-(short WDClear %d ,W)110.5 626.4 Q(atch Dog Clear ,Unitless)-.8 E
-(short AcommsDN %d ,Acoustic Comms Drop No)110.5 638.4 Q 2.5(w,)-.25 G
-(Unitless)-2.5 E(short WDStatus %d ,W)110.5 650.4 Q
-(atch Dog Status ,Unkno)-.8 E(wn)-.25 E(short D)110.5 662.4 Q -.8(Wo)-.3
-G(ut %d ,Drop W).8 E(eight Acti)-.8 E .3 -.15(ve ,)-.25 H(Unitless).15 E
-(short GulperProxIn %d ,Gulper Proximity Sensor ,Unitless)110.5 674.4 Q
-(adam6017.log Contents:)108 698.4 Q(timeT)110.5 710.4 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E
-(double chan0 %8.8e ,chan0 ,UNKNO)110.5 722.4 Q(WN)-.35 E(MB-System 5.0)
-72 768 Q(21 October 2013)137.055 E(1)195.395 E 0 Cg EP
+(mat speci\214ed in the log header will be used.)108 530.4 Q(The)108
+554.4 Q F2(-M)3.697 E F3(mode)A F0 1.197
+(option sets the output mode. By def)3.697 F 1.197
+(ault, the output will be ASCII te)-.1 F 1.197(xt with tab characters)
+-.15 F .667(between \214elds, which is equi)108 566.4 R -.25(va)-.25 G
+.667(lent to).25 F F2(-M)3.167 E F3(0)A F0 3.166(.I)C 3.166(ff)-3.166 G
+(Imode)-3.166 E F3 3.166(=1)3.166 G 3.166(,t)-3.166 G .666
+(hen the output will be ASCII te)-3.166 F .666(xt with comma)-.2 F
+(delimiter)108 578.4 Q .237(s. If mode = 1, then the output will binary\
+ values \(8-btye double or 4-byte int values\) with nothing)-.1 F
+(between the desir)108 590.4 Q(ed \214elds.)-.37 E -1.05(Fo)108 614.4 S
+2.814(rl)1.05 G .514 -.1(og \214)-2.814 H .314
+(les that do not include navigation, an e).1 F .314
+(xternal navigation \214le in the "fn)-.2 F .314
+(v" format may be speci\214ed)-.4 F(using the)108 626.4 Q F2(-N)2.5 E F3
+(option.)2.5 E(As of A)108 650.4 Q(ugust 2009, the contents of the MB)
+-.2 E(ARI Mapping A)-.25 E(UV missions lo)-.5 E(gs ar)-.1 E(e:)-.37 E
+(Dr)108 674.4 Q(opW)-.45 E(eight.lo)-.92 E 2.5(gC)-.1 G(ontents:)-2.5 E
+(timeT)110.5 686.4 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)
+-.5 E(short WDT)110.5 698.4 Q(imer %d ,Count Down T)-.55 E
+(imer ,Seconds)-.55 E(short BWT)110.5 710.4 Q(imer %d ,Burn W)-.55 E(ir)
+-.55 E 2.5(eT)-.37 G(imer ,Seconds)-3.05 E(short WDClear %d ,W)110.5
+722.4 Q(atc)-.92 E 2.5(hD)-.15 G .2 -.1(og C)-2.5 H(lear ,Unitless).1 E
+F0(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(1)193.45 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F(double chan1 %8.8e ,chan1 ,UNKNO)
-110.5 84 Q(WN)-.35 E(double chan2 %8.8e ,chan2 ,UNKNO)110.5 96 Q(WN)-.35
-E(double chan3 %8.8e ,chan3 ,UNKNO)110.5 108 Q(WN)-.35 E
-(double chan4 %8.8e ,chan4 ,UNKNO)110.5 120 Q(WN)-.35 E
-(double chan5 %8.8e ,chan5 ,UNKNO)110.5 132 Q(WN)-.35 E
-(double chan6 %8.8e ,chan6 ,UNKNO)110.5 144 Q(WN)-.35 E
-(double chan7 %8.8e ,chan7 ,UNKNO)110.5 156 Q(WN)-.35 E
-(ats.log Contents:)108 180 Q(timeT)110.5 192 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(double AtsDelta %8.8e ,Last\
- ms drift bt Reson and Auv clocks: drift = delta0 \255 \(tReson-tAuv\) \
-,seconds)110.5 204 Q(double AtsDrift %8.8e ,AtsDrift ,seconds)110.5 216
-Q(dvl.log Contents:)108 240 Q(timeT)110.5 252 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(double dvlBotV)110.5 264 Q
-(elx %8.8e ,dvlBotV)-1.11 E(elx ,UNKNO)-1.11 E(WN)-.35 E(double dvlBotV)
-110.5 276 Q(ely %8.8e ,dvlBotV)-1.11 E(ely ,UNKNO)-1.11 E(WN)-.35 E
-(double dvlBotV)110.5 288 Q(elz %8.8e ,dvlBotV)-1.11 E(elz ,UNKNO)-1.11
-E(WN)-.35 E(double dvlBotV)110.5 300 Q(ele %8.8e ,dvlBotV)-1.11 E
-(ele ,UNKNO)-1.11 E(WN)-.35 E(short dvlBotV)110.5 312 Q
-(elStat %d ,dvlBotV)-1.11 E(elStat ,UNKNO)-1.11 E(WN)-.35 E(double dvlW)
-110.5 324 Q(atV)-.8 E(elx %8.8e ,dvlW)-1.11 E(atV)-.8 E(elx ,UNKNO)-1.11
-E(WN)-.35 E(double dvlW)110.5 336 Q(atV)-.8 E(ely %8.8e ,dvlW)-1.11 E
-(atV)-.8 E(ely ,UNKNO)-1.11 E(WN)-.35 E(double dvlW)110.5 348 Q(atV)-.8
-E(elz %8.8e ,dvlW)-1.11 E(atV)-.8 E(elz ,UNKNO)-1.11 E(WN)-.35 E
-(double dvlW)110.5 360 Q(atV)-.8 E(ele %8.8e ,dvlW)-1.11 E(atV)-.8 E
-(ele ,UNKNO)-1.11 E(WN)-.35 E(short dvlW)110.5 372 Q(atV)-.8 E
-(elStat %d ,dvlW)-1.11 E(atV)-.8 E(elStat ,UNKNO)-1.11 E(WN)-.35 E
-(double dvlT)110.5 384 Q(emp %8.8e ,dvlT)-.7 E(emp ,UNKNO)-.7 E(WN)-.35
-E(double dvlPitch %8.8e ,dvlPitch ,UNKNO)110.5 396 Q(WN)-.35 E
-(double dvlRoll %8.8e ,dvlRoll ,UNKNO)110.5 408 Q(WN)-.35 E
-(double dvlHeading %8.8e ,dvlHeading ,UNKNO)110.5 420 Q(WN)-.35 E
-(double dvlBeam1 %4.6f ,dvlBeam1 ,UNKNO)110.5 432 Q(WN)-.35 E
-(double dvlBeam2 %4.6f ,dvlBeam2 ,UNKNO)110.5 444 Q(WN)-.35 E
-(double dvlBeam3 %4.6f ,dvlBeam3 ,UNKNO)110.5 456 Q(WN)-.35 E
-(double dvlBeam4 %8.8e ,dvlBeam4 ,UNKNO)110.5 468 Q(WN)-.35 E
-(double dvlRange %8.8e ,dvlRange ,UNKNO)110.5 480 Q(WN)-.35 E
-(double dvlT)110.5 492 Q(oping %20.4f ,dvlT)-.8 E(oping ,UNKNO)-.8 E(WN)
--.35 E(double dvlSpdSnd %12.4f ,dvlSpdSnd ,UNKNO)110.5 504 Q(WN)-.35 E
-(dynamicControl.log Contents:)108 528 Q(timeT)110.5 540 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(double myT)110.5 552 Q
-(ime %.2f ,myT)-.35 E(ime ,UNKNO)-.35 E(WN)-.35 E(double xT)110.5 564 Q
-(rackError %8.8e ,xT)-.35 E(rackError ,UNKNO)-.35 E(WN)-.35 E
-(double cPsi %8.8e ,cPsi ,UNKNO)110.5 576 Q(WN)-.35 E
-(double cDeltaR %8.8e ,cDeltaR ,UNKNO)110.5 588 Q(WN)-.35 E
-(double tPsi %8.8e ,tPsi ,UNKNO)110.5 600 Q(WN)-.35 E
-(double psiProp %8.8e ,psiProp ,UNKNO)110.5 612 Q(WN)-.35 E
-(double psiInt %8.8e ,psiInt ,UNKNO)110.5 624 Q(WN)-.35 E
-(double psiRate %8.8e ,psiRate ,UNKNO)110.5 636 Q(WN)-.35 E
-(double xteInte)110.5 648 Q(gral %8.8e ,xteInte)-.15 E(gral ,UNKNO)-.15
-E(WN)-.35 E(double kxte %8.8e ,kxte ,UNKNO)110.5 660 Q(WN)-.35 E
-(double dPsi %8.8e ,dPsi ,UNKNO)110.5 672 Q(WN)-.35 E
-(double speedCmd %8.8e ,speedCmd ,UNKNO)110.5 684 Q(WN)-.35 E
-(double ome)110.5 696 Q -.05(ga)-.15 G(Cmd %8.8e ,ome).05 E -.05(ga)-.15
-G(Cmd ,UNKNO).05 E(WN)-.35 E(double cDepth %8.8e ,cDepth ,UNKNO)110.5
-708 Q(WN)-.35 E(double tDepth %8.8e ,tDepth ,UNKNO)110.5 720 Q(WN)-.35 E
-(MB-System 5.0)72 768 Q(21 October 2013)137.055 E(2)195.395 E 0 Cg EP
+135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF
+(short AcommsDN %d ,Acoustic Comms Dr)110.5 84 Q(op Now ,Unitless)-.45 E
+(short WDStatus %d ,W)110.5 96 Q(atc)-.92 E 2.5(hD)-.15 G .2 -.1(og S)
+-2.5 H(tatus ,Unknown).1 E(short D)110.5 108 Q -.92(Wo)-.4 G(ut %d ,Dr)
+.92 E(op W)-.45 E(eight Active ,Unitless)-.92 E(short GulperPr)110.5 120
+Q(oxIn %d ,Gulper Pr)-.45 E(oximity Sensor ,Unitless)-.45 E(adam6017.lo)
+108 144 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 156 Q .2 -.1(ag t)
+-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(double c)110.5 168 Q
+(han0 %8.8e ,c)-.15 E(han0 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 180 Q
+(han1 %8.8e ,c)-.15 E(han1 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 192 Q
+(han2 %8.8e ,c)-.15 E(han2 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 204 Q
+(han3 %8.8e ,c)-.15 E(han3 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 216 Q
+(han4 %8.8e ,c)-.15 E(han4 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 228 Q
+(han5 %8.8e ,c)-.15 E(han5 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 240 Q
+(han6 %8.8e ,c)-.15 E(han6 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 252 Q
+(han7 %8.8e ,c)-.15 E(han7 ,UNKNO)-.15 E(WN)-.5 E(ats.lo)108 276 Q 2.5
+(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 288 Q .2 -.1(ag t)-.92 H
+(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
+(double AtsDelta %8.8e ,Last ms drift bt Reson and A)110.5 300 Q
+(uv cloc)-.2 E(ks: drift = delta0 \255 \(tReson-tA)-.2 E(uv\) ,seconds)
+-.2 E(double AtsDrift %8.8e ,AtsDrift ,seconds)110.5 312 Q(dvl.lo)108
+336 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 348 Q .2 -.1(ag t)-.92 H
+(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(double dvlBotV)110.5 360 Q
+(elx %8.8e ,dvlBotV)-1.11 E(elx ,UNKNO)-1.11 E(WN)-.5 E(double dvlBotV)
+110.5 372 Q(ely %8.8e ,dvlBotV)-1.11 E(ely ,UNKNO)-1.11 E(WN)-.5 E
+(double dvlBotV)110.5 384 Q(elz %8.8e ,dvlBotV)-1.11 E(elz ,UNKNO)-1.11
+E(WN)-.5 E(double dvlBotV)110.5 396 Q(ele %8.8e ,dvlBotV)-1.11 E
+(ele ,UNKNO)-1.11 E(WN)-.5 E(short dvlBotV)110.5 408 Q
+(elStat %d ,dvlBotV)-1.11 E(elStat ,UNKNO)-1.11 E(WN)-.5 E(double dvlW)
+110.5 420 Q(atV)-.92 E(elx %8.8e ,dvlW)-1.11 E(atV)-.92 E(elx ,UNKNO)
+-1.11 E(WN)-.5 E(double dvlW)110.5 432 Q(atV)-.92 E(ely %8.8e ,dvlW)
+-1.11 E(atV)-.92 E(ely ,UNKNO)-1.11 E(WN)-.5 E(double dvlW)110.5 444 Q
+(atV)-.92 E(elz %8.8e ,dvlW)-1.11 E(atV)-.92 E(elz ,UNKNO)-1.11 E(WN)-.5
+E(double dvlW)110.5 456 Q(atV)-.92 E(ele %8.8e ,dvlW)-1.11 E(atV)-.92 E
+(ele ,UNKNO)-1.11 E(WN)-.5 E(short dvlW)110.5 468 Q(atV)-.92 E
+(elStat %d ,dvlW)-1.11 E(atV)-.92 E(elStat ,UNKNO)-1.11 E(WN)-.5 E
+(double dvlT)110.5 480 Q(emp %8.8e ,dvlT)-.92 E(emp ,UNKNO)-.92 E(WN)-.5
+E(double dvlPitc)110.5 492 Q 2.5(h%)-.15 G(8.8e ,dvlPitc)-2.5 E 2.5(h,)
+-.15 G(UNKNO)-2.5 E(WN)-.5 E(double dvlRoll %8.8e ,dvlRoll ,UNKNO)110.5
+504 Q(WN)-.5 E(double dvlHeading %8.8e ,dvlHeading ,UNKNO)110.5 516 Q
+(WN)-.5 E(double dvlBeam1 %4.6f ,dvlBeam1 ,UNKNO)110.5 528 Q(WN)-.5 E
+(double dvlBeam2 %4.6f ,dvlBeam2 ,UNKNO)110.5 540 Q(WN)-.5 E
+(double dvlBeam3 %4.6f ,dvlBeam3 ,UNKNO)110.5 552 Q(WN)-.5 E
+(double dvlBeam4 %8.8e ,dvlBeam4 ,UNKNO)110.5 564 Q(WN)-.5 E
+(double dvlRang)110.5 576 Q 2.5(e%)-.1 G(8.8e ,dvlRang)-2.5 E 2.5(e,)-.1
+G(UNKNO)-2.5 E(WN)-.5 E(double dvlT)110.5 588 Q(oping %20.4f ,dvlT)-.92
+E(oping ,UNKNO)-.92 E(WN)-.5 E
+(double dvlSpdSnd %12.4f ,dvlSpdSnd ,UNKNO)110.5 600 Q(WN)-.5 E
+(dynamicContr)108 624 Q(ol.lo)-.45 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)
+110.5 636 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
+(double myT)110.5 648 Q(ime %.2f ,myT)-.55 E(ime ,UNKNO)-.55 E(WN)-.5 E
+(double xT)110.5 660 Q -.15(ra)-.55 G -.2(ck).15 G(Err).2 E
+(or %8.8e ,xT)-.45 E -.15(ra)-.55 G -.2(ck).15 G(Err).2 E(or ,UNKNO)-.45
+E(WN)-.5 E(double cPsi %8.8e ,cPsi ,UNKNO)110.5 672 Q(WN)-.5 E
+(double cDeltaR %8.8e ,cDeltaR ,UNKNO)110.5 684 Q(WN)-.5 E
+(double tPsi %8.8e ,tPsi ,UNKNO)110.5 696 Q(WN)-.5 E(double psiPr)110.5
+708 Q(op %8.8e ,psiPr)-.45 E(op ,UNKNO)-.45 E(WN)-.5 E
+(double psiInt %8.8e ,psiInt ,UNKNO)110.5 720 Q(WN)-.5 E F0
+(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(2)193.45 E 0 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F
-(double DepthError %8.8e ,DepthError ,UNKNO)110.5 84 Q(WN)-.35 E
-(double dInte)110.5 96 Q(gral %8.8e ,dInte)-.15 E(gral ,UNKNO)-.15 E(WN)
--.35 E(double mDepthRateT)110.5 108 Q(erm %8.8e ,mDepthRateT)-.7 E
-(erm ,UNKNO)-.7 E(WN)-.35 E(double cTheta %8.8e ,cTheta ,UNKNO)110.5 120
-Q(WN)-.35 E(double pitchProp %8.8e ,pitchProp ,UNKNO)110.5 132 Q(WN)-.35
-E(double pitchInt %8.8e ,pitchInt ,UNKNO)110.5 144 Q(WN)-.35 E
-(double pitchRate %8.8e ,pitchRate ,UNKNO)110.5 156 Q(WN)-.35 E
-(double pitchIntInp %8.8e ,pitchIntInp ,UNKNO)110.5 168 Q(WN)-.35 E
-(double cDeltaEBL %8.8e ,cDeltaEBL ,UNKNO)110.5 180 Q(WN)-.35 E
-(double cDeltaE %8.8e ,cDeltaE ,UNKNO)110.5 192 Q(WN)-.35 E(double tar)
-110.5 204 Q(getNorthing %13.2f ,tar)-.18 E(getNorthing ,UNKNO)-.18 E(WN)
--.35 E(double tar)110.5 216 Q(getEasting %13.2f ,tar)-.18 E
-(getEasting ,UNKNO)-.18 E(WN)-.35 E(double ne)110.5 228 Q
-(wBearing %8.8e ,ne)-.25 E(wBearing ,UNKNO)-.25 E(WN)-.35 E(double ne)
-110.5 240 Q(wNorthing %13.2f ,ne)-.25 E(wNorthing ,UNKNO)-.25 E(WN)-.35
-E(double ne)110.5 252 Q(wEasting %13.2f ,ne)-.25 E(wEasting ,UNKNO)-.25
-E(WN)-.35 E(short \214rst %d ,\214rst ,UNKNO)110.5 264 Q(WN)-.35 E -.1
-(fa)108 288 S(stcatlog.log Contents:).1 E(timeT)110.5 300 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(double conducti)110.5 312 Q
-(vity %8.8e ,Calculated conducti)-.25 E(vity ,Siemens/meter)-.25 E
-(double temperature %8.8e ,Calculated temperature ,Celsius)110.5 324 Q
-(double pressure %8.8e ,Calculated pressure ,Decibars)110.5 336 Q
-(double calculated_salinity %8.8e ,Calculated salinity ,V)110.5 348 Q
-(olts)-1.29 E(double cond_frequenc)110.5 360 Q 2.5(y%)-.15 G(8.8e ,Ra)
--2.5 E 2.5(wC)-.15 G(onducti)-2.5 E(vity frequenc)-.25 E 2.5(y,)-.15 G
-(Hertz)-2.5 E(double temp_counts %8.8e ,Ra)110.5 372 Q 2.5(wP)-.15 G
-(ressure A/D counts ,Unitless)-2.5 E
-(double pressure_counts %8.8e ,pressure_counts ,Unitless)110.5 384 Q
-1.682(double pressure_temp_comp_v)110.5 396 R 1.682
-(oltage_reading %8.8e ,Ra)-.2 F 4.182(wp)-.15 G 1.683
-(ressure temp compensation v)-4.182 F 1.683(oltage reading)-.2 F(,V)108
-408 Q(olts)-1.29 E(double calculated_sound_v)110.5 420 Q
-(elocity %8.8e ,Calculated sound v)-.15 E(elocity ,M/s)-.15 E
-(gps.log Contents:)108 444 Q(timeT)110.5 456 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(inte)110.5 468 Q
-(ger hours %d ,Hours ,Hours)-.15 E(inte)110.5 480 Q
-(ger minutes %d ,Minutes ,Minutes)-.15 E(inte)110.5 492 Q
-(ger seconds %d ,Seconds ,Seconds)-.15 E(inte)110.5 504 Q
-(ger centiSeconds %d ,CentiSeconds ,CentiSeconds)-.15 E
-(angle latitude %8.8e ,V)110.5 516 Q(ehicle latitude ,De)-1.11 E(grees)
--.15 E(angle longitude %8.8e ,V)110.5 528 Q(ehicle longitude ,De)-1.11 E
-(grees)-.15 E(short quality %d ,GPS quality code ,Unitless)110.5 540 Q
+135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF
+(double psiRate %8.8e ,psiRate ,UNKNO)110.5 84 Q(WN)-.5 E
+(double xteInte)110.5 96 Q(gr)-.4 E(al %8.8e ,xteInte)-.15 E(gr)-.4 E
+(al ,UNKNO)-.15 E(WN)-.5 E(double kxte %8.8e ,kxte ,UNKNO)110.5 108 Q
+(WN)-.5 E(double dPsi %8.8e ,dPsi ,UNKNO)110.5 120 Q(WN)-.5 E
+(double speedCmd %8.8e ,speedCmd ,UNKNO)110.5 132 Q(WN)-.5 E(double ome)
+110.5 144 Q(gaCmd %8.8e ,ome)-.4 E(gaCmd ,UNKNO)-.4 E(WN)-.5 E
+(double cDepth %8.8e ,cDepth ,UNKNO)110.5 156 Q(WN)-.5 E
+(double tDepth %8.8e ,tDepth ,UNKNO)110.5 168 Q(WN)-.5 E
+(double DepthErr)110.5 180 Q(or %8.8e ,DepthErr)-.45 E(or ,UNKNO)-.45 E
+(WN)-.5 E(double dInte)110.5 192 Q(gr)-.4 E(al %8.8e ,dInte)-.15 E(gr)
+-.4 E(al ,UNKNO)-.15 E(WN)-.5 E(double mDepthRateT)110.5 204 Q
+(erm %8.8e ,mDepthRateT)-.92 E(erm ,UNKNO)-.92 E(WN)-.5 E
+(double cTheta %8.8e ,cTheta ,UNKNO)110.5 216 Q(WN)-.5 E(double pitc)
+110.5 228 Q(hPr)-.15 E(op %8.8e ,pitc)-.45 E(hPr)-.15 E(op ,UNKNO)-.45 E
+(WN)-.5 E(double pitc)110.5 240 Q(hInt %8.8e ,pitc)-.15 E(hInt ,UNKNO)
+-.15 E(WN)-.5 E(double pitc)110.5 252 Q(hRate %8.8e ,pitc)-.15 E
+(hRate ,UNKNO)-.15 E(WN)-.5 E(double pitc)110.5 264 Q
+(hIntInp %8.8e ,pitc)-.15 E(hIntInp ,UNKNO)-.15 E(WN)-.5 E
+(double cDeltaEBL %8.8e ,cDeltaEBL ,UNKNO)110.5 276 Q(WN)-.5 E
+(double cDeltaE %8.8e ,cDeltaE ,UNKNO)110.5 288 Q(WN)-.5 E(double tar)
+110.5 300 Q -.1(ge)-.37 G(tNorthing %13.2f ,tar).1 E -.1(ge)-.37 G
+(tNorthing ,UNKNO).1 E(WN)-.5 E(double tar)110.5 312 Q -.1(ge)-.37 G
+(tEasting %13.2f ,tar).1 E -.1(ge)-.37 G(tEasting ,UNKNO).1 E(WN)-.5 E
+(double ne)110.5 324 Q(wBearing %8.8e ,ne)-.15 E(wBearing ,UNKNO)-.15 E
+(WN)-.5 E(double ne)110.5 336 Q(wNorthing %13.2f ,ne)-.15 E
+(wNorthing ,UNKNO)-.15 E(WN)-.5 E(double ne)110.5 348 Q
+(wEasting %13.2f ,ne)-.15 E(wEasting ,UNKNO)-.15 E(WN)-.5 E(short \214r)
+110.5 360 Q(st %d ,\214r)-.1 E(st ,UNKNO)-.1 E(WN)-.5 E(fastcatlo)108
+384 Q -.15(g.)-.1 G(lo).15 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5
+396 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
+(double conductivity %8.8e ,Calculated conductivity ,Siemens/meter)110.5
+408 Q(double temper)110.5 420 Q(atur)-.15 E 2.5(e%)-.37 G
+(8.8e ,Calculated temper)-2.5 E(atur)-.15 E 2.5(e,)-.37 G(Celsius)-2.5 E
+(double pr)110.5 432 Q(essur)-.37 E 2.5(e%)-.37 G(8.8e ,Calculated pr)
+-2.5 E(essur)-.37 E 2.5(e,)-.37 G(Decibar)-2.5 E(s)-.1 E
+(double calculated_salinity %8.8e ,Calculated salinity ,V)110.5 444 Q
+(olts)-1.11 E(double cond_fr)110.5 456 Q
+(equency %8.8e ,Raw Conductivity fr)-.37 E(equency ,Hertz)-.37 E
+(double temp_counts %8.8e ,Raw Pr)110.5 468 Q(essur)-.37 E 2.5(eA)-.37 G
+(/D counts ,Unitless)-2.5 E(double pr)110.5 480 Q(essur)-.37 E
+(e_counts %8.8e ,pr)-.37 E(essur)-.37 E(e_counts ,Unitless)-.37 E 1.66
+(double pr)110.5 492 R(essur)-.37 E(e_temp_comp_volta)-.37 E -.1(ge)-.1
+G(_r).1 E 1.66(eading %8.8e ,Raw pr)-.37 F(essur)-.37 E 4.16(et)-.37 G
+1.66(emp compensation volta)-4.16 F 1.86 -.1(ge r)-.1 H(eading)-.27 E
+(,V)108 504 Q(olts)-1.11 E
+(double calculated_sound_velocity %8.8e ,Calculated sound velocity ,M/s)
+110.5 516 Q(gps.lo)108 540 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5
+552 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(inte)110.5
+564 Q -.1(ge)-.4 G 2.5(rh).1 G(our)-2.5 E 2.5(s%)-.1 G 2.5(d,)-2.5 G
+(Hour)-2.5 E 2.5(s,)-.1 G(Hour)-2.5 E(s)-.1 E(inte)110.5 576 Q -.1(ge)
+-.4 G 2.5(rm).1 G(inutes %d ,Minutes ,Minutes)-2.5 E(inte)110.5 588 Q
+-.1(ge)-.4 G 2.5(rs).1 G(econds %d ,Seconds ,Seconds)-2.5 E(inte)110.5
+600 Q -.1(ge)-.4 G 2.5(rc).1 G
+(entiSeconds %d ,CentiSeconds ,CentiSeconds)-2.5 E
+(angle latitude %8.8e ,V)110.5 612 Q(ehicle latitude ,De)-1.11 E(gr)-.4
+E(ees)-.37 E(angle longitude %8.8e ,V)110.5 624 Q(ehicle longitude ,De)
+-1.11 E(gr)-.4 E(ees)-.37 E
+(short quality %d ,GPS quality code ,Unitless)110.5 636 Q
 (short numberOfSatellites %d ,Number of satellites visible ,Unitless)
-110.5 552 Q
-(double hdop %8.8e ,Horizontal dilution of precision ,Unitless)110.5 564
-Q(double antennaHeight %8.8e ,Altitude of GPS antenna abo)110.5 576 Q .3
--.15(ve m)-.15 H(ean sea le).15 E -.15(ve)-.25 G 2.5(l,).15 G(meters)
--2.5 E(double geoHeight %8.8e ,Geoidal separation ,meters)110.5 588 Q
-(short dgpsDataAge %d ,Age of dif)110.5 600 Q
-(ferential GPS correction ,seconds)-.25 E(short dgpsRSID %d ,Dif)110.5
-612 Q(ferential reference station ID ,Unitless)-.25 E -.1(ke)108 636 S
-(arfott.log Contents:).1 E(timeT)110.5 648 Q(ag time %8.8e ,time ,UNKNO)
--.8 E(WN)-.35 E(inte)110.5 660 Q(ger mCyclesK %d ,mCyclesK ,UNKNO)-.15 E
-(WN)-.35 E(inte)110.5 672 Q(ger mModeK %d ,mModeK ,UNKNO)-.15 E(WN)-.35
-E(inte)110.5 684 Q(ger mMonK %d ,mMonK ,UNKNO)-.15 E(WN)-.35 E
-(double mLatK %3.8f ,mLatK ,UNKNO)110.5 696 Q(WN)-.35 E
-(double mLonK %3.8f ,mLonK ,UNKNO)110.5 708 Q(WN)-.35 E
-(double mNorthK %13.2f ,mNorthK ,UNKNO)110.5 720 Q(WN)-.35 E
-(MB-System 5.0)72 768 Q(21 October 2013)137.055 E(3)195.395 E 0 Cg EP
+110.5 648 Q(double hdop %8.8e ,Horizontal dilution of pr)110.5 660 Q
+(ecision ,Unitless)-.37 E
+(double antennaHeight %8.8e ,Altitude of GPS antenna abo)110.5 672 Q
+(ve mean sea le)-.1 E(vel ,meter)-.15 E(s)-.1 E(double g)110.5 684 Q
+(eoHeight %8.8e ,Geoidal separ)-.1 E(ation ,meter)-.15 E(s)-.1 E
+(short dgpsDataAg)110.5 696 Q 2.5(e%)-.1 G 2.5(d,)-2.5 G(Ag)-2.5 E 2.5
+(eo)-.1 G 2.5(fd)-2.5 G(if)-2.5 E(fer)-.18 E(ential GPS corr)-.37 E
+(ection ,seconds)-.37 E(short dgpsRSID %d ,Dif)110.5 708 Q(fer)-.18 E
+(ential r)-.37 E(efer)-.37 E(ence station ID ,Unitless)-.37 E F0
+(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(3)193.45 E 0 Cg EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F(double mEastK %13.2f ,mEastK ,UNKNO)
-110.5 84 Q(WN)-.35 E(double mDepthK %8.8e ,mDepthK ,UNKNO)110.5 96 Q(WN)
--.35 E(double mRollK %8.8e ,mRollK ,UNKNO)110.5 108 Q(WN)-.35 E
-(double mPitchK %8.8e ,mPitchK ,UNKNO)110.5 120 Q(WN)-.35 E
-(double mHeadK %8.8e ,mHeadK ,UNKNO)110.5 132 Q(WN)-.35 E
-(double mVbodyxK %8.8e ,mVbodyxK ,UNKNO)110.5 144 Q(WN)-.35 E
-(double mVbodyyK %8.8e ,mVbodyyK ,UNKNO)110.5 156 Q(WN)-.35 E
-(double mVbodyzK %8.8e ,mVbodyzK ,UNKNO)110.5 168 Q(WN)-.35 E
-(double mAccelxK %8.8e ,mAccelxK ,UNKNO)110.5 180 Q(WN)-.35 E
-(double mAccelyK %8.8e ,mAccelyK ,UNKNO)110.5 192 Q(WN)-.35 E
-(double mAccelzK %8.8e ,mAccelzK ,UNKNO)110.5 204 Q(WN)-.35 E
-(double mPrateK %8.8e ,mPrateK ,UNKNO)110.5 216 Q(WN)-.35 E
-(double mQrateK %8.8e ,mQrateK ,UNKNO)110.5 228 Q(WN)-.35 E
-(double mRrateK %8.8e ,mRrateK ,UNKNO)110.5 240 Q(WN)-.35 E(double utcT)
-110.5 252 Q(ime %8.8e ,utcT)-.35 E(ime ,UNKNO)-.35 E(WN)-.35 E
-(m3dmgx1.log Contents:)108 276 Q(timeT)110.5 288 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E
-(angle mRollCB %8.8e ,Roll ,De)110.5 300 Q(grees)-.15 E(angle mOme)110.5
-312 Q -.05(ga)-.15 G(_xCB %8.8e ,Roll rate ,De).05 E(grees/second)-.15 E
-(angle mPitchCB %8.8e ,Pitch ,De)110.5 324 Q(grees)-.15 E(angle mOme)
-110.5 336 Q -.05(ga)-.15 G(_yCB %8.8e ,Pitch rate ,De).05 E
-(grees/second)-.15 E(angle mY)110.5 348 Q -.15(aw)-1 G(CB %8.8e ,Y).15 E
-.3 -.15(aw ,)-1 H(De).15 E(grees)-.15 E(angle mOme)110.5 360 Q -.05(ga)
--.15 G(_zCB %8.8e ,Y).05 E .3 -.15(aw r)-1 H(ate ,De).15 E(grees/second)
--.15 E(double mAccel_xCB %8.8e ,Acceleration along v)110.5 372 Q
-(ehicle x-axis ,G)-.15 E(double mAccel_yCB %8.8e ,Acceleration along v)
-110.5 384 Q(ehicle y-axis ,G)-.15 E
-(double mAccel_zCB %8.8e ,Acceleration along v)110.5 396 Q
-(ehicle z-axis ,G)-.15 E
-(double mMag_xCB %8.8e ,Magnetic \214eld along v)110.5 408 Q
-(ehicle x-axis ,Gauss)-.15 E
-(double mMag_yCB %8.8e ,Magnetic \214eld along v)110.5 420 Q
-(ehicle y-axis ,Gauss)-.15 E
-(double mMag_zCB %8.8e ,Magnetic \214eld along v)110.5 432 Q
-(ehicle z-axis ,Gauss)-.15 E(double mT)110.5 444 Q(empCB %8.8e ,Crossbo)
--.7 E 2.5(wi)-.25 G(nternal temperature ,Celsius)-2.5 E(na)108 468 Q
-(vig)-.2 E(ation.log Contents:)-.05 E(timeT)110.5 480 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(double mPos_x %13.2f ,V)
-110.5 492 Q(ehicle Northing \(WGS 84 Zone 10S\) ,Meters)-1.11 E
-(double mPos_y %13.2f ,V)110.5 504 Q
-(ehicle Easting \(WGS 84 Zone 10S\) ,Meters)-1.11 E
-(double mDepth %8.8e ,V)110.5 516 Q(ehicle Depth ,Meters)-1.11 E(double\
- mGpsNorth %13.2f ,Northing \(WGS 84 Zone 10S\) based upon GPS \214x ,M\
-eters)110.5 528 Q(double mGpsEast %13.2f ,Easting \(WGS 84 Zone 10S\) b\
-ased upon GPS \214x ,Meters)110.5 540 Q(inte)110.5 552 Q(ger mGpsV)-.15
-E(alid %d ,GPS \214x Status code ,Unitless)-1.11 E(double mPhi %8.8e ,V)
-110.5 564 Q(ehicle roll ,De)-1.11 E(grees)-.15 E(double mTheta %8.8e ,V)
-110.5 576 Q(ehicle pitch ,De)-1.11 E(grees)-.15 E(double mPsi %8.8e ,V)
-110.5 588 Q(ehicle ya)-1.11 E 2.5(w,)-.15 G(De)-2.5 E(grees)-.15 E
-(double mOme)110.5 600 Q -.05(ga)-.15 G(_x %8.8e ,V).05 E
-(ehicle roll rate ,De)-1.11 E(grees/second)-.15 E(double mOme)110.5 612
-Q -.05(ga)-.15 G(_y %8.8e ,V).05 E(ehicle pitch rate ,De)-1.11 E
-(grees/second)-.15 E(double mOme)110.5 624 Q -.05(ga)-.15 G(_z %8.8e ,V)
-.05 E(ehicle ya)-1.11 E 2.5(wr)-.15 G(ate ,De)-2.5 E(grees/second)-.15 E
-(double mPsaRange %8.8e ,Altimeter range ,Meters)110.5 636 Q
-(double mAltitude %8.8e ,V)110.5 648 Q(ehicle altitude abo)-1.11 E .3
--.15(ve b)-.15 H(ottom ,Meters).15 E
-(double mDvlAltitude %8.8e ,mDvlAltitude ,UNKNO)110.5 660 Q(WN)-.35 E
-(double mW)110.5 672 Q(aterSpeed %8.8e ,Current speed based upon D)-.8 E
-(VL data ,Meters/second)-.4 E(inte)110.5 684 Q(ger mDvlV)-.15 E
-(alid %d ,Dvl v)-1.11 E(alid \215ag in Na)-.25 E(vig)-.2 E(ation ,UNKNO)
--.05 E(WN)-.35 E(inte)110.5 696 Q(ger mDvlNe)-.15 E(wData %d ,Na)-.25 E
-(vig)-.2 E(ation thinks the Dvl has ne)-.05 E 2.5(wd)-.25 G(ata ,UNKNO)
--2.5 E(WN)-.35 E(double mDeltaT %8.8e ,T)110.5 708 Q
-(ime between Dvl updates ,Seconds)-.35 E(double n\214x %13.2f ,Northing\
- \(WGS 84 Zone 10S\) based upon baseline \214x ,Meters)110.5 720 Q
-(MB-System 5.0)72 768 Q(21 October 2013)137.055 E(4)195.395 E 0 Cg EP
+135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF -.1(ke)108 84
+S(arfott.lo).1 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 96 Q .2 -.1
+(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(inte)110.5 108 Q -.1
+(ge)-.4 G 2.5(rm).1 G(CyclesK %d ,mCyclesK ,UNKNO)-2.5 E(WN)-.5 E(inte)
+110.5 120 Q -.1(ge)-.4 G 2.5(rm).1 G(ModeK %d ,mModeK ,UNKNO)-2.5 E(WN)
+-.5 E(inte)110.5 132 Q -.1(ge)-.4 G 2.5(rm).1 G(MonK %d ,mMonK ,UNKNO)
+-2.5 E(WN)-.5 E(double mLatK %3.8f ,mLatK ,UNKNO)110.5 144 Q(WN)-.5 E
+(double mLonK %3.8f ,mLonK ,UNKNO)110.5 156 Q(WN)-.5 E
+(double mNorthK %13.2f ,mNorthK ,UNKNO)110.5 168 Q(WN)-.5 E
+(double mEastK %13.2f ,mEastK ,UNKNO)110.5 180 Q(WN)-.5 E
+(double mDepthK %8.8e ,mDepthK ,UNKNO)110.5 192 Q(WN)-.5 E
+(double mRollK %8.8e ,mRollK ,UNKNO)110.5 204 Q(WN)-.5 E(double mPitc)
+110.5 216 Q(hK %8.8e ,mPitc)-.15 E(hK ,UNKNO)-.15 E(WN)-.5 E
+(double mHeadK %8.8e ,mHeadK ,UNKNO)110.5 228 Q(WN)-.5 E
+(double mVbodyxK %8.8e ,mVbodyxK ,UNKNO)110.5 240 Q(WN)-.5 E
+(double mVbodyyK %8.8e ,mVbodyyK ,UNKNO)110.5 252 Q(WN)-.5 E
+(double mVbodyzK %8.8e ,mVbodyzK ,UNKNO)110.5 264 Q(WN)-.5 E
+(double mAccelxK %8.8e ,mAccelxK ,UNKNO)110.5 276 Q(WN)-.5 E
+(double mAccelyK %8.8e ,mAccelyK ,UNKNO)110.5 288 Q(WN)-.5 E
+(double mAccelzK %8.8e ,mAccelzK ,UNKNO)110.5 300 Q(WN)-.5 E(double mPr)
+110.5 312 Q(ateK %8.8e ,mPr)-.15 E(ateK ,UNKNO)-.15 E(WN)-.5 E
+(double mQr)110.5 324 Q(ateK %8.8e ,mQr)-.15 E(ateK ,UNKNO)-.15 E(WN)-.5
+E(double mRr)110.5 336 Q(ateK %8.8e ,mRr)-.15 E(ateK ,UNKNO)-.15 E(WN)
+-.5 E(double utcT)110.5 348 Q(ime %8.8e ,utcT)-.55 E(ime ,UNKNO)-.55 E
+(WN)-.5 E(m3dmgx1.lo)108 372 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5
+384 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
+(angle mRollCB %8.8e ,Roll ,De)110.5 396 Q(gr)-.4 E(ees)-.37 E
+(angle mOme)110.5 408 Q(ga_xCB %8.8e ,Roll r)-.4 E(ate ,De)-.15 E(gr)-.4
+E(ees/second)-.37 E(angle mPitc)110.5 420 Q(hCB %8.8e ,Pitc)-.15 E 2.5
+(h,)-.15 G(De)-2.5 E(gr)-.4 E(ees)-.37 E(angle mOme)110.5 432 Q
+(ga_yCB %8.8e ,Pitc)-.4 E 2.5(hr)-.15 G(ate ,De)-2.65 E(gr)-.4 E
+(ees/second)-.37 E(angle mY)110.5 444 Q(awCB %8.8e ,Y)-.92 E(aw ,De)-.92
+E(gr)-.4 E(ees)-.37 E(angle mOme)110.5 456 Q(ga_zCB %8.8e ,Y)-.4 E(aw r)
+-.92 E(ate ,De)-.15 E(gr)-.4 E(ees/second)-.37 E
+(double mAccel_xCB %8.8e ,Acceler)110.5 468 Q
+(ation along vehicle x-axis ,G)-.15 E(double mAccel_yCB %8.8e ,Acceler)
+110.5 480 Q(ation along vehicle y-axis ,G)-.15 E
+(double mAccel_zCB %8.8e ,Acceler)110.5 492 Q
+(ation along vehicle z-axis ,G)-.15 E(double mMa)110.5 504 Q
+(g_xCB %8.8e ,Ma)-.1 E(gnetic \214eld along vehicle x-axis ,Gauss)-.1 E
+(double mMa)110.5 516 Q(g_yCB %8.8e ,Ma)-.1 E
+(gnetic \214eld along vehicle y-axis ,Gauss)-.1 E(double mMa)110.5 528 Q
+(g_zCB %8.8e ,Ma)-.1 E(gnetic \214eld along vehicle z-axis ,Gauss)-.1 E
+(double mT)110.5 540 Q(empCB %8.8e ,Cr)-.92 E(ossbow internal temper)
+-.45 E(atur)-.15 E 2.5(e,)-.37 G(Celsius)-2.5 E(navigation.lo)108 564 Q
+2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 576 Q .2 -.1(ag t)-.92 H
+(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(double mP)110.5 588 Q
+(os_x %13.2f ,V)-.8 E(ehicle Northing \(WGS 84 Zone 10S\) ,Meter)-1.11 E
+(s)-.1 E(double mP)110.5 600 Q(os_y %13.2f ,V)-.8 E
+(ehicle Easting \(WGS 84 Zone 10S\) ,Meter)-1.11 E(s)-.1 E
+(double mDepth %8.8e ,V)110.5 612 Q(ehicle Depth ,Meter)-1.11 E(s)-.1 E
+(double mGpsNorth %13.2f ,Northing \(WGS 84 Zone 10S\) based upon GPS \
+\214x ,Meter)110.5 624 Q(s)-.1 E(double mGpsEast %13.2f ,Easting \(WGS \
+84 Zone 10S\) based upon GPS \214x ,Meter)110.5 636 Q(s)-.1 E(inte)110.5
+648 Q -.1(ge)-.4 G 2.5(rm).1 G(GpsV)-2.5 E
+(alid %d ,GPS \214x Status code ,Unitless)-1.11 E(double mPhi %8.8e ,V)
+110.5 660 Q(ehicle r)-1.11 E(oll ,De)-.45 E(gr)-.4 E(ees)-.37 E
+(double mTheta %8.8e ,V)110.5 672 Q(ehicle pitc)-1.11 E 2.5(h,)-.15 G
+(De)-2.5 E(gr)-.4 E(ees)-.37 E(double mPsi %8.8e ,V)110.5 684 Q
+(ehicle yaw ,De)-1.11 E(gr)-.4 E(ees)-.37 E(double mOme)110.5 696 Q
+(ga_x %8.8e ,V)-.4 E(ehicle r)-1.11 E(oll r)-.45 E(ate ,De)-.15 E(gr)-.4
+E(ees/second)-.37 E(double mOme)110.5 708 Q(ga_y %8.8e ,V)-.4 E
+(ehicle pitc)-1.11 E 2.5(hr)-.15 G(ate ,De)-2.65 E(gr)-.4 E(ees/second)
+-.37 E(double mOme)110.5 720 Q(ga_z %8.8e ,V)-.4 E(ehicle yaw r)-1.11 E
+(ate ,De)-.15 E(gr)-.4 E(ees/second)-.37 E F0(MB-System 5.0)72 768 Q
+(18 February 2015)135.11 E(4)193.45 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F(double e\214x %13.2f ,Easting \(WGS \
-84 Zone 10S\) based upon baseline \214x ,Meters)110.5 84 Q(double \214l\
-ter_north %13.2f ,Kalman \214lter northing \(WGS 84 Zone 10S\) ,Meters)
-110.5 96 Q(double \214lter_east %13.2f ,Kalman \214lter easting \(WGS 8\
-4 Zone 10S\) ,Meters)110.5 108 Q
-(double \214lter_depth %8.8e ,Kalman \214lter depth ,Meters)110.5 120 Q
-(double north_current %8.8e ,Northw)110.5 132 Q(ard \215o)-.1 E
-(wing current estimate ,Meters/second)-.25 E
-(double east_current %8.8e ,Eastw)110.5 144 Q(ard \215o)-.1 E
-(wing current estimate ,Meters/second)-.25 E
-(double speed_bias %8.8e ,Speed bias based upon long baseline \214x)
-110.5 156 Q(es ,Meters/second)-.15 E
-(double heading_bias %8.8e ,Heading bias based upon long baseline \214x)
-110.5 168 Q(es ,De)-.15 E(grees)-.15 E
-(double latitude %5.8f ,latitude ,UNKNO)110.5 180 Q(WN)-.35 E
-(double longitude %5.8f ,longitude ,UNKNO)110.5 192 Q(WN)-.35 E
-(parosci.log Contents:)108 216 Q(timeT)110.5 228 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E
-(double depth %8.3lf ,Depth ,Meters)110.5 240 Q
-(double temp %8.8e ,Pressure Sensor Internal T)110.5 252 Q(emp ,Celsius)
--.7 E(double pressure %8.8lf ,Pressure ,Bars)110.5 264 Q
-(double temp_period %8.8lf ,T)110.5 276 Q
-(emperature Period ,Microseconds)-.7 E
-(double pres_period %8.8lf ,Pressure Period ,Microseconds)110.5 288 Q
-(tailCone.log Contents:)108 312 Q(timeT)110.5 324 Q
-(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E(inte)110.5 336 Q
-(ger status %d ,status ,UNKNO)-.15 E(WN)-.35 E(inte)110.5 348 Q(ger ele)
--.15 E -.25(va)-.25 G(torCurrent %d ,ele).25 E -.25(va)-.25 G
-(torCurrent ,UNKNO).25 E(WN)-.35 E(inte)110.5 360 Q
-(ger rudderCurrent %d ,rudderCurrent ,UNKNO)-.15 E(WN)-.35 E
-(\215oat propCurrent1 %f ,propCurrent1 ,UNKNO)110.5 372 Q(WN)-.35 E
-(inte)110.5 384 Q(ger propCurrent2 %d ,propCurrent2 ,UNKNO)-.15 E(WN)
--.35 E(inte)110.5 396 Q(ger propRpm %d ,propRpm ,UNKNO)-.15 E(WN)-.35 E
-(\215oat ele)110.5 408 Q -.25(va)-.25 G(torAngle %f ,ele).25 E -.25(va)
--.25 G(torAngle ,UNKNO).25 E(WN)-.35 E
-(\215oat rudderAngle %f ,rudderAngle ,UNKNO)110.5 420 Q(WN)-.35 E(inte)
-110.5 432 Q(ger propPwm %d ,propPwm ,UNKNO)-.15 E(WN)-.35 E(inte)110.5
-444 Q(ger propT)-.15 E(emp %d ,propT)-.7 E(emp ,UNKNO)-.7 E(WN)-.35 E/F1
-10.95/Times-Bold at 0 SF -.548(AU)72 472.8 S(THORSHIP).548 E F0(Da)108
-484.8 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 496.8 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 508.8 Q
-(Lamont-Doherty Earth Observ)113 520.8 Q(atory)-.25 E F1(OPTIONS)72
-549.6 Q/F2 10/Times-Bold at 0 SF<ad48>108 561.6 Q F0 .162(This "help" \215\
+135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF
+(double mPsaRang)110.5 84 Q 2.5(e%)-.1 G(8.8e ,Altimeter r)-2.5 E(ang)
+-.15 E 2.5(e,)-.1 G(Meter)-2.5 E(s)-.1 E(double mAltitude %8.8e ,V)110.5
+96 Q(ehicle altitude abo)-1.11 E(ve bottom ,Meter)-.1 E(s)-.1 E
+(double mDvlAltitude %8.8e ,mDvlAltitude ,UNKNO)110.5 108 Q(WN)-.5 E
+(double mW)110.5 120 Q(aterSpeed %8.8e ,Curr)-.92 E
+(ent speed based upon D)-.37 E(VL data ,Meter)-.4 E(s/second)-.1 E(inte)
+110.5 132 Q -.1(ge)-.4 G 2.5(rm).1 G(DvlV)-2.5 E
+(alid %d ,Dvl valid \215a)-1.11 E 2.5(gi)-.1 G 2.5(nN)-2.5 G
+(avigation ,UNKNO)-2.5 E(WN)-.5 E(inte)110.5 144 Q -.1(ge)-.4 G 2.5(rm)
+.1 G(DvlNe)-2.5 E(wData %d ,Navigation thinks the Dvl has ne)-.15 E 2.5
+(wd)-.15 G(ata ,UNKNO)-2.5 E(WN)-.5 E(double mDeltaT %8.8e ,T)110.5 156
+Q(ime between Dvl updates ,Seconds)-.55 E(double n\214x %13.2f ,Northin\
+g \(WGS 84 Zone 10S\) based upon baseline \214x ,Meter)110.5 168 Q(s)-.1
+E(double e\214x %13.2f ,Easting \(WGS 84 Zone 10S\) based upon baseline\
+ \214x ,Meter)110.5 180 Q(s)-.1 E(double \214lter_north %13.2f ,Kalman \
+\214lter northing \(WGS 84 Zone 10S\) ,Meter)110.5 192 Q(s)-.1 E(double\
+ \214lter_east %13.2f ,Kalman \214lter easting \(WGS 84 Zone 10S\) ,Met\
+er)110.5 204 Q(s)-.1 E
+(double \214lter_depth %8.8e ,Kalman \214lter depth ,Meter)110.5 216 Q
+(s)-.1 E(double north_curr)110.5 228 Q(ent %8.8e ,Northwar)-.37 E 2.5
+<648d>-.37 G(owing curr)-2.5 E(ent estimate ,Meter)-.37 E(s/second)-.1 E
+(double east_curr)110.5 240 Q(ent %8.8e ,Eastwar)-.37 E 2.5<648d>-.37 G
+(owing curr)-2.5 E(ent estimate ,Meter)-.37 E(s/second)-.1 E(double spe\
+ed_bias %8.8e ,Speed bias based upon long baseline \214xes ,Meter)110.5
+252 Q(s/second)-.1 E(double heading_bias %8.8e ,Heading bias based upon\
+ long baseline \214xes ,De)110.5 264 Q(gr)-.4 E(ees)-.37 E
+(double latitude %5.8f ,latitude ,UNKNO)110.5 276 Q(WN)-.5 E
+(double longitude %5.8f ,longitude ,UNKNO)110.5 288 Q(WN)-.5 E(par)108
+312 Q(osci.lo)-.45 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 324 Q .2
+-.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
+(double depth %8.3lf ,Depth ,Meter)110.5 336 Q(s)-.1 E
+(double temp %8.8e ,Pr)110.5 348 Q(essur)-.37 E 2.5(eS)-.37 G
+(ensor Internal T)-2.5 E(emp ,Celsius)-.92 E(double pr)110.5 360 Q
+(essur)-.37 E 2.5(e%)-.37 G(8.8lf ,Pr)-2.5 E(essur)-.37 E 2.5(e,)-.37 G
+(Bar)-2.5 E(s)-.1 E(double temp_period %8.8lf ,T)110.5 372 Q(emper)-.92
+E(atur)-.15 E 2.5(eP)-.37 G(eriod ,Micr)-3.3 E(oseconds)-.45 E
+(double pr)110.5 384 Q(es_period %8.8lf ,Pr)-.37 E(essur)-.37 E 2.5(eP)
+-.37 G(eriod ,Micr)-3.3 E(oseconds)-.45 E(tailCone)108 408 Q(.lo)-.15 E
+2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 420 Q .2 -.1(ag t)-.92 H
+(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(inte)110.5 432 Q -.1(ge)-.4 G 2.5
+(rs).1 G(tatus %d ,status ,UNKNO)-2.5 E(WN)-.5 E(inte)110.5 444 Q -.1
+(ge)-.4 G 2.5(re).1 G(le)-2.5 E(vatorCurr)-.15 E(ent %d ,ele)-.37 E
+(vatorCurr)-.15 E(ent ,UNKNO)-.37 E(WN)-.5 E(inte)110.5 456 Q -.1(ge)-.4
+G 2.5(rr).1 G(udderCurr)-2.5 E(ent %d ,rudderCurr)-.37 E(ent ,UNKNO)-.37
+E(WN)-.5 E(\215oat pr)110.5 468 Q(opCurr)-.45 E(ent1 %f ,pr)-.37 E
+(opCurr)-.45 E(ent1 ,UNKNO)-.37 E(WN)-.5 E(inte)110.5 480 Q -.1(ge)-.4 G
+2.5(rp).1 G -.45(ro)-2.5 G(pCurr).45 E(ent2 %d ,pr)-.37 E(opCurr)-.45 E
+(ent2 ,UNKNO)-.37 E(WN)-.5 E(inte)110.5 492 Q -.1(ge)-.4 G 2.5(rp).1 G
+-.45(ro)-2.5 G(pRpm %d ,pr).45 E(opRpm ,UNKNO)-.45 E(WN)-.5 E
+(\215oat ele)110.5 504 Q(vatorAngle %f ,ele)-.15 E(vatorAngle ,UNKNO)
+-.15 E(WN)-.5 E(\215oat rudderAngle %f ,rudderAngle ,UNKNO)110.5 516 Q
+(WN)-.5 E(inte)110.5 528 Q -.1(ge)-.4 G 2.5(rp).1 G -.45(ro)-2.5 G
+(pPwm %d ,pr).45 E(opPwm ,UNKNO)-.45 E(WN)-.5 E(inte)110.5 540 Q -.1(ge)
+-.4 G 2.5(rp).1 G -.45(ro)-2.5 G(pT).45 E(emp %d ,pr)-.92 E(opT)-.45 E
+(emp ,UNKNO)-.92 E(WN)-.5 E/F2 10.95/Times-Bold at 0 SF -.548(AU)72 568.8 S
+(THORSHIP).548 E F0(Da)108 580.8 Q(vid W)-.2 E 2.5(.C)-.92 G
+(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 592.8 Q 2.5(yB)
+-.15 G(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 604.8 Q
+(Lamont-Doherty Earth Observ)113 616.8 Q(atory)-.25 E F2(OPTIONS)72
+645.6 Q/F3 10/Times-Bold at 0 SF<ad48>108 657.6 Q F0 .162(This "help" \215\
 ag cause the program to print out a description of its operation and th\
-en e)22.52 F .161(xit immedi-)-.15 F(ately)144 573.6 Q(.)-.65 E F2<ad46>
-108 590.4 Q/F3 10/Times-Italic at 0 SF(printformat)24.19 E F0 1.347
-(Sets the printing format \(in fprintf\(\) style\) of the ne)144 602.4 R
-1.348(xt v)-.15 F 1.348(alue speci\214ed using the)-.25 F F2<ad4f>3.848
-E F0 1.348(option. By)3.848 F(def)144 614.4 Q(ault,)-.1 E F2
+en e)22.52 F .161(xit immedi-)-.15 F(ately)144 669.6 Q(.)-.65 E F3<ad46>
+108 686.4 Q F1(printformat)24.19 E F0 1.347
+(Sets the printing format \(in fprintf\(\) style\) of the ne)144 698.4 R
+1.348(xt v)-.15 F 1.348(alue speci\214ed using the)-.25 F F3<ad4f>3.848
+E F0 1.348(option. By)3.848 F(def)144 710.4 Q(ault,)-.1 E F3
 (mbauvloglist)3.682 E F0 1.182
 (uses the print format speci\214ed in the log \214le header)3.682 F
-3.682(.I)-.55 G 3.682(ft)-3.682 G(he)-3.682 E F2(-F)3.682 E F0 1.181
-(option has)3.681 F 1.455(been used, using it ag)144 626.4 R 1.455
-(ain with)-.05 F F3(printformat)3.955 E F0 1.456(equal to "def)3.956 F
-1.456(ault" will reset the print format to that)-.1 F
-(speci\214ed in the log \214le header)144 638.4 Q(.)-.55 E F2<ad49>108
-655.2 Q F3(i\214le)26.41 E F0(Sets the input MB)144 667.2 Q(ARI A)-.35 E
-(UV mission log)-.55 E(\214lename.)5 E F2<ad4c>108 684 Q F3(lon\215ip)
-23.63 E F0 .129(Sets the range of the longitude v)144 696 R .129
-(alues output.)-.25 F(If)5.129 E F3(lon\215ip)2.629 E F0 .129
-(=\2551 then the longitude v)B .128(alues will be in the)-.25 F .02
-(range from \255360 to 0 de)144 708 R .02(grees. If)-.15 F F3(lon\215ip)
-2.52 E F0 .021(=0 then the longitude v)B .021
-(alues will be in the range from \255180)-.25 F .702(to 180 de)144 720 R
-.702(grees. If)-.15 F F3(lon\215ip)3.202 E F0 .702
-(=1 then the longitude v)B .701
-(alues will be in the range from 0 to 360 de)-.25 F(grees.)-.15 E
-(MB-System 5.0)72 768 Q(21 October 2013)137.055 E(5)195.395 E 0 Cg EP
+3.682(.I)-.55 G 3.682(ft)-3.682 G(he)-3.682 E F3(-F)3.682 E F0 1.181
+(option has)3.681 F 1.455(been used, using it ag)144 722.4 R 1.455
+(ain with)-.05 F F1(printformat)3.955 E F0 1.456(equal to "def)3.956 F
+1.456(ault" will reset the print format to that)-.1 F(MB-System 5.0)72
+768 Q(18 February 2015)135.11 E(5)193.45 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F(Def)144 84 Q(ault:)-.1 E/F1 10
-/Times-Bold at 0 SF(mbauvloglist)2.5 E F0(uses the user def)2.5 E(ault)-.1
-E/F2 10/Times-Italic at 0 SF(lon\215ip)2.5 E F0(set using)2.5 E F1
-(mbdefaults)2.5 E F0(.)A F1<ad4f>108 100.8 Q F2(valuename)22.52 E F0
-(Causes)144 112.8 Q F1(mbauvloglist)3.372 E F0 .872
-(to output the speci\214ed v)3.372 F .872(alue. This option can be gi)
--.25 F -.15(ve)-.25 G 3.372(nm).15 G .873(ultiple times, and)-3.372 F
-(the v)144 124.8 Q(alues will be output in the order speci\214ed.)-.25 E
-F1<ad50>108 141.6 Q F0(Prints out the log \214le header)144 153.6 Q(.)
--.55 E F1<ad53>108 170.4 Q F0(Scales angular v)144 182.4 Q
-(alues to be in de)-.25 E(grees instead of radians.)-.15 E F1<ad56>108
-199.2 Q F0(The)23.08 E F1<ad56>2.5 E F0
-(option causes the program to be v)2.5 E(erbose.)-.15 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLE)72 216 Q F0 1.6 -.8(To e)108 228 T
+135.94(5.0 mbauvloglist\(1\))2.5 F(speci\214ed in the log \214le header)
+144 84 Q(.)-.55 E/F1 10/Times-Bold at 0 SF<ad49>108 100.8 Q/F2 10
+/Times-Italic at 0 SF(i\214le)26.41 E F0(Sets the input MB)144 112.8 Q
+(ARI A)-.35 E(UV mission log)-.55 E(\214lename.)5 E F1<ad4c>108 129.6 Q
+F2(lon\215ip)23.63 E F0 .129(Sets the range of the longitude v)144 141.6
+R .129(alues output.)-.25 F(If)5.129 E F2(lon\215ip)2.629 E F0 .129
+(=\2551 then the longitude v)B .128(alues will be in the)-.25 F .02
+(range from \255360 to 0 de)144 153.6 R .02(grees. If)-.15 F F2
+(lon\215ip)2.52 E F0 .021(=0 then the longitude v)B .021
+(alues will be in the range from \255180)-.25 F .702(to 180 de)144 165.6
+R .702(grees. If)-.15 F F2(lon\215ip)3.202 E F0 .702
+(=1 then the longitude v)B .701
+(alues will be in the range from 0 to 360 de)-.25 F(grees.)-.15 E(Def)
+144 177.6 Q(ault:)-.1 E F1(mbauvloglist)2.5 E F0(uses the user def)2.5 E
+(ault)-.1 E F2(lon\215ip)2.5 E F0(set using)2.5 E F1(mbdefaults)2.5 E F0
+(.)A F1<ad4d>108 194.4 Q F2(mode)20.86 E F0 .44
+(Speci\214es the output mode. If)144 206.4 R F2(mode)2.94 E F0 2.94(=0)
+2.94 G 2.94(,t)-2.94 G .44(hen the output is ASCII te)-2.94 F .44
+(xt with tab delimiters between)-.15 F .088(\214elds. If)144 218.4 R F2
+(mode)2.588 E F0 2.588(=1)2.588 G 2.587(,t)-2.588 G .087
+(hen the output is ASCII te)-2.587 F .087
+(xt with comma delimiters between \214elds.)-.15 F(If)5.087 E F2(mode)
+2.587 E F0(=)2.587 E .597(2, then the output is binary with no v)144
+230.4 R .597(alues or breaks between \214elds. Def)-.25 F .597
+(ault: ASCII te)-.1 F .597(xt with tab)-.15 F(delimiters.)144 242.4 Q F1
+<ad4e>108 259.2 Q F2(nav\214le)23.08 E F0 1.145(Speci\214es a na)144
+271.2 R(vig)-.2 E 1.145(ation \214le in the "fn)-.05 F 1.144
+(v" format that contains position, heading, sensor depth, and)-.4 F
+(attitude data. V)144 283.2 Q(alues mer)-1.11 E(ged \(interpolated\) fr\
+om these data can be speci\214ed for output using the)-.18 E(mer)156.5
+295.2 Q(geLon)-.18 E(mer)156.5 307.2 Q(geLat)-.18 E(mer)156.5 319.2 Q
+(geHeading)-.18 E(mer)156.5 331.2 Q(geSpeed)-.18 E(mer)156.5 343.2 Q
+(geDraft)-.18 E(mer)156.5 355.2 Q(geSensordepth)-.18 E(mer)156.5 367.2 Q
+(geRoll)-.18 E(mer)156.5 379.2 Q(gePitch)-.18 E(mer)156.5 391.2 Q(geHea)
+-.18 E -.15(ve)-.2 G -.25(va)144 403.2 S(luenames in the).25 E F1(-O)2.5
+E F0(option.)2.5 E F1<ad4f>108 420 Q F2(valuename)22.52 E F0(Causes)144
+432 Q F1(mbauvloglist)3.372 E F0 .872(to output the speci\214ed v)3.372
+F .872(alue. This option can be gi)-.25 F -.15(ve)-.25 G 3.372(nm).15 G
+.873(ultiple times, and)-3.372 F 1.768(the v)144 444 R 1.768
+(alues will be output in the order speci\214ed.)-.25 F 1.767(The v)6.767
+F 1.767(alid v)-.25 F 1.767(aluename strings consist of those)-.25 F
+(de\214ned in the header of the log \214le being parsed, plus the follo)
+144 456 Q(wing:)-.25 E(zero)156.5 468 Q(timeT)156.5 480 Q(ag)-.8 E(mer)
+156.5 492 Q(geLon)-.18 E(mer)156.5 504 Q(geLat)-.18 E(mer)156.5 516 Q
+(geHeading)-.18 E(mer)156.5 528 Q(geSpeed)-.18 E(mer)156.5 540 Q
+(geDraft)-.18 E(mer)156.5 552 Q(geSensordepth)-.18 E(mer)156.5 564 Q
+(geRoll)-.18 E(mer)156.5 576 Q(gePitch)-.18 E(mer)156.5 588 Q(geHea)-.18
+E -.15(ve)-.2 G .672(All of the special v)144 600 R .673
+(alues are double v)-.25 F .673(alues. Those be)-.25 F .673
+(ginning with "mer)-.15 F .673(ge" deri)-.18 F .973 -.15(ve f)-.25 H
+.673(rom interpola-).15 F(tion of data from an e)144 612 Q(xternal na)
+-.15 E(vig)-.2 E(ation \214le speci\214ed using the)-.05 E F1(-N)2.5 E
+F0(option.)2.5 E F1<ad50>108 628.8 Q F0
+(Prints out the log \214le header)144 640.8 Q(.)-.55 E F1<ad53>108 657.6
+Q F0(Scales angular v)144 669.6 Q(alues to be in de)-.25 E
+(grees instead of radians.)-.15 E F1<ad56>108 686.4 Q F0(The)23.08 E F1
+<ad56>2.5 E F0(option causes the program to be v)2.5 E(erbose.)-.15 E/F3
+10.95/Times-Bold at 0 SF(EXAMPLE)72 703.2 Q F0 1.6 -.8(To e)108 715.2 T
 (xtract a list of pressure and w).65 E
 (ater sound speed from the CTD log of an A)-.1 E(UV mission, use:)-.55 E
-(mbauvloglist \255I mvc_logs/2006.224.00/f)144 240 Q(astcatlog.log \\)
--.1 E(-F%f \255O pressure \255O calculated_sound_v)180 252 Q(elocity)
--.15 E .353
-(This simple list is ordered as the data were collected, follo)108 264 R
-.353(wing the ups and do)-.25 F .353(wns of the A)-.25 F .353
-(UV mission. In)-.55 F 1.456(order to construct a model of the w)108 276
+(mbauvloglist \255I mvc_logs/2006.224.00/f)144 727.2 Q(astcatlog.log \\)
+-.1 E(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(6)193.45 E 0 Cg
+EP
+%%Page: 7 7
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
+135.94(5.0 mbauvloglist\(1\))2.5 F
+(-F%f \255O pressure \255O calculated_sound_v)180 84 Q(elocity)-.15 E
+.353(This simple list is ordered as the data were collected, follo)108
+96 R .353(wing the ups and do)-.25 F .353(wns of the A)-.25 F .353
+(UV mission. In)-.55 F 1.456(order to construct a model of the w)108 108
 R 1.456
 (ater sound speed as a function of depth, one can sort the output of)-.1
-F F1(mbauvloglist)108 288 Q F0 .486(\(using the program)2.986 F F1(sort)
-2.986 E F0 2.986(\)t)C 2.986(ob)-2.986 G 2.986(eo)-2.986 G .485
+F/F1 10/Times-Bold at 0 SF(mbauvloglist)108 120 Q F0 .486
+(\(using the program)2.986 F F1(sort)2.986 E F0 2.986(\)t)C 2.986(ob)
+-2.986 G 2.986(eo)-2.986 G .485
 (rdered with increasing pressure \(depth\), and then resampled)-2.986 F
-(into uniform increments of pressure using the)108 300 Q F1(GMT)2.5 E F0
+(into uniform increments of pressure using the)108 132 Q F1(GMT)2.5 E F0
 (program)2.5 E F1(sample1d)2.5 E F0(.)A
-(mbauvloglist \255I mvc_logs/2006.224.00/f)144 312 Q(astcatlog.log \\)
--.1 E(-F%f \255O pressure \255O calculated_sound_v)180 324 Q(elocity \\)
--.15 E 2.5(|s)180 336 S(ort \255n \255u > auv_ssv)-2.5 E(.txt)-.65 E
-(sample1d auv_ssv)144 348 Q
-(.txt \255Fl \255H1 \255S0.0 \255I10.0 > auv_ssv_bin.txt)-.65 E F3
-(SEE ALSO)72 376.8 Q F1(mbsystem)108 388.8 Q F0(\(1\),)A F1(sample1d)2.5
-E F0(,)A F1(sort)2.5 E F0(.)A F3 -.11(BU)72 417.6 S(GS).11 E F0
-(Indubitably)108 429.6 Q(.)-.65 E(MB-System 5.0)72 768 Q
-(21 October 2013)137.055 E(6)195.395 E 0 Cg EP
+(mbauvloglist \255I mvc_logs/2006.224.00/f)144 144 Q(astcatlog.log \\)
+-.1 E(-F%f \255O pressure \255O calculated_sound_v)180 156 Q(elocity \\)
+-.15 E 2.5(|s)180 168 S(ort \255n \255u > auv_ssv)-2.5 E(.txt)-.65 E
+(sample1d auv_ssv)144 180 Q
+(.txt \255Fl \255H1 \255S0.0 \255I10.0 > auv_ssv_bin.txt)-.65 E/F2 10.95
+/Times-Bold at 0 SF(SEE ALSO)72 208.8 Q F1(mbsystem)108 220.8 Q F0(\(1\),)A
+F1(sample1d)2.5 E F0(,)A F1(sort)2.5 E F0(.)A F2 -.11(BU)72 249.6 S(GS)
+.11 E F0(Indubitably)108 261.6 Q(.)-.65 E(MB-System 5.0)72 768 Q
+(18 February 2015)135.11 E(7)193.45 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbauvnavusbl.ps b/src/ps/mbauvnavusbl.ps
index c691a66..70c2661 100644
--- a/src/ps/mbauvnavusbl.ps
+++ b/src/ps/mbauvnavusbl.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbbackangle.ps b/src/ps/mbbackangle.ps
index 3522217..de1a5eb 100644
--- a/src/ps/mbbackangle.ps
+++ b/src/ps/mbbackangle.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -517,7 +517,7 @@ e beam amplitude and)125.5 460.8 R(sidescan with mbprocess, \214rst use)
 (rages o).15 E -.15(ve)-.15 G 2.5(ru).15 G 2.5(pt)-2.5 G 2.5(o5)-2.5 G
 2.5(0p)-2.5 G(ings. The output looks lik)-2.5 E(e:)-.1 E
 (Program mbbackangle)144 580.8 Q -1.11(Ve)144 592.8 S
-(rsion $Id: mbbackangle.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbbackangle.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)144 604.8 Q(ersion 5.0.4)-1.11 E(Pings to a)144 628.8 Q
 -.15(ve)-.2 G 7.5(rage: 50).15 F(Number of angle bins: 81)144 640.8 Q
 (Maximum angle:)144 652.8 Q(80.000000)22.5 E(Def)144 664.8 Q
@@ -565,7 +565,7 @@ her created \(if necessary\) or modi\214ed to)108 336 R 9.298
 -.1 E
 (## Sidescan correction table \214les generated by program mbbackangle)
 144 372 Q(## V)144 384 Q
-(ersion $Id: mbbackangle.ps 2219 2014-12-11 21:22:25Z caress $)-1.11 E
+(ersion $Id: mbbackangle.ps 2252 2015-07-01 19:35:37Z caress $)-1.11 E
 (## MB-system V)144 396 Q(ersion 5.0.4)-1.11 E(## T)144 408 Q
 (able \214le format: 1.0.0)-.8 E
 (## Run by user <caress> on cpu <hess> at <Fri Oct)144 420 Q 2.5(11)5 G
diff --git a/src/ps/mbclean.ps b/src/ps/mbclean.ps
index 64cc726..61cd9a4 100644
--- a/src/ps/mbclean.ps
+++ b/src/ps/mbclean.ps
@@ -1,11 +1,11 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
 %%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 7
+%%Pages: 6
 %%PageOrder: Ascend
 %%DocumentMedia: Default 612 792 0 () ()
 %%Orientation: Portrait
@@ -309,8 +309,7 @@ Q F2<ad42>A F0(option\).)2.5 E
 .395(This program \215ags beams by outputting the \215ags as edit e)108
 722.4 R -.15(ve)-.25 G .395(nts to an "edit sa).15 F .694 -.15(ve \214)
 -.2 H .394(le", lik).15 F 2.894(et)-.1 G .394(hat produced by)-2.894 F
-(MB-System 5.0)72 768 Q 2.5(1D)135.115 G(ecember 2014)-2.5 E(1)193.455 E
-0 Cg EP
+(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(1)200.945 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
@@ -417,8 +416,8 @@ E F0(manual page. Def)2.5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)2.5 G
 current ping and the pings immediately)6.423 F .56
 (before and after that ping.)144 729.6 R .56(If a depth v)5.56 F .559
 (alue is less than)-.25 F F3(fr)3.059 E(action_low)-.15 E F0 .559
-(times the median depth \(e.g.)3.059 F(MB-System 5.0)72 768 Q 2.5(1D)
-135.115 G(ecember 2014)-2.5 E(2)193.455 E 0 Cg EP
+(times the median depth \(e.g.)3.059 F(MB-System 5.0)72 768 Q
+(14 April 2015)142.605 E(2)200.945 E 0 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
@@ -480,275 +479,254 @@ G .568(th sonar format supported by).1 F F2(MBIO)144 273.6 Q F0 3.428
 2.5(=1)2.5 G 31.92(:F)-2.5 G
 (lags one beam associated with each outlier slope.)-31.92 E
 (The \215agged beam is the one furthest from the local)252 444 Q
-(median depth.)252 456 Q F1(mode)180 468 Q F0 2.5(=2)2.5 G 31.92(:F)-2.5
-G(lags both beams associated with each outlier slope.)-31.92 E F1(mode)
-180 480 Q F0 2.5(=3)2.5 G 31.92(:Z)-2.5 G
-(eros one beam associated with each outlier slope.)-31.92 E
-(The zeroed beam is the one furthest from the local)252 492 Q
-(median depth.)252 504 Q F1(mode)180 516 Q F0 2.713(=4)2.713 G 31.92(:Z)
--2.713 G .214(eros both beams associated with each outlier slope.)-31.92
-F .214(If the data format)5.214 F .49
-(of the input \214le prohibits storage of ne)144 528 R -.05(ga)-.15 G
-(ti).05 E .789 -.15(ve d)-.25 H .489
-(epths, an error message will be output and the pro-).15 F(gram will e)
-144 540 Q(xit. Def)-.15 E(ault:)-.1 E F1(mode)2.5 E F0 2.5(=1)2.5 G(.)
--2.5 E F2<ad50>108 556.8 Q F1(speed_low/speed_high)24.19 E F0 .481
-(This option causes)144 568.8 R F2(mbclean)2.981 E F0 .481(to \215ag as\
- bad all beams in pings associated with platform speed out-)2.981 F
-2.624(side the acceptable range from)144 580.8 R F1(speed_low)5.124 E F0
+(median depth.)252 456 Q F1(mode)180 468 Q F0 3.217(=2)3.217 G 31.92(:F)
+-3.217 G .717(lags both beams associated with each outlier slope.)-31.92
+F(Def)5.718 E(ault:)-.1 E F1(mode)3.218 E F0(=)3.218 E(1.)144 480 Q F2
+<ad50>108 496.8 Q F1(speed_low/speed_high)24.19 E F0 .482
+(This option causes)144 508.8 R F2(mbclean)2.982 E F0 .481(to \215ag as\
+ bad all beams in pings associated with platform speed out-)2.982 F
+2.623(side the acceptable range from)144 520.8 R F1(speed_low)5.124 E F0
 (to)5.124 E F1(speed_high)5.124 E F0 5.124(.T)C 2.624(he speed v)-5.124
-F 2.623(alues are speci\214ed in)-.25 F(km/hour)144 592.8 Q(.)-.55 E F2
-<ad51>108 609.6 Q F1(bac)22.52 E(kup)-.2 E F0 1.091(This \215ag causes)
-144 621.6 R F2(mbclean)3.591 E F0 1.092
-(to search for bad "rails" in the sw)3.591 F 1.092(ath sonar sw)-.1 F
-1.092(ath; the "rails" refer to)-.1 F .985
-(groups of outer beams which ha)144 633.6 R 1.285 -.15(ve c)-.2 H .985
+F 2.624(alues are speci\214ed in)-.25 F(km/hour)144 532.8 Q(.)-.55 E F2
+<ad51>108 549.6 Q F1(bac)22.52 E(kup)-.2 E F0 1.092(This \215ag causes)
+144 561.6 R F2(mbclean)3.592 E F0 1.092
+(to search for bad "rails" in the sw)3.592 F 1.092(ath sonar sw)-.1 F
+1.091(ath; the "rails" refer to)-.1 F .985
+(groups of outer beams which ha)144 573.6 R 1.285 -.15(ve c)-.2 H .985
 (rosstrack distances \(and depths\) much less than the).15 F 3.485(ys)
--.15 G(hould)-3.485 E(ha)144 645.6 Q -.15(ve)-.2 G 5.102(.T).15 G .102
+-.15 G(hould)-3.485 E(ha)144 585.6 Q -.15(ve)-.2 G 5.103(.T).15 G .103
 (hese are identi\214ed when one or more outer beams lies more than)
--5.102 F F1(bac)2.603 E(kup)-.2 E F0 .103(meters inboard of)2.603 F 2.5
-(am)144 657.6 S
+-5.103 F F1(bac)2.602 E(kup)-.2 E F0 .102(meters inboard of)2.602 F 2.5
+(am)144 597.6 S
 (ore inner beam; all beams meeting this criteria are \215agged.)-2.5 E
-F2<ad52>108 674.4 Q F1(maxheadingr)23.08 E(ate)-.15 E F0 .917(The v)144
-686.4 R(alue)-.25 E F1(maxheadingr)3.417 E(ate)-.15 E F0 .917
+F2<ad52>108 614.4 Q F1(maxheadingr)23.08 E(ate)-.15 E F0 .916(The v)144
+626.4 R(alue)-.25 E F1(maxheadingr)3.417 E(ate)-.15 E F0 .917
 (is the maximum acceptable rate of change in heading in de)3.417 F
-(grees/sec-)-.15 E .159
+(grees/sec-)-.15 E .16
 (ond. All soundings associated with pings for which the heading w)144
-698.4 R .16(as changing at a greater rate will)-.1 F(be \215agged.)144
-710.4 Q(MB-System 5.0)72 768 Q 2.5(1D)135.115 G(ecember 2014)-2.5 E(3)
-193.455 E 0 Cg EP
+638.4 R .159(as changing at a greater rate will)-.1 F(be \215agged.)144
+650.4 Q F2<ad53>108 667.2 Q F1(slope/mode/unit)24.74 E F0 .54(The v)144
+679.2 R(alue)-.25 E F1(slope)3.04 E F0 .54
+(is the maximum acceptable spik)3.04 F 3.04(es)-.1 G 3.04(lope. If)-3.04
+F .54(the slope from the preceding beam to)3.04 F .342(this beam e)144
+691.2 R .342(xceeds this v)-.15 F .342
+(alue, and the slope from this beam to subsequent beam e)-.25 F .341
+(xceeds this v)-.15 F(alue)-.25 E -.2(bu)144 703.2 S 2.515(tw).2 G .015
+(ith an opposite sign this beam is considered a spik)-2.515 F 2.515(ea)
+-.1 G .016(nd will be \215agged or remo)-2.515 F -.15(ve)-.15 G 2.516
+(da).15 G(ccording)-2.516 E .462
+(to the operational mode speci\214ed using the)144 715.2 R F2<ad4d>2.962
+E F0 2.962(option. Acrosstrack)2.962 F .462
+(slopes are determined by the)2.962 F 1.535(preceding and subsequent be\
+ams in the same ping. Alongtrack slopes are determined from the)144
+727.2 R(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(3)200.945 E 0 Cg
+EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad53>108 84 Q/F2 10
-/Times-Italic at 0 SF(slope/mode/unit)24.74 E F0 .54(The v)144 96 R(alue)
--.25 E F2(slope)3.04 E F0 .54(is the maximum acceptable spik)3.04 F 3.04
-(es)-.1 G 3.04(lope. If)-3.04 F .54
-(the slope from the preceding beam to)3.04 F .341(this beam e)144 108 R
-.342(xceeds this v)-.15 F .342
-(alue, and the slope from this beam to subsequent beam e)-.25 F .342
-(xceeds this v)-.15 F(alue)-.25 E -.2(bu)144 120 S 2.516(tw).2 G .015
-(ith an opposite sign this beam is considered a spik)-2.516 F 2.515(ea)
--.1 G .015(nd will be \215agged or remo)-2.515 F -.15(ve)-.15 G 2.515
-(da).15 G(ccording)-2.515 E .462
-(to the operational mode speci\214ed using the)144 132 R F1<ad4d>2.962 E
-F0 2.962(option. Acrosstrack)2.962 F .462(slopes are determined by the)
-2.962 F 1.535(preceding and subsequent beams in the same ping. Alongtra\
-ck slopes are determined from the)144 144 R .485(same beam in the pre)
-144 156 R .485(vious and subsequent pings.)-.25 F .485(Alongtrack are f)
-5.485 F .485(airly sensiti)-.1 F .785 -.15(ve t)-.25 H 2.985(ot).15 G
-.485(he minimum)-2.985 F(distance)144 168 Q F1<ad44>3.362 E F0 .861
-(option, which will normally need to be set less to a v)3.362 F .861
-(ery small v)-.15 F .861(alue for alongtrack)-.25 F(slopes to be detect\
-ed. There is no test that alongtrack distances are all in the same dire\
-ction.)144 180 Q(If)144 204 Q F2(mode)2.729 E F0 .229(is 1 \(def)2.729 F
-.229(ault\) only acrosstrack spik)-.1 F .229(es are detected.)-.1 F(If)
-5.229 E F2(mode)2.73 E F0 .23(is 2 only alongtrack spik)2.73 F .23
-(es are)-.1 F 2.5(detected. If)144 216 R F2(mode)2.5 E F0
+(5.0 mbclean\(1\))2.5 F .485(same beam in the pre)144 84 R .485
+(vious and subsequent pings.)-.25 F .485(Alongtrack are f)5.485 F .485
+(airly sensiti)-.1 F .785 -.15(ve t)-.25 H 2.985(ot).15 G .485
+(he minimum)-2.985 F(distance)144 96 Q/F1 10/Times-Bold at 0 SF<ad44>3.361
+E F0 .861(option, which will normally need to be set less to a v)3.361 F
+.861(ery small v)-.15 F .862(alue for alongtrack)-.25 F(slopes to be de\
+tected. There is no test that alongtrack distances are all in the same \
+direction.)144 108 Q(If)144 132 Q/F2 10/Times-Italic at 0 SF(mode)2.73 E F0
+.23(is 1 \(def)2.73 F .23(ault\) only acrosstrack spik)-.1 F .229
+(es are detected.)-.1 F(If)5.229 E F2(mode)2.729 E F0 .229
+(is 2 only alongtrack spik)2.729 F .229(es are)-.1 F 2.5(detected. If)
+144 144 R F2(mode)2.5 E F0
 (is 3 both along track and across track slopes are check)2.5 E(ed.)-.1 E
-F2(unit)144 240 Q F0 .155(is optional and speci\214es the unit of)2.655
+F2(unit)144 168 Q F0 .155(is optional and speci\214es the unit of)2.655
 F F2(slope)2.655 E F0 2.655(,0\()C(def)-2.655 E .155
 (ault\) indicates the slope is in tangents, 1 slope)-.1 F .052
-(is in radians, 2 slope is in de)144 252 R 2.552(grees. A)-.15 F .052
+(is in radians, 2 slope is in de)144 180 R 2.552(grees. A)-.15 F .052
 (beam is not considered a spik)2.552 F 2.552(ei)-.1 G 2.552(fe)-2.552 G
 .052(ither the preceding or sub-)-2.552 F
-(sequent beam has already been \215agged.)144 264 Q(Def)5 E(ault:)-.1 E
-F2(slope)2.5 E F0 2.5(=1)2.5 G(.0)-2.5 E F1<ad54>108 280.8 Q F2(toler)
+(sequent beam has already been \215agged.)144 192 Q(Def)5 E(ault:)-.1 E
+F2(slope)2.5 E F0 2.5(=1)2.5 G(.0)-2.5 E F1<ad54>108 208.8 Q F2(toler)
 23.63 E(ance)-.15 E F0 .38
-(If requested this option will reset the timestamps of edit e)144 292.8
+(If requested this option will reset the timestamps of edit e)144 220.8
 R -.15(ve)-.25 G .38(nts from an e).15 F .38(xisting esf \214le to e)
--.15 F(xactly)-.15 E 1.338(match the timestamps of the surv)144 304.8 R
-1.638 -.15(ey p)-.15 H 1.339(ings. The /fItolerance/fP v).15 F 1.339
-(alue sets ho)-.25 F 3.839(wc)-.25 G 1.339(lose timestamps)-3.839 F .232
+-.15 F(xactly)-.15 E 1.339(match the timestamps of the surv)144 232.8 R
+1.639 -.15(ey p)-.15 H 1.338(ings. The /fItolerance/fP v).15 F 1.338
+(alue sets ho)-.25 F 3.838(wc)-.25 G 1.338(lose timestamps)-3.838 F .232
 (must be in seconds to be considered a match. This option handles the c\
-ase where surv)144 316.8 R .532 -.15(ey d)-.15 H .232(ata ha).15 F -.15
-(ve)-.2 G .626(been processed using non-)144 328.8 R F1(MB-System)A F0
+ase where surv)144 244.8 R .533 -.15(ey d)-.15 H .233(ata ha).15 F -.15
+(ve)-.2 G .626(been processed using non-)144 256.8 R F1(MB-System)A F0
 (softw)3.126 E .626(are and a user is e)-.1 F .626
-(xtracting the edits from one set of)-.15 F(\214les with)144 340.8 Q F1
+(xtracting the edits from one set of)-.15 F(\214les with)144 268.8 Q F1
 (mbgetesf)2.5 E F0(and then applying them to another using)2.5 E F1
-(mbpr)2.5 E(ocess)-.18 E F0(.)A F1<ad55>108 357.6 Q F2(nmin)23.08 E F0
-.336(This \215ag causes)144 369.6 R F1(mbclean)2.836 E F0 .336
-(to search for port or starboard halv)2.836 F .335
-(es of pings which contain fe)-.15 F .335(wer than)-.25 F F2(nmin)144
-381.6 Q F0(good bath)2.5 E(ymetry v)-.05 E(alues. All bath)-.25 E
+(mbpr)2.5 E(ocess)-.18 E F0(.)A F1<ad55>108 285.6 Q F2(nmin)23.08 E F0
+.335(This \215ag causes)144 297.6 R F1(mbclean)2.835 E F0 .336
+(to search for port or starboard halv)2.835 F .336
+(es of pings which contain fe)-.15 F .336(wer than)-.25 F F2(nmin)144
+309.6 Q F0(good bath)2.5 E(ymetry v)-.05 E(alues. All bath)-.25 E
 (ymetry v)-.05 E(alues in the af)-.25 E
-(fected half-pings are \215agged.)-.25 E F1<ad56>108 398.4 Q F0
-(Normally)23.08 E(,)-.65 E F1(mbclean)3.461 E F0 -.1(wo)3.461 G .961
-(rks "silently" without outputting an).1 F .962
-(ything to the stderr stream.)-.15 F .962(If the)5.962 F F1<ad56>3.462 E
-F0 1.32(\215ag is gi)144 410.4 R -.15(ve)-.25 G 1.32(n, then).15 F F1
-(mbclean)3.82 E F0 -.1(wo)3.82 G 1.319(rks in a "v).1 F 1.319
-(erbose" mode and outputs the program v)-.15 F 1.319(ersion being)-.15 F
+(fected half-pings are \215agged.)-.25 E F1<ad56>108 326.4 Q F0
+(Normally)23.08 E(,)-.65 E F1(mbclean)3.462 E F0 -.1(wo)3.462 G .962
+(rks "silently" without outputting an).1 F .961
+(ything to the stderr stream.)-.15 F .961(If the)5.961 F F1<ad56>3.461 E
+F0 1.319(\215ag is gi)144 338.4 R -.15(ve)-.25 G 1.319(n, then).15 F F1
+(mbclean)3.819 E F0 -.1(wo)3.819 G 1.319(rks in a "v).1 F 1.32
+(erbose" mode and outputs the program v)-.15 F 1.32(ersion being)-.15 F
 (used, all error status messages, and the number of beams \215agged as \
-bad.)144 422.4 Q F1<ad57>108 439.2 Q F2(west/east/south/north)20.3 E F0
-.218(This option causes)144 451.2 R F1(mbclean)2.718 E F0 .218
-(to \215ag as bad all beams in pings with na)2.718 F(vig)-.2 E .219
-(ation outside the speci\214ed)-.05 F(acceptable bounds.)144 463.2 Q F1
-<ad58>108 480 Q F2(zap_beams)23.08 E F0 .118
-(If this option is used, the outermost)144 492 R F2(zap_beams)2.618 E F0
+bad.)144 350.4 Q F1<ad57>108 367.2 Q F2(west/east/south/north)20.3 E F0
+.219(This option causes)144 379.2 R F1(mbclean)2.718 E F0 .218
+(to \215ag as bad all beams in pings with na)2.718 F(vig)-.2 E .218
+(ation outside the speci\214ed)-.05 F(acceptable bounds.)144 391.2 Q F1
+<ad58>108 408 Q F2(zap_beams)23.08 E F0 .118
+(If this option is used, the outermost)144 420 R F2(zap_beams)2.618 E F0
 .118(at both ends of the sw)2.618 F .118
 (ath are \215agged as bad; this is)-.1 F
-(useful if the outer beams are kno)144 504 Q(wn to be unreliable. Def)
+(useful if the outer beams are kno)144 432 Q(wn to be unreliable. Def)
 -.25 E(ault:)-.1 E F2(zap_beams)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad59>
-108 520.8 Q F2(distanceleft/distanceright)23.08 E F0 .516
-(This option causes)144 532.8 R F1(mbclean)3.017 E F0 .517(to \215ag as\
+108 448.8 Q F2(distanceleft/distanceright)23.08 E F0 .517
+(This option causes)144 460.8 R F1(mbclean)3.017 E F0 .517(to \215ag as\
  bad all beams with acrosstrack distances more to port than)3.017 F F2
-(distanceleft)144 544.8 Q F0 .155(and more to starboard than)2.655 F F2
+(distanceleft)144 472.8 Q F0 .155(and more to starboard than)2.655 F F2
 (distanceright)2.655 E F0 2.655(.T)C .155
 (he distances are de\214ned in meters, and dis-)-2.655 F
-(tances to port of nadir are ne)144 556.8 Q -.05(ga)-.15 G(ti).05 E -.15
-(ve)-.25 G(.).15 E F1<ad5a>108 573.6 Q F0 .287(This option causes)144
-585.6 R F1(mbclean)2.787 E F0 .288
+(tances to port of nadir are ne)144 484.8 Q -.05(ga)-.15 G(ti).05 E -.15
+(ve)-.25 G(.).15 E F1<ad5a>108 501.6 Q F0 .288(This option causes)144
+513.6 R F1(mbclean)2.788 E F0 .288
 (to \215ag as bad all beams in pings with zero longitude and latitude v)
-2.787 F(al-)-.25 E(ues.)144 597.6 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72
-626.4 Q F0 .428(Suppose one wishes to do a \214rst pass edit of six Sim\
-rad EM300 \214les in the processing format \(format 57\).)108 638.4 R
-2.5(Ad)108 650.4 S(atalist referencing these six \214les e)-2.5 E
+2.788 F(al-)-.25 E(ues.)144 525.6 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72
+554.4 Q F0 .428(Suppose one wishes to do a \214rst pass edit of six Sim\
+rad EM300 \214les in the processing format \(format 57\).)108 566.4 R
+2.5(Ad)108 578.4 S(atalist referencing these six \214les e)-2.5 E
 (xists as the \214le datalist.mb-1 and has the contents:)-.15 E
-(0001_20020424_212920.mb57 57)144 662.4 Q(0002_20020425_011607.mb57 57)
-144 674.4 Q(0003_20020425_022926.mb57 57)144 686.4 Q
-(0004_20020425_024336.mb57 57)144 698.4 Q(0005_20020425_034057.mb57 57)
-144 710.4 Q(0006_20020425_045013.mb57 57)144 722.4 Q(MB-System 5.0)72
-768 Q 2.5(1D)135.115 G(ecember 2014)-2.5 E(4)193.455 E 0 Cg EP
+(0001_20020424_212920.mb57 57)144 590.4 Q(0002_20020425_011607.mb57 57)
+144 602.4 Q(0003_20020425_022926.mb57 57)144 614.4 Q
+(0004_20020425_024336.mb57 57)144 626.4 Q(0005_20020425_034057.mb57 57)
+144 638.4 Q(0006_20020425_045013.mb57 57)144 650.4 Q .041(Use the follo)
+108 662.4 R .041(wing to \215ag an)-.25 F 2.541(yb)-.15 G .041
+(eams which de)-2.541 F .04
+(viate by more than 20% from the local median depth or which)-.25 F
+(produce a slope greater than 3.5 \(74 de)108 674.4 Q(grees\):)-.15 E
+(mbclean \255Idatalist.mb-1 \\)144 698.4 Q
+(-M1 \255C3.5 \255D0.01/0.20 \\)180 710.4 Q(-G0.80/1.20)180 722.4 Q
+(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(4)200.945 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F .04(Use the follo)108 84 R .04
-(wing to \215ag an)-.25 F 2.54(yb)-.15 G .04(eams which de)-2.54 F .041
-(viate by more than 20% from the local median depth or which)-.25 F
-(produce a slope greater than 3.5 \(74 de)108 96 Q(grees\):)-.15 E
-(mbclean \255Idatalist.mb-1 \\)144 120 Q(-M1 \255C3.5 \255D0.01/0.20 \\)
-180 132 Q(-G0.80/1.20)180 144 Q .212
+(5.0 mbclean\(1\))2.5 F .212
 (The program will output \215agging statistics for each \214le and gi)
-108 168 R .512 -.15(ve t)-.25 H .212(otals at the end. If the).15 F/F1
-10/Times-Bold at 0 SF<ad56>2.712 E F0 .212(option is speci-)2.712 F
-(\214ed,)108 180 Q F1(mbclean)2.695 E F0 .196(will also output informat\
-ion for each beam that is \215agged. Here is an e)2.695 F .196
-(xample of the non)-.15 F -.15(ve)-.4 G -.2(r-).15 G(bose output:)108
-192 Q(Processing 0001_20020424_212920.mb57)144 204 Q(908 bath)144 216 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 228 S
-(uter beams zapped)-2.5 E 2.5(0b)144 240 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 252 S
+108 84 R .512 -.15(ve t)-.25 H .212(otals at the end. If the).15 F/F1 10
+/Times-Bold at 0 SF<ad56>2.712 E F0 .212(option is speci-)2.712 F(\214ed,)
+108 96 Q F1(mbclean)2.696 E F0 .196(will also output information for ea\
+ch beam that is \215agged. Here is an e)2.696 F .195(xample of the non)
+-.15 F -.15(ve)-.4 G -.2(r-).15 G(bose output:)108 108 Q
+(Processing 0001_20020424_212920.mb57)144 120 Q(908 bath)144 132 Q
+(ymetry data records processed)-.05 E 2.5(0o)144 144 S
+(uter beams zapped)-2.5 E 2.5(0b)144 156 S(eams zapped for too fe)-2.5 E
+2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 168 S
 (eams out of acceptable depth range)-2.5 E
-(64 beams out of acceptable fractional depth range)144 264 Q 2.5(0b)144
-276 S(eams e)-2.5 E(xceed acceptable de)-.15 E
-(viation from median depth)-.25 E 2.5(0b)144 288 S
-(ad rail beams identi\214ed)-2.5 E(1601 e)144 300 Q(xcessi)-.15 E .3
+(64 beams out of acceptable fractional depth range)144 180 Q 2.5(0b)144
+192 S(eams e)-2.5 E(xceed acceptable de)-.15 E
+(viation from median depth)-.25 E 2.5(0b)144 204 S
+(ad rail beams identi\214ed)-2.5 E(1601 e)144 216 Q(xcessi)-.15 E .3
 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5 G(xcessi)-2.65 E
 .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(1665 beams \215agged)144 312 Q 2.5(0b)144 324 S(eams un\215agged)-2.5 E
-2.5(0b)144 336 S(eams zeroed)-2.5 E
-(Processing 0002_20020425_011607.mb57)144 360 Q(259 bath)144 372 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 384 S
-(uter beams zapped)-2.5 E 2.5(0b)144 396 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 408 S
-(eams out of acceptable depth range)-2.5 E 2.5(0b)144 420 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 432 S
+(1665 beams \215agged)144 228 Q 2.5(0b)144 240 S(eams un\215agged)-2.5 E
+(Processing 0002_20020425_011607.mb57)144 264 Q(259 bath)144 276 Q
+(ymetry data records processed)-.05 E 2.5(0o)144 288 S
+(uter beams zapped)-2.5 E 2.5(0b)144 300 S(eams zapped for too fe)-2.5 E
+2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 312 S
+(eams out of acceptable depth range)-2.5 E 2.5(0b)144 324 S
+(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 336 S
+(eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
+E 2.5(0b)144 348 S(ad rail beams identi\214ed)-2.5 E(242 e)144 360 Q
+(xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
+G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
+(242 beams \215agged)144 372 Q 2.5(0b)144 384 S(eams un\215agged)-2.5 E
+(Processing 0003_20020425_022926.mb57)144 408 Q(65 bath)144 420 Q
+(ymetry data records processed)-.05 E 2.5(0o)144 432 S
+(uter beams zapped)-2.5 E 2.5(0b)144 444 S(eams zapped for too fe)-2.5 E
+2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 456 S
+(eams out of acceptable depth range)-2.5 E 2.5(9b)144 468 S
+(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 480 S
 (eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 444 S(ad rail beams identi\214ed)-2.5 E(242 e)144 456 Q
+E 2.5(0b)144 492 S(ad rail beams identi\214ed)-2.5 E(497 e)144 504 Q
 (xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
 G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(242 beams \215agged)144 468 Q 2.5(0b)144 480 S(eams un\215agged)-2.5 E
-2.5(0b)144 492 S(eams zeroed)-2.5 E
-(Processing 0003_20020425_022926.mb57)144 516 Q(65 bath)144 528 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 540 S
-(uter beams zapped)-2.5 E 2.5(0b)144 552 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 564 S
-(eams out of acceptable depth range)-2.5 E 2.5(9b)144 576 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 588 S
+(506 beams \215agged)144 516 Q 2.5(0b)144 528 S(eams un\215agged)-2.5 E
+(Processing 0004_20020425_024336.mb57)144 552 Q(410 bath)144 564 Q
+(ymetry data records processed)-.05 E 2.5(0o)144 576 S
+(uter beams zapped)-2.5 E 2.5(0b)144 588 S(eams zapped for too fe)-2.5 E
+2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 600 S
+(eams out of acceptable depth range)-2.5 E 2.5(0b)144 612 S
+(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 624 S
 (eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 600 S(ad rail beams identi\214ed)-2.5 E(497 e)144 612 Q
+E 2.5(0b)144 636 S(ad rail beams identi\214ed)-2.5 E(148 e)144 648 Q
 (xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
 G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(506 beams \215agged)144 624 Q 2.5(0b)144 636 S(eams un\215agged)-2.5 E
-2.5(0b)144 648 S(eams zeroed)-2.5 E
-(Processing 0004_20020425_024336.mb57)144 672 Q(410 bath)144 684 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 696 S
-(uter beams zapped)-2.5 E 2.5(0b)144 708 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 720 S
-(eams out of acceptable depth range)-2.5 E(MB-System 5.0)72 768 Q 2.5
-(1D)135.115 G(ecember 2014)-2.5 E(5)193.455 E 0 Cg EP
+(148 beams \215agged)144 660 Q 2.5(0b)144 672 S(eams un\215agged)-2.5 E
+(Processing 0005_20020425_034057.mb57)144 696 Q(252 bath)144 708 Q
+(ymetry data records processed)-.05 E 2.5(0o)144 720 S
+(uter beams zapped)-2.5 E(MB-System 5.0)72 768 Q(14 April 2015)142.605 E
+(5)200.945 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F 2.5(0b)144 84 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 96 S
-(eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 108 S(ad rail beams identi\214ed)-2.5 E(148 e)144 120 Q
-(xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
-G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(148 beams \215agged)144 132 Q 2.5(0b)144 144 S(eams un\215agged)-2.5 E
-2.5(0b)144 156 S(eams zeroed)-2.5 E
-(Processing 0005_20020425_034057.mb57)144 180 Q(252 bath)144 192 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 204 S
-(uter beams zapped)-2.5 E 2.5(0b)144 216 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 228 S
-(eams out of acceptable depth range)-2.5 E 2.5(0b)144 240 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 252 S
+(5.0 mbclean\(1\))2.5 F 2.5(0b)144 84 S(eams zapped for too fe)-2.5 E
+2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 96 S
+(eams out of acceptable depth range)-2.5 E 2.5(0b)144 108 S
+(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 120 S
 (eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 264 S(ad rail beams identi\214ed)-2.5 E(100 e)144 276 Q
+E 2.5(0b)144 132 S(ad rail beams identi\214ed)-2.5 E(100 e)144 144 Q
 (xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
 G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(100 beams \215agged)144 288 Q 2.5(0b)144 300 S(eams un\215agged)-2.5 E
-2.5(0b)144 312 S(eams zeroed)-2.5 E
-(Processing 0006_20020425_045013.mb57)144 336 Q(562 bath)144 348 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 360 S
-(uter beams zapped)-2.5 E 2.5(0b)144 372 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 384 S
-(eams out of acceptable depth range)-2.5 E 2.5(0b)144 396 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 408 S
+(100 beams \215agged)144 156 Q 2.5(0b)144 168 S(eams un\215agged)-2.5 E
+(Processing 0006_20020425_045013.mb57)144 192 Q(562 bath)144 204 Q
+(ymetry data records processed)-.05 E 2.5(0o)144 216 S
+(uter beams zapped)-2.5 E 2.5(0b)144 228 S(eams zapped for too fe)-2.5 E
+2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 240 S
+(eams out of acceptable depth range)-2.5 E 2.5(0b)144 252 S
+(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 264 S
 (eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 420 S(ad rail beams identi\214ed)-2.5 E(41 e)144 432 Q
+E 2.5(0b)144 276 S(ad rail beams identi\214ed)-2.5 E(41 e)144 288 Q
 (xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
 G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(41 beams \215agged)144 444 Q 2.5(0b)144 456 S(eams un\215agged)-2.5 E
-2.5(0b)144 468 S(eams zeroed)-2.5 E(MBclean Processing T)144 492 Q
-(otals:)-.8 E(-------------------------)144 504 Q 2.5(6t)144 516 S
-(otal sw)-2.5 E(ath data \214les processed)-.1 E(2456 total bath)144 528
-Q(ymetry data records processed)-.05 E 2.5(0t)144 540 S
-(otal beams \215agged in old esf \214les)-2.5 E 2.5(0t)144 552 S
-(otal beams un\215agged in old esf \214les)-2.5 E 2.5(0t)144 564 S
-(otal beams zeroed in old esf \214les)-2.5 E 2.5(0t)144 576 S
-(otal outer beams zapped)-2.5 E 2.5(0t)144 588 S
+(41 beams \215agged)144 300 Q 2.5(0b)144 312 S(eams un\215agged)-2.5 E
+(MBclean Processing T)144 336 Q(otals:)-.8 E(-------------------------)
+144 348 Q 2.5(6t)144 360 S(otal sw)-2.5 E(ath data \214les processed)-.1
+E(2456 total bath)144 372 Q(ymetry data records processed)-.05 E 2.5(0t)
+144 384 S(otal beams \215agged in old esf \214les)-2.5 E 2.5(0t)144 396
+S(otal beams un\215agged in old esf \214les)-2.5 E 2.5(0t)144 408 S
+(otal beams zeroed in old esf \214les)-2.5 E 2.5(0t)144 420 S
+(otal outer beams zapped)-2.5 E 2.5(0t)144 432 S
 (otal beams zapped for too fe)-2.5 E 2.5(wg)-.25 G(ood beams in ping)
--2.5 E 2.5(0t)144 600 S(otal beams out of acceptable depth range)-2.5 E
-(73 total beams out of acceptable fractional depth range)144 612 Q 2.5
-(0t)144 624 S(otal beams e)-2.5 E(xceed acceptable de)-.15 E
-(viation from median depth)-.25 E 2.5(0t)144 636 S
-(otal bad rail beams identi\214ed)-2.5 E(2629 total e)144 648 Q(xcessi)
+-2.5 E 2.5(0t)144 444 S(otal beams out of acceptable depth range)-2.5 E
+(73 total beams out of acceptable fractional depth range)144 456 Q 2.5
+(0t)144 468 S(otal beams e)-2.5 E(xceed acceptable de)-.15 E
+(viation from median depth)-.25 E 2.5(0t)144 480 S
+(otal bad rail beams identi\214ed)-2.5 E(2629 total e)144 492 Q(xcessi)
 -.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0t)38.5 G
 (otal e)-2.5 E(xcessi)-.15 E .3 -.15(ve s)-.25 H(pik).15 E
-(es identi\214ed)-.1 E(2702 total beams \215agged)144 660 Q 2.5(0t)144
-672 S(otal beams un\215agged)-2.5 E 2.5(0t)144 684 S(otal beams zeroed)
--2.5 E(MB-System 5.0)72 768 Q 2.5(1D)135.115 G(ecember 2014)-2.5 E(6)
-193.455 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbedit)2.5 E F0
-(\(1\),)A F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A F2(mbpr)2.5 E(ocess)-.18 E
-F0(\(1\),)A F1 -.11(BU)72 124.8 S(GS).11 E F0 1.013
-(The algorithms implemented in)108 136.8 R F2(mbclean)3.513 E F0 1.013
+(es identi\214ed)-.1 E(2702 total beams \215agged)144 504 Q 2.5(0t)144
+516 S(otal beams un\215agged)-2.5 E/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72
+544.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 556.8 Q F0(\(1\),)A F2
+(mbedit)2.5 E F0(\(1\),)A F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A F2(mbpr)2.5
+E(ocess)-.18 E F0(\(1\),)A F1 -.11(BU)72 585.6 S(GS).11 E F0 1.012
+(The algorithms implemented in)108 597.6 R F2(mbclean)3.513 E F0 1.013
 (simply don')3.513 F 3.513(td)-.18 G 1.013(etect all bath)-3.513 F 1.013
-(ymetric artif)-.05 F 1.013(acts that are ob)-.1 F 1.012(vious to)-.15 F
-.518(the e)108 148.8 R .518(ye on contour charts.)-.15 F(Although)5.518
+(ymetric artif)-.05 F 1.013(acts that are ob)-.1 F 1.013(vious to)-.15 F
+.519(the e)108 609.6 R .518(ye on contour charts.)-.15 F(Although)5.518
 E F2(mbclean)3.018 E F0 .518
-(often does a credible \214rst pass at \215agging ob)3.018 F .519
-(vious artif)-.15 F(acts,)-.1 E .397(we strongly recommend that an)108
-160.8 R 2.897(ys)-.15 G -.1(wa)-2.897 G .397(th bath).1 F .396
-(ymetry processing stream include interacti)-.05 F .696 -.15(ve e)-.25 H
-.396(diting of the ba-).15 F(th)108 172.8 Q(ymetry data \(e.g.)-.05 E F2
-(mbedit)2.5 E F0(\).)A(MB-System 5.0)72 768 Q 2.5(1D)135.115 G
-(ecember 2014)-2.5 E(7)193.455 E 0 Cg EP
+(often does a credible \214rst pass at \215agging ob)3.018 F .518
+(vious artif)-.15 F(acts,)-.1 E .396(we strongly recommend that an)108
+621.6 R 2.896(ys)-.15 G -.1(wa)-2.896 G .396(th bath).1 F .396
+(ymetry processing stream include interacti)-.05 F .697 -.15(ve e)-.25 H
+.397(diting of the ba-).15 F(th)108 633.6 Q(ymetry data \(e.g.)-.05 E F2
+(mbedit)2.5 E F0(\).)A(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(6)
+200.945 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbcontour.ps b/src/ps/mbcontour.ps
index 8e54548..9748de2 100644
--- a/src/ps/mbcontour.ps
+++ b/src/ps/mbcontour.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -231,13 +231,13 @@ BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
 (5.0 mbcontour\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbcontour)108 96 Q F0 3.232<ad47>3.232 G
-.732(MT compatible utility for color \214ll or color shaded relief sw)
--3.232 F .731(ath plots of sw)-.1 F .731(ath sonar data)-.1 F
+.219 E/F2 10/Times-Bold at 0 SF(mbcontour)108 96 Q F0<ad>3.69 E F2(GMT)3.69
+E F0 1.189(plug-in module for color \214ll or color shaded relief sw)
+3.69 F 1.189(ath plots of sw)-.1 F 1.189(ath sonar data)-.1 F
 (using Postscript.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8
-S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 112.645(mbcontour \255J)108
-189.6 R/F3 10/Times-Italic at 0 SF(par)A(ameter)-.15 E(s)-.1 E F2<ad52>
-115.145 E F3(west/east/south/north)A F2([\255A)108 201.6 Q F3
+S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 68.71(gmt mbcontour \255J)
+108 189.6 R/F3 10/Times-Italic at 0 SF(par)A(ameter)-.15 E(s)-.1 E F2<ad52>
+71.21 E F3(west/east/south/north)A F2([\255A)108 201.6 Q F3
 (cont_int/col_int/tic_int/lab_int/tic_int/lab_hgt/lab_spacing)A F2<ad42>
 7.197 E F3(tic)A(kinfo)-.2 E F2<ad62>7.197 E F3(yr/mo/da/hr/mn/sc)A F2
 <ad43>7.196 E F3(con-)A(tour\214le)108 213.6 Q F2<ad63>11.015 E F3
@@ -252,35 +252,35 @@ S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 112.645(mbcontour \255J)108
 .472<ad5120ad53>2.972 F F3(speed)A F2<ad54>2.972 E F3(time)A(gap)-.4 E
 F2 .472<ad5520ad5720ad58>2.972 F F3(x-shift)A F2<ad59>2.972 E F3(y-)A
 (shift)108 249.6 Q F2<ad5a>2.5 E F3(algorithm)A F2(\255V \255H])2.5 E F1
-(DESCRIPTION)72 278.4 Q F2(mbcontour)108 290.4 Q F0 1.221
-(is a utility for sw)3.721 F 1.221(ath contouring of sw)-.1 F 1.221
-(ath bath)-.1 F 1.22(ymetry data using Postscript.)-.05 F(Lik)6.22 E(e)
--.1 E F2(mbswath)3.72 E F0(,)A F2(mbcontour)108 302.4 Q F0 .273
-(is fully compatible with the GMT package v)2.773 F .274(ersion 4. T)
--.15 F .474 -.1(wo c)-.8 H .274(ontouring algorithms are a).1 F -.25(va)
--.2 G(ilable;).25 E(the)108 314.4 Q F2<ad5a>4.41 E F0 1.91
-(option speci\214es which is used.)4.41 F 1.91(The \214rst, def)6.91 F
-1.91(ault approach dra)-.1 F 1.91(ws contours between successi)-.15 F
--.15(ve)-.25 G .181(pings; this algorithm is simple and therefore f)108
-326.4 R .181(ast b)-.1 F .181
-(ut produces poor looking contours when beams from one)-.2 F .569
-(ping lie "behind" beams from a pre)108 338.4 R .569(vious ping \(this \
-happens for sonars that ping at nonnull pitch angles or)-.25 F .2
-(for the "inside" beams when ships mak)108 350.4 R 2.7(es)-.1 G .2
-(harp turns\). The second algorithm constructs a triangular netw)-2.7 F
-(ork)-.1 E .112(from the a)108 362.4 R -.25(va)-.2 G .112
-(ilable soundings and contours the netw).25 F .112
-(ork; this approach is complicated and therefore slo)-.1 F 2.612(wb)-.25
-G(ut)-2.812 E 1.088
-(produces good looking contours under most conditions. The contour le)
-108 374.4 R -.15(ve)-.25 G 3.588(ls and).15 F 1.088
-(colors can be controlled)3.588 F .793
-(directly or set implicitly using contour and color change interv)108
-386.4 R 3.293(als. Contours)-.25 F .793(can also be set to ha)3.293 F
-1.092 -.15(ve t)-.2 H(icks).15 E(pointing do)108 398.4 Q(wnhill.)-.25 E
-.652(Shiptracks can also be plotted using the)108 422.4 R F2<ad44>3.152
-E F0(,)A F2<ad47>3.152 E F0 3.152(,a)C(nd)-3.152 E F2<ad4d>3.152 E F0
-.652(options. The)3.152 F F2<ad44>3.152 E F0 .653
+(DESCRIPTION)72 278.4 Q F2(mbcontour)108 290.4 Q F0 2.18
+(is a plug-in module for plotting bath)4.68 F 2.179
+(ymetry contours from sw)-.05 F 2.179(ath sonar data using)-.1 F F2(GMT)
+4.679 E F0 .601(\(Generic Mapping T)108 302.4 R .601(ools\). Lik)-.8 F
+(e)-.1 E F2(mbswath)3.101 E F0(,)A F2(mbcontour)3.101 E F0 .602
+(is fully compatible with the)3.101 F F2(GMT)3.102 E F0 .602(package v)
+3.102 F(ersion)-.15 E 2.168(5. T)108 314.4 R 2.368 -.1(wo c)-.8 H 2.168
+(ontouring algorithms are a).1 F -.25(va)-.2 G 2.167(ilable; the).25 F
+F2<ad5a>4.667 E F0 2.167(option speci\214es which is used.)4.667 F 2.167
+(The \214rst, def)7.167 F(ault)-.1 E .169(approach dra)108 326.4 R .169
+(ws contours between successi)-.15 F .469 -.15(ve p)-.25 H .169
+(ings; this algorithm is simple and therefore f).15 F .17(ast b)-.1 F
+.17(ut produces)-.2 F .779(poor looking contours when beams from one pi\
+ng lie "behind" beams from a pre)108 338.4 R .779
+(vious ping \(this happens)-.25 F .947(for sonars that ping at nonnull \
+pitch angles or for the "inside" beams when ships mak)108 350.4 R 3.448
+(es)-.1 G .948(harp turns\). The)-3.448 F .914
+(second algorithm constructs a triangular netw)108 362.4 R .914
+(ork from the a)-.1 F -.25(va)-.2 G .914
+(ilable soundings and contours the netw).25 F(ork;)-.1 E .079
+(this approach is complicated and therefore slo)108 374.4 R 2.579(wb)
+-.25 G .08(ut produces good looking contours under most conditions.)
+-2.779 F .832(The contour le)108 386.4 R -.15(ve)-.25 G 3.332(ls and).15
+F .831(colors can be controlled directly or set implicitly using contou\
+r and color change)3.332 F(interv)108 398.4 Q 2.5(als. Contours)-.25 F
+(can also be set to ha)2.5 E .3 -.15(ve t)-.2 H(icks pointing do).15 E
+(wnhill.)-.25 E .652(Shiptracks can also be plotted using the)108 422.4
+R F2<ad44>3.152 E F0(,)A F2<ad47>3.152 E F0 3.152(,a)C(nd)-3.152 E F2
+<ad4d>3.152 E F0 .652(options. The)3.152 F F2<ad44>3.152 E F0 .653
 (option controls the basic track)3.152 F .592
 (plotting, including time annotation. The)108 434.4 R F2<ad47>3.091 E F0
 .591(option causes the start of each sw)3.091 F .591
@@ -306,381 +306,398 @@ F .571(plotting without the performance penalty of)108 554.4 R F2
 F -.15(ve)-.25 G 3.07(nt).15 G .57(hose with)-3.07 F .537(no rele)108
 566.4 R -.15(ve)-.25 G .537(nt data. W).15 F 3.037(er)-.8 G .537
 (ecommend that users maintain a ".inf" \214le for each sw)-3.037 F .538
-(ath data \214le used for gridding)-.1 F(or plotting. The programs)108
-578.4 Q F2(mbswath)2.5 E F0(and)2.5 E F2(mbgrid)2.5 E F0
-(also use ".inf" \214les in the same f)2.5 E(ashion.)-.1 E F1 -.548(AU)
-72 607.2 S(THORSHIP).548 E F0(Da)108 619.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 631.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 643.2 Q
-(Lamont-Doherty Earth Observ)113 655.2 Q(atory)-.25 E F1(OPTIONS)72 684
-Q F2<ad41>108 696 Q F3
-(cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt/lab_spacing)23.08 E F0
-.838(If speci\214c contour le)144 708 R -.15(ve)-.25 G .838
-(ls are not speci\214ed with the).15 F F3(-C)3.337 E F0 .837
-(option, then contours will be generated in)3.337 F .956
-(four colors \(black, red, green, and blue\) with interv)144 720 R .956
-(als, annotations, and tickmarks controlled by)-.25 F(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
+(ath data \214le used for gridding)-.1 F(or plotting. The)108 578.4 Q F2
+(GMT)2.5 E F0(modules)2.5 E F2(mbswath)2.5 E F0(and)2.5 E F2(mbgrid)2.5
+E F0(also use ".inf" \214les in the same f)2.5 E(ashion.)-.1 E .307
+(In order for)108 602.4 R F2(GMT)2.807 E F0 .307(to successfully e)2.807
+F -.15(xe)-.15 G(cute).15 E F2(mbcontour)2.807 E F0 2.807(,t)C .306
+(he location of the shared library)-2.807 F F3(libmbgmt)2.806 E F0
+(contain-)2.806 E 1.53(ing this module must be kno)108 614.4 R 1.53
+(wn to)-.25 F F2(GMT)4.031 E F0 6.531(.T)C 1.531
+(his can be accomplished by either setting the GMT_CUS-)-6.531 F -.18
+(TO)108 626.4 S .375(M_LIBS parameter in the \214le gmt.conf that is pa\
+rt of the GMT installation, by setting this parameter in).18 F .335
+(the \214le gmt.conf in the user')108 638.4 R 2.835(sh)-.55 G .335
+(ome directory)-2.835 F 2.835(,o)-.65 G 2.835(rb)-2.835 G 2.835(yu)
+-2.835 G .335(sing the GMT module)-2.835 F F2(gmtset)2.835 E F0 .335
+(to modify this parame-)2.835 F .853(ter in the current w)108 650.4 R
+.853(orking directory)-.1 F 3.353(.I)-.65 G .853(f, for instance, the)
+-3.353 F F3(libmbgmt)3.353 E F0 .853
+(shared library has been installed in the)3.353 F
+(\214le /usr/lib/libmbgmt.dylib, then the GMT_CUST)108 662.4 Q
+(OM_LIBS parameter in a gmt.conf \214le can be set to:)-.18 E(GMT_CUST)
+128 674.4 Q(OM_LIBS = /usr/lib/libmbgmt.dylib)-.18 E F1 -.548(AU)72
+703.2 S(THORSHIP).548 E F0(Da)108 715.2 Q(vid W)-.2 E 2.5(.C)-.92 G
+(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 727.2 Q 2.5(yB)
+-.15 G(ay Aquarium Research Institute)-2.5 E(MB-System 5.0)72 768 Q 2.5
+(5F)137.61 G(ebruary 2015)-2.5 E(1)195.95 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F .55(these parameters.)144 84 R .549
-(Contours will be generated at in)5.55 F -.15(ve)-.4 G(rv).15 E .549
-(als of)-.25 F/F1 10/Times-Italic at 0 SF(cont_int)3.049 E F0 3.049
-(meters. Color)3.049 F .549(changes will)3.049 F .815(occur at interv)
-144 96 R .815(als of)-.25 F F1(col_int)3.315 E F0 3.315
-(meters. Contours)3.315 F .815(will ha)3.315 F 1.116 -.15(ve d)-.2 H
--.25(ow).15 G .816(nhill f).25 F .816(acing tickmarks)-.1 F F1(tic_int)
-3.316 E F0(inches)3.316 E 2.01(long e)144 108 R -.15(ve)-.25 G(ry).15 E
-F1(tic_int)4.51 E F0 2.01(meters. Contours will ha)4.51 F 2.31 -.15
-(ve a)-.2 H(nnotations).15 E F1(label_len)4.51 E F0 2.01(inches high e)
-4.51 F -.15(ve)-.25 G(ry).15 E F1(lab_int)4.51 E F0 .531
+(5.0 mbcontour\(1\))2.5 F(Dale N. Chayes \(dale at ldeo.columbia.edu\))108
+84 Q(Lamont-Doherty Earth Observ)113 96 Q(atory)-.25 E/F1 10.95
+/Times-Bold at 0 SF(OPTIONS)72 124.8 Q/F2 10/Times-Bold at 0 SF<ad41>108 136.8
+Q/F3 10/Times-Italic at 0 SF
+(cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt/lab_spacing)23.08 E F0
+.837(If speci\214c contour le)144 148.8 R -.15(ve)-.25 G .837
+(ls are not speci\214ed with the).15 F F3(-C)3.338 E F0 .838
+(option, then contours will be generated in)3.338 F .956
+(four colors \(black, red, green, and blue\) with interv)144 160.8 R
+.956(als, annotations, and tickmarks controlled by)-.25 F .549
+(these parameters.)144 172.8 R .549(Contours will be generated at in)
+5.549 F -.15(ve)-.4 G(rv).15 E .549(als of)-.25 F F3(cont_int)3.049 E F0
+3.05(meters. Color)3.049 F .55(changes will)3.05 F .816(occur at interv)
+144 184.8 R .816(als of)-.25 F F3(col_int)3.316 E F0 3.315
+(meters. Contours)3.316 F .815(will ha)3.315 F 1.115 -.15(ve d)-.2 H
+-.25(ow).15 G .815(nhill f).25 F .815(acing tickmarks)-.1 F F3(tic_int)
+3.315 E F0(inches)3.315 E 2.01(long e)144 196.8 R -.15(ve)-.25 G(ry).15
+E F3(tic_int)4.51 E F0 2.01(meters. Contours will ha)4.51 F 2.31 -.15
+(ve a)-.2 H(nnotations).15 E F3(label_len)4.51 E F0 2.01(inches high e)
+4.51 F -.15(ve)-.25 G(ry).15 E F3(lab_int)4.51 E F0 .532
 (meters. The origins of contour labels will be separated by at least)144
-120 R F1(lab_spacing)3.032 E F0 .532(inches \(potentially)3.032 F -.15
-(ove)144 132 S 1.898(rlapping labels will be omitted\); if).15 F F1
-(lab_spacing)4.397 E F0 4.397(=0)4.397 G 1.897
-(.0 then the spacing will be de\214ned by)-4.397 F F1(lab_hgt)144 144 Q
-F0 3.121(.I)C 3.121(ff)-3.121 G -.25(ew)-3.121 G .621(er than se).25 F
--.15(ve)-.25 G 3.121(np).15 G .621(arameters are speci\214ed, the def)
--3.121 F .621(ault v)-.1 F .622(alues are used for the)-.25 F(missing)
-5.622 E 3.81(parameters. Def)144 156 R(aults:)-.1 E F1(cont_int)3.81 E
-F0 3.81(=2)3.81 G(5;)-3.81 E F1(col_int)3.81 E F0 3.809(=1)3.81 G(00;)
--3.809 E F1(tic_int)3.809 E F0 3.809(=1)3.809 G(00;)-3.809 E F1(lab_int)
-3.809 E F0 3.809(=1)3.809 G(00;)-3.809 E F1(tic_int)3.809 E F0 3.809(=0)
-3.809 G(.1;)-3.809 E F1(lab_hgt)144 168 Q F0 2.5(=0)2.5 G(.05;)-2.5 E F1
-(lab_spacing)2.5 E F0 2.5(=0)2.5 G(.0.)-2.5 E/F2 10/Times-Bold at 0 SF
-<ad42>108 184.8 Q F1(tic)23.63 E(kinfo)-.2 E F0
-(Sets map boundary tickmark interv)144 196.8 Q(als. See)-.25 E F2
-(psbasemap)2.5 E F0(for details.)2.5 E F2<ad62>108 213.6 Q F1
-(yr/mo/da/hr/mn/sc)24.74 E F0 .614(Sets the starting time for data allo)
-144 225.6 R .614
+208.8 R F3(lab_spacing)3.031 E F0 .531(inches \(potentially)3.031 F -.15
+(ove)144 220.8 S 1.897(rlapping labels will be omitted\); if).15 F F3
+(lab_spacing)4.397 E F0 4.397(=0)4.397 G 1.898
+(.0 then the spacing will be de\214ned by)-4.397 F F3(lab_hgt)144 232.8
+Q F0 3.122(.I)C 3.122(ff)-3.122 G -.25(ew)-3.122 G .622(er than se).25 F
+-.15(ve)-.25 G 3.122(np).15 G .621(arameters are speci\214ed, the def)
+-3.122 F .621(ault v)-.1 F .621(alues are used for the)-.25 F(missing)
+5.621 E 3.809(parameters. Def)144 244.8 R(aults:)-.1 E F3(cont_int)3.809
+E F0 3.809(=2)3.809 G(5;)-3.809 E F3(col_int)3.809 E F0 3.809(=1)3.809 G
+(00;)-3.809 E F3(tic_int)3.809 E F0 3.809(=1)3.809 G(00;)-3.809 E F3
+(lab_int)3.81 E F0 3.81(=1)3.81 G(00;)-3.81 E F3(tic_int)3.81 E F0 3.81
+(=0)3.81 G(.1;)-3.81 E F3(lab_hgt)144 256.8 Q F0 2.5(=0)2.5 G(.05;)-2.5
+E F3(lab_spacing)2.5 E F0 2.5(=0)2.5 G(.0.)-2.5 E F2<ad42>108 273.6 Q F3
+(tic)23.63 E(kinfo)-.2 E F0(Sets map boundary tickmark interv)144 285.6
+Q(als. See)-.25 E F2(psbasemap)2.5 E F0(for details.)2.5 E F2<ad62>108
+302.4 Q F3(yr/mo/da/hr/mn/sc)24.74 E F0 .614
+(Sets the starting time for data allo)144 314.4 R .614
 (wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 237.6 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad43>108 254.4 Q F1
+(will be ignored.)144 326.4 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)
+2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad43>108 343.2 Q F3
 (contour\214le)23.08 E F0 .451
-(Sets the \214le from which the contour le)144 266.4 R -.15(ve)-.25 G
-.451(ls and their style and color are read.).15 F .451
-(This \214le consists of)5.451 F(lines in the format:)144 278.4 Q F1(le)
-154 290.4 Q(vel label tic)-.15 E 2.5(kr)-.2 G(ed gr)-2.87 E(een blue)
--.37 E F0(where)144 302.4 Q F1(le)2.812 E(vel)-.15 E F0 .312
-(is the depth v)2.812 F .313(alue to be contoured in meters,)-.25 F F1
-(label)2.813 E F0 .313(is either 'a' for annotated or 'n' for)2.813 F
-.332(not annotated,)144 314.4 R F1(tic)2.832 E(k)-.2 E F0 .332
+(Sets the \214le from which the contour le)144 355.2 R -.15(ve)-.25 G
+.451(ls and their style and color are read.).15 F .452
+(This \214le consists of)5.451 F(lines in the format:)144 367.2 Q F3(le)
+154 379.2 Q(vel label tic)-.15 E 2.5(kr)-.2 G(ed gr)-2.87 E(een blue)
+-.37 E F0(where)144 391.2 Q F3(le)2.813 E(vel)-.15 E F0 .313
+(is the depth v)2.813 F .313(alue to be contoured in meters,)-.25 F F3
+(label)2.813 E F0 .312(is either 'a' for annotated or 'n' for)2.813 F
+.332(not annotated,)144 403.2 R F3(tic)2.832 E(k)-.2 E F0 .332
 (is either ')2.832 F .332
-(t' for tick marks or 'n' for no tick marks, and)-.18 F F1 -.37(re)2.832
-G(d).37 E F0(,)A F1(gr)2.832 E(een)-.37 E F0 2.832(,a)C(nd)-2.832 E F1
-(blue)2.832 E F0(set)2.832 E .346
-(the color of the contour lines \(these v)144 326.4 R .347
+(t' for tick marks or 'n' for no tick marks, and)-.18 F F3 -.37(re)2.832
+G(d).37 E F0(,)A F3(gr)2.832 E(een)-.37 E F0 2.832(,a)C(nd)-2.832 E F3
+(blue)2.832 E F0(set)2.832 E .347
+(the color of the contour lines \(these v)144 415.2 R .347
 (alues can range from 0 to 255\). If a GMT cpt \214le is gi)-.25 F -.15
-(ve)-.25 G 2.847(na).15 G(s)-2.847 E(the)144 338.4 Q F1(contour\214le)
-2.678 E F0 2.678(,t)C .177(he color boundaries speci\214ed in the cpt \
-\214le will be interpreted as contour le)-2.678 F -.15(ve)-.25 G .177
-(ls to).15 F 1.808(be plotted with unannotated, untick)144 350.4 R 1.808
-(ed, black contours.)-.1 F 1.809(If contours are speci\214ed using the)
-6.808 F F2<ad43>4.309 E F0(option, then an)144 362.4 Q 2.5(yu)-.15 G
+(ve)-.25 G 2.846(na).15 G(s)-2.846 E(the)144 427.2 Q F3(contour\214le)
+2.677 E F0 2.677(,t)C .178(he color boundaries speci\214ed in the cpt \
+\214le will be interpreted as contour le)-2.677 F -.15(ve)-.25 G .178
+(ls to).15 F 1.809(be plotted with unannotated, untick)144 439.2 R 1.809
+(ed, black contours.)-.1 F 1.808(If contours are speci\214ed using the)
+6.808 F F2<ad43>4.308 E F0(option, then an)144 451.2 Q 2.5(yu)-.15 G
 (se of the)-2.5 E F2<ad41>2.5 E F0(option will be ignored.)2.5 E F2
-<ad44>108 379.2 Q F1(time_tic)23.08 E(k/time_annot/date_annot/time_tic)
--.2 E(k_len)-.2 E F0 1.365(Sets the parameters go)144 391.2 R -.15(ve)
--.15 G 1.365(rning the annotation of the shiptrack.).15 F -.35(Ti)6.365
-G 1.365(me marks are made with "X").35 F .089
-(marks along the shiptrack; annotated time marks sho)144 403.2 R 2.589
-(wt)-.25 G .09(he time in HH:MM format ne)-2.589 F .09(xt to the time)
--.15 F .747(mark and annotated date marks sho)144 415.2 R 3.247(wt)-.25
-G .747(he time and julian day in HH:MM/DDD format.)-3.247 F .746
-(The "X")5.746 F 1.522(marks are)144 427.2 R F1(time_tic)4.022 E(k_len)
--.2 E F0 1.522(inches high for normal time marks and 1.5 times)4.022 F
-F1(time_tic)4.023 E(k_len)-.2 E F0(inches)4.023 E .429
-(high for annotated time or date marks.)144 439.2 R .429(The interv)
-5.429 F .429(al of time ticks, annotated time ticks, and anno-)-.25 F
-3.234(tated date ticks are gi)144 451.2 R -.15(ve)-.25 G 5.734(ni).15 G
-5.734(nh)-5.734 G 3.234(ours by)-5.734 F F1(time_tic)5.734 E(k)-.2 E F0
-(,)A F1(time_annot)5.734 E F0 5.734(,a)C(nd)-5.734 E F1(date_annot)5.735
-E F0 5.735(,r)C(especti)-5.735 E -.15(ve)-.25 G(ly).15 E(.)-.65 E(Def)
-144 463.2 Q(aults:)-.1 E F1(time_tic)2.5 E(k)-.2 E F0 2.5(=0)2.5 G(.25;)
--2.5 E F1(time_annot)2.5 E F0 2.5(=1)2.5 G(.0;)-2.5 E F1(date_annot)2.5
-E F0 2.5(=4)2.5 G(.0;)-2.5 E F1(time_tic)2.5 E(k_len)-.2 E F0 2.5(=0)2.5
-G(.1.)-2.5 E F2<ad45>108 480 Q F1(yr/mo/da/hr/mn/sc)23.63 E F0 .287
-(Sets the ending time for data allo)144 492 R .287
+<ad44>108 468 Q F3(time_tic)23.08 E(k/time_annot/date_annot/time_tic)-.2
+E(k_len)-.2 E F0 1.365(Sets the parameters go)144 480 R -.15(ve)-.15 G
+1.365(rning the annotation of the shiptrack.).15 F -.35(Ti)6.365 G 1.365
+(me marks are made with "X").35 F .09
+(marks along the shiptrack; annotated time marks sho)144 492 R 2.589(wt)
+-.25 G .089(he time in HH:MM format ne)-2.589 F .089(xt to the time)-.15
+F .746(mark and annotated date marks sho)144 504 R 3.247(wt)-.25 G .747
+(he time and julian day in HH:MM/DDD format.)-3.247 F .747(The "X")5.747
+F 1.523(marks are)144 516 R F3(time_tic)4.023 E(k_len)-.2 E F0 1.522
+(inches high for normal time marks and 1.5 times)4.023 F F3(time_tic)
+4.022 E(k_len)-.2 E F0(inches)4.022 E .428
+(high for annotated time or date marks.)144 528 R .429(The interv)5.429
+F .429(al of time ticks, annotated time ticks, and anno-)-.25 F 3.235
+(tated date ticks are gi)144 540 R -.15(ve)-.25 G 5.734(ni).15 G 5.734
+(nh)-5.734 G 3.234(ours by)-5.734 F F3(time_tic)5.734 E(k)-.2 E F0(,)A
+F3(time_annot)5.734 E F0 5.734(,a)C(nd)-5.734 E F3(date_annot)5.734 E F0
+5.734(,r)C(especti)-5.734 E -.15(ve)-.25 G(ly).15 E(.)-.65 E(Def)144 552
+Q(aults:)-.1 E F3(time_tic)2.5 E(k)-.2 E F0 2.5(=0)2.5 G(.25;)-2.5 E F3
+(time_annot)2.5 E F0 2.5(=1)2.5 G(.0;)-2.5 E F3(date_annot)2.5 E F0 2.5
+(=4)2.5 G(.0;)-2.5 E F3(time_tic)2.5 E(k_len)-.2 E F0 2.5(=0)2.5 G(.1.)
+-2.5 E F2<ad45>108 568.8 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .286
+(Sets the ending time for data allo)144 580.8 R .287
 (wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 504 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad66>108 520.8 Q F1(format)
+F(be ignored.)144 592.8 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)2.5 E
+F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad66>108 609.6 Q F3(format)
 26.97 E F0 .22(Sets the data format used if the input is read from stdi\
-n or from a \214le. If)144 532.8 R F1(format)2.72 E F0 2.72(<0)2.72 G
-2.72(,t)-2.72 G .22(hen the input)-2.72 F .008
-(\214le speci\214ed with the)144 544.8 R F2<ad49>2.508 E F0 .008
-(option will actually contain a list of input sw)2.508 F .007
-(ath sonar data \214les. This pro-)-.1 F .011(gram uses the)144 556.8 R
-F2(MBIO)2.511 E F0 .012(library and will read or write an)2.511 F 2.512
+n or from a \214le. If)144 621.6 R F3(format)2.72 E F0 2.72(<0)2.72 G
+2.72(,t)-2.72 G .22(hen the input)-2.72 F .007
+(\214le speci\214ed with the)144 633.6 R F2<ad49>2.507 E F0 .008
+(option will actually contain a list of input sw)2.508 F .008
+(ath sonar data \214les. This pro-)-.1 F .012(gram uses the)144 645.6 R
+F2(MBIO)2.512 E F0 .012(library and will read or write an)2.512 F 2.512
 (ys)-.15 G -.1(wa)-2.512 G .012(th sonar format supported by).1 F F2
-(MBIO)2.512 E F0 2.512(.A)C 1.297(list of the sw)144 568.8 R 1.297
+(MBIO)2.511 E F0 2.511(.A)C 1.296(list of the sw)144 657.6 R 1.297
 (ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
-1.296(and their identi\214er v)3.796 F 1.296(alues is)-.25 F(gi)144
-580.8 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
-E F0(manual page. Def)2.5 E(ault:)-.1 E F1(format)2.5 E F0 2.5<3dad>2.5
-G(1.)-2.5 E F2<ad46>108 597.6 Q F1 -.37(re)24.19 G(d/gr).37 E(een/blue)
--.37 E F0(Sets the color used for Frame and annotation. [Def)144 609.6 Q
-(ault is black])-.1 E F2<ad47>108 626.4 Q F1(name_hgt[/name_perp])22.52
-E F0 -.45(Tu)144 638.4 S .958(rns on sw).45 F .958
-(ath \214le name annotation. The)-.1 F F1(name_hgt)3.459 E F0 .959
-(parameter sets the height of the lettering in)3.459 F .16
-(inches. By def)144 650.4 R .159
-(ault, the \214le name will be plotted along the shiptrack. If the)-.1 F
-F1(name_perp)2.659 E F0 .159(parameter is)2.659 F(gi)144 662.4 Q -.15
-(ve)-.25 G 2.559(na).15 G 2.559(s1)-2.559 G 2.559(,t)-2.559 G .059(hen \
-the \214le name will be plotted perpendicular to the shiptrack. The)
--2.559 F F2<ad47>2.56 E F0 .06(option implies)2.56 F .635
-(track plotting, so if the)144 674.4 R F2<ad44>3.135 E F0 .634(option i\
-s not also speci\214ed, then track plotting will be turned on with)3.135
-F(def)144 686.4 Q(ault parameters.)-.1 E(Def)5 E(ault:)-.1 E F1
-(name_hgt)2.5 E F0 2.5(=0)2.5 G(.1.)-2.5 E F2<ad48>108 703.2 Q F0 .162(\
-This "help" \215ag cause the program to print out a description of its \
-operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144 715.2 Q
-(.)-.65 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
+1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144
+669.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
+E F0(manual page. Def)2.5 E(ault:)-.1 E F3(format)2.5 E F0 2.5<3dad>2.5
+G(1.)-2.5 E F2<ad46>108 686.4 Q F3 -.37(re)24.19 G(d/gr).37 E(een/blue)
+-.37 E F0(Sets the color used for Frame and annotation. [Def)144 698.4 Q
+(ault is black])-.1 E F2<ad47>108 715.2 Q F3(name_hgt[/name_perp])22.52
+E F0 -.45(Tu)144 727.2 S .959(rns on sw).45 F .959
+(ath \214le name annotation. The)-.1 F F3(name_hgt)3.459 E F0 .958
+(parameter sets the height of the lettering in)3.459 F(MB-System 5.0)72
+768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(2)195.95 E 0 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad49>108 84 Q/F2 10
-/Times-Italic at 0 SF(in\214le)26.41 E F0 .468
-(Sets the input \214lename. If)144 96 R F2(format)2.967 E F0 2.967(>0\()
-2.967 G .467(set with the)-2.967 F F1<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .467(ath sonar data contained)-.1 F(in)144
-108 Q F2(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F2
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F2
+(5.0 mbcontour\(1\))2.5 F .159(inches. By def)144 84 R .159
+(ault, the \214le name will be plotted along the shiptrack. If the)-.1 F
+/F1 10/Times-Italic at 0 SF(name_perp)2.66 E F0 .16(parameter is)2.66 F(gi)
+144 96 Q -.15(ve)-.25 G 2.56(na).15 G 2.56(s1)-2.56 G 2.56(,t)-2.56 G
+.059(hen the \214le name will be plotted perpendicular to the shiptrack\
+. The)-2.56 F/F2 10/Times-Bold at 0 SF<ad47>2.559 E F0 .059(option implies)
+2.559 F .634(track plotting, so if the)144 108 R F2<ad44>3.134 E F0 .635
+(option is not also speci\214ed, then track plotting will be turned on \
+with)3.134 F(def)144 120 Q(ault parameters.)-.1 E(Def)5 E(ault:)-.1 E F1
+(name_hgt)2.5 E F0 2.5(=0)2.5 G(.1.)-2.5 E F2<ad48>108 136.8 Q F0 .162(\
+This "help" \215ag cause the program to print out a description of its \
+operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 148.8 Q
+(.)-.65 E F2<ad49>108 165.6 Q F1(in\214le)26.41 E F0 .467
+(Sets the input \214lename. If)144 177.6 R F1(format)2.967 E F0 2.967
+(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
+(option\) then the sw)2.967 F .468(ath sonar data contained)-.1 F(in)144
+189.6 Q F1(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F1
+(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F1
 (in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .869(list of the input sw)144 120 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .868
-(The program will read)5.869 F .194
-(and plot the data in each one of these \214les.)144 132 R .195(In the)
-5.195 F F2(in\214le)2.695 E F0 .195
-(\214le, each data \214le should be follo)2.695 F .195(wed by a)-.25 F
-(data format identi\214er)144 144 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)154 156 Q(data\214le2 24)154 168 Q .03
-(This program uses the)144 180 R F1(MBIO)2.53 E F0 .029
-(library and will read an)2.53 F 2.529(ys)-.15 G -.1(wa)-2.529 G .029
-(th sonar format supported by).1 F F1(MBIO)2.529 E F0 2.529(.A)C 1.296
-(list of the sw)144 192 R 1.297
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144 204
-Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page.)2.5 E .706(An input data\214le may be accompanied by a "f)
-144 216 R .706(ast bath)-.1 F .706(ymetry" or "fbt" \214le and by a "f)
--.05 F .705(ast na)-.1 F(vig)-.2 E(a-)-.05 E .202(tion" or "fn)144 228 R
-.202(v" \214le. The "fbt" and "fn)-.4 F .203(v" \214le naming con)-.4 F
--.15(ve)-.4 G .203(ntion is to add the ".fbt" or ".fbt" suf).15 F .203
-(\214x to)-.25 F 1.057(the original sw)144 240 R 1.057
-(ath data \214lename.)-.1 F 1.056(An "fbt" \214le contains only sw)6.057
-F 1.056(ath bath)-.1 F 1.056(ymetry information in a)-.05 F 1.17
+2.937 F .868(list of the input sw)144 201.6 R .869
+(ath sonar data \214les to be processed and their formats.)-.1 F .869
+(The program will read)5.869 F .195
+(and plot the data in each one of these \214les.)144 213.6 R .195
+(In the)5.195 F F1(in\214le)2.695 E F0 .195
+(\214le, each data \214le should be follo)2.695 F .194(wed by a)-.25 F
+(data format identi\214er)144 225.6 Q 2.5(,e)-.4 G(.g.:)-2.5 E
+(data\214le1 11)154 237.6 Q(data\214le2 24)154 249.6 Q .029
+(This program uses the)144 261.6 R F2(MBIO)2.529 E F0 .029
+(library and will read an)2.529 F 2.529(ys)-.15 G -.1(wa)-2.529 G .03
+(th sonar format supported by).1 F F2(MBIO)2.53 E F0 2.53(.A)C 1.297
+(list of the sw)144 273.6 R 1.297
+(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
+1.296(and their identi\214er v)3.796 F 1.296(alues is)-.25 F(gi)144
+285.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
+E F0(manual page.)2.5 E .706
+(An input data\214le may be accompanied by a "f)144 297.6 R .706
+(ast bath)-.1 F .706(ymetry" or "fbt" \214le and by a "f)-.05 F .706
+(ast na)-.1 F(vig)-.2 E(a-)-.05 E .203(tion" or "fn)144 309.6 R .203
+(v" \214le. The "fbt" and "fn)-.4 F .203(v" \214le naming con)-.4 F -.15
+(ve)-.4 G .202(ntion is to add the ".fbt" or ".fbt" suf).15 F .202
+(\214x to)-.25 F 1.056(the original sw)144 321.6 R 1.056
+(ath data \214lename.)-.1 F 1.056(An "fbt" \214le contains only sw)6.056
+F 1.057(ath bath)-.1 F 1.057(ymetry information in a)-.05 F 1.171
 (compact format \(format 71\), and is thus quick to read. In the e)144
-252 R -.15(ve)-.25 G 1.171(nt that bath).15 F 1.171(ymetry contours is)
--.05 F .073(being generated,)144 264 R F1(mbcontour)2.573 E F0 .073
+333.6 R -.15(ve)-.25 G 1.17(nt that bath).15 F 1.17(ymetry contours is)
+-.05 F .072(being generated,)144 345.6 R F2(mbcontour)2.573 E F0 .073
 (will attempt to read an "fbt" \214le in lieu of the original data.)
-2.573 F .072(An "fn)5.073 F(v")-.4 E 1.46(\214le contains only na)144
-276 R(vig)-.2 E 1.461(ation information in a compact ASCII format \(for\
-mat 166\), and is thus)-.05 F -2.15 -.25(ev e)144 288 T 2.789(nq).25 G
-(uick)-2.789 E .289(er to read.)-.1 F(When)5.288 E F1(mbcontour)2.788 E
+2.573 F .073(An "fn)5.073 F(v")-.4 E 1.461(\214le contains only na)144
+357.6 R(vig)-.2 E 1.461(ation information in a compact ASCII format \(f\
+ormat 166\), and is thus)-.05 F -2.15 -.25(ev e)144 369.6 T 2.788(nq).25
+G(uick)-2.788 E .288(er to read.)-.1 F(When)5.288 E F2(mbcontour)2.788 E
 F0 .288(is only generating a shiptrack plot, it will attempt to read)
-2.788 F(an "fn)144 300 Q(v" \214le in lieu of the original data.)-.4 E
-(Def)144 312 Q(ault:)-.1 E F2(in\214le)2.5 E F0 2.5(=")2.5 G(stdin".)
--2.5 E F1<ad4a>108 328.8 Q F0 .959
-(Selects the map projection. Scale is inch/de)25.3 F .959
-(gree, 1:xxxxx.)-.15 F .96(or width in inches \(upper case modi-)5.959 F
-(\214er\).)144 340.8 Q F1(CYLINDRICAL PR)144 364.8 Q(OJECTIONS:)-.3 E
-(\255Jc)144 388.8 Q F2(lon0/lat0/scale)A F0(\(Cassini\))2.5 E F1(\255Jm)
-144 400.8 Q F2(scale)A F0(\(Mercator\))2.5 E F1<ad4a>144 412.8 Q(oa)-.15
-E F2(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 424.8 Q
-(ob)-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 436.8 Q(oc)-.15 E F2
+2.788 F(an "fn)144 381.6 Q(v" \214le in lieu of the original data.)-.4 E
+F2<ad4a>108 410.4 Q F0 .96(Selects the map projection. Scale is inch/de)
+25.3 F .959(gree, 1:xxxxx.)-.15 F .959
+(or width in inches \(upper case modi-)5.959 F(\214er\).)144 422.4 Q F2
+(CYLINDRICAL PR)144 446.4 Q(OJECTIONS:)-.3 E(\255Jc)144 470.4 Q F1
+(lon0/lat0/scale)A F0(\(Cassini\))2.5 E F2(\255Jm)144 482.4 Q F1(scale)A
+F0(\(Mercator\))2.5 E F2<ad4a>144 494.4 Q(oa)-.15 E F1
+(lon0/lat0/azimuth/scale)A F0
+(\(Oblique Mercator \255 point and azimuth\))2.5 E F2<ad4a>144 506.4 Q
+(ob)-.15 E F1(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
+2.5 E 2.5(op)-.1 G(oints\))-2.5 E F2<ad4a>144 518.4 Q(oc)-.15 E F1
 (lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 448.8 Q F2
+(\(Oblique Mercator \255 point and pole\))2.5 E F2(\255Jq)144 530.4 Q F1
 (lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 460.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 472.8 Q(u)-.15 E F2(zone/scale)A F0
+(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F2
+(\255Jt)144 542.4 Q F1(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
+(erse Mercator\))-.15 E F2<ad4a>144 554.4 Q(u)-.15 E F1(zone/scale)A F0
 (\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 484.8 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 508.8 Q
-(OJECTIONS:)-.3 E<ad4a>144 532.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F1<ad4a>144 544.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F1(\255Jg)144 556.8 Q F2(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F1(\255Js)144 568.8 Q F2(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F1(CONIC PR)144 592.8 Q(OJECTIONS:)-.3
-E(\255Jb)144 616.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F1(\255Jl)144 628.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F1(MISCELLANEOUS PR)144 652.8 Q(OJECTIONS:)-.3 E(\255Jh)144 676.8 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 688.8 Q F2(lon0/scale)A
-F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 700.8 Q F2(lon0/scale)A F0(\(Eck)
-2.5 E(ert VI\))-.1 E F1(\255Jn)144 712.8 Q F2(lon0/scale)A F0
-(\(Robinson\))2.5 E F1(\255Jr)144 724.8 Q F2(lon0/scale)A F0(\(W)2.5 E
-(ink)-.4 E(el T)-.1 E(ripel\))-.35 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
+(erse Mercator\))-.15 E F2(\255Jy)144 566.4 Q F1(lon0/lats/scale)A F0
+(\(Basic Cylindrical Projection\))2.5 E F2(AZIMUTHAL PR)144 590.4 Q
+(OJECTIONS:)-.3 E<ad4a>144 614.4 Q(a)-.15 E F1(lon0/lat0/scale)A F0
+(\(Lambert\).)2.5 E F2<ad4a>144 626.4 Q(e)-.15 E F1(lon0/lat0/scale)A F0
+(\(Equidistant\).)2.5 E F2(\255Jg)144 638.4 Q F1(lon0/lat0/scale)A F0
+(\(Orthographic\).)2.5 E F2(\255Js)144 650.4 Q F1(lon0/lat0/scale)A F0
+(\(General Stereographic\))2.5 E F2(CONIC PR)144 674.4 Q(OJECTIONS:)-.3
+E(\255Jb)144 698.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
+F2(\255Jl)144 710.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
+E(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(3)195.95 E
+0 Cg EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255Jw)144 84 Q/F2 10
-/Times-Italic at 0 SF(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1
-(NON-GEOGRAPHICAL PR)144 108 Q(OJECTIONS:)-.3 E(\255Jp)144 132 Q F2
-(scale)A F0(\(Linear projection for polar \(theta,r\) coordinates\))2.5
-E F1(\255Jx)144 144 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
+(5.0 mbcontour\(1\))2.5 F/F1 10/Times-Bold at 0 SF(MISCELLANEOUS PR)144 84
+Q(OJECTIONS:)-.3 E(\255Jh)144 108 Q/F2 10/Times-Italic at 0 SF(lon0/scale)A
+F0(\(Hammer\))2.5 E F1(\255Ji)144 120 Q F2(lon0/scale)A F0
+(\(Sinusoidal\))2.5 E F1(\255Jk)144 132 Q F2(lon0/scale)A F0(\(Eck)2.5 E
+(ert VI\))-.1 E F1(\255Jn)144 144 Q F2(lon0/scale)A F0(\(Robinson\))2.5
+E F1(\255Jr)144 156 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E
+(ripel\))-.35 E F1(\255Jw)144 168 Q F2(lon0/scale)A F0(\(Moll)2.5 E
+(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144 192 Q(OJECTIONS:)-.3 E(\255Jp)
+144 216 Q F2(scale)A F0
+(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
+(\255Jx)144 228 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
 (/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
 (og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 156 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 172.8 Q F0(More)22.52 E F2 -.8(Po)2.5 G
+(More details can be found in the)144 240 Q F1(psbasemap)2.5 E F0
+(manpages.)2.5 E F1<ad4b>108 256.8 Q F0(More)22.52 E F2 -.8(Po)2.5 G
 (stScript).8 E F0(code will be appended later [Def)2.5 E
-(ault terminates the plot system].)-.1 E F1<ad4c>108 189.6 Q F2
-(lon\215ip)23.63 E F0 .459(Sets the range of the longitude v)144 201.6 R
+(ault terminates the plot system].)-.1 E F1<ad4c>108 273.6 Q F2
+(lon\215ip)23.63 E F0 .458(Sets the range of the longitude v)144 285.6 R
 .459(alues returned by the sw)-.25 F .459(ath sonar i/o routines.)-.1 F
-(If)5.458 E F2(lon\215ip)2.958 E F0 .458(=\2551 then)B .891
-(the longitude v)144 213.6 R .892
+(If)5.459 E F2(lon\215ip)2.959 E F0 .459(=\2551 then)B .892
+(the longitude v)144 297.6 R .892
 (alues will be in the range from \255360 to 0 de)-.25 F .892(grees. If)
--.15 F F2(lon\215ip)3.392 E F0 .892(=0 then the longitude)B -.25(va)144
-225.6 S .131(lues will be in the range from \255180 to 180 de).25 F .131
+-.15 F F2(lon\215ip)3.391 E F0 .891(=0 then the longitude)B -.25(va)144
+309.6 S .131(lues will be in the range from \255180 to 180 de).25 F .131
 (grees. If)-.15 F F2(lon\215ip)2.631 E F0 .131(=1 then the longitude v)B
-.131(alues will be)-.25 F(in the range from 0 to 360 de)144 237.6 Q 2.5
+.132(alues will be)-.25 F(in the range from 0 to 360 de)144 321.6 Q 2.5
 (grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4d>108 254.4 Q F2(pingnumber_tic)20.86 E
-(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len)-.2 E F0 .709
-(Sets the parameters go)144 266.4 R -.15(ve)-.15 G .709
+E F1<ad4d>108 338.4 Q F2(pingnumber_tic)20.86 E
+(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len)-.2 E F0 .71
+(Sets the parameters go)144 350.4 R -.15(ve)-.15 G .709
 (rning the pingnumber annotation of the shiptrack.).15 F -.35(Ti)5.709 G
-.71(ck marks are made).35 F .583(along the shiptrack at)144 278.4 R F2
-(pingnumber_tic)3.083 E(k)-.2 E F0(interv)3.083 E .583(als; these are)
--.25 F F2(time_tic)3.082 E(k_len)-.2 E F0 .582(inches long. Longer tick)
-3.082 F 4.113(marks are made along the shiptrack at)144 290.4 R F2
-(pingnumber_annot)6.613 E F0(interv)6.613 E 4.114
-(als; these are 1.5 times)-.25 F F2(time_tic)144 302.4 Q(k_len)-.2 E F0
+.709(ck marks are made).35 F .582(along the shiptrack at)144 362.4 R F2
+(pingnumber_tic)3.082 E(k)-.2 E F0(interv)3.082 E .582(als; these are)
+-.25 F F2(time_tic)3.083 E(k_len)-.2 E F0 .583(inches long. Longer tick)
+3.083 F 4.114(marks are made along the shiptrack at)144 374.4 R F2
+(pingnumber_annot)6.613 E F0(interv)6.613 E 4.113
+(als; these are 1.5 times)-.25 F F2(time_tic)144 386.4 Q(k_len)-.2 E F0
 .858(inches long.)3.358 F(Def)5.858 E(aults:)-.1 E F2(pingnumber_tic)
 3.358 E(k)-.2 E F0 3.358(=5)3.358 G(0;)-3.358 E F2(pingnumber_annot)
 3.358 E F0 3.358(=1)3.358 G(00;)-3.358 E F2(pingnum-)3.358 E(ber_tic)144
-314.4 Q(k_len)-.2 E F0 2.5(=0)2.5 G(.1.)-2.5 E F1<ad4e>108 331.2 Q F2
+398.4 Q(k_len)-.2 E F0 2.5(=0)2.5 G(.1.)-2.5 E F1<ad4e>108 415.2 Q F2
 (nplot)23.08 E F0 .095(Sets the number of pings to be read in before ea\
-ch contouring episode. See the description of)2.595 F(the)144 343.2 Q F1
-<ad5a>3.253 E F2(algorithm)A F0 .753(option for advice on reasonable v)
-3.253 F .753(alues Def)-.25 F(ault:)-.1 E F2(nplot)3.253 E F0 3.252(=5)
-3.253 G 3.252(0u)-3.252 G(nless)-3.252 E F1<ad5a>3.252 E F2(1)A F0 .752
-(is speci-)3.252 F(\214ed, in which case the def)144 355.2 Q(ault is)-.1
-E F2(nplot)2.5 E F0 2.5(=5)2.5 G(.)-2.5 E F1<ad4f>108 372 Q F0
+ch contouring episode. See the description of)2.596 F(the)144 427.2 Q F1
+<ad5a>3.252 E F2(algorithm)A F0 .752(option for advice on reasonable v)
+3.252 F .753(alues Def)-.25 F(ault:)-.1 E F2(nplot)3.253 E F0 3.253(=5)
+3.253 G 3.253(0u)-3.253 G(nless)-3.253 E F1<ad5a>3.253 E F2(1)A F0 .753
+(is speci-)3.253 F(\214ed, in which case the def)144 439.2 Q(ault is)-.1
+E F2(nplot)2.5 E F0 2.5(=5)2.5 G(.)-2.5 E F1<ad4f>108 456 Q F0
 (Selects Ov)22.52 E(erlay plot mode [Def)-.15 E(ault initializes a ne)
--.1 E 2.5(wp)-.25 G(lot system].)-2.5 E F1<ad50>108 388.8 Q F0
+-.1 E 2.5(wp)-.25 G(lot system].)-2.5 E F1<ad50>108 472.8 Q F0
 (Selects Portrait plotting mode [GMT Def)24.19 E
 (ault is Landscape, see gmtdef)-.1 E(aults to change this].)-.1 E F1
-<ad70>108 405.6 Q F2(pings)24.74 E F0 1.219(Sets the ping a)144 417.6 R
--.15(ve)-.2 G 1.219(raging of the input data. If).15 F F2(pings)3.719 E
-F0 3.72(=1)3.719 G 3.72(,t)-3.72 G 1.22(hen no ping a)-3.72 F -.15(ve)
--.2 G 1.22(raging is performed. If).15 F F2(pings)144 429.6 Q F0 2.652
-(>0)2.652 G 2.652(,t)-2.652 G .152
-(hen that number of input pings will be a)-2.652 F -.15(ve)-.2 G .151
-(raged to produce one output ping.).15 F(If)5.151 E F2(pings)2.651 E F0
-(=)2.651 E .313(0, then the ping a)144 441.6 R -.15(ve)-.2 G .313(ragin\
+<ad70>108 489.6 Q F2(pings)24.74 E F0 1.22(Sets the ping a)144 501.6 R
+-.15(ve)-.2 G 1.22(raging of the input data. If).15 F F2(pings)3.719 E
+F0 3.719(=1)3.719 G 3.719(,t)-3.719 G 1.219(hen no ping a)-3.719 F -.15
+(ve)-.2 G 1.219(raging is performed. If).15 F F2(pings)144 513.6 Q F0
+2.651(>0)2.651 G 2.651(,t)-2.651 G .151
+(hen that number of input pings will be a)-2.651 F -.15(ve)-.2 G .152
+(raged to produce one output ping.).15 F(If)5.152 E F2(pings)2.652 E F0
+(=)2.652 E .314(0, then the ping a)144 525.6 R -.15(ve)-.2 G .313(ragin\
 g will automatically be done so that the along-track ping spacing is eq\
-ual).15 F(to the across-track beam spacing.)144 453.6 Q(Def)5 E(ault:)
+ual).15 F(to the across-track beam spacing.)144 537.6 Q(Def)5 E(ault:)
 -.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)-.2 G
-(raging\).).15 E F1<ad51>108 470.4 Q F0 .263(Causes the program to plot\
+(raging\).).15 E F1<ad51>108 554.4 Q F0 .262(Causes the program to plot\
  the triangles constructed as part of the contouring if the "triangle a\
-lgo-)22.52 F(rithm" is speci\214ed using the)144 482.4 Q F1<ad5a>2.5 E
+lgo-)22.52 F(rithm" is speci\214ed using the)144 566.4 Q F1<ad5a>2.5 E
 F2(1)A F0(option. This allo)2.5 E(ws the data distrib)-.25 E
-(ution to be directly vie)-.2 E(wed.)-.25 E F1<ad52>108 499.2 Q F2
-(west/east/south/north)23.08 E F0 1.334
-(Sets the longitude and latitude bounds within which sw)144 511.2 R
-1.335(ath sonar data will be read and plotted.)-.1 F 2.696
-(Only the data which lies within these bounds will be read.)144 523.2 R
-(Def)7.696 E(ault:)-.1 E F2(west)5.196 E F0 2.696(=\255360, east)B F2
-(=360)A F0(,)A F2(south)144 535.2 Q F0(=\25590,)A F2(north)2.5 E F0
-(=90.)A F1<ad53>108 552 Q F2(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 564 R
-.532(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be processed. Def)144 576 Q(ault:)
--.1 E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 592.8 Q F2
-(time)23.63 E(gap)-.4 E F0 .479(Sets the maximum time g)144 604.8 R .479
-(ap in minutes between adjacent pings allo)-.05 F .478
-(wed before the data is consid-)-.25 F(ered to ha)144 616.8 Q .3 -.15
+(ution to be directly vie)-.2 E(wed.)-.25 E F1<ad52>108 583.2 Q F2
+(west/east/south/north)23.08 E F0 1.335
+(Sets the longitude and latitude bounds within which sw)144 595.2 R
+1.334(ath sonar data will be read and plotted.)-.1 F 2.696
+(Only the data which lies within these bounds will be read.)144 607.2 R
+(Def)7.696 E(ault:)-.1 E F2(west)5.197 E F0 2.697(=\255360, east)B F2
+(=360)A F0(,)A F2(south)144 619.2 Q F0(=\25590,)A F2(north)2.5 E F0
+(=90.)A F1<ad53>108 636 Q F2(speed)24.74 E F0 .532
+(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 648 R
+.531(wed in the input data; pings associated)-.25 F
+(with a smaller ship speed will not be processed. Def)144 660 Q(ault:)
+-.1 E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 676.8 Q F2
+(time)23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 688.8 R .479
+(ap in minutes between adjacent pings allo)-.05 F .479
+(wed before the data is consid-)-.25 F(ered to ha)144 700.8 Q .3 -.15
 (ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1<ad55>108 633.6 Q F0(Dra)23.08 E 2.624(wU)-.15 G
-.124(nix System time stamp on plot.)-2.624 F(Optionally)5.124 E 2.624
+(=1)2.5 G(.)-2.5 E F1<ad55>108 717.6 Q F0(Dra)23.08 E 2.625(wU)-.15 G
+.124(nix System time stamp on plot.)-2.625 F(Optionally)5.124 E 2.624
 (,a)-.65 G .124(ppend a label, or 'c' which will plot the com-)-2.624 F
-(mand string.)144 645.6 Q F1<ad56>108 662.4 Q F0(Selects v)23.08 E
-(erbose mode, which will send progress reports to stderr [Def)-.15 E
-(ault runs "silently"].)-.1 E F1<ad57>108 679.2 Q F0(Normally)20.3 E(,)
--.65 E F1(mbcontour)4.175 E F0 -.1(wo)4.175 G 1.675(rks with bath).1 F
-1.675(ymetry v)-.05 F 1.675(alues in meters.)-.25 F 1.675(If the)6.675 F
-F1<ad57>4.175 E F0 1.675(\215ag is gi)4.175 F -.15(ve)-.25 G 1.675
-(n, then).15 F F1(mbcontour)144 691.2 Q F0(will contour the bath)2.5 E
-(ymetry v)-.05 E(alues in feet.)-.25 E F1<ad5820ad59>108 708 Q F0
-(Shift origin of plot by \()7.66 E F2(x-shift,y-shift)A F0 2.5(\)i)C 2.5
-(nches [Def)-2.5 F(ault is \(1,1\) for ne)-.1 E 2.5(wp)-.25 G
-(lots, \(0,0\) for o)-2.5 E -.15(ve)-.15 G(rlays].).15 E(MB-System 5.0)
-72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
+(mand string.)144 729.6 Q(MB-System 5.0)72 768 Q 2.5(5F)137.61 G
+(ebruary 2015)-2.5 E(4)195.95 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad5a>108 84 Q/F2 10
-/Times-Italic at 0 SF(algorithm)23.63 E F0 2.486
-(Sets the contouring algorithm to be used. If)144 96 R F2(algorithm)
-4.986 E F0 2.487(=0, a simple ping to ping contouring)B .886
-(approach is used; this algorithm is f)144 108 R .885(ast b)-.1 F .885
-(ut produces poor looking contours when used with data)-.2 F .376
-(where beams from one ping may lie "behind" beams from pre)144 120 R
-.377(vious pings \(this happens for sonars)-.25 F .355(that ping at non\
-null pitch angles or for the "inside" beams when ships mak)144 132 R
-2.855(es)-.1 G .355(harp turns\).)-2.855 F(If)5.355 E F2(algo-)2.855 E
-(rithm)144 144 Q F0 .472(=1 then a triangular netw)B .472
+(5.0 mbcontour\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad56>108 84 Q F0
+(Selects v)23.08 E
+(erbose mode, which will send progress reports to stderr [Def)-.15 E
+(ault runs "silently"].)-.1 E F1<ad57>108 100.8 Q F0(Normally)20.3 E(,)
+-.65 E F1(mbcontour)4.175 E F0 -.1(wo)4.175 G 1.675(rks with bath).1 F
+1.675(ymetry v)-.05 F 1.675(alues in meters.)-.25 F 1.675(If the)6.675 F
+F1<ad57>4.175 E F0 1.675(\215ag is gi)4.175 F -.15(ve)-.25 G 1.675
+(n, then).15 F F1(mbcontour)144 112.8 Q F0(will contour the bath)2.5 E
+(ymetry v)-.05 E(alues in feet.)-.25 E F1<ad5820ad59>108 129.6 Q F0
+(Shift origin of plot by \()7.66 E/F2 10/Times-Italic at 0 SF
+(x-shift,y-shift)A F0 2.5(\)i)C 2.5(nches [Def)-2.5 F
+(ault is \(1,1\) for ne)-.1 E 2.5(wp)-.25 G(lots, \(0,0\) for o)-2.5 E
+-.15(ve)-.15 G(rlays].).15 E F1<ad5a>108 146.4 Q F2(algorithm)23.63 E F0
+2.487(Sets the contouring algorithm to be used. If)144 158.4 R F2
+(algorithm)4.986 E F0 2.486(=0, a simple ping to ping contouring)B .885
+(approach is used; this algorithm is f)144 170.4 R .885(ast b)-.1 F .886
+(ut produces poor looking contours when used with data)-.2 F .377
+(where beams from one ping may lie "behind" beams from pre)144 182.4 R
+.376(vious pings \(this happens for sonars)-.25 F .355(that ping at non\
+null pitch angles or for the "inside" beams when ships mak)144 194.4 R
+2.856(es)-.1 G .356(harp turns\).)-2.856 F(If)5.356 E F2(algo-)2.856 E
+(rithm)144 206.4 Q F0 .473(=1 then a triangular netw)B .472
 (ork is constructed from the a)-.1 F -.25(va)-.2 G .472
-(ilable soundings and this netw).25 F .473(ork is)-.1 F .838
-(in turn contoured; this algorithm is slo)144 156 R 3.338(wb)-.25 G .837
-(ut produces good looking contours in most cases. It is)-3.538 F .915(i\
-mportant to note that the time required for "triangle" algorithm increa\
-ses with the square of the)144 168 R .805
-(number of beams to be contoured; thus it is sensible to k)144 180 R
-.804(eep the number of pings contoured at a)-.1 F .395
-(time small \(e.g. use)144 192 R F1<ad4e>2.895 E F2(5)A F0 2.895
+(ilable soundings and this netw).25 F .472(ork is)-.1 F .837
+(in turn contoured; this algorithm is slo)144 218.4 R 3.337(wb)-.25 G
+.838(ut produces good looking contours in most cases. It is)-3.537 F
+.915(important to note that the time required for "triangle" algorithm \
+increases with the square of the)144 230.4 R .804
+(number of beams to be contoured; thus it is sensible to k)144 242.4 R
+.805(eep the number of pings contoured at a)-.1 F .395
+(time small \(e.g. use)144 254.4 R F1<ad4e>2.895 E F2(5)A F0 2.895
 (\). The)B .395(time required for the "ping to ping" algorithm v)2.895 F
-.395(aries linearly with)-.25 F 1.139
-(the number of pings contoured; thus lar)144 204 R 1.138
+.395(aries linearly with)-.25 F 1.138
+(the number of pings contoured; thus lar)144 266.4 R 1.139
 (ger numbers of pings may be reasonably contoured at a)-.18 F
-(time \(e.g. use)144 216 Q F1<ad4e>2.5 E F2(50)A F0 2.5(\). Def)B(ault:)
--.1 E F2(algorithm)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad23>108 232.8 Q F0
-(Speci\214es the number of plot copies. [Def)25.3 E(ault is 1])-.1 E/F3
-10.95/Times-Bold at 0 SF(EXAMPLES)72 249.6 Q F0 .792(Suppose the user has \
-a Hydrosweep data \214le in the L-DEO in-house binary format \()108
-261.6 R F1(MBIO)A F0 .792(format id 24\))3.292 F 1.022(called hs_e)108
-273.6 R 1.021(w9302_161_mn.mb24 which lies in the re)-.25 F 1.021
-(gion w/s/e/n = \25532.1874/-26.6236/54.6349/56.7536.)-.15 F(The follo)
-108 285.6 Q(wing will suf)-.25 E(\214ce to generate a traditional four)
--.25 E(-color contour plot:)-.2 E(mbcontour \255Idatalist \255Jm2.44652)
-118 297.6 Q(-R-25.7252/-23.0683/59.7415/61.0699)22.5 E 21.494
-(-Ba0.5314g0.5314 -A50.0/250.0/250.0/250.0/0.01/0.1 -p1)128 309.6 R
-1.495(\255P \255X1 \255Y1 \255K \255V > mbcon-)3.994 F(tour)108 321.6 Q
-(.ps)-.55 E(where the \214le datalist contains:)108 333.6 Q(hs_e)118
-345.6 Q(w9302_161_mn.mb24 24)-.25 E 2.581(Ap)108 357.6 S .081
-(lot including a na)-2.581 F(vig)-.2 E .081
-(ation track can also be created using)-.05 F F1(mbcontour)2.581 E F0
-5.081(.H)C .081(ere the)-5.081 F F1<ad44>2.581 E F0 .081
-(\215ag is used to add a)2.581 F .943
-(plot of the ship track annotated with time marks e)108 369.6 R -.15(ve)
--.25 G .944(ry 0.25 hours, annotated time marks e).15 F -.15(ve)-.25 G
-.944(ry hour).15 F 3.444(,a)-.4 G(nd)-3.444 E(day annotations e)108
-381.6 Q -.15(ve)-.25 G(ry four hours:).15 E 36.167
-(mbcontour \255Idatalist \255Jm2.44652)118 393.6 R
-(-R-25.7252/-23.0683/59.7415/61.0699)58.666 E 64.265
-(-Ba0.5314g0.5314":.File hs_e)108 405.6 R 84.265
+(time \(e.g. use)144 278.4 Q F1<ad4e>2.5 E F2(50)A F0 2.5(\). Def)B
+(ault:)-.1 E F2(algorithm)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad23>108
+295.2 Q F0(Speci\214es the number of plot copies. [Def)25.3 E
+(ault is 1])-.1 E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 312 Q F0 .792(Su\
+ppose the user has a Hydrosweep data \214le in the L-DEO in-house binar\
+y format \()108 324 R F1(MBIO)A F0 .791(format id 24\))3.291 F 1.021
+(called hs_e)108 336 R 1.021(w9302_161_mn.mb24 which lies in the re)-.25
+F 1.021(gion w/s/e/n = \25532.1874/-26.6236/54.6349/56.7536.)-.15 F
+(The follo)108 348 Q(wing will suf)-.25 E
+(\214ce to generate a traditional four)-.25 E(-color contour plot:)-.2 E
+(gmt mbcontour \255Idatalist \255Jm2.44652)118 360 Q
+(-R-25.7252/-23.0683/59.7415/61.0699)22.5 E 21.495
+(-Ba0.5314g0.5314 -A50.0/250.0/250.0/250.0/0.01/0.1 -p1)128 372 R 1.494
+(\255P \255X1 \255Y1 \255K \255V > mbcon-)3.995 F(tour)108 384 Q(.ps)
+-.55 E(where the \214le datalist contains:)108 396 Q(hs_e)118 408 Q
+(w9302_161_mn.mb24 24)-.25 E 2.581(Ap)108 420 S .081(lot including a na)
+-2.581 F(vig)-.2 E .081(ation track can also be created using)-.05 F F1
+(mbcontour)2.581 E F0 5.081(.H)C .081(ere the)-5.081 F F1<ad44>2.581 E
+F0 .081(\215ag is used to add a)2.581 F .944
+(plot of the ship track annotated with time marks e)108 432 R -.15(ve)
+-.25 G .943(ry 0.25 hours, annotated time marks e).15 F -.15(ve)-.25 G
+.943(ry hour).15 F 3.443(,a)-.4 G(nd)-3.443 E(day annotations e)108 444
+Q -.15(ve)-.25 G(ry four hours:).15 E 22.61
+(gmt mbcontour \255Idatalist \255Jm2.44652)118 456 R
+(-R-25.7252/-23.0683/59.7415/61.0699)45.11 E 64.265
+(-Ba0.5314g0.5314":.File hs_e)108 468 R 84.265
 (w9302_161_bmn.mb24:" -D0.25/1/4/0.1)-.25 F 20
-(-A50.0/250.0/250.0/250.0/0.01/0.1 -p1)108 417.6 R
+(-A50.0/250.0/250.0/250.0/0.01/0.1 -p1)108 480 R
 (\255P \255X1 \255Y1 \255K \255V > hs_e)2.5 E(w9302_161_bmn.mb24.ps)-.25
-E F3(SEE ALSO)72 446.4 Q F1(mbsystem)108 458.4 Q F0(\(1\),)A F1
+E F3(SEE ALSO)72 508.8 Q F1(mbsystem)108 520.8 Q F0(\(1\),)A F1
 (mbm_plot)2.5 E F0(\(1\),)A F1(mbswath)2.5 E F0(\(1\),)A F1(gmtsystem)
 2.5 E F0(\(1\),)A F1(psbasemap)2.5 E F0(\(1\),)A F1(psto24)2.5 E F0
-(\(1\))A F3 -.11(BU)72 487.2 S(GS).11 E F0(Please let us kno)108 499.2 Q
--.65(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(5)204.835 E 0 Cg EP
+(\(1\))A F3 -.11(BU)72 549.6 S(GS).11 E F0(Please let us kno)108 561.6 Q
+-.65(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5
+E(5)195.95 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbcopy.ps b/src/ps/mbcopy.ps
index fe78a2f..1046eff 100644
--- a/src/ps/mbcopy.ps
+++ b/src/ps/mbcopy.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbctdlist.ps b/src/ps/mbctdlist.ps
index d3eefad..a9e30c4 100644
--- a/src/ps/mbctdlist.ps
+++ b/src/ps/mbctdlist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbdatalist.ps b/src/ps/mbdatalist.ps
index f8932d2..196cea0 100644
--- a/src/ps/mbdatalist.ps
+++ b/src/ps/mbdatalist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:26 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbdefaults.ps b/src/ps/mbdefaults.ps
index fe7ae30..d2ffb4b 100644
--- a/src/ps/mbdefaults.ps
+++ b/src/ps/mbdefaults.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbdumpesf.ps b/src/ps/mbdumpesf.ps
index 9198ec1..c7c045b 100644
--- a/src/ps/mbdumpesf.ps
+++ b/src/ps/mbdumpesf.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -231,75 +231,112 @@ BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 140.95(mbdumpesf\(1\) MB-System)72 48 R 140.95
 (5.0 mbdumpesf\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbmask)108 96 Q F0(,)A F2(mbdumpesf)2.5 E
-F0 2.5<ad4f>2.5 G(utput te)-2.5 E(xt v)-.15 E
-(ersion of beam edits from a binary edit sa)-.15 E .3 -.15(ve \214)-.2 H
-(le.).15 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11
-E F1(SYNOPSIS)72 165.6 Q F2(mbdumpesf \255I)108 177.6 Q F0(\214le [)A F2
-<ad5620ad48>A F0(])A F1(DESCRIPTION)72 206.4 Q F0(Sw)108 218.4 Q .821
-(ath bath)-.1 F .821
+.219 E/F2 10/Times-Bold at 0 SF(mbdumpesf)108 96 Q F0 2.776<ad4f>2.776 G
+.276(utput beam edits from a binary edit sa)-2.776 F .576 -.15(ve \214)
+-.2 H .276(le, either in the binary form or as an ASCII te).15 F(xt)-.15
+E(dump.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
+(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 .888
+(mbdumpesf \255\255input=)108 189.6 R/F3 10/Times-Italic at 0 SF(\214le)A
+F0([)3.388 E F2(\255\255output=)A F3(\214le)A F2(\255\255ignor)3.388 E
+.888(e-un\215ag \255\255ignor)-.18 F .889(e-\215ag \255\255ignor)-.18 F
+.889(e-\214lter \255\255ignor)-.18 F(e-zer)-.18 E(o)-.18 E<adad76>108
+201.6 Q(erbose \255\255help)-.1 E F0(])A F1(DESCRIPTION)72 230.4 Q F0
+(Sw)108 242.4 Q .821(ath bath)-.1 F .821
 (ymetry data is typically edited either with interacti)-.05 F 1.121 -.15
 (ve t)-.25 H .821(ools such as).15 F F2(mbedit)3.32 E F0 .82
-(or automatic \214lters)3.32 F .83(such as)108 230.4 R F2(mbclean)3.33 E
+(or automatic \214lters)3.32 F .83(such as)108 254.4 R F2(mbclean)3.33 E
 F0 5.83(.I)C(n)-5.83 E F2(MB-System)3.33 E F0 3.33(,t)C .831
 (he beam \215ags are stored in binary "edit sa)-3.33 F 1.131 -.15
 (ve \214)-.2 H .831(les" \(\214le suf).15 F .831(\214x ".esf"\).)-.25 F
-(The program)108 242.4 Q F2(mbdumpesf)2.5 E F0
-(reads esf \214les and outputs each of the edit e)2.5 E -.15(ve)-.25 G
-(nts as a te).15 E(xt line to stdout.)-.15 E F1 -.548(AU)72 271.2 S
-(THORSHIP).548 E F0(Da)108 283.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 295.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 307.2 Q
-(Lamont-Doherty Earth Observ)113 319.2 Q(atory)-.25 E F1
-(MBDUMPESF OPTIONS)72 348 Q F2<ad48>108 360 Q F0 .391(This "help" \215a\
-g causes the program to print out a description of its operation and th\
-en e)22.52 F .39(xit imme-)-.15 F(diately)144 372 Q(.)-.65 E F2<ad49>108
-388.8 Q/F3 10/Times-Italic at 0 SF(\214le)26.41 E F0("Edit sa)144 400.8 Q
-.3 -.15(ve \214)-.2 H(le" from which the edit e).15 E -.15(ve)-.25 G
-(nts will be read.).15 E F2<ad56>108 417.6 Q F0(Normally)23.08 E(,)-.65
-E F2(mbdumpesf)3.147 E F0 .648(outputs one line for each edit e)3.147 F
--.15(ve)-.25 G .648(nt in the input esf \214le.).15 F .648(If the)5.648
-F F2<ad56>3.148 E F0 .648(\215ag is)3.148 F(gi)144 429.6 Q -.15(ve)-.25
-G .55(n, then).15 F F2(mbdumpesf)3.05 E F0 .55
-(also outputs the total number of each type of edit e)3.05 F -.15(ve)
--.25 G .55(nt at the end of the).15 F(listing.)144 441.6 Q F1(EXAMPLES)
-72 470.4 Q F0 5.142(Suppose one has edited a sw)108 482.4 R 5.142
+1.133(The program)108 266.4 R F2(mbdumpesf)3.633 E F0 1.132(reads and o\
+utputs esf \214les. If no output \214le is speci\214ed, then each of th\
+e edit)3.633 F -2.15 -.25(ev e)108 278.4 T .12
+(nts is written in ASCII te).25 F .12(xt as a single line to stdout. If\
+ an output \214le is speci\214ed with the)-.15 F F2(\255\255output=)2.62
+E F3(\214le)A F0(option, then the edit sa)108 290.4 Q .3 -.15(ve d)-.2 H
+(ata will be written to that \214le in binary form.).15 E
+(The four types of edit e)108 314.4 Q -.15(ve)-.25 G
+(nts supported by esf \214les are:).15 E(action=1: \215ag manually)144
+326.4 Q(action=2: un\215ag)144 338.4 Q(action=3: zero \255 mak)144 350.4
+Q 2.5(eb)-.1 G(eam null)-2.5 E(action=4: \215ag by auto\214lter)144
+362.4 Q .988(This program can be forced to ignore \(e)108 374.4 R .987
+(xclude from the output\) an)-.15 F 3.487(yo)-.15 G 3.487(ft)-3.487 G
+.987(he e)-3.487 F -.15(ve)-.25 G .987(nt types using the options).15 F
+F2(\255\255ignor)108 386.4 Q(e-un\215ag)-.18 E F0(,)A F2(\255\255ignor)
+2.5 E(e-\215ag)-.18 E F0(,)A F2(\255\255ignor)2.5 E(e-\214lter)-.18 E F0
+2.5(,a)C(nd)-2.5 E F2(\255\255ignor)2.5 E(e-zer)-.18 E(o)-.18 E F0(.)A
+F1 -.548(AU)72 415.2 S(THORSHIP).548 E F0(Da)108 427.2 Q(vid W)-.2 E 2.5
+(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 439.2 Q
+2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 451.2 Q
+(Lamont-Doherty Earth Observ)113 463.2 Q(atory)-.25 E F1
+(MBDUMPESF OPTIONS)72 492 Q F2(\255\255input=)108 504 Q F3(\214le)A F0
+("Edit sa)144 516 Q .3 -.15(ve \214)-.2 H
+(le" \(esf \214le\) from which the edit e).15 E -.15(ve)-.25 G
+(nts will be read.).15 E F2(\255\255output=)108 532.8 Q F3(\214le)A F0
+.381(Speci\214es output esf \214le. If this option is not used, then th\
+e edit e)144 544.8 R -.15(ve)-.25 G .381
+(nt stream will be output to std-).15 F(out as a sequence of ASCII te)
+144 556.8 Q(xt lines.)-.15 E F2(\255\255ignor)108 573.6 Q(e-un\215ag)
+-.18 E F0(Causes)144 585.6 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
+E 2.5(yu)-.15 G(n\215ag edit e)-2.5 E -.15(ve)-.25 G
+(nts read from the input.).15 E F2(\255\255ignor)108 602.4 Q(e-\215ag)
+-.18 E F0(Causes)144 614.4 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
+E 2.5<798d>-.15 G(ag edit e)-2.5 E -.15(ve)-.25 G
+(nts read from the input.).15 E F2(\255\255ignor)108 631.2 Q(e-\214lter)
+-.18 E F0(Causes)144 643.2 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
+E 2.5<798c>-.15 G(lter edit e)-2.5 E -.15(ve)-.25 G
+(nts read from the input.).15 E F2(\255\255ignor)108 660 Q(e-zer)-.18 E
+(o)-.18 E F0(Causes)144 672 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
+E 2.5(yz)-.15 G(ero edit e)-2.5 E -.15(ve)-.25 G
+(nts read from the input.).15 E F2<adad76>108 688.8 Q(erbose)-.1 E F0
+(Normally)144 700.8 Q(,)-.65 E F2(mbdumpesf)3.064 E F0 .564
+(outputs one line for each edit e)3.064 F -.15(ve)-.25 G .564
+(nt in the input esf \214le.).15 F .563(If the \255\255v)5.563 F(erbose)
+-.15 E .487(\215ag is gi)144 712.8 R -.15(ve)-.25 G .487(n, then).15 F
+F2(mbdumpesf)2.987 E F0 .488
+(also outputs the total number of each type of edit e)2.988 F -.15(ve)
+-.25 G .488(nt at the end).15 F(of the listing.)144 724.8 Q
+(MB-System 5.0)72 768 Q 2.5(3M)146.495 G(ay 2015)-2.5 E(1)204.835 E 0 Cg
+EP
+%%Page: 2 2
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 140.95(mbdumpesf\(1\) MB-System)72 48 R 140.95
+(5.0 mbdumpesf\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255\255help)108 84 Q F0
+.391(This "help" \215ag causes the program to print out a description o\
+f its operation and then e)6.26 F .39(xit imme-)-.15 F(diately)144 96 Q
+(.)-.65 E/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 124.8 Q F0 5.142
+(Suppose one has edited a sw)108 136.8 R 5.142
 (ath \214le 20080422_222636.mb88, resulting in an esf \214le named)-.1 F
-(20080422_222636.mb88.esf. T)108 494.4 Q 2.5(od)-.8 G(ump the edit e)
--2.5 E -.15(ve)-.25 G(nts as a te).15 E(xt stream, use)-.15 E F2
+(20080422_222636.mb88.esf. T)108 148.8 Q 2.5(od)-.8 G(ump the edit e)
+-2.5 E -.15(ve)-.25 G(nts as a te).15 E(xt stream, use)-.15 E F1
 (mbdumpesf)2.5 E F0(:)A(mbdumpesf \255I 20080422_222636.mb88.esf)144
-506.4 Q(The output will look something lik)108 518.4 Q(e:)-.1 E(EDITS R\
+160.8 Q(The output will look something lik)108 172.8 Q(e:)-.1 E(EDITS R\
 EAD: i:0 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:21 acti\
-on:1)108 542.4 Q(EDITS READ: i:1 time: 947562291.799000 2008/04/22 22:2\
-6:36.799000 beam:22 action:1)108 554.4 Q(EDITS READ: i:2 time: 94756229\
-1.799000 2008/04/22 22:26:36.799000 beam:23 action:1)108 566.4 Q(EDITS \
+on:1)108 196.8 Q(EDITS READ: i:1 time: 947562291.799000 2008/04/22 22:2\
+6:36.799000 beam:22 action:1)108 208.8 Q(EDITS READ: i:2 time: 94756229\
+1.799000 2008/04/22 22:26:36.799000 beam:23 action:1)108 220.8 Q(EDITS \
 READ: i:3 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:24 act\
-ion:1)108 578.4 Q(EDITS READ: i:4 time: 947562291.799000 2008/04/22 22:\
-26:36.799000 beam:25 action:1)108 590.4 Q(EDITS READ: i:5 time: 9475622\
-91.799000 2008/04/22 22:26:36.799000 beam:26 action:1)108 602.4 Q(EDITS\
+ion:1)108 232.8 Q(EDITS READ: i:4 time: 947562291.799000 2008/04/22 22:\
+26:36.799000 beam:25 action:1)108 244.8 Q(EDITS READ: i:5 time: 9475622\
+91.799000 2008/04/22 22:26:36.799000 beam:26 action:1)108 256.8 Q(EDITS\
  READ: i:6 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:27 ac\
-tion:1)108 614.4 Q(EDITS READ: i:7 time: 947562291.799000 2008/04/22 22\
-:26:36.799000 beam:28 action:1)108 626.4 Q(Here the lar)108 650.4 Q
+tion:1)108 268.8 Q(EDITS READ: i:7 time: 947562291.799000 2008/04/22 22\
+:26:36.799000 beam:28 action:1)108 280.8 Q(Here the lar)108 304.8 Q
 (ge time v)-.18 E
 (alue is epoch seconds \(seconds since 1/1/1970\), and the edit e)-.25 E
 -.15(ve)-.25 G(nt action v).15 E(alues are:)-.25 E
-(action=1: \215ag manually)144 662.4 Q(action=2: un\215ag)144 674.4 Q
-(action=3: zero \255 mak)144 686.4 Q 2.5(eb)-.1 G(eam null)-2.5 E
-(action=4: \215ag by auto\214lter)144 698.4 Q(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 140.95(mbdumpesf\(1\) MB-System)72 48 R 140.95
-(5.0 mbdumpesf\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2
-10/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbedit)2.5 E F0
-(\(1\),)A F2(mbeditviz)2.5 E F0(\(1\), fBmbclean)A F2(\(1\), mb)A
-(unclean\(1\))-.2 E F1 -.11(BU)72 124.8 S(GS).11 E F0 -.8(To)108 136.8 S
-2.5(os).8 G(imple to ha)-2.5 E .3 -.15(ve a)-.2 H .3 -.15(ny i).15 H
-(nteresting problems.).15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
+(action=1: \215ag manually)144 316.8 Q(action=2: un\215ag)144 328.8 Q
+(action=3: zero \255 mak)144 340.8 Q 2.5(eb)-.1 G(eam null)-2.5 E
+(action=4: \215ag by auto\214lter)144 352.8 Q F2(SEE ALSO)72 381.6 Q F1
+(mbsystem)108 393.6 Q F0(\(1\),)A F1(mbedit)2.5 E F0(\(1\),)A F1
+(mbeditviz)2.5 E F0(\(1\), fBmbclean)A F1(\(1\), mb)A(unclean\(1\))-.2 E
+F2 -.11(BU)72 422.4 S(GS).11 E F0 -.8(To)108 434.4 S 2.5(os).8 G
+(imple to ha)-2.5 E .3 -.15(ve a)-.2 H .3 -.15(ny i).15 H
+(nteresting problems.).15 E(MB-System 5.0)72 768 Q 2.5(3M)146.495 G
+(ay 2015)-2.5 E(2)204.835 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbedit.ps b/src/ps/mbedit.ps
index bcce667..feb8552 100644
--- a/src/ps/mbedit.ps
+++ b/src/ps/mbedit.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbeditviz.ps b/src/ps/mbeditviz.ps
index 545585d..894fb30 100644
--- a/src/ps/mbeditviz.ps
+++ b/src/ps/mbeditviz.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbextractsegy.ps b/src/ps/mbextractsegy.ps
index e57f014..7397823 100644
--- a/src/ps/mbextractsegy.ps
+++ b/src/ps/mbextractsegy.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbfilter.ps b/src/ps/mbfilter.ps
index d660270..5300737 100644
--- a/src/ps/mbfilter.ps
+++ b/src/ps/mbfilter.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:15 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbformat.ps b/src/ps/mbformat.ps
index 7f85d55..7373f08 100644
--- a/src/ps/mbformat.ps
+++ b/src/ps/mbformat.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbgetesf.ps b/src/ps/mbgetesf.ps
index 9de8f2f..04d12cf 100644
--- a/src/ps/mbgetesf.ps
+++ b/src/ps/mbgetesf.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbgrdtiff.ps b/src/ps/mbgrdtiff.ps
index 80b9ab5..525a080 100644
--- a/src/ps/mbgrdtiff.ps
+++ b/src/ps/mbgrdtiff.ps
@@ -1,11 +1,11 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
 %%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
+%%Pages: 3
 %%PageOrder: Ascend
 %%DocumentMedia: Default 612 792 0 () ()
 %%Orientation: Portrait
@@ -231,142 +231,185 @@ BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbgrdtif)72 48 Q 150.09(f\(1\) MB-System)-.25 F
 150.09(5.0 mbgrdtif)2.5 F(f\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbgrdtiff)108 96 Q F0 2.5
-<ad67>2.5 G
-(enerates a geographically located TIFF image from a GMT grid \214le.)
--2.5 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbgrdtiff \255C)108 177.6 Q/F3 10/Times-Italic at 0
-SF(cpt\214le)A F2<ad49>2.5 E F3(gr)A(d\214le)-.37 E F2<ad4f>2.5 E F3
-(tif)A(f_\214le)-.18 E F2([\255H \255K)2.5 E F3(intens\214le)A F2
-(\255V -W])2.5 E F1(DESCRIPTION)72 206.4 Q F2(mbgrdtiff)108 218.4 Q F0
-.439(generates a TIFF image from a)2.939 F F2(GMT)2.938 E F0 .438
-(grid. The image generation is similar to that of the)2.938 F F2(GMT)
-2.938 E F0(program)108 230.4 Q F2(grdimage)2.564 E F0 2.564(.I)C 2.564
-(np)-2.564 G(articular)-2.564 E 2.564(,t)-.4 G .064
-(he color map is applied from a)-2.564 F F2(GMT)2.564 E F0 .064
-(CPT \214le, and shading o)2.564 F -.15(ve)-.15 G .065(rlay grids).15 F
-.66(may be applied.)108 242.4 R .66(The image is 8 bits per pix)5.66 F
-.659(el if the color map is a grayscale, and 24 bits per pix)-.15 F .659
-(el other)-.15 F(-)-.2 E 1.034(wise. In order to automatically generate\
- a reasonable image of a grid, use the macro)108 254.4 R F2(mbm_grdtiff)
-3.535 E F0 6.035(.T)C(he)-6.035 E(program)108 266.4 Q F2(mbgrdtiff)2.824
-E F0 .324(recognizes the coordinate system used by)2.824 F F2(mbgrid)
-2.823 E F0(or)2.823 E F2(mbmosaic)2.823 E F0 .323
-(to generate a grid \214le,)2.823 F .927(and then embeds the projection\
- and grid bounds information into the TIFF image in accordance with the)
-108 278.4 R .513(GeoTIFF standard. A number of GIS softw)108 290.4 R
-.512(are packages recognize the georeferencing information in Geo-)-.1 F
-.156(TIFF images.)108 302.4 R .156(In particular)5.156 F 2.656(,i)-.4 G
-.156(mages generated by)-2.656 F F2(mbgrdtiff)2.656 E F0 .157
-(from grids created using)2.656 F F2(mbgrid)2.657 E F0(or)2.657 E F2
-(mbmosaic)2.657 E F0 1.27(can be loaded into the GRASS, ArcInfo, ArcV)
-108 314.4 R(ie)-.6 E 2.569 -.65(w, a)-.25 H 1.269
-(nd ArcGIS GIS packages as geographically located).65 F(co)108 326.4 Q
--.15(ve)-.15 G 2.787(rages. The).15 F F2(mbgrid)2.787 E F0(and)2.787 E
-F2(mbmosaic)2.787 E F0 .288
-(manual pages each contain an appendix with a complete list of the)2.787
-F .602(projected coordinate systems that may used in grid generation. S\
-ome softw)108 338.4 R .601(are packages \(e.g. W)-.1 F .601(infrog\) do)
--.4 F 1.338(not recognize the embedded coordinate system information, a\
-nd install require a parallel "w)108 350.4 R 1.338(orld" \214le to)-.1 F
-(specify the bounds and resolution. The)108 362.4 Q F2(-W)2.5 E F0
+(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbgrdtiff)108 96 Q F0<ad>
+3.396 E F2(GMT)3.396 E F0 .896(plug-in module for generating a geograph\
+ically located GeoTIFF image from a GMT)3.396 F(grid \214le.)108 108 Q
+F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
+(SYNOPSIS)72 177.6 Q F2(gmt mbgrdtiff \255C)108 189.6 Q/F3 10
+/Times-Italic at 0 SF(cpt\214le)A F2<ad49>2.5 E F3(gr)A(d\214le)-.37 E F2
+<ad4f>2.5 E F3(tif)A(f_\214le)-.18 E F2([\255H \255K)2.5 E F3
+(intens\214le)A F2(\255V -W])2.5 E F1(DESCRIPTION)72 218.4 Q F2
+(mbgrdtiff)108 230.4 Q F0 .688
+(is a plug-in module to generate a Geographically located GeoT)3.188 F
+(if)-.35 E 3.188(fi)-.25 G .688(mage from a)-3.188 F F2(GMT)3.188 E F0
+.689(grid \214le)3.189 F(using)108 242.4 Q F2(GMT)2.64 E F0 .14
+(\(Generic Mapping T)2.64 F 2.64(ools\). Lik)-.8 F(e)-.1 E F2(mbcontour)
+2.64 E F0(and)2.64 E F2(mbswath)2.64 E F0(,)A F2(mbgrdtiff)2.64 E F0 .14
+(is fully compatible with)2.64 F(the)108 254.4 Q F2(GMT)2.935 E F0 .435
+(package v)2.935 F .435(ersion 5.)-.15 F 2.935(AG)5.435 G .435(eoTIFF i\
+mage \214le includes location, projection and scaling information.)
+-2.935 F 1.377(The image generation used by)108 266.4 R F2(mbgrdtiff)
+3.877 E F0 1.376(is identical to that of the Postscript-producing)3.877
+F F2(GMT)3.876 E F0(program)3.876 E F2(grdimage)108 278.4 Q F0 2.822(.I)
+C 2.822(np)-2.822 G(articular)-2.822 E 2.822(,t)-.4 G .323
+(he color map is applied from a)-2.822 F F2(GMT)2.823 E F0 .323
+(CPT \214le, and shading o)2.823 F -.15(ve)-.15 G .323
+(rlay grids may be).15 F 3.34(applied. The)108 290.4 R .84
+(image is 8 bits per pix)3.34 F .84
+(el if the color map is a grayscale, and 24 bits per pix)-.15 F .84
+(el otherwise. In)-.15 F .955(order to automatically generate a reasona\
+ble image of a grid, use the macro)108 302.4 R F2(mbm_grdtiff)3.456 E F0
+5.956(.T)C .956(he program)-5.956 F F2(mbgrdtiff)108 314.4 Q F0 .286
+(recognizes the coordinate system used by)2.786 F F2(mbgrid)2.786 E F0
+(or)2.786 E F2(mbmosaic)2.786 E F0 .285
+(to generate a grid \214le, and then)2.786 F .785(embeds the projection\
+ and grid bounds information into the TIFF image in accordance with the\
+ GeoTIFF)108 326.4 R 2.429(standard. A number of GIS softw)108 338.4 R
+2.429(are packages recognize the georeferencing information in GeoTIFF)
+-.1 F 3.133(images. In)108 350.4 R(particular)3.133 E 3.133(,i)-.4 G
+.633(mages generated by)-3.133 F F2(mbgrdtiff)3.133 E F0 .634
+(from grids created using)3.134 F F2(mbgrid)3.134 E F0(or)3.134 E F2
+(mbmosaic)3.134 E F0(can)3.134 E .472
+(be loaded into the GRASS, ArcInfo, ArcV)108 362.4 R(ie)-.6 E 1.772 -.65
+(w, a)-.25 H .472(nd ArcGIS GIS packages as geographically located co)
+.65 F -.15(ve)-.15 G -.2(r-).15 G 2.932(ages. The)108 374.4 R F2(mbgrid)
+2.932 E F0(and)2.932 E F2(mbmosaic)2.932 E F0 .432
+(manual pages each contain an appendix with a complete list of the pro-)
+2.932 F .432
+(jected coordinate systems that may used in grid generation. Some softw)
+108 386.4 R .431(are packages \(e.g. W)-.1 F .431(infrog\) do not)-.4 F
+.188(recognize the embedded coordinate system information, and install \
+require a parallel "w)108 398.4 R .188(orld" \214le to specify)-.1 F
+(the bounds and resolution. The)108 410.4 Q F2(-W)2.5 E F0
 (option causes a w)2.5 E(orld \214le to be generated with a ".tfw" suf)
--.1 E(\214x.)-.25 E F1 -.548(AU)72 379.2 S(THORSHIP).548 E F0(Da)108
-391.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 403.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 415.2 Q
-(Lamont-Doherty Earth Observ)113 427.2 Q(atory)-.25 E F1(OPTIONS)72 456
-Q F2<ad43>108 468 Q F0 1.072(Sets the color palette \(CPT\) \214le whic\
-h controls the color of the plot.)23.08 F 1.071
-(See documentation of the)6.072 F .329(GMT package for a complete descr\
-iption of cpt \214les. If the R, G, and B v)144 480 R .33
-(alues in the CPT \214le are)-.25 F .266(all equal for each data le)144
-492 R -.15(ve)-.25 G 2.765(l\().15 G .265
+-.1 E(\214x.)-.25 E .048(In order for)108 434.4 R F2(GMT)2.548 E F0 .048
+(to successfully e)2.548 F -.15(xe)-.15 G(cute).15 E F2(mbgrdtiff)2.547
+E F0 2.547(,t)C .047(he location of the shared library)-2.547 F F3
+(libmbgmt)2.547 E F0(containing)2.547 E 2.651(this module must be kno)
+108 446.4 R 2.651(wn to)-.25 F F2(GMT)5.151 E F0 7.651(.T)C 2.652
+(his can be accomplished by either setting the GMT_CUS-)-7.651 F -.18
+(TO)108 458.4 S .375(M_LIBS parameter in the \214le gmt.conf that is pa\
+rt of the GMT installation, by setting this parameter in).18 F .335
+(the \214le gmt.conf in the user')108 470.4 R 2.835(sh)-.55 G .335
+(ome directory)-2.835 F 2.835(,o)-.65 G 2.835(rb)-2.835 G 2.835(yu)
+-2.835 G .335(sing the GMT module)-2.835 F F2(gmtset)2.835 E F0 .335
+(to modify this parame-)2.835 F .853(ter in the current w)108 482.4 R
+.853(orking directory)-.1 F 3.353(.I)-.65 G .853(f, for instance, the)
+-3.353 F F3(libmbgmt)3.353 E F0 .853
+(shared library has been installed in the)3.353 F
+(\214le /usr/lib/libmbgmt.dylib, then the GMT_CUST)108 494.4 Q
+(OM_LIBS parameter in a gmt.conf \214le can be set to:)-.18 E(GMT_CUST)
+128 506.4 Q(OM_LIBS = /usr/lib/libmbgmt.dylib)-.18 E F1 -.548(AU)72
+535.2 S(THORSHIP).548 E F0(Da)108 547.2 Q(vid W)-.2 E 2.5(.C)-.92 G
+(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 559.2 Q 2.5(yB)
+-.15 G(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 571.2 Q
+(Lamont-Doherty Earth Observ)113 583.2 Q(atory)-.25 E F1(OPTIONS)72 612
+Q F2<ad43>108 624 Q F0 1.072(Sets the color palette \(CPT\) \214le whic\
+h controls the color of the plot.)23.08 F 1.072
+(See documentation of the)6.072 F .33(GMT package for a complete descri\
+ption of cpt \214les. If the R, G, and B v)144 636 R .329
+(alues in the CPT \214le are)-.25 F .265(all equal for each data le)144
+648 R -.15(ve)-.25 G 2.765(l\().15 G .265
 (i.e. R=G=B\), the the output TIFF image will be 8 bits per pix)-2.765 F
-.265(el. Oth-)-.15 F
-(erwise, the output TIFF image will be 24 bits per pix)144 504 Q(el.)
--.15 E F2<ad48>108 520.8 Q F0 .162(This "help" \215ag cause the program\
- to print out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 532.8 Q(.)-.65 E F2<ad49>108 549.6 Q F3
-(gr)26.41 E(d\214le)-.37 E F0 1.299
-(Sets the name of the gridded data \214le to be plotted.)144 561.6 R
-1.298(The data must be in a form acceptable to)6.298 F F2(GMT)144 573.6
-Q F0 -.15(ve)2.5 G(rsion 3 programs \(see the).15 E F2(GMT)2.5 E F0
-(Cookbook & T)2.5 E(echnical Reference\).)-.7 E F2<ad4b>108 590.4 Q F3
-(intensity_\214le)22.52 E F0 .599
-(Sets the name of the gridded data \214le containing intensity v)144
-602.4 R .599(alues to be used for shading the map.)-.25 F(Alternati)144
-614.4 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F3(gr)2.704 E(d\214le)-.37 E F0
-.204(may be a list of grid \214les \(one \214lename on each line\) to b\
-e used together)2.704 F 2.703(.I)-.55 G 2.703(fa)-2.703 G .821(list of \
-\214les is supplied, the intensity \214les must conform in order to the\
- list of data grid \214les the)144 626.4 R(y)-.15 E(will shade.)144
-638.4 Q F2<ad4f>108 655.2 Q F3 -.45(ro)22.52 G(ot).45 E F0 .423(Sets th\
-e root used to construct the \214lename of the output shellscript \()144
-667.2 R F3 -.45(ro)C(ot).45 E F0 .422(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 679.2 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 691.2 Q F3 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad56>108
-708 Q F0(Selects v)23.08 E(erbose mode [Def)-.15 E
-(ault runs "silently"].)-.1 E(MB-System 5.0)72 768 Q(28 September 2013)
-131.775 E(1)190.115 E 0 Cg EP
+.266(el. Oth-)-.15 F
+(erwise, the output TIFF image will be 24 bits per pix)144 660 Q(el.)
+-.15 E F2<ad48>108 676.8 Q F0 .162(This "help" \215ag cause the program\
+ to print out a description of its operation and then e)22.52 F .161
+(xit immedi-)-.15 F(ately)144 688.8 Q(.)-.65 E F2<ad49>108 705.6 Q F3
+(gr)26.41 E(d\214le)-.37 E F0 .235(The \214rst in)144 717.6 R -.2(vo)-.4
+G .235(cation of the).2 F F2(-I)2.735 E F3(gr)A(d\214le)-.37 E F0 .235
+(option sets the name of the gridded data \214le to be plotted.)2.735 F
+(The)5.235 E 1.95(data must be in a form acceptable to)144 729.6 R F2
+(GMT)4.45 E F0 -.15(ve)4.45 G 1.95(rsion 3 programs \(see the).15 F F2
+(GMT)4.45 E F0 1.95(Cookbook &)4.45 F(MB-System 5.0)72 768 Q 2.5(5F)
+137.61 G(ebruary 2015)-2.5 E(1)195.95 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbgrdtif)72 48 Q 150.09(f\(1\) MB-System)-.25 F
-150.09(5.0 mbgrdtif)2.5 F(f\(1\))-.25 E/F1 10/Times-Bold at 0 SF<ad57>108
-84 Q F0(The)20.3 E F1(-W)3.442 E F0 .942(option causes a "w)3.442 F .942
+150.09(5.0 mbgrdtif)2.5 F(f\(1\))-.25 E -.7(Te)144 84 S
+(chnical Reference\).).7 E/F1 10/Times-Bold at 0 SF<ad49>108 100.8 Q/F2 10
+/Times-Italic at 0 SF(intensity_\214le)26.41 E F0 .3(The second in)144
+112.8 R -.2(vo)-.4 G .3(cation of the).2 F F1(-I)2.8 E F2(gr)A(d\214le)
+-.37 E F0 .3
+(option sets the name of a gridded data \214le containing inten-)2.8 F
+.907(sity v)144 124.8 R .907(alues to be used for shading the map.)-.25
+F(Alternati)5.907 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)3.407 E
+(d\214le)-.37 E F0 .906(may be a list of grid \214les \(one)3.407 F .273
+(\214lename on each line\) to be used together)144 136.8 R 2.773(.I)-.55
+G 2.773(fal)-2.773 G .273
+(ist of \214les is supplied, the intensity \214les must con-)-2.773 F
+(form in order to the list of data grid \214les the)144 148.8 Q 2.5(yw)
+-.15 G(ill shade.)-2.5 E F1<ad4f>108 165.6 Q F2 -.45(ro)22.52 G(ot).45 E
+F0 .423(Sets the root used to construct the \214lename of the output sh\
+ellscript \()144 177.6 R F2 -.45(ro)C(ot).45 E F0 .422
+(.cmd\) and names of \214les)B .156
+(created when the shellscript is run.)144 189.6 R .157
+(Normally the name of the input grid \214le or grid \214le list is used)
+5.157 F(as the)144 201.6 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad56>108
+218.4 Q F0(Selects v)23.08 E(erbose mode [Def)-.15 E
+(ault runs "silently"].)-.1 E F1<ad57>108 235.2 Q F0(The)20.3 E F1(-W)
+3.442 E F0 .942(option causes a "w)3.442 F .942
 (orld" \214le to be generated parallel to the GeoT)-.1 F(if)-.35 E 3.441
-(fi)-.25 G .941(mage with a ".tfw")-3.441 F(suf)144 96 Q 2.893
+(fi)-.25 G .941(mage with a ".tfw")-3.441 F(suf)144 247.2 Q 2.893
 (\214x. Some softw)-.25 F 2.893(are packages \(e.g. W)-.1 F 2.894
 (infrog\) do not recognize the coordinate information)-.4 F
-(embedded in the GeoT)144 108 Q(if)-.35 E 2.5<668c>-.25 G
-(le, and look for a w)-2.5 E(orld \214le.)-.1 E/F2 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 124.8 Q F0 .405(Suppose we ha)108 136.8 R .705 -.15(ve o)
--.2 H .405(btained tw).15 F 2.905(oG)-.1 G .404(RD \214les called PunaA\
-_bath.grd and PunaA_ss.grd, both with dimensions)-2.905 F 1.424
+(embedded in the GeoT)144 259.2 Q(if)-.35 E 2.5<668c>-.25 G
+(le, and look for a w)-2.5 E(orld \214le.)-.1 E/F3 10.95/Times-Bold at 0 SF
+(EXAMPLES)72 276 Q F0 .405(Suppose we ha)108 288 R .705 -.15(ve o)-.2 H
+.405(btained tw).15 F 2.905(oG)-.1 G .404(RD \214les called PunaA_bath.\
+grd and PunaA_ss.grd, both with dimensions)-2.905 F 1.424
 (1162 x 1068. The \214le PunaA_bath.grd contains sea\215oor topograph)
-108 148.8 R 3.925(y\()-.05 G 1.425(depth v)-3.925 F 1.425(alues are ne)
+108 300 R 3.925(y\()-.05 G 1.425(depth v)-3.925 F 1.425(alues are ne)
 -.25 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 3.925(,r).15 G(anging)
 -3.925 E .253(from \2555035 m to \2551619 m\), and the \214le PunaA_ss.\
-grd contains a sidescan mosaic \(re\215ecti)108 160.8 R .253(vity v)-.25
-F .253(alues rang-)-.25 F(ing from 0 to 128 dB\). In order to generate \
-a 24 bit color TIFF image of the sea\215oor topograph)108 172.8 Q 1.3
--.65(y, w)-.05 H 2.5(eu).65 G(se:)-2.5 E(mbgrdtif)144 184.8 Q 2.5<66ad>
--.25 G 2.5(IP)-2.5 G 60.18(unaA_bath.grd -O)-2.5 F 67.62
+grd contains a sidescan mosaic \(re\215ecti)108 312 R .253(vity v)-.25 F
+.253(alues rang-)-.25 F(ing from 0 to 128 dB\). In order to generate a \
+24 bit color TIFF image of the sea\215oor topograph)108 324 Q 1.3 -.65
+(y, w)-.05 H 2.5(eu).65 G(se:)-2.5 E(gmt mbgrdtif)144 336 Q 2.5<66ad>
+-.25 G 2.5(IP)-2.5 G 42.12(unaA_bath.grd -O)-2.5 F 67.62
 (PunaA_bath.tif -C)2.5 F(bath.cpt \255V)2.5 E
 (where the color is controlled by a GMT cpt \214le bath.cpt containing:)
-108 196.8 Q 2.5(-5250 37 57)144 208.8 R(175 \2554875)2.5 E(40 127 251)5
-E 2.5(-4875 40)144 220.8 R(127 251 \2554500)2.5 E(50 190 255)5 E 2.5
-(-4500 50)144 232.8 R(190 255 \2554125 106 235 255)2.5 E
-(-4125 106 235 255 \2553750 138 236 174)144 244.8 Q
-(-3750 138 236 174 \2553375 205 255 162)144 256.8 Q
-(-3375 205 255 162 \2553000 240 236 121)144 268.8 Q
-(-3000 240 236 121 \2552625 255 189)144 280.8 Q(87)5 E(-2625 255 189)144
-292.8 Q(87 \2552250 255 161)5 E(68)5 E(-2250 255 161)144 304.8 Q
+108 348 Q 2.5(-5250 37 57)144 360 R(175 \2554875)2.5 E(40 127 251)5 E
+2.5(-4875 40)144 372 R(127 251 \2554500)2.5 E(50 190 255)5 E 2.5
+(-4500 50)144 384 R(190 255 \2554125 106 235 255)2.5 E
+(-4125 106 235 255 \2553750 138 236 174)144 396 Q
+(-3750 138 236 174 \2553375 205 255 162)144 408 Q
+(-3375 205 255 162 \2553000 240 236 121)144 420 Q
+(-3000 240 236 121 \2552625 255 189)144 432 Q(87)5 E(-2625 255 189)144
+444 Q(87 \2552250 255 161)5 E(68)5 E(-2250 255 161)144 456 Q
 (68 \2551875 255 186 133)5 E(-1875 255 186 133 \2551500 255 255 255)144
-316.8 Q(In order to generate an 8 bit grayscale TIFF image of the sides\
-can mosaic, we use:)108 328.8 Q(mbgrdtif)144 340.8 Q 2.5<66ad>-.25 G 2.5
-(IP)-2.5 G 69.62(unaA_ss.grd -O)-2.5 F 41.06(PunaA_ss.tif -C)2.5 F
+468 Q(In order to generate an 8 bit grayscale TIFF image of the sidesca\
+n mosaic, we use:)108 480 Q(gmt mbgrdtif)144 492 Q 2.5<66ad>-.25 G 2.5
+(IP)-2.5 G 51.56(unaA_ss.grd -O)-2.5 F 41.06(PunaA_ss.tif -C)2.5 F
 (ss.cpt \255V)2.5 E(where the grayscale is controlled by a GMT cpt \214\
-le ss.cpt containing:)108 352.8 Q 5(0.00 0 0 0 16.50)146.5 364.8 R 2.5
-(26 26 26)5 F 2.5(16.50 26 26 26)144 376.8 R 2.5(22.87 51 51 51)7.5 F
-2.5(22.87 51 51 51)144 388.8 R 2.5(27.00 77 77 77)7.5 F 2.5
-(27.00 77 77 77)144 400.8 R(30.00 102 102 102)7.5 E(30.00 102 102 102)
-144 412.8 Q(32.25 128 128 128)7.5 E(32.25 128 128 128)144 424.8 Q
-(34.25 153 153 153)7.5 E(34.25 153 153 153)144 436.8 Q
-(36.25 179 179 179)7.5 E(36.25 179 179 179)144 448.8 Q
-(38.50 204 204 204)7.5 E(38.50 204 204 204)144 460.8 Q
-(41.23 230 230 230)7.5 E(41.23 230 230 230)144 472.8 Q
-(128.00 255 255 255)5 E(Here greater re\215ecti)108 484.8 Q
-(vity amplitudes are represented by light grayscales.)-.25 E F2
-(SEE ALSO)72 513.6 Q F1(mbsystem)108 525.6 Q F0(\(1\),)A F1(mbm_grdplot)
+le ss.cpt containing:)108 504 Q 5(0.00 0 0 0 16.50)146.5 516 R 2.5
+(26 26 26)5 F 2.5(16.50 26 26 26)144 528 R 2.5(22.87 51 51 51)7.5 F 2.5
+(22.87 51 51 51)144 540 R 2.5(27.00 77 77 77)7.5 F 2.5(27.00 77 77 77)
+144 552 R(30.00 102 102 102)7.5 E(30.00 102 102 102)144 564 Q
+(32.25 128 128 128)7.5 E(32.25 128 128 128)144 576 Q(34.25 153 153 153)
+7.5 E(34.25 153 153 153)144 588 Q(36.25 179 179 179)7.5 E
+(36.25 179 179 179)144 600 Q(38.50 204 204 204)7.5 E(38.50 204 204 204)
+144 612 Q(41.23 230 230 230)7.5 E(41.23 230 230 230)144 624 Q
+(128.00 255 255 255)5 E(Here greater re\215ecti)108 636 Q
+(vity amplitudes are represented by light grayscales.)-.25 E F3
+(SEE ALSO)72 664.8 Q F1(mbsystem)108 676.8 Q F0(\(1\),)A F1(mbm_grdplot)
 6.595 E F0(\(1\),)A F1(mbgrid)6.595 E F0(\(1\),)A F1(mbmosaic)6.595 E F0
 (\(1\),)A F1(mbm_grid)6.595 E F0(\(1\),)A F1(mbm_grdtiff)6.595 E F0
-(\(1\),)A F1(gmt)6.595 E F0(\(1\),)A F1(grdimage)108 537.6 Q F0(\(1\))A
-F2 -.11(BU)72 566.4 S(GS).11 E F0(Let us kno)108 578.4 Q -.65(w.)-.25 G
-(MB-System 5.0)72 768 Q(28 September 2013)131.775 E(2)190.115 E 0 Cg EP
+(\(1\),)A F1(gmt)6.595 E F0(\(1\),)A F1(grdimage)108 688.8 Q F0(\(1\))A
+(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(2)195.95 E 0
+Cg EP
+%%Page: 3 3
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF(mbgrdtif)72 48 Q 150.09(f\(1\) MB-System)-.25 F
+150.09(5.0 mbgrdtif)2.5 F(f\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF -.11
+(BU)72 84 S(GS).11 E F0(Let us kno)108 96 Q -.65(w.)-.25 G
+(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(3)195.95 E 0
+Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbgrdviz.ps b/src/ps/mbgrdviz.ps
index a55b710..11690bf 100644
--- a/src/ps/mbgrdviz.ps
+++ b/src/ps/mbgrdviz.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbgrid.ps b/src/ps/mbgrid.ps
index a57b5ee..d946857 100644
--- a/src/ps/mbgrid.ps
+++ b/src/ps/mbgrid.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -1104,7 +1104,7 @@ ugh spine interpola-)108 681.6 R(tion e)108 693.6 Q -.15(ve)-.25 G 2.5
 (ni).15 G 2.5(nt)-2.5 G(he areas not co)-2.5 E -.15(ve)-.15 G
 (red by data. The output looks lik).15 E(e:)-.1 E(Program MBGRID)110.5
 717.6 Q -1.11(Ve)110.5 729.6 S
-(rsion $Id: mbgrid.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbgrid.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
 (8)190.545 E 0 Cg EP
 %%Page: 9 9
diff --git a/src/ps/mbhistogram.ps b/src/ps/mbhistogram.ps
index 457a015..2846856 100644
--- a/src/ps/mbhistogram.ps
+++ b/src/ps/mbhistogram.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbhsdump.ps b/src/ps/mbhsdump.ps
index 01bc980..a6aa1a2 100644
--- a/src/ps/mbhsdump.ps
+++ b/src/ps/mbhsdump.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbhysweeppreprocess.ps b/src/ps/mbhysweeppreprocess.ps
index 7e14260..165ef4c 100644
--- a/src/ps/mbhysweeppreprocess.ps
+++ b/src/ps/mbhysweeppreprocess.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:27 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbinfo.ps b/src/ps/mbinfo.ps
index 13fb2bc..06cc974 100644
--- a/src/ps/mbinfo.ps
+++ b/src/ps/mbinfo.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbio.ps b/src/ps/mbio.ps
index 428f67a..fc9a06a 100644
--- a/src/ps/mbio.ps
+++ b/src/ps/mbio.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbkongsbergpreprocess.ps b/src/ps/mbkongsbergpreprocess.ps
index b8f7af6..4b658ca 100644
--- a/src/ps/mbkongsbergpreprocess.ps
+++ b/src/ps/mbkongsbergpreprocess.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mblevitus.ps b/src/ps/mblevitus.ps
index 5263683..65abd23 100644
--- a/src/ps/mblevitus.ps
+++ b/src/ps/mblevitus.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mblist.ps b/src/ps/mblist.ps
index 2b76b8c..1ed4ef4 100644
--- a/src/ps/mblist.ps
+++ b/src/ps/mblist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:16 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_arc2grd.ps b/src/ps/mbm_arc2grd.ps
index ab86e80..b069bc9 100644
--- a/src/ps/mbm_arc2grd.ps
+++ b/src/ps/mbm_arc2grd.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_bpr.ps b/src/ps/mbm_bpr.ps
index 4d37e20..e195c7d 100644
--- a/src/ps/mbm_bpr.ps
+++ b/src/ps/mbm_bpr.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_copy.ps b/src/ps/mbm_copy.ps
index d8b7fd8..7964fe5 100644
--- a/src/ps/mbm_copy.ps
+++ b/src/ps/mbm_copy.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_dslnavfix.ps b/src/ps/mbm_dslnavfix.ps
index 0c68ecc..a64277d 100644
--- a/src/ps/mbm_dslnavfix.ps
+++ b/src/ps/mbm_dslnavfix.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_fmtvel.ps b/src/ps/mbm_fmtvel.ps
index 7e38f58..2a35c38 100644
--- a/src/ps/mbm_fmtvel.ps
+++ b/src/ps/mbm_fmtvel.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_grd2arc.ps b/src/ps/mbm_grd2arc.ps
index d552848..c4c15af 100644
--- a/src/ps/mbm_grd2arc.ps
+++ b/src/ps/mbm_grd2arc.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_grd2geovrml.ps b/src/ps/mbm_grd2geovrml.ps
index e369bd1..101b909 100644
--- a/src/ps/mbm_grd2geovrml.ps
+++ b/src/ps/mbm_grd2geovrml.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_grd3dplot.ps b/src/ps/mbm_grd3dplot.ps
index 108e3c8..35ed2a8 100644
--- a/src/ps/mbm_grd3dplot.ps
+++ b/src/ps/mbm_grd3dplot.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -253,899 +253,929 @@ F3(cpt\214le)2.5 E F0 2.5(]])C(Additional Options:)108 237.6 Q([)108
 F3(:scale_label)A F0(])A F2<ad4d>2.5 E F3(misc)A F2<ad5120ad52>2.5 E F3
 (w/e/s/n)A F2<ad5820ad5920ad5a>2.5 E F3(min/max)A F0(])2.5 E
 (Miscellaneous Options:)108 273.6 Q([)108 285.6 Q F2(\255MGD)A F3
-(gmtdef/value)A F2(\255MGF)6.507 E F3(scale_loc)A F2(\255MGL)4.007 E F0
+(gmtdef/value)A F2(\255MGF)16.01 E F3(scale_loc)A F2(\255MGL)13.51 E F0
 ([)A F3(f)A F0(][)A F3(x)A F0(])A F3(lon0/lat0/slat/length)A F0([)A F3
-(m)A F0(])A F2(\255MGQ)4.008 E F3(dpi)A F2(\255MGS)4.008 E F3
-(scalefactor)A F2(\255MGT)108 297.6 Q F3(x/y/size/angle/font/just/te)A
-(xt)-.2 E F2(\255MGU[)2.5 E F3(/dx/dy/)A F2(][)A F3(label)A F2 2.5<5dad>
-C(MVM)-2.5 E F3(mesh_pen)A F2(\255MVN[)2.5 E F3(null[/r/g/b])A F2 2.5
-(]])C F1(DESCRIPTION)72 338.4 Q F2(mbm_grd3dplot)108 350.4 Q F0 .042
+(units)A F0(][)A F3(+llabel)A F0(])A F2(\255MGQ)13.51 E F3(dpi)A F2
+(\255MGS)108 297.6 Q F3(scalefactor)A F2(\255MGT)19.997 E F3
+(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)19.997 E F3(/dx/dy/)
+A F2(][)A F3(label)A F2 19.996<5dad>C(MVM)-19.996 E F3(mesh_pen)A F2
+(\255MVN[)108 309.6 Q F3(null[/r/g/b])A F2 2.5(]])C F1(DESCRIPTION)72
+338.4 Q F2(mbm_grd3dplot)108 350.4 Q F0 .042
 (is a macro to generate a shellscript of GMT commands which, when e)
-2.542 F -.15(xe)-.15 G .042(cuted, will gener).15 F(-)-.2 E 1.273
+2.542 F -.15(xe)-.15 G .042(cuted, will gener).15 F(-)-.2 E 1.274
 (ate a 3D perspecti)108 362.4 R 1.573 -.15(ve P)-.25 H 1.273
 (ostscript plot of gridded data.).15 F(Se)6.273 E -.15(ve)-.25 G 1.273
-(ral styles of plots can be generated, including).15 F .099
+(ral styles of plots can be generated, including).15 F .098
 (color \214ll vie)108 374.4 R .099(ws, color shaded relief vie)-.25 F
 .099(ws, mesh plot vie)-.25 F .099(ws, and te)-.25 F .099(xt labels. Fi)
--.15 F .399 -.15(ve d)-.25 H(if).15 E .098(ferent color schemes are)-.25
+-.15 F .399 -.15(ve d)-.25 H(if).15 E .099(ferent color schemes are)-.25
 F .858(included. The plot will be scaled to \214t on the speci\214ed pa\
 ge size or)108 386.4 R 3.358(,i)-.4 G 3.358(ft)-3.358 G .858
 (he scale is user de\214ned, the page)-3.358 F .778
 (size will be chosen in accordance with the plot size. The v)108 398.4 R
-.778(ertical e)-.15 F .778(xaggeration may be speci\214ed. The pri-)-.15
-F .33(mary purpose of this macro is to allo)108 410.4 R 2.831(wt)-.25 G
-.331(he simple, semi-automated production of nice looking maps with a)
--2.831 F(fe)108 422.4 Q 3.034(wc)-.25 G .534(ommand line ar)-3.034 F
+.778(ertical e)-.15 F .779(xaggeration may be speci\214ed. The pri-)-.15
+F .331(mary purpose of this macro is to allo)108 410.4 R 2.831(wt)-.25 G
+.33(he simple, semi-automated production of nice looking maps with a)
+-2.831 F(fe)108 422.4 Q 3.033(wc)-.25 G .533(ommand line ar)-3.033 F
 .533(guments. F)-.18 F .533(or users seeking more control o)-.15 F -.15
 (ve)-.15 G 3.033(rt).15 G .533(he plot appearance, a number of addi-)
--3.033 F .871(tional optional ar)108 434.4 R .871(guments are pro)-.18 F
-.871(vided. T)-.15 F .871
-(ruly ambitious users may edit the plot shellscript to tak)-.35 F 3.372
-(ea)-.1 G(dv)-3.372 E(an-)-.25 E
-(tage of GMT capabilities not supported by this macro.)108 446.4 Q F1
--.548(AU)72 475.2 S(THORSHIP).548 E F0(Da)108 487.2 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 499.2 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 511.2 Q
-(Lamont-Doherty Earth Observ)113 523.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 552 Q(ASIC OPTIONS)-.329 E F2<ad41>108 564 Q
+-3.033 F .872(tional optional ar)108 434.4 R .872(guments are pro)-.18 F
+.872(vided. T)-.15 F .871
+(ruly ambitious users may edit the plot shellscript to tak)-.35 F 3.371
+(ea)-.1 G(dv)-3.371 E(an-)-.25 E
+(tage of GMT capabilities not supported by this macro.)108 446.4 Q .083
+(By def)108 470.4 R .083
+(ault the output plot generation shellscript includes lines which e)-.1
+F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
+ript image on the screen. The program to be used to display the Postscr\
+ipt is set using)108 482.4 R F2(mbdefaults)3.307 E F0 3.307(;t)C(he)
+-3.307 E(def)108 494.4 Q .325(ault v)-.1 F .325(alue can be o)-.25 F
+-.15(ve)-.15 G .325(rridden by setting the en).15 F .326(vironment v)-.4
+F .326(ariable $MB_PS_VIEWER.)-.25 F(In)5.326 E -.2(vo)-.4 G .326
+(king the plot).2 F(generation shellscript with a)108 506.4 Q F2(-N)2.5
+E F0(command line ar)2.5 E
+(gument suppresses the screen display of the plot.)-.18 E .305
+(The plot scripts generated by this macro will w)108 530.4 R .305
+(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
+.305(nd are not compatible)-2.805 F(with earlier v)108 542.4 Q
+(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 571.2 S(THORSHIP).548 E
+F0(Da)108 583.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
+E(g\))-.18 E(Montere)113 595.2 Q 2.5(yB)-.15 G
+(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 607.2 Q
+(Lamont-Doherty Earth Observ)113 619.2 Q(atory)-.25 E F1
+(SIMPLE DESCRIPTION OF B)72 648 Q(ASIC OPTIONS)-.329 E F2<ad41>108 660 Q
 F3(ma)23.08 E(gnitude[/azimuth/ele)-.1 E(vation])-.15 E F0 1.15(Sets th\
 e parameters which control the synthetic illumination of the gridded da\
-ta \(shaded relief\).)144 576 R .05(The v)144 588 R(alue)-.25 E F3(ma)
-2.55 E(gnitude)-.1 E F0 .05(is an ef)2.55 F(fecti)-.25 E .351 -.15
-(ve ve)-.25 H .051(rtical e).15 F .051
-(xageration which modulates the intensity of the shad-)-.15 F .882
-(ing; typical v)144 600 R .882(alues are in the 0.1 to 10 range.)-.25 F
-.882(The v)5.882 F(alue)-.25 E F3(azimuth)3.382 E F0 .881
-(is the azimuth in de)3.381 F .881(grees from)-.15 F .628
-(north from which the data is illuminated.)144 612 R .629(The v)5.629 F
-(alue)-.25 E F3(ele)3.129 E(vation)-.15 E F0 .629(is the ele)3.129 F
--.25(va)-.25 G .629(tion of the illumination).25 F(in de)144 624 Q
+ta \(shaded relief\).)144 672 R .051(The v)144 684 R(alue)-.25 E F3(ma)
+2.551 E(gnitude)-.1 E F0 .051(is an ef)2.551 F(fecti)-.25 E .351 -.15
+(ve ve)-.25 H .051(rtical e).15 F .05
+(xageration which modulates the intensity of the shad-)-.15 F .881
+(ing; typical v)144 696 R .881(alues are in the 0.1 to 10 range.)-.25 F
+.882(The v)5.882 F(alue)-.25 E F3(azimuth)3.382 E F0 .882
+(is the azimuth in de)3.382 F .882(grees from)-.15 F .629
+(north from which the data is illuminated.)144 708 R .629(The v)5.629 F
+(alue)-.25 E F3(ele)3.129 E(vation)-.15 E F0 .628(is the ele)3.129 F
+-.25(va)-.25 G .628(tion of the illumination).25 F(in de)144 720 Q
 (grees from horizontal.)-.15 E(Def)5 E(aults:)-.1 E F3(ma)2.5 E(gnitude)
 -.1 E F0 2.5(=0)2.5 G(.2;)-2.5 E F3(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)
--2.5 E F3(ele)2.5 E(vation)-.15 E F0 2.5(=3)2.5 G(0.0;)-2.5 E F2<ad44>
-108 640.8 Q F3([\215ipcolor/\215ipshade])23.08 E F0(Normally)144 652.8 Q
-3.321(,t)-.65 G .821(he color or grayscale tables used for color maps r\
-un from cool colors \(or dark grays\))-3.321 F 1.289(for lo)144 664.8 R
-3.789(wg)-.25 G 1.289(rid v)-3.789 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.79
-(alues. This)-.25 F 1.29(option re)3.79 F -.15(ve)-.25 G 1.29(rses the)
-.15 F .028
-(color table so that cool colors \(dark grays\) correspond to high v)144
-676.8 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 688.8
-Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F2<ad44>3.954 E F0 1.454
-(is gi)3.954 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
-the color table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 700.8 R .216
-(either by synthetic illumination \()5.216 F F2<ad47>A F3(2)A F0 2.716
-(\)o)C 2.715(ru)-2.716 G .215(sing an)-2.715 F .021(intensity \214le \()
-144 712.8 R F2<ad4b>A F0(and)2.522 E F2<ad47>2.522 E F3(3)A F0 .022
-(options\), then setting)2.522 F F3(\215ipshade)2.522 E F0 2.522(=1w)
-2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .022
-(ntion to).15 F 1.542(be re)144 724.8 R -.15(ve)-.25 G 1.542
-(rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G 1.541
-(rlaid as light shading\).).15 F(Using)6.541 E F2<ad44>4.041 E F3(0/1)A
-F0 1.541(will \215ip the shading)4.041 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
+-2.5 E F3(ele)2.5 E(vation)-.15 E F0 2.5(=3)2.5 G(0.0;)-2.5 E
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(1)198.45 E 0
+Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F(con)144 84 Q -.15(ve)-.4 G(ntion b)
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad44>108 84 Q
+/F2 10/Times-Italic at 0 SF([\215ipcolor/\215ipshade])23.08 E F0(Normally)
+144 96 Q 3.32(,t)-.65 G .821(he color or grayscale tables used for colo\
+r maps run from cool colors \(or dark grays\))-3.32 F 1.29(for lo)144
+108 R 3.79(wg)-.25 G 1.29(rid v)-3.79 F 1.289
+(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.789
+(alues. This)-.25 F 1.289(option re)3.789 F -.15(ve)-.25 G 1.289
+(rses the).15 F .028
+(color table so that cool colors \(dark grays\) correspond to high v)144
+120 R .029(alues and hot colors \(light grays\) to)-.25 F(lo)144 132 Q
+3.955(wv)-.25 G 3.955(alues. If)-4.205 F F1<ad44>3.955 E F0 1.454(is gi)
+3.955 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to the col\
+or table used for color or gray \214ll plots,)-3.954 F .216
+(shaded or unshaded. If the plot is to be shaded,)144 144 R .216
+(either by synthetic illumination \()5.216 F F1<ad47>A F2(2)A F0 2.716
+(\)o)C 2.716(ru)-2.716 G .216(sing an)-2.716 F .022(intensity \214le \()
+144 156 R F1<ad4b>A F0(and)2.522 E F1<ad47>2.522 E F2(3)A F0 .022
+(options\), then setting)2.522 F F2(\215ipshade)2.522 E F0 2.522(=1w)
+2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .021
+(ntion to).15 F .087(be re)144 168 R -.15(ve)-.25 G .087
+(rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
+(rlaid as light shading\).).15 F(Using)5.087 E F1<ad44>2.587 E F2(0/1)A
+F0 .088(will \215ip the shading con-)2.588 F -.15(ve)144 180 S(ntion b)
 .15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E(ault color con)-.1 E
--.15(ve)-.4 G(ntion.).15 E/F1 10/Times-Bold at 0 SF<ad45>108 100.8 Q F0([)
-23.63 E/F2 10/Times-Italic at 0 SF(vie)A(w_az/vie)-.15 E(w_el)-.15 E F0(])A
-.462(Sets the azimuth and ele)144 112.8 R -.25(va)-.25 G .462
-(tion in de).25 F .462(grees of the vie)-.15 F .462
-(wpoint for 3D perspecti)-.25 F .762 -.15(ve v)-.25 H(ie).15 E 2.962
-(ws. An)-.25 F F2(vie)2.962 E(w_az)-.15 E F0 1.527
-(of 0 represents a vie)144 124.8 R 4.027(wf)-.25 G 1.527
-(rom the north, and)-4.027 F F2(vie)4.027 E(w_az)-.15 E F0 4.027(=9)
-4.027 G 4.027(0r)-4.027 G 1.526(epresents a vie)-4.027 F 4.026(wf)-.25 G
-1.526(rom the east.)-4.026 F(An)6.526 E F2(vie)144 136.8 Q(w_el)-.15 E
+-.15(ve)-.4 G(ntion.).15 E F1<ad45>108 196.8 Q F0([)23.63 E F2(vie)A
+(w_az/vie)-.15 E(w_el)-.15 E F0(])A .462(Sets the azimuth and ele)144
+208.8 R -.25(va)-.25 G .462(tion in de).25 F .462(grees of the vie)-.15
+F .462(wpoint for 3D perspecti)-.25 F .762 -.15(ve v)-.25 H(ie).15 E
+2.962(ws. An)-.25 F F2(vie)2.962 E(w_az)-.15 E F0 1.526
+(of 0 represents a vie)144 220.8 R 4.026(wf)-.25 G 1.527
+(rom the north, and)-4.026 F F2(vie)4.027 E(w_az)-.15 E F0 4.027(=9)
+4.027 G 4.027(0r)-4.027 G 1.527(epresents a vie)-4.027 F 4.027(wf)-.25 G
+1.527(rom the east.)-4.027 F(An)6.527 E F2(vie)144 232.8 Q(w_el)-.15 E
 F0(of 0 represents a horizontal vie)2.5 E 3.8 -.65(w. D)-.25 H(ef).65 E
 (ault:)-.1 E F2(vie)2.5 E(w_az)-.15 E F0 2.5(=2)2.5 G(00.; ele)-2.5 E
--.25(va)-.25 G(tion = 40.).25 E F1<ad46>108 153.6 Q F0([)24.19 E F2 -.2
-(ex)C -.1(agge).2 G -.15(ra).1 G(tion).15 E F0(])A .512(Sets the v)144
-165.6 R .513(ertical e)-.15 F .513(xaggeration of the perspecti)-.15 F
+-.25(va)-.25 G(tion = 40.).25 E F1<ad46>108 249.6 Q F0([)24.19 E F2 -.2
+(ex)C -.1(agge).2 G -.15(ra).1 G(tion).15 E F0(])A .513(Sets the v)144
+261.6 R .513(ertical e)-.15 F .513(xaggeration of the perspecti)-.15 F
 .813 -.15(ve p)-.25 H 3.013(lot. By).15 F(def)3.013 E .513(ault the v)
--.1 F .513(ertical e)-.15 F .513(xaggeration is cho-)-.15 F .967
-(sen so that the plot \214ts nicely on the page. This option w)144 177.6
-R .966(orks only if the data are in geographic)-.1 F
-(coordinates \(longitude and latitude\).)144 189.6 Q F1<ad47>108 206.4 Q
-F2(color_mode)22.52 E F0 -.45(Tu)144 218.4 S
+-.1 F .513(ertical e)-.15 F .512(xaggeration is cho-)-.15 F .966
+(sen so that the plot \214ts nicely on the page. This option w)144 273.6
+R .967(orks only if the data are in geographic)-.1 F
+(coordinates \(longitude and latitude\).)144 285.6 Q F1<ad47>108 302.4 Q
+F2(color_mode)22.52 E F0 -.45(Tu)144 314.4 S
 (rns on color \214ll plot and sets the style of the plot.).45 E F2
-(color_mode)164 230.4 Q F0 2.5(=1)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G
-(olor/gray \214ll.)-2.5 E F2(color_mode)164 242.4 Q F0 2.5(=2)2.5 G 2.5
+(color_mode)164 326.4 Q F0 2.5(=1)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G
+(olor/gray \214ll.)-2.5 E F2(color_mode)164 338.4 Q F0 2.5(=2)2.5 G 2.5
 (:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(synthetic illumination.)204 254.4 Q F2(color_mode)164 266.4 Q F0 2.5
+(synthetic illumination.)204 350.4 Q F2(color_mode)164 362.4 Q F0 2.5
 (=3)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(an intensity \214le. The)204 278.4 Q F1<ad4b>2.5 E F0
-(option must be used to specify)204 290.4 Q(the intensity \214le.)252
-302.4 Q F2(color_mode)164 314.4 Q F0 2.5(=4)2.5 G 2.5(:3)-2.5 G 2.5(DC)
--2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252 326.4 Q F2
-(color_mode)164 338.4 Q F0 2.5(=5)2.5 G 2.5(:3)-2.5 G 2.5(DC)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 350.4 Q F2
-(color_mode)164 362.4 Q F0 2.5(=6)2.5 G 2.5(:3)-2.5 G 2.5(Dm)-2.5 G
-(esh plot.)-2.5 E F2(color_mode)164 374.4 Q F0 2.5(=7)2.5 G 2.5(:3)-2.5
-G 2.5(Dm)-2.5 G(esh plot with contours.)-2.5 E F1<ad48>108 391.2 Q F0
+(an intensity \214le. The)204 374.4 Q F1<ad4b>2.5 E F0
+(option must be used to specify)204 386.4 Q(the intensity \214le.)252
+398.4 Q F2(color_mode)164 410.4 Q F0 2.5(=4)2.5 G 2.5(:3)-2.5 G 2.5(DC)
+-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252 422.4 Q F2
+(color_mode)164 434.4 Q F0 2.5(=5)2.5 G 2.5(:3)-2.5 G 2.5(DC)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 446.4 Q F2
+(color_mode)164 458.4 Q F0 2.5(=6)2.5 G 2.5(:3)-2.5 G 2.5(Dm)-2.5 G
+(esh plot.)-2.5 E F2(color_mode)164 470.4 Q F0 2.5(=7)2.5 G 2.5(:3)-2.5
+G 2.5(Dm)-2.5 G(esh plot with contours.)-2.5 E F1<ad48>108 487.2 Q F0
 .162(This "help" \215ag cause the program to print out a description of\
- its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-403.2 Q(.)-.65 E F1<ad49>108 420 Q F2(gr)26.41 E(d\214le)-.37 E F0 .159
-(Sets the name of the gridded data \214le to be plotted.)144 432 R
-(Alternati)5.158 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.658 E
-(d\214le)-.37 E F0 .158(may be a list of grid \214les)2.658 F
-(\(one \214lename on each line\) to be plotted together)144 444 Q(.)-.55
-E F1<ad4b>108 460.8 Q F2(intensity_\214le)22.52 E F0
+ its operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144
+499.2 Q(.)-.65 E F1<ad49>108 516 Q F2(gr)26.41 E(d\214le)-.37 E F0 .158
+(Sets the name of the gridded data \214le to be plotted.)144 528 R
+(Alternati)5.158 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.659 E
+(d\214le)-.37 E F0 .159(may be a list of grid \214les)2.659 F
+(\(one \214lename on each line\) to be plotted together)144 540 Q(.)-.55
+E F1<ad4b>108 556.8 Q F2(intensity_\214le)22.52 E F0
 (Sets the name of the gridded data \214le containing instensity v)144
-472.8 Q(alues to be used for shading the map.)-.25 E F1<ad4e>108 489.6 Q
+568.8 Q(alues to be used for shading the map.)-.25 E F1<ad4e>108 585.6 Q
 F2(dr)23.08 E(ape_\214le)-.15 E F0 .312(Sets the name of the gridded da\
-ta \214le to be draped on the relief pro)144 501.6 R .312
-(vided by the \214le speci\214ed with)-.15 F(the)144 513.6 Q F1<ad49>
-3.157 E F0 .657(option. If)3.157 F F1<ad4e>3.157 E F2(dr)A(ape_\214le)
--.15 E F0 .656(is speci\214ed, then all color control options will appl\
-y to the data in)3.157 F(\\fIdrape_\214le)144 525.6 Q F2(.)A F1<ad4f>108
-542.4 Q F2 -.45(ro)22.52 G(ot).45 E F0 .422(Sets the root used to const\
-ruct the \214lename of the output shellscript \()144 554.4 R F2 -.45(ro)
-C(ot).45 E F0 .423(.cmd\) and names of \214les)B .157
-(created when the shellscript is run.)144 566.4 R .157
+ta \214le to be draped on the relief pro)144 597.6 R .312
+(vided by the \214le speci\214ed with)-.15 F(the)144 609.6 Q F1<ad49>
+3.156 E F0 .656(option. If)3.156 F F1<ad4e>3.156 E F2(dr)A(ape_\214le)
+-.15 E F0 .657(is speci\214ed, then all color control options will appl\
+y to the data in)3.156 F(\\fIdrape_\214le)144 621.6 Q F2(.)A F1<ad4f>108
+638.4 Q F2 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the root used to const\
+ruct the \214lename of the output shellscript \()144 650.4 R F2 -.45(ro)
+C(ot).45 E F0 .422(.cmd\) and names of \214les)B .156
+(created when the shellscript is run.)144 662.4 R .157
 (Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 578.4 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-595.2 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
+5.157 F(as the)144 674.4 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
+691.2 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
 he size of the page the plot will be centered on. If the user does not \
-set the plot)144 607.2 R .126(scale, the plot will be sized as lar)144
-619.2 R .125(ge as will \214t on the designated page. If the user sets \
+set the plot)144 703.2 R .125(scale, the plot will be sized as lar)144
+715.2 R .125(ge as will \214t on the designated page. If the user sets \
 the plot scale)-.18 F .948
 (such that the plot will not \214t on the designated page, a lar)144
-631.2 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
-1.343(page sizes include ANSI A, B, C, D, E, F)144 643.2 R 3.843(,a)-.8
-G 1.342(nd E1, as well as most metric page sizes. See the)-3.843 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 655.2 R 3.81(wf)-.25 G
-1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-667.2 Q(ault page size is A.)-.1 E F1<ad53>108 684 Q F2([color/shade])
-24.74 E F0 1.393(This option enables ef)144 696 R(fecti)-.25 E 1.693
--.15(ve h)-.25 H 1.392
-(istogram equalization of the color and/or shading of the gridded).15 F
-.628(data. The equalization is not achie)144 708 R -.15(ve)-.25 G 3.128
-(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F 2.052(color o\
-r shading tables so that the boundaries in the tables encompass equal f\
-ractions of the)144 720 R(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
+727.2 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)198.45 E 0
+Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 1.235(datapoints. This serv)144 84 R
-1.235(es to focus color or shading contrasts in v)-.15 F 1.235
-(alue ranges corresponding to the)-.25 F -.2(bu)144 96 S .348
-(lk of the data v).2 F 2.848(alues. If)-.25 F/F1 10/Times-Bold at 0 SF
-<ad53>2.848 E F0 .348(is gi)2.848 F -.15(ve)-.25 G 2.848(na).15 G .348
-(lone or with)-2.848 F/F2 10/Times-Italic at 0 SF(color)2.847 E F0 2.847
-(=1)2.847 G 2.847(,i)-2.847 G 2.847(te)-2.847 G .347
-(nables equalization of the color)-2.847 F .874
-(table used for color or gray \214ll plots,)144 108 R .874
-(shaded or unshaded. If the plot is to be shaded,)5.874 F .875
-(either by)5.875 F .254(synthetic illumination \()144 120 R F1<ad47>A F2
-(2)A F0 2.754(\)o)C 2.754(ru)-2.754 G .254(sing an intensity \214le \()
--2.754 F F1<ad4b>A F0(and)2.754 E F1<ad47>2.754 E F2(3)A F0 .254
-(options\), then setting)2.754 F F2(shade)2.754 E F0(=)2.754 E 3.096(1w)
-144 132 S .596(ill cause the shading to be equalized.)-3.096 F(Using)
-5.597 E F1<ad53>3.097 E F2(0/1)A F0 .597
-(will equalize the shading without equaliz-)3.097 F
-(ing the color table.)144 144 Q F1<ad55>108 160.8 Q F2(orientation)23.08
-E F0 .2(Normally the orientation of the plot \(portrait or landscape\) \
-is selected automatically so as to maxi-)144 172.8 R .333
-(mize the plot scale.)144 184.8 R(The)5.333 E F1<ad55>2.833 E F0 .333
-(option allo)2.833 F .333(ws the user to set the plot orientation. If)
--.25 F F2(orientation)2.833 E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 196.8 Q F2(orientation)2.5 E F0
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F 1.342
+(page sizes include ANSI A, B, C, D, E, F)144 84 R 3.842(,a)-.8 G 1.343
+(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
+(COMPLETE DESCRIPTION OF OPTIONS section belo)144 96 R 3.81(wf)-.25 G
+1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
+108 Q(ault page size is A.)-.1 E/F1 10/Times-Bold at 0 SF<ad53>108 124.8 Q
+/F2 10/Times-Italic at 0 SF([color/shade])24.74 E F0 1.392
+(This option enables ef)144 136.8 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H
+1.392(istogram equalization of the color and/or shading of the gridded)
+.15 F .628(data. The equalization is not achie)144 148.8 R -.15(ve)-.25
+G 3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
+(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
+ shading tables so that the boundaries in the tables encompass equal fr\
+actions of the data-)144 160.8 R .19(points. This serv)144 172.8 R .19
+(es to focus color or shading contrasts in v)-.15 F .19
+(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
+(the data v)144 184.8 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
+(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
+F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
+.838(nables equalization of the color table)-3.338 F .991
+(used for color or gray \214ll plots,)144 196.8 R .991
+(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
+(either by syn-)5.991 F .637(thetic illumination \()144 208.8 R F1<ad47>
+A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
+(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
+3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
+F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 220.8
+R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
+(will equalize the shading without equalizing)3 F(the color table.)144
+232.8 Q F1<ad55>108 249.6 Q F2(orientation)23.08 E F0 .2(Normally the o\
+rientation of the plot \(portrait or landscape\) is selected automatica\
+lly so as to maxi-)144 261.6 R .334(mize the plot scale.)144 273.6 R
+(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
+(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
+E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
+(portrait plot will be produced; if)144 285.6 Q F2(orientation)2.5 E F0
 2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 213.6 Q F0(Causes)23.08 E F1(mbm_grd3dplot)3.694 E F0 1.193
+<ad56>108 302.4 Q F0(Causes)23.08 E F1(mbm_grd3dplot)3.693 E F0 1.193
 (to operate in "v)3.693 F 1.193
 (erbose" mode so that it outputs more information than)-.15 F(usual.)144
-225.6 Q F1<ad57>108 242.4 Q F2([color_style)20.3 E F0([)A F2(/palette)A
+314.4 Q F1<ad57>108 331.2 Q F2([color_style)20.3 E F0([)A F2(/palette)A
 F0([)A F2(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
 (This option controls the color scheme used for color \214ll plots.)144
-254.4 Q(If)144 278.4 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
+343.2 Q(If)144 367.2 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
 -3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 290.4 Q F0 2.816(=2)2.816 G
-2.816(,t)-2.816 G .316
-(he color scheme will be a set of discrete color interv)-2.816 F .315
-(als. The color palette used is)-.25 F(set using)144 302.4 Q F2(palette)
+ading of colors. If)-.1 F F2(color_style)144 379.2 Q F0 2.815(=2)2.815 G
+2.815(,t)-2.815 G .315
+(he color scheme will be a set of discrete color interv)-2.815 F .316
+(als. The color palette used is)-.25 F(set using)144 391.2 Q F2(palette)
 2.5 E F0 2.5(.F)C -2.15 -.25(iv e)-2.5 H(palettes are a)2.75 E -.25(va)
--.2 G(ilable:).25 E F2(palette)180 314.4 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5
-G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 326.4 Q F0 2.5
+-.2 G(ilable:).25 E F2(palette)180 403.2 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5
+G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 415.2 Q F0 2.5
 (=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)180
-338.4 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F2(palette)180 350.4 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 362.4 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E 4.383(Ac)144 374.4 S 1.883
-(omplete description of the color palettes is gi)-4.383 F -.15(ve)-.25 G
+427.2 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
+(ntensity colors).25 E F2(palette)180 439.2 Q F0 2.5(=4)2.5 G 26.36(:g)
+-2.5 G(rayscale)-26.36 E F2(palette)180 451.2 Q F0 2.5(=5)2.5 G 26.36
+(:u)-2.5 G(niform grayscale)-26.36 E 4.384(Ac)144 463.2 S 1.883
+(omplete description of the color palettes is gi)-4.384 F -.15(ve)-.25 G
 4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
-F(OPTIONS section belo)144 386.4 Q -.65(w.)-.25 G(The)144 398.4 Q F2
-(ncolor)2.607 E(s)-.1 E F0 .107(parameter sets the number of color v)
-2.607 F .107(alues used in plotting, whether the colors are rep-)-.25 F
+F(OPTIONS section belo)144 475.2 Q -.65(w.)-.25 G(The)144 487.2 Q F2
+(ncolor)2.606 E(s)-.1 E F0 .107(parameter sets the number of color v)
+2.606 F .107(alues used in plotting, whether the colors are rep-)-.25 F
 (resented in a continuous color scale or a stepped, discrete color scal\
-e [def)144 410.4 Q(ault is 11].)-.1 E .522(If the option ar)144 434.4 R
+e [def)144 499.2 Q(ault is 11].)-.1 E .523(If the option ar)144 523.2 R
 .522(gument is the path to an e)-.18 F(xisting)-.15 E F1(GMT)3.022 E F0
-.523(color palette \(CPT\) \214le, then that CPT \214le)3.022 F
-(and its color scheme will be used for the plot)144 446.4 Q/F3 10.95
-/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 475.2 Q F1<ad41>108
-487.2 Q F2(ma)23.08 E(gnitude[/azimuth])-.1 E F0 1.15(Sets the paramete\
-rs which control the synthetic illumination of the gridded data \(shade\
-d relief\).)144 499.2 R .05(The v)144 511.2 R(alue)-.25 E F2(ma)2.55 E
-(gnitude)-.1 E F0 .05(is an ef)2.55 F(fecti)-.25 E .351 -.15(ve ve)-.25
-H .051(rtical e).15 F .051
-(xageration which modulates the intensity of the shad-)-.15 F .827
-(ing; typical v)144 523.2 R .827(alues are in the 0.1 to 0.5 range.)-.25
-F .827(The v)5.827 F(alue)-.25 E F2(azimuth)3.327 E F0 .826
-(is the azimuth from which the)3.326 F(data is illuminated.)144 535.2 Q
+.522(color palette \(CPT\) \214le, then that CPT \214le)3.022 F
+(and its color scheme will be used for the plot)144 535.2 Q/F3 10.95
+/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 564 Q F1<ad41>108
+576 Q F2(ma)23.08 E(gnitude[/azimuth])-.1 E F0 1.15(Sets the parameters\
+ which control the synthetic illumination of the gridded data \(shaded \
+relief\).)144 588 R .051(The v)144 600 R(alue)-.25 E F2(ma)2.551 E
+(gnitude)-.1 E F0 .051(is an ef)2.551 F(fecti)-.25 E .351 -.15(ve ve)
+-.25 H .051(rtical e).15 F .05
+(xageration which modulates the intensity of the shad-)-.15 F .826
+(ing; typical v)144 612 R .826(alues are in the 0.1 to 0.5 range.)-.25 F
+.827(The v)5.827 F(alue)-.25 E F2(azimuth)3.327 E F0 .827
+(is the azimuth from which the)3.327 F(data is illuminated.)144 624 Q
 (Def)5 E(aults:)-.1 E F2(ma)2.5 E(gnitude)-.1 E F0 2.5(=0)2.5 G(.2;)-2.5
-E F2(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)-2.5 E F1<ad42>108 552 Q F2(tic)
-23.63 E(kinfo)-.2 E F0 .218(Sets map boundary tickmark interv)144 564 R
-.218(als. See the)-.25 F F1(psbasemap)2.719 E F0 .219
-(manual page for details. By def)2.719 F .219(ault the)-.1 F
+E F2(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)-2.5 E F1<ad42>108 640.8 Q F2
+(tic)23.63 E(kinfo)-.2 E F0 .219(Sets map boundary tickmark interv)144
+652.8 R .219(als. See the)-.25 F F1(psbasemap)2.719 E F0 .218
+(manual page for details. By def)2.719 F .218(ault the)-.1 F
 (program chooses basemap annotations based on the map boundaries.)144
-576 Q F1<ad44>108 592.8 Q F2([\215ipcolor/\215ipshade])23.08 E F0
-(Normally)144 604.8 Q 3.321(,t)-.65 G .821(he color or grayscale tables\
- used for color maps run from cool colors \(or dark grays\))-3.321 F
-1.289(for lo)144 616.8 R 3.789(wg)-.25 G 1.289(rid v)-3.789 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.79
-(alues. This)-.25 F 1.29(option re)3.79 F -.15(ve)-.25 G 1.29(rses the)
-.15 F .028
+664.8 Q F1<ad44>108 681.6 Q F2([\215ipcolor/\215ipshade])23.08 E F0
+(Normally)144 693.6 Q 3.32(,t)-.65 G .821(he color or grayscale tables \
+used for color maps run from cool colors \(or dark grays\))-3.32 F 1.29
+(for lo)144 705.6 R 3.79(wg)-.25 G 1.29(rid v)-3.79 F 1.289
+(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.789
+(alues. This)-.25 F 1.289(option re)3.789 F -.15(ve)-.25 G 1.289
+(rses the).15 F .028
 (color table so that cool colors \(dark grays\) correspond to high v)144
-628.8 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 640.8
-Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F1<ad44>3.954 E F0 1.454
-(is gi)3.954 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
-the color table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 652.8 R .216
-(either by synthetic illumination \()5.216 F F1<ad47>A F2(2)A F0 2.716
-(\)o)C 2.715(ru)-2.716 G .215(sing an)-2.715 F .021(intensity \214le \()
-144 664.8 R F1<ad4b>A F0(and)2.522 E F1<ad47>2.522 E F2(3)A F0 .022
-(options\), then setting)2.522 F F2(\215ipshade)2.522 E F0 2.522(=1w)
-2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .022
-(ntion to).15 F .088(be re)144 676.8 R -.15(ve)-.25 G .088
-(rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
-(rlaid as light shading\).).15 F(Using)5.087 E F1<ad44>2.587 E F2(0/1)A
-F0 .087(will \215ip the shading con-)2.587 F -.15(ve)144 688.8 S
-(ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E
-(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F1<ad45>108 705.6 Q F0
-([)23.63 E F2(vie)A(w_az/vie)-.15 E(w_el)-.15 E F0(])A .462
-(Sets the azimuth and ele)144 717.6 R -.25(va)-.25 G .462(tion in de).25
-F .462(grees of the vie)-.15 F .462(wpoint for 3D perspecti)-.25 F .762
--.15(ve v)-.25 H(ie).15 E 2.962(ws. An)-.25 F F2(vie)2.962 E(w_az)-.15 E
-F0 1.527(of 0 represents a vie)144 729.6 R 4.027(wf)-.25 G 1.527
-(rom the north, and)-4.027 F F2(vie)4.027 E(w_az)-.15 E F0 4.027(=9)
-4.027 G 4.027(0r)-4.027 G 1.526(epresents a vie)-4.027 F 4.026(wf)-.25 G
-1.526(rom the east.)-4.026 F(An)6.526 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
+717.6 R .029(alues and hot colors \(light grays\) to)-.25 F(lo)144 729.6
+Q 3.955(wv)-.25 G 3.955(alues. If)-4.205 F F1<ad44>3.955 E F0 1.454
+(is gi)3.955 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
+the color table used for color or gray \214ll plots,)-3.954 F
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
+Cg EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Italic at 0 SF(vie)144 84 Q
-(w_el)-.15 E F0(of 0 represents a horizontal vie)2.5 E 3.8 -.65(w. D)
--.25 H(ef).65 E(ault:)-.1 E F1(vie)2.5 E(w_az)-.15 E F0 2.5(=2)2.5 G
-(00.; ele)-2.5 E -.25(va)-.25 G(tion = 40.).25 E/F2 10/Times-Bold at 0 SF
-<ad47>108 100.8 Q F1(color_mode)22.52 E F0 -.45(Tu)144 112.8 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F1
-(color_mode)164 124.8 Q F0 2.5(=1)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G
-(olor/gray \214ll.)-2.5 E F1(color_mode)164 136.8 Q F0 2.5(=2)2.5 G 2.5
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F .216
+(shaded or unshaded. If the plot is to be shaded,)144 84 R .216
+(either by synthetic illumination \()5.216 F/F1 10/Times-Bold at 0 SF<ad47>
+A/F2 10/Times-Italic at 0 SF(2)A F0 2.716(\)o)C 2.716(ru)-2.716 G .216
+(sing an)-2.716 F .022(intensity \214le \()144 96 R F1<ad4b>A F0(and)
+2.522 E F1<ad47>2.522 E F2(3)A F0 .022(options\), then setting)2.522 F
+F2(\215ipshade)2.522 E F0 2.522(=1w)2.522 G .022
+(ill cause the shading con)-2.522 F -.15(ve)-.4 G .021(ntion to).15 F
+.087(be re)144 108 R -.15(ve)-.25 G .087(rsed \(e.g. high intensities o)
+.15 F -.15(ve)-.15 G .087(rlaid as light shading\).).15 F(Using)5.087 E
+F1<ad44>2.587 E F2(0/1)A F0 .088(will \215ip the shading con-)2.588 F
+-.15(ve)144 120 S(ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def)
+.15 E(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F1<ad45>108 136.8
+Q F0([)23.63 E F2(vie)A(w_az/vie)-.15 E(w_el)-.15 E F0(])A .462
+(Sets the azimuth and ele)144 148.8 R -.25(va)-.25 G .462(tion in de).25
+F .462(grees of the vie)-.15 F .462(wpoint for 3D perspecti)-.25 F .762
+-.15(ve v)-.25 H(ie).15 E 2.962(ws. An)-.25 F F2(vie)2.962 E(w_az)-.15 E
+F0 1.526(of 0 represents a vie)144 160.8 R 4.026(wf)-.25 G 1.527
+(rom the north, and)-4.026 F F2(vie)4.027 E(w_az)-.15 E F0 4.027(=9)
+4.027 G 4.027(0r)-4.027 G 1.527(epresents a vie)-4.027 F 4.027(wf)-.25 G
+1.527(rom the east.)-4.027 F(An)6.527 E F2(vie)144 172.8 Q(w_el)-.15 E
+F0(of 0 represents a horizontal vie)2.5 E 3.8 -.65(w. D)-.25 H(ef).65 E
+(ault:)-.1 E F2(vie)2.5 E(w_az)-.15 E F0 2.5(=2)2.5 G(00.; ele)-2.5 E
+-.25(va)-.25 G(tion = 40.).25 E F1<ad47>108 189.6 Q F2(color_mode)22.52
+E F0 -.45(Tu)144 201.6 S
+(rns on color \214ll plot and sets the style of the plot.).45 E F2
+(color_mode)164 213.6 Q F0 2.5(=1)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G
+(olor/gray \214ll.)-2.5 E F2(color_mode)164 225.6 Q F0 2.5(=2)2.5 G 2.5
 (:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(synthetic illumination.)204 148.8 Q F1(color_mode)164 160.8 Q F0 2.5
+(synthetic illumination.)204 237.6 Q F2(color_mode)164 249.6 Q F0 2.5
 (=3)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(an intensity \214le. The)204 172.8 Q F2<ad4b>2.5 E F0
-(option must be used to specify)204 184.8 Q(the intensity \214le.)252
-196.8 Q F1(color_mode)164 208.8 Q F0 2.5(=4)2.5 G 2.5(:3)-2.5 G 2.5(DC)
--2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252 220.8 Q F1
-(color_mode)164 232.8 Q F0 2.5(=5)2.5 G 2.5(:3)-2.5 G 2.5(DC)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 244.8 Q F1
-(color_mode)164 256.8 Q F0 2.5(=6)2.5 G 2.5(:3)-2.5 G 2.5(Dm)-2.5 G
-(esh plot.)-2.5 E F1(color_mode)164 268.8 Q F0 2.5(=7)2.5 G 2.5(:3)-2.5
-G 2.5(Dm)-2.5 G(esh plot with contours.)-2.5 E(See the)144 280.8 Q F2
+(an intensity \214le. The)204 261.6 Q F1<ad4b>2.5 E F0
+(option must be used to specify)204 273.6 Q(the intensity \214le.)252
+285.6 Q F2(color_mode)164 297.6 Q F0 2.5(=4)2.5 G 2.5(:3)-2.5 G 2.5(DC)
+-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252 309.6 Q F2
+(color_mode)164 321.6 Q F0 2.5(=5)2.5 G 2.5(:3)-2.5 G 2.5(DC)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 333.6 Q F2
+(color_mode)164 345.6 Q F0 2.5(=6)2.5 G 2.5(:3)-2.5 G 2.5(Dm)-2.5 G
+(esh plot.)-2.5 E F2(color_mode)164 357.6 Q F0 2.5(=7)2.5 G 2.5(:3)-2.5
+G 2.5(Dm)-2.5 G(esh plot with contours.)-2.5 E(See the)144 369.6 Q F1
 (grdimage)2.5 E F0
-(manual page for information on shading with intensity \214les)2.5 E F2
-<ad48>108 297.6 Q F0 .162(This "help" \215ag cause the program to print\
- out a description of its operation and then e)22.52 F .162(xit immedi-)
--.15 F(ately)144 309.6 Q(.)-.65 E F2<ad49>108 326.4 Q F1(gr)26.41 E
-(d\214le)-.37 E F0 1.299
-(Sets the name of the gridded data \214le to be plotted.)144 338.4 R
-1.298(The data must be in a form acceptable to)6.298 F F2(GMT)144 350.4
-Q F0 -.15(ve)2.5 G(rsion 3 programs \(see the).15 E F2(GMT)2.5 E F0
-(Cookbook & T)2.5 E(echnical Reference\).)-.7 E F2<ad4a>108 367.2 Q F1
-(pr)25.3 E(ojection)-.45 E F0([)A F1(/scale | /width)A F0(])A .367
-(Selects the map projection. By def)144 379.2 R .368
+(manual page for information on shading with intensity \214les)2.5 E F1
+<ad48>108 386.4 Q F0 .162(This "help" \215ag cause the program to print\
+ out a description of its operation and then e)22.52 F .161(xit immedi-)
+-.15 F(ately)144 398.4 Q(.)-.65 E F1<ad49>108 415.2 Q F2(gr)26.41 E
+(d\214le)-.37 E F0 1.298
+(Sets the name of the gridded data \214le to be plotted.)144 427.2 R
+1.299(The data must be in a form acceptable to)6.298 F F1(GMT)144 439.2
+Q F0 -.15(ve)2.5 G(rsion 3 programs \(see the).15 E F1(GMT)2.5 E F0
+(Cookbook & T)2.5 E(echnical Reference\).)-.7 E F1<ad4a>108 456 Q F2(pr)
+25.3 E(ojection)-.45 E F0([)A F2(/scale | /width)A F0(])A .368
+(Selects the map projection. By def)144 468 R .367
 (ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.668(to \214t on the selected page size \(see)144 391.2 R F2<ad50>3.168
-E F0 .668(option\). The user may specify a dif)3.168 F .667
+.667(to \214t on the selected page size \(see)144 480 R F1<ad50>3.168 E
+F0 .668(option\). The user may specify a dif)3.168 F .668
 (ferent projection to be)-.25 F .768(used, in which case the plot scale\
  is still automatically chosen to \214t the page. The user may also)144
-403.2 R .034(specify both the projection and the plot scale. If the pro\
-jection specifying character is upper case, a)144 415.2 R 1.508
-(plot width rather than a plot scale is used.)144 427.2 R 1.508
-(The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.509
+492 R .034(specify both the projection and the plot scale. If the proje\
+ction specifying character is upper case, a)144 504 R 1.509
+(plot width rather than a plot scale is used.)144 516 R 1.508
+(The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.508
 (gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 439.2 R
-(plot will not \214t on the def)144 451.2 Q
+inches. If the user speci\214es a plot scale such that the)144 528 R
+(plot will not \214t on the def)144 540 Q
 (ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E F2(CYLINDRICAL PR)144 475.2 Q
-(OJECTIONS:)-.3 E(\255Jc)144 499.2 Q F1(lon0/lat0/scale)A F0
-(\(Cassini\))2.5 E F2(\255Jm)144 511.2 Q F1(scale)A F0(\(Mercator\))2.5
-E F2<ad4a>144 523.2 Q(oa)-.15 E F1(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F2<ad4a>144 535.2 Q
-(ob)-.15 E F1(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F2<ad4a>144 547.2 Q(oc)-.15 E F1
+(ger page size will be chosen.)-.18 E F1(CYLINDRICAL PR)144 564 Q
+(OJECTIONS:)-.3 E(\255Jc)144 588 Q F2(lon0/lat0/scale)A F0(\(Cassini\))
+2.5 E F1(\255Jm)144 600 Q F2(scale)A F0(\(Mercator\))2.5 E F1<ad4a>144
+612 Q(oa)-.15 E F2(lon0/lat0/azimuth/scale)A F0
+(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 624 Q(ob)
+-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)2.5
+E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 636 Q(oc)-.15 E F2
 (lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F2(\255Jq)144 559.2 Q F1
+(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 648 Q F2
 (lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F2
-(\255Jt)144 571.2 Q F1(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2<ad4a>144 583.2 Q(u)-.15 E F1(zone/scale)A F0
+(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
+(\255Jt)144 660 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
+(erse Mercator\))-.15 E F1<ad4a>144 672 Q(u)-.15 E F2(zone/scale)A F0
 (\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2(\255Jy)144 595.2 Q F1(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F2(AZIMUTHAL PR)144 619.2 Q
-(OJECTIONS:)-.3 E<ad4a>144 643.2 Q(a)-.15 E F1(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F2<ad4a>144 655.2 Q(e)-.15 E F1(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F2(\255Jg)144 667.2 Q F1(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F2(\255Js)144 679.2 Q F1(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F2(CONIC PR)144 703.2 Q(OJECTIONS:)-.3
-E(\255Jb)144 727.2 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
+(erse Mercator\))-.15 E F1(\255Jy)144 684 Q F2(lon0/lats/scale)A F0
+(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 708 Q
+(OJECTIONS:)-.3 E F0(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)
+-2.5 E(4)198.45 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255Jl)144 84
-Q/F2 10/Times-Italic at 0 SF(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F1(MISCELLANEOUS PR)144 108 Q(OJECTIONS:)-.3 E(\255Jh)144 132 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 144 Q F2(lon0/scale)A F0
-(\(Sinusoidal\))2.5 E F1(\255Jk)144 156 Q F2(lon0/scale)A F0(\(Eck)2.5 E
-(ert VI\))-.1 E F1(\255Jn)144 168 Q F2(lon0/scale)A F0(\(Robinson\))2.5
-E F1(\255Jr)144 180 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E
-(ripel\))-.35 E F1(\255Jw)144 192 Q F2(lon0/scale)A F0(\(Moll)2.5 E
-(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144 216 Q(OJECTIONS:)-.3 E(\255Jp)
-144 240 Q F2(scale)A F0
-(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 252 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4a>144 84 Q
+(a)-.15 E/F2 10/Times-Italic at 0 SF(lon0/lat0/scale)A F0(\(Lambert\).)2.5
+E F1<ad4a>144 96 Q(e)-.15 E F2(lon0/lat0/scale)A F0(\(Equidistant\).)2.5
+E F1(\255Jg)144 108 Q F2(lon0/lat0/scale)A F0(\(Orthographic\).)2.5 E F1
+(\255Js)144 120 Q F2(lon0/lat0/scale)A F0(\(General Stereographic\))2.5
+E F1(CONIC PR)144 144 Q(OJECTIONS:)-.3 E(\255Jb)144 168 Q F2
+(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E F1(\255Jl)144 180 Q F2
+(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5 E F1(MISCELLANEOUS PR)
+144 204 Q(OJECTIONS:)-.3 E(\255Jh)144 228 Q F2(lon0/scale)A F0
+(\(Hammer\))2.5 E F1(\255Ji)144 240 Q F2(lon0/scale)A F0(\(Sinusoidal\))
+2.5 E F1(\255Jk)144 252 Q F2(lon0/scale)A F0(\(Eck)2.5 E(ert VI\))-.1 E
+F1(\255Jn)144 264 Q F2(lon0/scale)A F0(\(Robinson\))2.5 E F1(\255Jr)144
+276 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E(ripel\))-.35 E
+F1(\255Jw)144 288 Q F2(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1
+(NON-GEOGRAPHICAL PR)144 312 Q(OJECTIONS:)-.3 E(\255Jp)144 336 Q F2
+(scale)A F0(\(Linear projection for polar \(theta,r\) coordinates\))2.5
+E F1(\255Jx)144 348 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
 (/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
 (og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 264 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 280.8 Q F2(intensity_\214le)22.52 E F0
+(More details can be found in the)144 360 Q F1(psbasemap)2.5 E F0
+(manpages.)2.5 E F1<ad4b>108 376.8 Q F2(intensity_\214le)22.52 E F0
 (Sets the name of the gridded data \214le containing instensity v)144
-292.8 Q(alues to be used for shading the map.)-.25 E F1<ad4c>108 309.6 Q
+388.8 Q(alues to be used for shading the map.)-.25 E F1<ad4c>108 405.6 Q
 F2(title:scalelabel)23.63 E F0 .157(Sets the title and the label for th\
 e colorscale \(if used\) of the plot. Note that a colon \(:\) rather th\
-an a)144 321.6 R 1.557(slash \(/\) is used to separate the labels. Colo\
-ns cannot be used in the labels themselv)144 333.6 R 1.557(es. If this)
--.15 F 1.367(option is not used, then a def)144 345.6 R 1.367
+an a)144 417.6 R 1.557(slash \(/\) is used to separate the labels. Colo\
+ns cannot be used in the labels themselv)144 429.6 R 1.557(es. If this)
+-.15 F 1.367(option is not used, then a def)144 441.6 R 1.367
 (ault title and colorscale label are pro)-.1 F 1.367
-(vided. If the title is supplied)-.15 F .742(alone, a def)144 357.6 R
-.742(ault colorscale label will be pro)-.1 F .742(vided. T)-.15 F 3.242
-(of)-.8 G .742(orce no title use)-3.242 F F1<ad4c>3.241 E F0 3.241("")C
-3.241(;t)-3.241 G 3.241(of)-3.241 G .741(orce no title or)-3.241 F
-(colorscale label use)144 369.6 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
-<ad4d>108 386.4 Q F0 3.055(As)20.86 G .555
+(vided. If the title is supplied)-.15 F .741(alone, a def)144 453.6 R
+.741(ault colorscale label will be pro)-.1 F .741(vided. T)-.15 F 3.242
+(of)-.8 G .742(orce no title use)-3.242 F F1<ad4c>3.242 E F0 3.242("")C
+3.242(;t)-3.242 G 3.242(of)-3.242 G .742(orce no title or)-3.242 F
+(colorscale label use)144 465.6 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
+<ad4d>108 482.4 Q F0 3.055(As)20.86 G .555
 (eries of "miscellaneous" options are pro)-3.055 F .555
 (vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055 E F1
 <ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1 G
-(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 398.4 R 3.829(,f)-.4
-G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
-(ther parameters associated with that option.)-3.829 F(The)6.328 E F1
-<ad4d>3.828 E F0(options)3.828 E .61(may be strung together separated b\
-y colons, e.g. "-MGQ100:GU", which is equi)144 410.4 R -.25(va)-.25 G
-.61(lent to "-MGQ).25 F(\255MGU".)144 422.4 Q F1<ad4e>108 439.2 Q F2(dr)
+(har)-3.055 E(-)-.2 E 1.328(acter identi\214er)144 494.4 R 3.828(,f)-.4
+G(ollo)-3.828 E 1.328(wed by an)-.25 F 3.828(yo)-.15 G 1.329
+(ther parameters associated with that option.)-3.828 F(The)6.329 E F1
+<ad4d>3.829 E F0(options)3.829 E .61(may be strung together separated b\
+y colons, e.g. "-MGQ100:GU", which is equi)144 506.4 R -.25(va)-.25 G
+.61(lent to "-MGQ).25 F(\255MGU".)144 518.4 Q F1<ad4e>108 535.2 Q F2(dr)
 23.08 E(ape_\214le)-.15 E F0 .312(Sets the name of the gridded data \
-\214le to be draped on the relief pro)144 451.2 R .312
-(vided by the \214le speci\214ed with)-.15 F(the)144 463.2 Q F1<ad49>
-3.156 E F0 .656(option. If)3.156 F F1<ad4e>3.156 E F2(dr)A(ape_\214le)
--.15 E F0 .657(is speci\214ed, then all color control options will appl\
-y to the data in)3.156 F(\\fIdrape_\214le)144 475.2 Q F2(.)A F1(\255MGD)
-108 492 Q F2(gmtdef/value)5.86 E F0(Allo)144 504 Q .227
+\214le to be draped on the relief pro)144 547.2 R .312
+(vided by the \214le speci\214ed with)-.15 F(the)144 559.2 Q F1<ad49>
+3.157 E F0 .657(option. If)3.157 F F1<ad4e>3.157 E F2(dr)A(ape_\214le)
+-.15 E F0 .656(is speci\214ed, then all color control options will appl\
+y to the data in)3.157 F(\\fIdrape_\214le)144 571.2 Q F2(.)A F1(\255MGD)
+108 588 Q F2(gmtdef/value)5.86 E F0(Allo)144 600 Q .227
 (ws the user to set the)-.25 F F1(GMT)2.727 E F0(def)2.727 E .227
 (ault v)-.1 F .227
-(alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 516 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
-(epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
+(alues used as the plot is constructed. This command may)-.25 F 1.134
+(be gi)144 612 R -.15(ve)-.25 G 3.634(nr).15 G 1.133
+(epeatedly to set as man)-3.634 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
 1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 528 Q
+(xample, to set the basemap)-.15 F(annotation font to Courier)144 624 Q
 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGF)108 544.8 Q F2(scale_loc)6.97 E F0
-(Sets the location of the color scale. The possible v)144 556.8 Q
-(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 568.8
+(\255MGF)108 640.8 Q F2(scale_loc)6.97 E F0
+(Sets the location of the color scale. The possible v)144 652.8 Q
+(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 664.8
 Q F0 2.5(=b)2.5 G 15.81(:b)-2.5 G(ottom of plot)-15.81 E F2(scale_loc)
-180 580.8 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
-(scale_loc)180 592.8 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
--18.03 E F2(scale_loc)180 604.8 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
-(ight of plot)-17.48 E([Def)144 616.8 Q(ault)-.1 E F2(scale_loc)2.5 E F0
-2.5(=b)2.5 G(])-2.5 E F1(\255MGL)108 633.6 Q F0([)6.41 E F2(f)A F0(][)A
-F2(x)A F0(])A F2(lon0/lat0/slat/length)A F0([)A F2(m)A F0(])A(Dra)144
-645.6 Q 1.44(ws a simple map scale centered on)-.15 F F2(lon0/lat0)3.94
-E F0 6.44(.U)C(se)-6.44 E F1(\255Lx)3.94 E F0 1.44
-(to specify position in inch instead.)3.94 F 1.333
-(Scale is calculated at latitude)144 657.6 R F2(slat)3.833 E F0(,)A F2
-(length)3.833 E F0 1.333(is in km [miles if m is appended].)3.833 F(Use)
-6.333 E F1(\255Lf)3.833 E F0 1.334(to get a)3.834 F("f)144 669.6 Q(anc)
--.1 E(y" scale [Def)-.15 E(ault is plain].)-.1 E F1(\255MGQ)108 686.4 Q
-F2(dpi)5.3 E F0 .839(Sets the resolution in dots per inch of the raster\
- image used for color \214ll maps. Lar)144 698.4 R .838(ger v)-.18 F
-.838(alues of)-.25 F F2(dpi)144 710.4 Q F0(produce lar)2.5 E
-(ger Postscript plot \214les. [Def)-.18 E(ault is 100].)-.1 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0
-Cg EP
+180 676.8 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
+(scale_loc)180 688.8 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
+-18.03 E F2(scale_loc)180 700.8 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
+(ight of plot)-17.48 E([Def)144 712.8 Q(ault)-.1 E F2(scale_loc)2.5 E F0
+2.5(=b)2.5 G(])-2.5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MGS)108 84
-Q/F2 10/Times-Italic at 0 SF(scalefactor)7.52 E F0 .728
-(The gridded data is multiplied by)144 96 R F2(scalefactor)3.229 E F0
-5.729(.T)C .729(his option is most often used \215ip the sign of the)
--5.729 F(data \()144 108 Q F2(scalefactor)A F0 2.5<3dad>2.5 G(1\). [Def)
--2.5 E(ault no scaling])-.1 E F1(\255MGT)108 124.8 Q F2
-(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .488(Causes a te)144
-136.8 R .488(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0
-.487(is te)2.987 F .487(xt size in points,)-.15 F F2(angle)2.987 E F0
-.487(is measured in de)2.987 F(grees)-.15 E(counter)144 148.8 Q .8
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MGL)108 84
+Q F0([)6.41 E/F2 10/Times-Italic at 0 SF(f)A F0(][)A F2(x)A F0(])A F2
+(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2(+llabel)A F0(])A
+(Dra)144 96 Q .16(ws a simple map scale centered on)-.15 F F2(lon0/lat0)
+2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0 .16(to get a "f)2.66
+F(anc)-.1 E .16(y" scale [Def)-.15 F .16(ault is plain].)-.1 F(Use)144
+108 Q F1(\255Lx)2.962 E F0 .461
+(to specify the position in inches instead of map units.)2.962 F .461
+(The scale is calculated at latitude)5.461 F F2(slat)144 120 Q F0 2.928
+(;i)C 2.928(ft)-2.928 G .428
+(he string "center" is used instead of a numerical v)-2.928 F .429
+(alue for)-.25 F F2(slat)2.929 E F0 2.929(,t)C .429
+(hen the macro will set the)-2.929 F 1.596
+(scaling according to the center of the plot bounds.)144 132 R 1.596
+(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.595
+(is in km by)4.096 F(def)144 144 Q .278(ault, b)-.1 F .279(ut the units\
+ can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet, \
+k = kilome-)-.2 F .912
+(ters, M = statue miles, n = nautical miles, and u = US surv)144 156 R
+1.211 -.15(ey f)-.15 H .911(eet. Append).15 F F2(+l)3.411 E F0 .911
+(to label the scale)3.411 F(with the rele)144 168 Q -.25(va)-.25 G
+(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
+(ferent label string.)-.25 E F1(\255MGQ)108 184.8 Q F2(dpi)5.3 E F0 .839
+(Sets the resolution in dots per inch of the raster image used for colo\
+r \214ll maps. Lar)144 196.8 R .839(ger v)-.18 F .839(alues of)-.25 F F2
+(dpi)144 208.8 Q F0(produce lar)2.5 E(ger Postscript plot \214les. [Def)
+-.18 E(ault is 100].)-.1 E F1(\255MGS)108 225.6 Q F2(scalefactor)7.52 E
+F0 .729(The gridded data is multiplied by)144 237.6 R F2(scalefactor)
+3.229 E F0 5.729(.T)C .729
+(his option is most often used \215ip the sign of the)-5.729 F(data \()
+144 249.6 Q F2(scalefactor)A F0 2.5<3dad>2.5 G(1\). [Def)-2.5 E
+(ault no scaling])-.1 E F1(\255MGT)108 266.4 Q F2
+(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .487(Causes a te)144
+278.4 R .487(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0
+.487(is te)2.987 F .488(xt size in points,)-.15 F F2(angle)2.988 E F0
+.488(is measured in de)2.988 F(grees)-.15 E(counter)144 290.4 Q .8
 (-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
 (sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
-3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.615(starts with a leading h)144
-160.8 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
-1.615(is tak)4.115 F 1.614(en to be a te)-.1 F 1.614(xtstring with the)
--.15 F 1.022(desired fontname.)144 172.8 R 1.022(See the)6.022 F F1
+3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.614(starts with a leading h)144
+302.4 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
+1.615(is tak)4.115 F 1.615(en to be a te)-.1 F 1.615(xtstring with the)
+-.15 F 1.023(desired fontname.)144 314.4 R 1.022(See the)6.023 F F1
 (gmtdefaults)3.522 E F0 1.022(man page for names and numbers of a)3.522
-F -.25(va)-.2 G 1.023(ilable fonts \(or).25 F(run)144 184.8 Q F1 .112
-(pstext \255L)2.612 F F0 2.612(\). The)B .111
-(alignment number refers to the part of the te)2.611 F .111
-(xtstring that will be mapped onto)-.15 F .289(the \()144 196.8 R F2
-(x,y)A F0 2.789(\)p)C .289(oint: 1 = Lo)-2.789 F .289(wer Left corner)
--.25 F 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789
-(,3=L)-.4 G -.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F
-(Center)144 208.8 Q 2.783(,7=M)-.4 G .283
+F -.25(va)-.2 G 1.022(ilable fonts \(or).25 F(run)144 326.4 Q F1 .111
+(pstext \255L)2.611 F F0 2.611(\). The)B .111
+(alignment number refers to the part of the te)2.611 F .112
+(xtstring that will be mapped onto)-.15 F .29(the \()144 338.4 R F2(x,y)
+A F0 2.79(\)p)C .289(oint: 1 = Lo)-2.79 F .289(wer Left corner)-.25 F
+2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789(,3=L)-.4 G
+-.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F(Center)144
+350.4 Q 2.783(,7=M)-.4 G .283
 (id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
 2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-220.8 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
-G(imes as needed.)-2.5 E F1 3.36(\255MGU [)108 237.6 R F2(/dx/dy/)A F1
-(][)A F2(label)A F1(])A .58(Draw Unix System time stamp on plot.)144
-249.6 R .581(User may specify wher)5.581 F 3.081(et)-.18 G .581(he lo)
--3.081 F .581(wer left cor)-.1 F .581(ner of the)-.15 F 2.777
-(stamp should fall on the page r)144 261.6 R(elati)-.18 E 2.977 -.1
+362.4 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
+G(imes as needed.)-2.5 E F1 3.36(\255MGU [)108 379.2 R F2(/dx/dy/)A F1
+(][)A F2(label)A F1(])A .581(Draw Unix System time stamp on plot.)144
+391.2 R .581(User may specify wher)5.581 F 3.08(et)-.18 G .58(he lo)
+-3.08 F .58(wer left cor)-.1 F .58(ner of the)-.15 F 2.777
+(stamp should fall on the page r)144 403.2 R(elati)-.18 E 2.977 -.1
 (ve t)-.1 H 5.277(ol).1 G -.1(ow)-5.277 G 2.777(er left cor).1 F 2.777
 (ner of plot in inch [Default is)-.15 F 2.5
-(\(-0.75,-0.75\)]. Optionally)144 273.6 R 2.5(,a)-.55 G
+(\(-0.75,-0.75\)]. Optionally)144 415.2 R 2.5(,a)-.55 G
 (ppend a label, or c \(which will plot the command string)-2.5 E(.\))
--.15 E(\255MVM)108 290.4 Q F2(mesh_pen)144 302.4 Q F0 .227
-(Set pen attrib)144 314.4 R .227(utes for mesh plot.)-.2 F .227
+-.15 E(\255MVM)108 432 Q F2(mesh_pen)144 444 Q F0 .228(Set pen attrib)
+144 456 R .227(utes for mesh plot.)-.2 F .227
 (The mesh plot must be speci\214ed with the)5.227 F F1<ad47>2.727 E F0
-.227(option. See chapter)2.727 F .719(4.12 in the GMT T)144 326.4 R .718
+.227(option. See chapter)2.727 F .718(4.12 in the GMT T)144 468 R .718
 (echnical reference for a discussion of GMT pen v)-.7 F 3.218
-(alues. [Def)-.25 F .718(aults: width = 1,)-.1 F(color = 0/0/0, te)144
-338.4 Q(xture = solid].)-.15 E F1(\255MVN)108 355.2 Q F0([)6.42 E F2
-(null[/r/g/b])A F0(])A(Dra)144 367.2 Q .482(ws a plane at the le)-.15 F
+(alues. [Def)-.25 F .719(aults: width = 1,)-.1 F(color = 0/0/0, te)144
+480 Q(xture = solid].)-.15 E F1(\255MVN)108 496.8 Q F0([)6.42 E F2
+(null[/r/g/b])A F0(])A(Dra)144 508.8 Q .482(ws a plane at the le)-.15 F
 -.15(ve)-.25 G 2.982(lo).15 G 2.982(ft)-2.982 G(he)-2.982 E F2(null)
 2.982 E F0 -.25(va)2.982 G .482
 (lue \(with respect to the data in the grid \214le speci\214ed with).25
-F(the)144 379.2 Q F1<ad49>3.272 E F0 .772
-(option. If the optional r/g/b is pro)3.272 F .772(vided, the frontal f)
--.15 F .771(acade between the plane and the data)-.1 F 1.066
-(perimeter is \214lled with this color)144 391.2 R 3.567(.I)-.55 G(f)
+F(the)144 520.8 Q F1<ad49>3.271 E F0 .772
+(option. If the optional r/g/b is pro)3.271 F .772(vided, the frontal f)
+-.15 F .772(acade between the plane and the data)-.1 F 1.067
+(perimeter is \214lled with this color)144 532.8 R 3.567(.I)-.55 G(f)
 -3.567 E F1(\255MVN)3.567 E F0 1.067(is gi)3.567 F -.15(ve)-.25 G 3.567
-(nb).15 G 3.567(yi)-3.567 G 1.067(tself, then)-3.567 F F1(mbm_grd3dplot)
-3.567 E F0 1.067(causes the)3.567 F 2.863(null plane to be dra)144 403.2
-R 2.863(wn at the minimum z-le)-.15 F -.15(ve)-.25 G 5.362(la).15 G
-2.862(nd the f)-5.362 F 2.862(acade to be colored a light gray)-.1 F
-(\(r=g=b=200\).)144 415.2 Q F1<ad4f>108 432 Q F2 -.45(ro)22.52 G(ot).45
-E F0 .422(Sets the root used to construct the \214lename of the output \
-shellscript \()144 444 R F2 -.45(ro)C(ot).45 E F0 .423
-(.cmd\) and names of \214les)B .157
-(created when the shellscript is run.)144 456 R .157
+(nb).15 G 3.566(yi)-3.567 G 1.066(tself, then)-3.566 F F1(mbm_grd3dplot)
+3.566 E F0 1.066(causes the)3.566 F 2.862(null plane to be dra)144 544.8
+R 2.862(wn at the minimum z-le)-.15 F -.15(ve)-.25 G 5.362(la).15 G
+2.862(nd the f)-5.362 F 2.863(acade to be colored a light gray)-.1 F
+(\(r=g=b=200\).)144 556.8 Q F1<ad4f>108 573.6 Q F2 -.45(ro)22.52 G(ot)
+.45 E F0 .423(Sets the root used to construct the \214lename of the out\
+put shellscript \()144 585.6 R F2 -.45(ro)C(ot).45 E F0 .422
+(.cmd\) and names of \214les)B .156
+(created when the shellscript is run.)144 597.6 R .157
 (Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 468 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-484.8 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
+5.157 F(as the)144 609.6 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
+626.4 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
 he size of the page the plot will be centered on. If the user does not \
-set the plot)144 496.8 R .126(scale, the plot will be sized as lar)144
-508.8 R .125(ge as will \214t on the designated page. If the user sets \
+set the plot)144 638.4 R .125(scale, the plot will be sized as lar)144
+650.4 R .125(ge as will \214t on the designated page. If the user sets \
 the plot scale)-.18 F .948
 (such that the plot will not \214t on the designated page, a lar)144
-520.8 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
-(page sizes are:)144 532.8 Q(American ANSI sizes:)169 556.8 Q 12.5(A8)
-169 568.8 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
-5 E 10(B1)169 580.8 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 592.8 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 604.8 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 616.8 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 628.8 S
-(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
-169 640.8 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
-(Metric ISO A sizes:)169 664.8 Q 5(A0 841.0)169 676.8 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 688.8 R 5(x8)
-2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 700.8 R 5
-(x5)2.5 G(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 712.8 R
-5(x4)2.5 G(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 724.8 R
-5(x2)2.5 G(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)204.835 E 0
-Cg EP
+662.4 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
+(page sizes are:)144 674.4 Q(American ANSI sizes:)169 698.4 Q 12.5(A8)
+169 710.4 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
+5 E 10(B1)169 722.4 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
+(431.8 mm\))5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5
+E(6)198.45 E 0 Cg EP
 %%Page: 7 7
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 5(A5 148.0)169 84 R 5(x2)2.5 G
-(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5(A6 105.0)169 96
-R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E(5.83 in.\))5 E 7.5
-(A7 74.0)169 108 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5 G(.91 x)-2.5 E
-(4.13 in.\))5 E 7.5(A8 52.0)169 120 R 7.5(x7)2.5 G(4.0 mm)-7.5 E 2.5
-(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 132 R 7.5(x5)2.5 G
-(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5(A10 26.0)169
-144 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E
-(Metric ISO B sizes:)169 168 Q 5(B0 1000.0x)169 180 R(1414.0 mm)2.5 E
-(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 192 R 2.5(x1)2.5 G(000.0 mm)
--2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 204 R 5(x7)2.5 G
-(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 216 R 5(x5)2.5 G
-(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 228 R 5(x3)2.5 G
-(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 240 R
-5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5
-(B6 125.0)169 252 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
-(6.93 in.\))5 E 7.5(B7 88.0)169 264 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5
-G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 276 R 7.5(x8)2.5 G(8.0 mm)
--7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 288 R 7.5
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F 10(C1)169 84 S(7.0 x 22.0 in.)-10 E
+2.5(\(4)10 G(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 96 S(2.0 x 34.0 in.)
+-10 E 2.5(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 108 S
+(4.0 x 44.0 in.)-10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169
+120 S(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5
+(E1 44.0)169 132 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10
+E(Metric ISO A sizes:)169 156 Q 5(A0 841.0)169 168 R 2.5(x1)2.5 G
+(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 180 R 5(x8)2.5
+G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 192 R 5(x5)2.5 G
+(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 204 R 5(x4)2.5 G
+(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 216 R 5(x2)2.5 G
+(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 228 R
+5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5
+(A6 105.0)169 240 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E
+(5.83 in.\))5 E 7.5(A7 74.0)169 252 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5
+G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 264 R 7.5(x7)2.5 G(4.0 mm)
+-7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 276 R 7.5
+(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5
+(A10 26.0)169 288 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E
+(1.46 in.\))5 E(Metric ISO B sizes:)169 312 Q 5(B0 1000.0x)169 324 R
+(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 336 R 2.5(x1)
+2.5 G(000.0 mm)-2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 348 R 5
+(x7)2.5 G(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 360 R 5
+(x5)2.5 G(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 372 R 5
+(x3)2.5 G(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)
+169 384 R 5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5
+E 5(B6 125.0)169 396 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
+(6.93 in.\))5 E 7.5(B7 88.0)169 408 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5
+G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 420 R 7.5(x8)2.5 G(8.0 mm)
+-7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 432 R 7.5
 (x6)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5
-(B10 31.0)169 300 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
-(1.73 in.\))5 E(Metric ISO C sizes:)169 324 Q 5(C0 914.4)169 336 R 2.5
-(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 348 R
-5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 360 R 5
-(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 372 R 5
-(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 384 R 5
+(B10 31.0)169 444 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
+(1.73 in.\))5 E(Metric ISO C sizes:)169 468 Q 5(C0 914.4)169 480 R 2.5
+(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 492 R
+5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 504 R 5
+(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 516 R 5
+(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 528 R 5
 (x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
-169 396 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
-E 5(C6 114.3)169 408 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
-(6.40 in.\))5 E 7.5(C7 81.3)169 420 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
-G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 444 Q(ge format sizes:)
--.18 E 2.5(m1 1371.6)169 456 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 468 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 480 R 2.5
+169 540 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
+E 5(C6 114.3)169 552 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
+(6.40 in.\))5 E 7.5(C7 81.3)169 564 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
+G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 588 Q(ge format sizes:)
+-.18 E 2.5(m1 1371.6)169 600 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
+(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 612 R 2.5(x2)2.5 G
+(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 624 R 2.5
 (x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-492 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 504 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 516 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(The def)144 540 Q(ault page size is A.)-.1 E
-/F1 10/Times-Bold at 0 SF<ad51>108 556.8 Q F0(Normally)22.52 E 2.867(,t)
+636 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
+(m5 1524.0)169 648 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
+5 E 2.5(m6 1524.0)169 660 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
+(\(60.00 x 96.00 in.\))5 E(The def)144 684 Q(ault page size is A.)-.1 E
+/F1 10/Times-Bold at 0 SF<ad51>108 700.8 Q F0(Normally)22.52 E 2.866(,t)
 -.65 G .367
-(he output plot generation shellscript includes lines which e)-2.867 F
--.15(xe)-.15 G .367(cute a program to display).15 F 1.071
-(the Postscript image on the screen.)144 568.8 R 1.071
+(he output plot generation shellscript includes lines which e)-2.866 F
+-.15(xe)-.15 G .367(cute a program to display).15 F 1.072
+(the Postscript image on the screen.)144 712.8 R 1.071
 (This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 580.8 S .148
-(cuting the shellscript produces a Postscript plot b).15 F .147
-(ut does not attempt to display it on the screen.)-.2 F .326
-(The program to be used to display the Postscript is set using)144 592.8
-R F1(mbdefaults)2.827 E F0 2.827(;t)C .327(he def)-2.827 F .327(ault v)
--.1 F .327(alue can be)-.25 F -.15(ove)144 604.8 S
-(rridden by setting the en).15 E(vironment v)-.4 E
-(ariable $MB_PS_VIEWER.)-.25 E F1<ad52>108 621.6 Q/F2 10/Times-Italic at 0
-SF(west/east/south/north)23.08 E .736(west, east, south,)144 633.6 R F0
-(and)3.236 E F2(north)3.236 E F0 .736(specify the Re)3.236 F .736
-(gion of interest.)-.15 F 2.336 -.8(To s)5.736 H .736
-(pecify boundaries in de).8 F .736(grees and)-.15 F 1.161
-(minutes [and seconds], use the dd:mm[:ss] format.)144 645.6 R(Append)
-6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.162
-(wer left and upper right map)-.25 F .209(coordinates are gi)144 657.6 R
--.15(ve)-.25 G 2.709(ni).15 G .209(nstead of wesn.)-2.709 F -1.1(Yo)
+(exe)144 724.8 S .147
+(cuting the shellscript produces a Postscript plot b).15 F .148
+(ut does not attempt to display it on the screen.)-.2 F(MB-System 5.0)72
+768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(7)198.45 E 0 Cg EP
+%%Page: 8 8
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F(Alternati)144 84 Q -.15(ve)-.25 G
+(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H .392
+(king the plot generation shellscript with a).4 F/F1 10/Times-Bold at 0 SF
+(-N)2.891 E F0 .391(command line ar)2.891 F .391(gument also sup-)-.18 F
+.227(presses the screen display of the plot. The program to be used to \
+display the Postscript is set using)144 96 R F1(mbdefaults)144 108 Q F0
+7.891(;t)C 5.391(he def)-7.891 F 5.391(ault v)-.1 F 5.391(alue can be o)
+-.25 F -.15(ve)-.15 G 5.391(rridden by setting the en).15 F 5.39
+(vironment v)-.4 F(ariable)-.25 E($MB_PS_VIEWER.)144 120 Q F1<ad52>108
+136.8 Q/F2 10/Times-Italic at 0 SF(west/east/south/north)23.08 E .736
+(west, east, south,)144 148.8 R F0(and)3.236 E F2(north)3.236 E F0 .736
+(specify the Re)3.236 F .736(gion of interest.)-.15 F 2.336 -.8(To s)
+5.736 H .736(pecify boundaries in de).8 F .736(grees and)-.15 F 1.162
+(minutes [and seconds], use the dd:mm[:ss] format.)144 160.8 R(Append)
+6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.161
+(wer left and upper right map)-.25 F .208(coordinates are gi)144 172.8 R
+-.15(ve)-.25 G 2.708(ni).15 G .208(nstead of wesn.)-2.708 F -1.1(Yo)
 5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E F2
-(w/e/s/n)2.708 E F0(re)2.708 E .208(gion to ha)-.15 F .508 -.15(ve m)-.2
-H .208(ore room).15 F .199(between the image and the ax)144 669.6 R
+(w/e/s/n)2.708 E F0(re)2.708 E .209(gion to ha)-.15 F .509 -.15(ve m)-.2
+H .209(ore room).15 F .199(between the image and the ax)144 184.8 R
 2.699(es. A)-.15 F .199(smaller re)2.699 F .199
 (gion than speci\214ed in the grd\214le will result in a sub-)-.15 F
-(set of the grid [Def)144 681.6 Q(ault is re)-.1 E(gion gi)-.15 E -.15
+(set of the grid [Def)144 196.8 Q(ault is re)-.1 E(gion gi)-.15 E -.15
 (ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G(he grd\214le].)-2.5 E F1<ad53>108
-698.4 Q F2([color/shade])24.74 E F0 1.393(This option enables ef)144
-710.4 R(fecti)-.25 E 1.693 -.15(ve h)-.25 H 1.392
+213.6 Q F2([color/shade])24.74 E F0 1.392(This option enables ef)144
+225.6 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H 1.392
 (istogram equalization of the color and/or shading of the gridded).15 F
-.628(data. The equalization is not achie)144 722.4 R -.15(ve)-.25 G
+.628(data. The equalization is not achie)144 237.6 R -.15(ve)-.25 G
 3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F(MB-System 5.0)
-72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(7)204.835 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F .518(color or shading tables so tha\
-t the boundaries in the tables encompass equal fractions of the data-)
-144 84 R .19(points. This serv)144 96 R .19
+(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
+ shading tables so that the boundaries in the tables encompass equal fr\
+actions of the data-)144 249.6 R .19(points. This serv)144 261.6 R .19
 (es to focus color or shading contrasts in v)-.15 F .19
-(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .838
-(the data v)144 108 R 3.338(alues. If)-.25 F/F1 10/Times-Bold at 0 SF<ad53>
-3.338 E F0 .838(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838
-(lone or with)-3.338 F/F2 10/Times-Italic at 0 SF(color)3.338 E F0 3.338
-(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G .838
-(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 120 R .991
+(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
+(the data v)144 273.6 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
+(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
+F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
+.838(nables equalization of the color table)-3.338 F .991
+(used for color or gray \214ll plots,)144 285.6 R .991
 (shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .638(thetic illumination \()144 132 R F1<ad47>A
-F2(2)A F0 3.138(\)o)C 3.138(ru)-3.138 G .638
-(sing an intensity \214le \()-3.138 F F1<ad4b>A F0(and)3.137 E F1<ad47>
-3.137 E F2(3)A F0 .637(options\), then setting)3.137 F F2(shade)3.137 E
-F0 3.137(=1)3.137 G .5(will cause the shading to be equalized.)144 144 R
-(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
+(either by syn-)5.991 F .637(thetic illumination \()144 297.6 R F1<ad47>
+A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
+(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
+3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
+F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 309.6
+R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
 (will equalize the shading without equalizing)3 F(the color table.)144
-156 Q F1<ad55>108 172.8 Q F2(orientation)23.08 E F0 .2(Normally the ori\
-entation of the plot \(portrait or landscape\) is selected automaticall\
-y so as to maxi-)144 184.8 R .333(mize the plot scale.)144 196.8 R(The)
-5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
+321.6 Q F1<ad55>108 338.4 Q F2(orientation)23.08 E F0 .2(Normally the o\
+rientation of the plot \(portrait or landscape\) is selected automatica\
+lly so as to maxi-)144 350.4 R .334(mize the plot scale.)144 362.4 R
+(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
 (ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 208.8 Q F2(orientation)2.5 E F0
+E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
+(portrait plot will be produced; if)144 374.4 Q F2(orientation)2.5 E F0
 2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad57>108 225.6 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
+<ad57>108 391.2 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
 (ncolor)A(s)-.1 E F0(]] | cpt\214le])A
 (This option controls the color scheme used for color \214ll plots.)144
-237.6 Q(If)144 261.6 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
+403.2 Q(If)144 427.2 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
 -3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 273.6 Q F0 2.815(=2)2.815 G
-2.815(,t)-2.815 G .315
-(he color scheme will be a set of discrete color interv)-2.815 F .316
-(als. The color palette used is)-.25 F(set using)144 285.6 Q F2(palette)
+ading of colors. If)-.1 F F2(color_style)144 439.2 Q F0 2.816(=2)2.816 G
+2.816(,t)-2.816 G .316
+(he color scheme will be a set of discrete color interv)-2.816 F .315
+(als. The color palette used is)-.25 F(set using)144 451.2 Q F2(palette)
 2.5 E F0 2.5(.S)C -2.15 -.25(ev e)-2.5 H 2.5(np).25 G(alettes are a)-2.5
-E -.25(va)-.2 G(ilable:).25 E F2(palette)180 297.6 Q F0 2.5(=1)2.5 G
+E -.25(va)-.2 G(ilable:).25 E F2(palette)180 463.2 Q F0 2.5(=1)2.5 G
 26.36(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180
-309.6 Q F0 2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2
-(palette)180 321.6 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36
-H(ntensity colors).25 E F2(palette)180 333.6 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 345.6 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E F2(palette)180 357.6 Q F0 2.5(=6)
-2.5 G 26.36(:u)-2.5 G(niform black)-26.36 E F2(palette)180 369.6 Q F0
+475.2 Q F0 2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2
+(palette)180 487.2 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36
+H(ntensity colors).25 E F2(palette)180 499.2 Q F0 2.5(=4)2.5 G 26.36(:g)
+-2.5 G(rayscale)-26.36 E F2(palette)180 511.2 Q F0 2.5(=5)2.5 G 26.36
+(:u)-2.5 G(niform grayscale)-26.36 E F2(palette)180 523.2 Q F0 2.5(=6)
+2.5 G 26.36(:u)-2.5 G(niform black)-26.36 E F2(palette)180 535.2 Q F0
 2.5(=7)2.5 G 26.36(:u)-2.5 G(niform white)-26.36 E
-(The RGB de\214nitions of the color palettes are:)144 393.6 Q
-(color palette 1 \255 Haxby Color T)144 417.6 Q(able)-.8 E 5(red: 255)
-149 429.6 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
-(green: 255 186 161 189 236 255 236 235 190 127)149 441.6 Q(57)5 E 2.5
-(blue: 255)149 453.6 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)
-2.5 E(color palette 2 \255 High Intensity Colors)144 477.6 Q 5(red: 255)
-149 489.6 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5
-(green: 0)149 501.6 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5
-(blue: 0)149 513.6 R 7.5(00000)7.5 G(255 255 255 255 255)-5 E
-(color palette 3 \255 Lo)144 537.6 Q 2.5(wI)-.25 G(ntensity Colors)-2.5
-E 5(red: 200)149 549.6 R(194 179 141)2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5
-(green: 0)149 561.6 R 2.5(49 90)5 F(141 179 200 141)2.5 E 5(90 0 0 0)5 F
-7.5(blue: 0)149 573.6 R 7.5(00000)7.5 G(141 179 200 179 141)-5 E
-(color palette 4 \255 Grayscale)144 597.6 Q 5(red: 255)149 609.6 R
-(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)7.5 E
-(green: 255 230 204 179 153 128 102)149 621.6 Q 2.5(77 51 26)5 F(0)7.5 E
-2.5(blue: 255)149 633.6 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F
-(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 657.6 Q 5(red: 128)
-149 669.6 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(green: 128 128 128 128 128 128 128 128 128 128 128)149 681.6 Q 2.5
-(blue: 128)149 693.6 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(color palette 6 \255 Uniform Black)144 717.6 Q 10(red: 0)149 729.6 R
-7.5(0000000000)7.5 G(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(8)204.835 E 0 Cg EP
+(The RGB de\214nitions of the color palettes are:)144 559.2 Q
+(color palette 1 \255 Haxby Color T)144 583.2 Q(able)-.8 E 5(red: 255)
+149 595.2 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
+(green: 255 186 161 189 236 255 236 235 190 127)149 607.2 Q(57)5 E 2.5
+(blue: 255)149 619.2 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)
+2.5 E(color palette 2 \255 High Intensity Colors)144 643.2 Q 5(red: 255)
+149 655.2 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5
+(green: 0)149 667.2 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5
+(blue: 0)149 679.2 R 7.5(00000)7.5 G(255 255 255 255 255)-5 E
+(color palette 3 \255 Lo)144 703.2 Q 2.5(wI)-.25 G(ntensity Colors)-2.5
+E 5(red: 200)149 715.2 R(194 179 141)2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5
+(green: 0)149 727.2 R 2.5(49 90)5 F(141 179 200 141)2.5 E 5(90 0 0 0)5 F
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(8)198.45 E 0
+Cg EP
 %%Page: 9 9
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 5(green: 0 0 0 0 0 0 0 0 0 0 0)149
-84 R 7.5(blue: 0)149 96 R 7.5(0000000000)7.5 G
-(color palette 7 \255 Uniform White)144 120 Q 5(red: 255)149 132 R
-(255 255 255 255 255 255 255 255 255 255)2.5 E
-(green: 255 255 255 255 255 255 255 255 255 255 255)149 144 Q 2.5
-(blue: 255)149 156 R(255 255 255 255 255 255 255 255 255 255)2.5 E .366
-(The Haxby colors ha)144 180 R .666 -.15(ve b)-.2 H .366
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F 7.5(blue: 0)149 84 R 7.5(00000)7.5 G
+(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 108 Q 5
+(red: 255)149 120 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)7.5
+E(green: 255 230 204 179 153 128 102)149 132 Q 2.5(77 51 26)5 F(0)7.5 E
+2.5(blue: 255)149 144 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F
+(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 168 Q 5(red: 128)149
+180 R(128 128 128 128 128 128 128 128 128 128)2.5 E
+(green: 128 128 128 128 128 128 128 128 128 128 128)149 192 Q 2.5
+(blue: 128)149 204 R(128 128 128 128 128 128 128 128 128 128)2.5 E
+(color palette 6 \255 Uniform Black)144 228 Q 10(red: 0)149 240 R 7.5
+(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 252 R 7.5(blue: 0)
+149 264 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
+288 Q 5(red: 255)149 300 R(255 255 255 255 255 255 255 255 255 255)2.5 E
+(green: 255 255 255 255 255 255 255 255 255 255 255)149 312 Q 2.5
+(blue: 255)149 324 R(255 255 255 255 255 255 255 255 255 255)2.5 E .365
+(The Haxby colors ha)144 348 R .665 -.15(ve b)-.2 H .366
 (een adapted from a palette de).15 F -.15(ve)-.25 G .366(loped by Dr).15
-F 2.865(.W)-.55 G .365(illiam Haxby of the Lam-)-3.265 F .319
-(ont-Doherty Earth Observ)144 192 R .319
-(atory; this palette is pleasing to the e)-.25 F .32
+F 2.866(.W)-.55 G .366(illiam Haxby of the Lam-)-3.266 F .32
+(ont-Doherty Earth Observ)144 360 R .319
+(atory; this palette is pleasing to the e)-.25 F .319
 (ye and well suited for shading. The)-.15 F .309(high intensity colors \
 describe linear paths through RGB space from red to blue to green to pu\
-rple;)144 204 R .437(because the colors are high intensity the)144 216 R
-2.937(ya)-.15 G .438(re not well suited to shading.)-2.937 F .438
-(The lo)5.438 F 2.938(wi)-.25 G .438(ntensity colors)-2.938 F .517
-(are similar to the high intensity)144 228 R 3.017(,b)-.65 G .517
-(ut muted and thus well suited to shading.)-3.217 F .516
+rple;)144 372 R .438(because the colors are high intensity the)144 384 R
+2.938(ya)-.15 G .437(re not well suited to shading.)-2.938 F .437
+(The lo)5.437 F 2.937(wi)-.25 G .437(ntensity colors)-2.937 F .517
+(are similar to the high intensity)144 396 R 3.017(,b)-.65 G .517
+(ut muted and thus well suited to shading.)-3.217 F .517
 (The grayscale palette)5.517 F .499(runs linearly from white to black a\
-nd is commonly used for plots of sidescan and amplitude data.)144 240 R
+nd is commonly used for plots of sidescan and amplitude data.)144 408 R
 (The uniform grayscale is useful for non-color shaded relief plots.)144
-252 Q(The)144 276 Q/F1 10/Times-Italic at 0 SF(ncolor)2.607 E(s)-.1 E F0
-.107(parameter sets the number of color v)2.607 F .107
+420 Q(The)144 444 Q/F1 10/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0
+.107(parameter sets the number of color v)2.606 F .107
 (alues used in plotting, whether the colors are rep-)-.25 F(resented in\
  a continuous color scale or a stepped, discrete color scale [def)144
-288 Q(ault is 11].)-.1 E .522(If the option ar)144 312 R .522
+456 Q(ault is 11].)-.1 E .523(If the option ar)144 480 R .522
 (gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
-(GMT)3.022 E F0 .523(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 324 Q F2
-<ad56>108 340.8 Q F0(Causes)23.08 E F2(mbm_grd3dplot)3.694 E F0 1.193
+(GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
+3.022 F(and its color scheme will be used for the plot)144 492 Q F2
+<ad56>108 508.8 Q F0(Causes)23.08 E F2(mbm_grd3dplot)3.693 E F0 1.193
 (to operate in "v)3.693 F 1.193
 (erbose" mode so that it outputs more information than)-.15 F(usual.)144
-352.8 Q F2<ad58>108 369.6 Q F0(Normally)23.08 E(,)-.65 E F2
-(mbm_grd3dplot)4.663 E F0 2.163(creates an e)4.663 F -.15(xe)-.15 G
-2.164(cutable shellscript and then e).15 F 4.664(xits. This)-.15 F 2.164
-(option will)4.664 F(cause the shellscript to be e)144 381.6 Q -.15(xe)
+520.8 Q F2<ad58>108 537.6 Q F0(Normally)23.08 E(,)-.65 E F2
+(mbm_grd3dplot)4.664 E F0 2.164(creates an e)4.664 F -.15(xe)-.15 G
+2.164(cutable shellscript and then e).15 F 4.663(xits. This)-.15 F 2.163
+(option will)4.663 F(cause the shellscript to be e)144 549.6 Q -.15(xe)
 -.15 G(cuted in the background before).15 E F2(mbm_grd3dplot)2.5 E F0
--.15(ex)2.5 G(its.).15 E F2<ad59>108 398.4 Q F0(Normally)23.08 E(,)-.65
-E F2(mbm_grd3dplot)4.373 E F0 1.873
-(generates nicely rounded numbers for the boundaries of the color)4.373
-F .654(palette. Often, the resulting color bounds e)144 410.4 R .655
-(xtend well outside the range of the gridded data.)-.15 F(This)5.655 E
+-.15(ex)2.5 G(its.).15 E F2<ad59>108 566.4 Q F0(Normally)23.08 E(,)-.65
+E F2(mbm_grd3dplot)4.372 E F0 1.873
+(generates nicely rounded numbers for the boundaries of the color)4.372
+F .655(palette. Often, the resulting color bounds e)144 578.4 R .655
+(xtend well outside the range of the gridded data.)-.15 F(This)5.654 E
 1.014(option causes the color boundaries to be uniformly distrib)144
-422.4 R 1.014(uted between the minimum and maxi-)-.2 F(mum v)144 434.4 Q
-(alues of the grid.)-.25 E F2<ad5a>108 451.2 Q F1(min/max)23.63 E F0
-.786(This option o)144 463.2 R -.15(ve)-.15 G .786
-(rrides the minimum and maximum v).15 F .787
-(alues of the gridded data, af)-.25 F .787(fecting the color)-.25 F
-(palette and the contour interv)144 475.2 Q
+590.4 R 1.014(uted between the minimum and maxi-)-.2 F(mum v)144 602.4 Q
+(alues of the grid.)-.25 E F2<ad5a>108 619.2 Q F1(min/max)23.63 E F0
+.787(This option o)144 631.2 R -.15(ve)-.15 G .787
+(rrides the minimum and maximum v).15 F .786
+(alues of the gridded data, af)-.25 F .786(fecting the color)-.25 F
+(palette and the contour interv)144 643.2 Q
 (al if those parameters are not speci\214ed by the user)-.25 E(.)-.55 E
-/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 504 Q F0 .107(Suppose we ha)108
-516 R .407 -.15(ve o)-.2 H .107(btained tw).15 F 2.606(oG)-.1 G .106
+/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 672 Q F0 .106(Suppose we ha)108
+684 R .406 -.15(ve o)-.2 H .106(btained tw).15 F 2.606(oG)-.1 G .106
 (RD \214les with dimensions of 127 by 194, one containing gridded bath)
--2.606 F(yme-)-.05 E .368(try \(grd_sb2112_e)108 528 R .368
+-2.606 F(yme-)-.05 E .369(try \(grd_sb2112_e)108 696 R .368
 (xample_bath\) and the other gridded sidescan \(grd_sb2112_e)-.15 F .368
 (xample_ss\). In order to gen-)-.15 F .599(erate a shellscript which wi\
-ll in turn generate a 3D color shaded relief vie)108 540 R 3.099(wo)-.25
+ll in turn generate a 3D color shaded relief vie)108 708 R 3.099(wo)-.25
 G 3.099(ft)-3.099 G .599(he bath)-3.099 F(ymetry)-.05 E 3.099(,w)-.65 G
-3.099(eu)-3.099 G .598(se the)-3.099 F F2<ad47>108 552 Q F1(2)A F0 3.397
-(option. The)3.397 F .897(grid \214le is in bath)3.397 F .898
-(ymetry \(positi)-.05 F 1.198 -.15(ve d)-.25 H -.25(ow).15 G .898
-(n\) rather in topograph).25 F 3.398(y\()-.05 G(positi)-3.398 E 1.198
--.15(ve u)-.25 H .898(p\), so the ba-).15 F(th)108 564 Q .844
-(ymetry needs to be rescaled by multiplying by \2551 \()-.05 F F2
-(\255MGS)A F1(-1)A F0 .844(\). W)B 3.344(ec)-.8 G .844
-(hoose an illumination magnitude of)-3.344 F 1.02
-(0.4 and an illumination azimuth of 45 de)108 576 R 1.021(grees \()-.15
-F F2<ad41>A F1(0.4/45)A F0 1.021(\). W)B 3.521(ea)-.8 G 1.021
-(lso choose a perspecti)-3.521 F 1.321 -.15(ve a)-.25 H 1.021
-(zimuth of 250).15 F(de)108 588 Q(grees and an ele)-.15 E -.25(va)-.25 G
-(tion of 30 de).25 E(grees \()-.15 E F2<ad45>A F1(240/30)A F0(\):)A
-(mbm_grd3dplot \255Igrd_sb2112_e)144 612 Q(xample_bath \\)-.15 E
-(\255G2 \255A0.4/45 \255E250/30 \255MGS-1 \255X \255V \\)154 624 Q
-(\255Osb2112_e)154 636 Q(xample_bath3d)-.15 E(No)108 660 Q 1.705 -.65
-(w, t)-.25 H 2.905(og).65 G .405(enerate a 3D perspecti)-2.905 F .705
--.15(ve v)-.25 H(ie).15 E 2.904(wo)-.25 G 2.904(ft)-2.904 G .404
-(he gridded bath)-2.904 F .404
-(ymetry shaded using the gridded sidescan data,)-.05 F .673(we use the)
-108 672 R F2<ad47>3.173 E F1(3)A F0(and)3.173 E F2<ad4b>3.173 E F0 3.174
-(options. W)3.173 F 3.174(ew)-.8 G .674
-(ant the sidescan data to be histogram equalized, so we use)-3.274 F F2
-<ad53>3.174 E F1(0/1)A F0(.)A 2.064 -.8(We a)108 684 T .464(lso w).8 F
-.464(ant the shading to be more prominent than the def)-.1 F .463
-(ault shading magnitude of 0.2 w)-.1 F .463(ould produce,)-.1 F
-(so we use)108 696 Q F2<ad41>2.5 E F1(0.5)A F0(:)A
-(mbm_grd3dplot \255Igrd_sb2112_e)144 720 Q(xample_bath \\)-.15 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(9)204.835 E 0
-Cg EP
+3.099(eu)-3.099 G .599(se the)-3.099 F F2<ad47>108 720 Q F1(2)A F0 4.409
+(option. The)4.409 F 1.908(grid \214le is in bath)4.408 F 1.908
+(ymetry \(positi)-.05 F 2.208 -.15(ve d)-.25 H -.25(ow).15 G 1.908
+(n\) rather in topograph).25 F 4.408(y\()-.05 G(positi)-4.408 E 2.208
+-.15(ve u)-.25 H 1.908(p\), so the).15 F(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(9)198.45 E 0 Cg EP
 %%Page: 10 10
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F(\255Kgrd_sb2112_e)154 84 Q
-(xample_ss \\)-.15 E(\255G3 \255A0.5 \255E250/30 \255D0/1 \\)154 96 Q
-(\255S0/1 \255MGS-1 \255X \255V \\)154 108 Q(\255Osb2112_e)154 120 Q
-(xample_bathss3d)-.15 E .748(The \214rst e)108 144 R .748
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F(bath)108 84 Q .214
+(ymetry needs to be rescaled by multiplying by \2551 \()-.05 F/F1 10
+/Times-Bold at 0 SF(\255MGS)A/F2 10/Times-Italic at 0 SF(-1)A F0 .215(\). W)B
+2.715(ec)-.8 G .215(hoose an illumination magnitude of)-2.715 F 1.021
+(0.4 and an illumination azimuth of 45 de)108 96 R 1.021(grees \()-.15 F
+F1<ad41>A F2(0.4/45)A F0 1.021(\). W)B 3.521(ea)-.8 G 1.02
+(lso choose a perspecti)-3.521 F 1.32 -.15(ve a)-.25 H 1.02
+(zimuth of 250).15 F(de)108 108 Q(grees and an ele)-.15 E -.25(va)-.25 G
+(tion of 30 de).25 E(grees \()-.15 E F1<ad45>A F2(240/30)A F0(\):)A
+(mbm_grd3dplot \255Igrd_sb2112_e)144 132 Q(xample_bath \\)-.15 E
+(\255G2 \255A0.4/45 \255E250/30 \255MGS-1 \255X \255V \\)154 144 Q
+(\255Osb2112_e)154 156 Q(xample_bath3d)-.15 E(No)108 180 Q 1.704 -.65
+(w, t)-.25 H 2.904(og).65 G .404(enerate a 3D perspecti)-2.904 F .704
+-.15(ve v)-.25 H(ie).15 E 2.904(wo)-.25 G 2.904(ft)-2.904 G .404
+(he gridded bath)-2.904 F .405
+(ymetry shaded using the gridded sidescan data,)-.05 F .674(we use the)
+108 192 R F1<ad47>3.174 E F2(3)A F0(and)3.174 E F1<ad4b>3.174 E F0 3.174
+(options. W)3.174 F 3.174(ew)-.8 G .674
+(ant the sidescan data to be histogram equalized, so we use)-3.274 F F1
+<ad53>3.173 E F2(0/1)A F0(.)A 2.063 -.8(We a)108 204 T .463(lso w).8 F
+.463(ant the shading to be more prominent than the def)-.1 F .464
+(ault shading magnitude of 0.2 w)-.1 F .464(ould produce,)-.1 F
+(so we use)108 216 Q F1<ad41>2.5 E F2(0.5)A F0(:)A
+(mbm_grd3dplot \255Igrd_sb2112_e)144 240 Q(xample_bath \\)-.15 E
+(\255Kgrd_sb2112_e)154 252 Q(xample_ss \\)-.15 E
+(\255G3 \255A0.5 \255E250/30 \255D0/1 \\)154 264 Q
+(\255S0/1 \255MGS-1 \255X \255V \\)154 276 Q(\255Osb2112_e)154 288 Q
+(xample_bathss3d)-.15 E .749(The \214rst e)108 312 R .748
 (xample produces and e)-.15 F -.15(xe)-.15 G .748
 (cutes a plot generation shellscript called sb2112_e).15 F
 (xample_bath3d.cmd)-.15 E .614
-(and the second produces a shellscript called sb2112_e)108 156 R 3.114
-(xample_bathss3d.cmd. As)-.15 F .614(an e)3.114 F .614
+(and the second produces a shellscript called sb2112_e)108 324 R 3.114
+(xample_bathss3d.cmd. As)-.15 F .614(an e)3.114 F .615
 (xample, the contents)-.15 F(of the plotting shellscript "sb2112_e)108
-168 Q(xample_bathss3d.cmd" are:)-.15 E(#)110.5 192 Q 2.5(#S)110.5 204 S
+336 Q(xample_bathss3d.cmd" are:)-.15 E(#)110.5 360 Q 2.5(#S)110.5 372 S
 (hellscript to create Postscript plot of data in grd \214le)-2.5 E 2.5
-(#C)110.5 216 S(reated by macro mbm_grd3dplot)-2.5 E(#)110.5 228 Q 2.5
-(#T)110.5 240 S(his shellscript created by follo)-2.5 E
-(wing command line:)-.25 E 2.5(#m)110.5 252 S
+(#C)110.5 384 S(reated by macro mbm_grd3dplot)-2.5 E(#)110.5 396 Q 2.5
+(#T)110.5 408 S(his shellscript created by follo)-2.5 E
+(wing command line:)-.25 E 2.5(#m)110.5 420 S
 (bm_grd3dplot \255Igrd_sb2112_e)-2.5 E(xample_bath \\)-.15 E 15<23ad>
-110.5 264 S(Kgrd_sb2112_e)-15 E(xample_ss \255G3 \255A0.5 \\)-.15 E 15
-<23ad>110.5 276 S(E250/30 \255D0/1 \255S0/1 \255MGS-1 \255X \255V \\)-15
-E 15<23ad>110.5 288 S(Osb2112_e)-15 E(xample_bathss3d)-.15 E(#)110.5 300
-Q 2.5(#S)110.5 312 S -2.25 -.2(av e)-2.5 H -.15(ex)2.7 G(isting GMT def)
-.15 E(aults)-.1 E(echo Sa)110.5 324 Q(ving GMT def)-.2 E(aults...)-.1 E
-(gmtdef)110.5 336 Q(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 348
-Q 2.5(#S)110.5 360 S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1
-E(echo Setting ne)110.5 372 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E
-(gmtset ANO)110.5 384 Q(T_FONT Helv)-.4 E(etica)-.15 E
-(gmtset LABEL_FONT Helv)110.5 396 Q(etica)-.15 E
-(gmtset HEADER_FONT Helv)110.5 408 Q(etica)-.15 E(gmtset ANO)110.5 420 Q
-(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 432 Q
-(gmtset HEADER_FONT_SIZE 10)110.5 444 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 456 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 468 Q(gmtset P)110.5 480
+110.5 432 S(Kgrd_sb2112_e)-15 E(xample_ss \255G3 \255A0.5 \\)-.15 E 15
+<23ad>110.5 444 S(E250/30 \255D0/1 \255S0/1 \255MGS-1 \255X \255V \\)-15
+E 15<23ad>110.5 456 S(Osb2112_e)-15 E(xample_bathss3d)-.15 E(#)110.5 468
+Q 2.5(#S)110.5 480 S -2.25 -.2(av e)-2.5 H -.15(ex)2.7 G(isting GMT def)
+.15 E(aults)-.1 E(echo Sa)110.5 492 Q(ving GMT def)-.2 E(aults...)-.1 E
+(gmtdef)110.5 504 Q(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 516
+Q 2.5(#S)110.5 528 S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1
+E(echo Setting ne)110.5 540 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E
+(gmtset ANO)110.5 552 Q(T_FONT Helv)-.4 E(etica)-.15 E
+(gmtset LABEL_FONT Helv)110.5 564 Q(etica)-.15 E
+(gmtset HEADER_FONT Helv)110.5 576 Q(etica)-.15 E(gmtset ANO)110.5 588 Q
+(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 600 Q
+(gmtset HEADER_FONT_SIZE 10)110.5 612 Q
+(gmtset FRAME_WIDTH 0.074999999999999997)110.5 624 Q
+(gmtset TICK_LENGTH 0.074999999999999997)110.5 636 Q(gmtset P)110.5 648
 Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 492 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 504 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
-110.5 516 Q(AN 255/255/255)-.35 E(#)110.5 528 Q 2.5(#M)110.5 540 S(ak)
+(gmtset COLOR_B)110.5 660 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
+(gmtset COLOR_FOREGR)110.5 672 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
+110.5 684 Q(AN 255/255/255)-.35 E(#)110.5 696 Q 2.5(#M)110.5 708 S(ak)
 -2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 552 Q 2.5
-(echo \2554500 37 57)110.5 564 R 2.5(175 \2554350 40)2.5 F(127 251 > \\)
-2.5 E(sb2112_e)144 576 Q(xample_bathss3d.cpt)-.15 E 2.5
-(echo \2554350 40)110.5 588 R(127 251)2.5 E 2.5(\2554200 50)5 F
-(190 255 >> \\)2.5 E(sb2112_e)144 600 Q(xample_bathss3d.cpt)-.15 E 2.5
-(echo \2554200 50)110.5 612 R(190 255)2.5 E(\2554050 106 235 255 >> \\)5
-E(sb2112_e)144 624 Q(xample_bathss3d.cpt)-.15 E 2.5(echo \2554050)110.5
-636 R(106 235 255)2.5 E(\2553900 138 236 174 >> \\)5 E(sb2112_e)144 648
-Q(xample_bathss3d.cpt)-.15 E 2.5(echo \2553900)110.5 660 R(138 236 174)
-2.5 E(\2553750 205 255 162 >> \\)5 E(sb2112_e)144 672 Q
-(xample_bathss3d.cpt)-.15 E 2.5(echo \2553750)110.5 684 R(205 255 162)
-2.5 E(\2553600 240 236 121 >> \\)5 E(sb2112_e)144 696 Q
-(xample_bathss3d.cpt)-.15 E 2.5(echo \2553600)110.5 708 R(240 236 121)
-2.5 E(\2553450 255 189)5 E(87 >> \\)5 E(sb2112_e)144 720 Q
-(xample_bathss3d.cpt)-.15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(10)199.835 E 0 Cg EP
+(echo Making color palette table \214le...)110.5 720 Q(MB-System 5.0)72
+768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(10)193.45 E 0 Cg EP
 %%Page: 11 11
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 2.5(echo \2553450)110.5 84 R
-(255 189)2.5 E 2.5(87 \2553300)5 F(255 161)2.5 E(68 >> \\)5 E(sb2112_e)
-144 96 Q(xample_bathss3d.cpt)-.15 E 2.5(echo \2553300)110.5 108 R
-(255 161)2.5 E 2.5(68 \2553150)5 F(255 186 133 >> \\)2.5 E(sb2112_e)144
-120 Q(xample_bathss3d.cpt)-.15 E 2.5(echo \2553150)110.5 132 R
-(255 186 133)2.5 E(\2553000 255 255 255 >> \\)5 E(sb2112_e)144 144 Q
-(xample_bathss3d.cpt)-.15 E(#)110.5 156 Q 2.5(#R)110.5 168 S
-(escale data)-2.5 E(echo Rescaling data by \2551...)110.5 180 Q
-(echo Running grdmath...)110.5 192 Q(grdmath grd_sb2112_e)110.5 204 Q
-(xample_bath \2551 x = \\)-.15 E(grd_sb2112_e)144 216 Q
-(xample_bath.scale)-.15 E(#)110.5 228 Q 2.5(#G)110.5 240 S
-(et shading array)-2.5 E(echo Getting shading array)110.5 252 Q(...)-.65
-E(echo Running grdhisteq...)110.5 264 Q(grdhisteq grd_sb2112_e)110.5 276
-Q(xample_ss \\)-.15 E(-Ggrd_sb2112_e)144 288 Q(xample_ss.eq \255N)-.15 E
-(echo Running grdmath...)110.5 300 Q(grdmath grd_sb2112_e)110.5 312 Q
-(xample_ss.eq \2550.5 x \\)-.15 E 2.5(=g)144 324 S(rd_sb2112_e)-2.5 E
-(xample_ss.int)-.15 E(rm \255f grd_sb2112_e)110.5 336 Q(xample_ss.eq)
--.15 E(#)110.5 348 Q 2.5(#M)110.5 360 S(ak)-2.5 E 2.5(e3)-.1 G 2.5(Dv)
--2.5 G(ie)-2.5 E(w)-.25 E(echo Running grdvie)110.5 372 Q -.65(w.)-.25 G
-(..).65 E(grdvie)110.5 384 Q 2.5(wg)-.25 G(rd_sb2112_e)-2.5 E
-(xample_bath.scale \\)-.15 E(-Jm13.678801784792578 \\)144 396 Q
-(-Jz0.0014760910157720331 \\)144 408 Q(-E250/30 \\)144 420 Q
-(-R114.221/114.421/-31.9001/-31.6377 \\)144 432 Q(-Csb2112_e)144 444 Q
-(xample_bathss3d.cpt \\)-.15 E(-N-4499.4399999999996/200/200/200 \\)144
-456 Q(-Igrd_sb2112_e)144 468 Q(xample_ss.int \\)-.15 E(-Qi \\)144 480 Q
-(-P \255X1.8081565710006675 \255Y2 \255K \255V \\)144 492 Q 2.5(>s)144
-504 S(b2112_e)-2.5 E(xample_bathss3d.ps)-.15 E(#)110.5 516 Q 2.5(#M)
-110.5 528 S(ak)-2.5 E 2.5(ec)-.1 G(olor scale)-2.5 E
-(echo Running psscale...)110.5 540 Q(psscale \255Csb2112_e)110.5 552 Q
-(xample_bathss3d.cpt \\)-.15 E(-D2.4418/-0.5000/4.8837/0.1500h \\)144
-564 Q(-B":.Data V)144 576 Q(alues:" \\)-1.11 E
-(-P \255K \255O \255V >> sb2112_e)144 588 Q(xample_bathss3d.ps)-.15 E(#)
-110.5 600 Q 2.5(#M)110.5 612 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
-(echo Running psbasemap...)110.5 624 Q
-(psbasemap \255Jm13.678801784792578 \\)110.5 636 Q
-(-Jz0.0014760910157720331 \\)144 648 Q(-E250/30 \\)144 660 Q
-(-R114.221/114.421/-31.9001/-31.6377 \\)144 672 Q
-(-B5m/5m:."Data File grd_sb2112_e)144 684 Q(xample_bath":WSZ \\)-.15 E
-(-P \255O \255V >> sb2112_e)144 696 Q(xample_bathss3d.ps)-.15 E(#)110.5
-708 Q 2.5(#D)110.5 720 S(elete surplus \214les)-2.5 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(11)199.835 E 0 Cg EP
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F 2.5(echo \2554500 37 57)110.5 84 R
+2.5(175 \2554350 40)2.5 F(127 251 > \\)2.5 E(sb2112_e)144 96 Q
+(xample_bathss3d.cpt)-.15 E 2.5(echo \2554350 40)110.5 108 R(127 251)2.5
+E 2.5(\2554200 50)5 F(190 255 >> \\)2.5 E(sb2112_e)144 120 Q
+(xample_bathss3d.cpt)-.15 E 2.5(echo \2554200 50)110.5 132 R(190 255)2.5
+E(\2554050 106 235 255 >> \\)5 E(sb2112_e)144 144 Q(xample_bathss3d.cpt)
+-.15 E 2.5(echo \2554050)110.5 156 R(106 235 255)2.5 E
+(\2553900 138 236 174 >> \\)5 E(sb2112_e)144 168 Q(xample_bathss3d.cpt)
+-.15 E 2.5(echo \2553900)110.5 180 R(138 236 174)2.5 E
+(\2553750 205 255 162 >> \\)5 E(sb2112_e)144 192 Q(xample_bathss3d.cpt)
+-.15 E 2.5(echo \2553750)110.5 204 R(205 255 162)2.5 E
+(\2553600 240 236 121 >> \\)5 E(sb2112_e)144 216 Q(xample_bathss3d.cpt)
+-.15 E 2.5(echo \2553600)110.5 228 R(240 236 121)2.5 E(\2553450 255 189)
+5 E(87 >> \\)5 E(sb2112_e)144 240 Q(xample_bathss3d.cpt)-.15 E 2.5
+(echo \2553450)110.5 252 R(255 189)2.5 E 2.5(87 \2553300)5 F(255 161)2.5
+E(68 >> \\)5 E(sb2112_e)144 264 Q(xample_bathss3d.cpt)-.15 E 2.5
+(echo \2553300)110.5 276 R(255 161)2.5 E 2.5(68 \2553150)5 F
+(255 186 133 >> \\)2.5 E(sb2112_e)144 288 Q(xample_bathss3d.cpt)-.15 E
+2.5(echo \2553150)110.5 300 R(255 186 133)2.5 E
+(\2553000 255 255 255 >> \\)5 E(sb2112_e)144 312 Q(xample_bathss3d.cpt)
+-.15 E(#)110.5 324 Q 2.5(#R)110.5 336 S(escale data)-2.5 E
+(echo Rescaling data by \2551...)110.5 348 Q(echo Running grdmath...)
+110.5 360 Q(grdmath grd_sb2112_e)110.5 372 Q(xample_bath \2551 x = \\)
+-.15 E(grd_sb2112_e)144 384 Q(xample_bath.scale)-.15 E(#)110.5 396 Q 2.5
+(#G)110.5 408 S(et shading array)-2.5 E(echo Getting shading array)110.5
+420 Q(...)-.65 E(echo Running grdhisteq...)110.5 432 Q
+(grdhisteq grd_sb2112_e)110.5 444 Q(xample_ss \\)-.15 E(-Ggrd_sb2112_e)
+144 456 Q(xample_ss.eq \255N)-.15 E(echo Running grdmath...)110.5 468 Q
+(grdmath grd_sb2112_e)110.5 480 Q(xample_ss.eq \2550.5 x \\)-.15 E 2.5
+(=g)144 492 S(rd_sb2112_e)-2.5 E(xample_ss.int)-.15 E
+(rm \255f grd_sb2112_e)110.5 504 Q(xample_ss.eq)-.15 E(#)110.5 516 Q 2.5
+(#M)110.5 528 S(ak)-2.5 E 2.5(e3)-.1 G 2.5(Dv)-2.5 G(ie)-2.5 E(w)-.25 E
+(echo Running grdvie)110.5 540 Q -.65(w.)-.25 G(..).65 E(grdvie)110.5
+552 Q 2.5(wg)-.25 G(rd_sb2112_e)-2.5 E(xample_bath.scale \\)-.15 E
+(-Jm13.678801784792578 \\)144 564 Q(-Jz0.0014760910157720331 \\)144 576
+Q(-E250/30 \\)144 588 Q(-R114.221/114.421/-31.9001/-31.6377 \\)144 600 Q
+(-Csb2112_e)144 612 Q(xample_bathss3d.cpt \\)-.15 E
+(-N-4499.4399999999996/200/200/200 \\)144 624 Q(-Igrd_sb2112_e)144 636 Q
+(xample_ss.int \\)-.15 E(-Qi \\)144 648 Q
+(-P \255X1.8081565710006675 \255Y2 \255K \255V \\)144 660 Q 2.5(>s)144
+672 S(b2112_e)-2.5 E(xample_bathss3d.ps)-.15 E(#)110.5 684 Q 2.5(#M)
+110.5 696 S(ak)-2.5 E 2.5(ec)-.1 G(olor scale)-2.5 E
+(echo Running psscale...)110.5 708 Q(psscale \255Csb2112_e)110.5 720 Q
+(xample_bathss3d.cpt \\)-.15 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(11)193.45 E 0 Cg EP
 %%Page: 12 12
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F(echo Deleting surplus \214les...)
-110.5 84 Q(rm \255f sb2112_e)110.5 96 Q(xample_bathss3d.cpt)-.15 E
-(rm \255f grd_sb2112_e)110.5 108 Q(xample_bath.scale)-.15 E(#)110.5 120
-Q 2.5(#R)110.5 132 S(eset GMT def)-2.5 E(ault fonts)-.1 E
-(echo Resetting GMT fonts...)110.5 144 Q(mv gmtdef)110.5 156 Q
-(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5 168 Q 2.5(#R)110.5 180 S
-(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)110.5 192 Q 2.5(wi)-.25 G
-2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5 204 Q 2.5<77ad>-.25 G
-(ps a \255maxp 4m sb2112_e)-2.5 E(xample_bathss3d.ps &)-.15 E(#)110.5
-216 Q 2.5(#A)110.5 228 S(ll done!)-2.5 E(echo All done!)110.5 240 Q/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 268.8 Q/F2 10/Times-Bold at 0 SF
-(grdimage)108 280.8 Q F0(\(1\),)A F2(grdcontour)13.298 E F0(\(1\),)A F2
-(mbdefaults)13.298 E F0(\(1\),)A F2(mbgrid)13.298 E F0(\(1\),)A F2
-(mbsystem)13.298 E F0(\(1\),)A F2(mbm_grd3dplot)13.298 E F0(\(1\),)A F2
-(mbm_plot)108 292.8 Q F0(\(1\),)A F2(psbasemap)2.5 E F0(\(1\),)A F2
-(pstext)2.5 E F0(\(1\),)A F2(psxy)2.5 E F0(\(1\))A F1 -.11(BU)72 321.6 S
-(GS).11 E F0(By making this macro more useful, we ha)108 333.6 Q .3 -.15
-(ve a)-.2 H(lso made it more comple).15 E(x.)-.15 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(12)199.835 E 0 Cg EP
+123.72(5.0 mbm_grd3dplot\(1\))2.5 F(-D2.4418/-0.5000/4.8837/0.1500h \\)
+144 84 Q(-B":.Data V)144 96 Q(alues:" \\)-1.11 E
+(-P \255K \255O \255V >> sb2112_e)144 108 Q(xample_bathss3d.ps)-.15 E(#)
+110.5 120 Q 2.5(#M)110.5 132 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
+(echo Running psbasemap...)110.5 144 Q
+(psbasemap \255Jm13.678801784792578 \\)110.5 156 Q
+(-Jz0.0014760910157720331 \\)144 168 Q(-E250/30 \\)144 180 Q
+(-R114.221/114.421/-31.9001/-31.6377 \\)144 192 Q
+(-B5m/5m:."Data File grd_sb2112_e)144 204 Q(xample_bath":WSZ \\)-.15 E
+(-P \255O \255V >> sb2112_e)144 216 Q(xample_bathss3d.ps)-.15 E(#)110.5
+228 Q 2.5(#D)110.5 240 S(elete surplus \214les)-2.5 E
+(echo Deleting surplus \214les...)110.5 252 Q(rm \255f sb2112_e)110.5
+264 Q(xample_bathss3d.cpt)-.15 E(rm \255f grd_sb2112_e)110.5 276 Q
+(xample_bath.scale)-.15 E(#)110.5 288 Q 2.5(#R)110.5 300 S(eset GMT def)
+-2.5 E(ault fonts)-.1 E(echo Resetting GMT fonts...)110.5 312 Q
+(mv gmtdef)110.5 324 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5 336 Q
+2.5(#R)110.5 348 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)110.5
+360 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5 372 Q
+2.5<77ad>-.25 G(ps a \255maxp 4m sb2112_e)-2.5 E(xample_bathss3d.ps &)
+-.15 E(#)110.5 384 Q 2.5(#A)110.5 396 S(ll done!)-2.5 E(echo All done!)
+110.5 408 Q/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 436.8 Q/F2 10
+/Times-Bold at 0 SF(grdimage)108 448.8 Q F0(\(1\),)A F2(grdcontour)13.298 E
+F0(\(1\),)A F2(mbdefaults)13.298 E F0(\(1\),)A F2(mbgrid)13.298 E F0
+(\(1\),)A F2(mbsystem)13.298 E F0(\(1\),)A F2(mbm_grd3dplot)13.298 E F0
+(\(1\),)A F2(mbm_plot)108 460.8 Q F0(\(1\),)A F2(psbasemap)2.5 E F0
+(\(1\),)A F2(pstext)2.5 E F0(\(1\),)A F2(psxy)2.5 E F0(\(1\))A F1 -.11
+(BU)72 489.6 S(GS).11 E F0(By making this macro more useful, we ha)108
+501.6 Q .3 -.15(ve a)-.2 H(lso made it more comple).15 E(x.)-.15 E
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(12)193.45 E 0
+Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbm_grdcut.ps b/src/ps/mbm_grdcut.ps
index e74f936..53a9002 100644
--- a/src/ps/mbm_grdcut.ps
+++ b/src/ps/mbm_grdcut.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_grdinfo.ps b/src/ps/mbm_grdinfo.ps
index 5637928..2c36c3e 100644
--- a/src/ps/mbm_grdinfo.ps
+++ b/src/ps/mbm_grdinfo.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_grdplot.ps b/src/ps/mbm_grdplot.ps
index 4f3a5f1..cb3a0ad 100644
--- a/src/ps/mbm_grdplot.ps
+++ b/src/ps/mbm_grdplot.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -252,1365 +252,1393 @@ Q F3([color_style)A F0([)A F3(/palette)A F0([)A F3(ncolor)A(s)-.1 E F0
 A F2<ad4d>3.688 E F3(misc)A F2 1.188<ad5120ad52>3.688 F F3(w/e/s/n)A F2
 <ad58>3.688 E<ad5920ad5a>108 261.6 Q F3(min/max[/mode] ])A
 (Miscellaneous Options:)108 285.6 Q([)108 297.6 Q F2(\255MGD)A F3
-(gmtdef/value)A F2(\255MGF)5.528 E F3(scale_loc)A F2(\255MGL)3.028 E F3
-([f][x]lon0/lat0/slat/length[m])A F2(\255MGQ)3.027 E F3(dpi)A F2
-(\255MGS)3.027 E F3(scalefactor)A F2(\255MGT)108 309.6 Q F3
-(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)8.21 E F3(/dx/dy/)A
-F2(][)A F3(label)A F2 8.21<5dad>C(MCA)-8.21 E F3(anot_int/)A F2([)A F3
+(gmtdef/value)A F2(\255MGF)14.33 E F3(scale_loc)A F2(\255MGL)11.83 E F3
+([f][x]lon0/lat0/slat/length[units][+llabel])A F2(\255MGQ)11.83 E F3
+(dpi)A F2(\255MGS)108 309.6 Q F3(scalefactor)A F2(\255MGT)65.89 E F3
+(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)65.89 E F3(/dx/dy/)A
+F2(][)A F3(label)A F2(])A(\255MCA)108 321.6 Q F3(anot_int/)A F2([)A F3
 -.18(ff)C(ont_size).18 E F2(][)A F3(aangle)A F2(][)A F3(/r/g/b)A F2(][)A
-F3(o)A F2(]])A(\255MCG)108 321.6 Q F3(gap/width)A F2(\255MCQ)8.029 E F3
-(cut)A F2(\255MCT[)8.029 E F3(+|-)A F2(][)A F3(gap/length)A F2(][)A F3
-(:LH)A F2 8.028<5dad>C(MCW)-8.028 E F3(type)A F2([)A F3(pen)A F2 8.028
-<5dad>C(MN)-8.028 E(A)-.2 E F3 5.528([nhgt[/P] | P])B F2(\255MNF)108
-333.6 Q F3(format)A F2(\255MNI)8.495 E F3(swathdata)A F2(\255MNN[)8.495
-E F3(ttic)A(k/tannot/dannot/tlen)-.2 E F2([)A F3(/nhgt)A F2 8.496(]|)C
-F3(F)A F2(|)8.496 E F3(FP)8.496 E F2 8.496<5dad>C(MNP[)-8.496 E F3
-(pingnum-)A(ber_tic)108 345.6 Q(k/pingnumber_annot/pingnumber_tic)-.2 E
-(k_len)-.2 E F2 2.635<5dad>C(MTC)-2.635 E F3(\214ll)A F2(\255MTD)2.635 E
-F3 -.37(re)C(solution).37 E F2(\255MTG)2.635 E F3(\214ll)A F2(\255MTI)
-2.635 E F3(river[/pen])A F2(\255MTN)108 357.6 Q F3(bor)A(der[/pen])-.37
-E F2(\255MTS)2.561 E F3(\214ll)A F2(\255MTW)2.561 E F3(pen)A F2(\255MXG)
-2.561 E F3(\214ll)A F2(\255MXI)2.561 E F3(xy_\214le)A F2 .062
-(\255MXM \255MXS)2.562 F F3(symbol/size)A F2(\255MXW)2.562 E F3(pen)A F2
-(])A F1(DESCRIPTION)72 386.4 Q F2(mbm_grdplot)108 398.4 Q F0 .399
+F3(o)A F2 .994(]] \255MCG)B F3(gap/width)A F2(\255MCQ)3.493 E F3(cut)A
+F2(\255MCT[)3.493 E F3(+|-)A F2(][)A F3(gap/length)A F2(][)A F3(:LH)A F2
+(])A(\255MCW)108 333.6 Q F3(type)A F2([)A F3(pen)A F2 9.92<5dad>C(MN)
+-9.92 E(A)-.2 E F3 7.42([nhgt[/P] | P])B F2(\255MNF)9.92 E F3(format)A
+F2(\255MNI)9.92 E F3(swathdata)A F2(\255MNN[)9.92 E F3(ttic)A
+(k/tannot/dan-)-.2 E(not/tlen)108 345.6 Q F2([)A F3(/nhgt)A F2 6.569(]|)
+C F3(F)A F2(|)6.568 E F3(FP)6.568 E F2 6.568<5dad>C(MNP[)-6.568 E F3
+(pingnumber_tic)A(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len)-.2 E F2
+6.568<5dad>C(MTC)-6.568 E F3(\214ll)A F2(\255MTD)108 357.6 Q F3 -.37(re)
+C(solution).37 E F2(\255MTG)7.788 E F3(\214ll)A F2(\255MTI)7.788 E F3
+(river[/pen])A F2(\255MTN)7.788 E F3(bor)A(der[/pen])-.37 E F2(\255MTS)
+7.788 E F3(\214ll)A F2(\255MTW)7.789 E F3(pen)A F2(\255MXG)7.789 E F3
+(\214ll)A F2(\255MXI)108 369.6 Q F3(xy_\214le)A F2(\255MXM \255MXS)2.5 E
+F3(symbol/size)A F2(\255MXW)2.5 E F3(pen)A F2(])A F1(DESCRIPTION)72
+398.4 Q F2(mbm_grdplot)108 410.4 Q F0 .399
 (is a macro that generates a shellscript of)2.899 F F2(GMT)2.899 E F0
 .398(commands which, when e)2.899 F -.15(xe)-.15 G .398
 (cuted, will gen-).15 F .716(erate a Postscript plot of gridded data.)
-108 410.4 R(Se)5.716 E -.15(ve)-.25 G .717
+108 422.4 R(Se)5.716 E -.15(ve)-.25 G .717
 (ral styles of plots can be generated, including color \214ll maps,).15
-F 1.636(contour maps, color \214ll maps o)108 422.4 R -.15(ve)-.15 G
+F 1.636(contour maps, color \214ll maps o)108 434.4 R -.15(ve)-.15 G
 1.636
 (rlaid with contours, shaded relief color maps, slope magnitude maps,)
-.15 F .266(coastline maps, te)108 434.4 R .266
+.15 F .266(coastline maps, te)108 446.4 R .266
 (xt labels, and xy data in lines or symbols. Fi)-.15 F .567 -.15(ve d)
 -.25 H(if).15 E .267(ferent color schemes are included.)-.25 F(The)5.267
 E .313(plot will be scaled to \214t on the speci\214ed page size or)108
-446.4 R 2.813(,i)-.4 G 2.813(ft)-2.813 G .312
+458.4 R 2.813(,i)-.4 G 2.813(ft)-2.813 G .312
 (he scale is user de\214ned, the page size will be cho-)-2.813 F .56(se\
 n in accordance with the plot size. The primary purpose of this macro i\
-s to allo)108 458.4 R 3.061(wt)-.25 G .561(he simple, semi-auto-)-3.061
-F .565(mated production of nice looking maps with a fe)108 470.4 R 3.064
+s to allo)108 470.4 R 3.061(wt)-.25 G .561(he simple, semi-auto-)-3.061
+F .565(mated production of nice looking maps with a fe)108 482.4 R 3.064
 (wc)-.25 G .564(ommand line ar)-3.064 F .564(guments. F)-.18 F .564
-(or users seeking more con-)-.15 F 1.527(trol o)108 482.4 R -.15(ve)-.15
+(or users seeking more con-)-.15 F 1.527(trol o)108 494.4 R -.15(ve)-.15
 G 4.027(rt).15 G 1.527
 (he plot appearance, a number of additional optional ar)-4.027 F 1.527
 (guments are pro)-.18 F 1.528(vided. T)-.15 F 1.528(ruly ambitious)-.35
-F .827(users may edit the plot shellscript to tak)108 494.4 R 3.327(ea)
+F .827(users may edit the plot shellscript to tak)108 506.4 R 3.327(ea)
 -.1 G(dv)-3.327 E .827(antage of)-.25 F F2(GMT)3.327 E F0 .827
 (capabilities not supported by this macro. A)3.327 F .055
-(companion macro)108 506.4 R F2(mbm_grd3dplot)2.555 E F0 .056
+(companion macro)108 518.4 R F2(mbm_grd3dplot)2.555 E F0 .056
 (can be used similarly to generate 3D perspecti)2.555 F .356 -.15(ve v)
--.25 H(ie).15 E .056(ws of gridded data.)-.25 F F1 -.548(AU)72 535.2 S
-(THORSHIP).548 E F0(Da)108 547.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 559.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 571.2 Q
-(Lamont-Doherty Earth Observ)113 583.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 612 Q(ASIC OPTIONS)-.329 E F2<ad41>108 624 Q
-F3(ma)23.08 E(gnitude[/azimuth/ele)-.1 E(vation])-.15 E F0 1.15(Sets th\
-e parameters which control the synthetic illumination of the gridded da\
-ta \(shaded relief\).)144 636 R .05(The v)144 648 R(alue)-.25 E F3(ma)
-2.55 E(gnitude)-.1 E F0 .05(is an ef)2.55 F(fecti)-.25 E .351 -.15
-(ve ve)-.25 H .051(rtical e).15 F .051
+-.25 H(ie).15 E .056(ws of gridded data.)-.25 F .084(By def)108 542.4 R
+.083(ault the output plot generation shellscript includes lines which e)
+-.1 F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807
+(script image on the screen. The program to be used to display the Post\
+script is set using)108 554.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
+-3.308 E(def)108 566.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
+-.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
+F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
+(king the plot).2 F(generation shellscript with a)108 578.4 Q F2(-N)2.5
+E F0(command line ar)2.5 E
+(gument suppresses the screen display of the plot.)-.18 E .305
+(The plot scripts generated by this macro will w)108 602.4 R .305
+(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
+.305(nd are not compatible)-2.805 F(with earlier v)108 614.4 Q
+(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 643.2 S(THORSHIP).548 E
+F0(Da)108 655.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
+E(g\))-.18 E(Montere)113 667.2 Q 2.5(yB)-.15 G
+(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 679.2 Q
+(Lamont-Doherty Earth Observ)113 691.2 Q(atory)-.25 E(MB-System 5.0)72
+768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
+%%Page: 2 2
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
+(SIMPLE DESCRIPTION OF B)72 84 Q(ASIC OPTIONS)-.329 E/F2 10/Times-Bold at 0
+SF<ad41>108 96 Q/F3 10/Times-Italic at 0 SF(ma)23.08 E
+(gnitude[/azimuth/ele)-.1 E(vation])-.15 E F0 1.15(Sets the parameters \
+which control the synthetic illumination of the gridded data \(shaded r\
+elief\).)144 108 R .05(The v)144 120 R(alue)-.25 E F3(ma)2.55 E(gnitude)
+-.1 E F0 .05(is an ef)2.55 F(fecti)-.25 E .351 -.15(ve ve)-.25 H .051
+(rtical e).15 F .051
 (xageration which modulates the intensity of the shad-)-.15 F .882
-(ing; typical v)144 660 R .882(alues are in the 0.1 to 10 range.)-.25 F
+(ing; typical v)144 132 R .882(alues are in the 0.1 to 10 range.)-.25 F
 .882(The v)5.882 F(alue)-.25 E F3(azimuth)3.382 E F0 .881
 (is the azimuth in de)3.381 F .881(grees from)-.15 F .628
-(north from which the data is illuminated.)144 672 R .629(The v)5.629 F
+(north from which the data is illuminated.)144 144 R .629(The v)5.629 F
 (alue)-.25 E F3(ele)3.129 E(vation)-.15 E F0 .629(is the ele)3.129 F
--.25(va)-.25 G .629(tion of the illumination).25 F(in de)144 684 Q
+-.25(va)-.25 G .629(tion of the illumination).25 F(in de)144 156 Q
 (grees from horizontal.)-.15 E(Def)5 E(aults:)-.1 E F3(ma)2.5 E(gnitude)
 -.1 E F0 2.5(=0)2.5 G(.2;)-2.5 E F3(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)
 -2.5 E F3(ele)2.5 E(vation)-.15 E F0 2.5(=3)2.5 G(0.0;)-2.5 E F2<ad43>
-108 700.8 Q F3(contour_contr)23.08 E(ol)-.45 E F0(If)144 712.8 Q F2
+108 172.8 Q F3(contour_contr)23.08 E(ol)-.45 E F0(If)144 184.8 Q F2
 <ad43>3.459 E F0 .959(is gi)3.459 F -.15(ve)-.25 G 3.459(na).15 G .959
 (lone, it causes unannotated contours to be dra)-3.459 F .958
 (wn using a contour interv)-.15 F .958(al calcu-)-.25 F .214
-(lated from the data. The user may also use)144 724.8 R F3
+(lated from the data. The user may also use)144 196.8 R F3
 (contour_contr)2.714 E(ol)-.45 E F0 .215(to specify the contour interv)
-2.714 F .215(al. See the)-.25 F(MB-System 5.0)72 768 Q 2.5(2A)141.215 G
-(ugust 2014)-2.5 E(1)199.555 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 84 Q 2.5(wf)-.25 G
-(or a more complete discussion.)-2.5 E/F1 10/Times-Bold at 0 SF<ad44>108
-100.8 Q/F2 10/Times-Italic at 0 SF([\215ipcolor/\215ipshade])23.08 E F0
-(Normally)144 112.8 Q 3.321(,t)-.65 G .821(he color or grayscale tables\
- used for color maps run from cool colors \(or dark grays\))-3.321 F
-1.289(for lo)144 124.8 R 3.789(wg)-.25 G 1.289(rid v)-3.789 F 1.289
+2.714 F .215(al. See the)-.25 F
+(COMPLETE DESCRIPTION OF OPTIONS section belo)144 208.8 Q 2.5(wf)-.25 G
+(or a more complete discussion.)-2.5 E F2<ad44>108 225.6 Q F3
+([\215ipcolor/\215ipshade])23.08 E F0(Normally)144 237.6 Q 3.321(,t)-.65
+G .821(he color or grayscale tables used for color maps run from cool c\
+olors \(or dark grays\))-3.321 F 1.289(for lo)144 249.6 R 3.789(wg)-.25
+G 1.289(rid v)-3.789 F 1.289
 (alues to hot colors \(or light grays\) for high grid v)-.25 F 3.79
 (alues. This)-.25 F 1.29(option re)3.79 F -.15(ve)-.25 G 1.29(rses the)
 .15 F .028
 (color table so that cool colors \(dark grays\) correspond to high v)144
-136.8 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 148.8
-Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F1<ad44>3.954 E F0 1.454
+261.6 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 273.6
+Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F2<ad44>3.954 E F0 1.454
 (is gi)3.954 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
 the color table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 160.8 R .216
-(either by synthetic illumination \()5.216 F F1<ad47>A F2(2)A F0 2.716
+(shaded or unshaded. If the plot is to be shaded,)144 285.6 R .216
+(either by synthetic illumination \()5.216 F F2<ad47>A F3(2)A F0 2.716
 (\)o)C 2.715(ru)-2.716 G .215(sing an)-2.715 F .021(intensity \214le \()
-144 172.8 R F1<ad4b>A F0(and)2.522 E F1<ad47>2.522 E F2(3)A F0 .022
-(options\), then setting)2.522 F F2(\215ipshade)2.522 E F0 2.522(=1w)
+144 297.6 R F2<ad4b>A F0(and)2.522 E F2<ad47>2.522 E F3(3)A F0 .022
+(options\), then setting)2.522 F F3(\215ipshade)2.522 E F0 2.522(=1w)
 2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .022
-(ntion to).15 F .088(be re)144 184.8 R -.15(ve)-.25 G .088
+(ntion to).15 F .088(be re)144 309.6 R -.15(ve)-.25 G .088
 (rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
-(rlaid as light shading\).).15 F(Using)5.087 E F1<ad44>2.587 E F2(0/1)A
-F0 .087(will \215ip the shading con-)2.587 F -.15(ve)144 196.8 S
+(rlaid as light shading\).).15 F(Using)5.087 E F2<ad44>2.587 E F3(0/1)A
+F0 .087(will \215ip the shading con-)2.587 F -.15(ve)144 321.6 S
 (ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E
-(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F1<ad47>108 213.6 Q F2
-(color_mode)22.52 E F0 -.45(Tu)144 225.6 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F2
-(color_mode)164 237.6 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
--2.5 E F2(color_mode)164 249.6 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 261.6 Q
-F2(color_mode)164 273.6 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 285.6 Q
-F1<ad4b>2.5 E F0(option must be used to specify)204 297.6 Q
-(the intensity \214le.)252 309.6 Q F2(color_mode)164 321.6 Q F0 2.5(=4)
+(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F2<ad47>108 338.4 Q F3
+(color_mode)22.52 E F0 -.45(Tu)144 350.4 S
+(rns on color \214ll plot and sets the style of the plot.).45 E F3
+(color_mode)164 362.4 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
+-2.5 E F3(color_mode)164 374.4 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 386.4 Q
+F3(color_mode)164 398.4 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 410.4 Q
+F2<ad4b>2.5 E F0(option must be used to specify)204 422.4 Q
+(the intensity \214le.)252 434.4 Q F3(color_mode)164 446.4 Q F0 2.5(=4)
 2.5 G 2.5(:C)-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252
-333.6 Q F2(color_mode)164 345.6 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 357.6 Q F1<ad48>
-108 374.4 Q F0 .162(This "help" \215ag cause the program to print out a\
+458.4 Q F3(color_mode)164 470.4 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 482.4 Q F2<ad48>
+108 499.2 Q F0 .162(This "help" \215ag cause the program to print out a\
  description of its operation and then e)22.52 F .162(xit immedi-)-.15 F
-(ately)144 386.4 Q(.)-.65 E F1<ad49>108 403.2 Q F2(gr)26.41 E(d\214le)
--.37 E F0 .159(Sets the name of the gridded data \214le to be plotted.)
-144 415.2 R(Alternati)5.158 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)
-2.658 E(d\214le)-.37 E F0 .158(may be a list of grid \214les)2.658 F
-(\(one \214lename on each line\) to be plotted together)144 427.2 Q(.)
--.55 E F1<ad4b>108 444 Q F2(intensity_\214le)22.52 E F0 .599
-(Sets the name of the gridded data \214le containing intensity v)144 456
-R .599(alues to be used for shading the map.)-.25 F(Alternati)144 468 Q
--.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.704 E(d\214le)-.37 E F0 .204(m\
-ay be a list of grid \214les \(one \214lename on each line\) to be used\
- together)2.704 F 2.703(.I)-.55 G 2.703(fa)-2.703 G 1.499(list of \214l\
-e is supplied, the intensity \214les must conform in order to the data \
-grid \214les the)144 480 R 3.999(yw)-.15 G(ill)-3.999 E(shade.)144 492 Q
-F1<ad4f>108 508.8 Q F2 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the root u\
-sed to construct the \214lename of the output shellscript \()144 520.8 R
-F2 -.45(ro)C(ot).45 E F0 .422(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 532.8 R .157
+(ately)144 511.2 Q(.)-.65 E F2<ad49>108 528 Q F3(gr)26.41 E(d\214le)-.37
+E F0 .159(Sets the name of the gridded data \214le to be plotted.)144
+540 R(Alternati)5.158 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F3(gr)2.658 E
+(d\214le)-.37 E F0 .158(may be a list of grid \214les)2.658 F
+(\(one \214lename on each line\) to be plotted together)144 552 Q(.)-.55
+E F2<ad4b>108 568.8 Q F3(intensity_\214le)22.52 E F0 .599
+(Sets the name of the gridded data \214le containing intensity v)144
+580.8 R .599(alues to be used for shading the map.)-.25 F(Alternati)144
+592.8 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F3(gr)2.704 E(d\214le)-.37 E F0
+.204(may be a list of grid \214les \(one \214lename on each line\) to b\
+e used together)2.704 F 2.703(.I)-.55 G 2.703(fa)-2.703 G 1.499(list of\
+ \214le is supplied, the intensity \214les must conform in order to the\
+ data grid \214les the)144 604.8 R 3.999(yw)-.15 G(ill)-3.999 E(shade.)
+144 616.8 Q F2<ad4f>108 633.6 Q F3 -.45(ro)22.52 G(ot).45 E F0 .423(Set\
+s the root used to construct the \214lename of the output shellscript \
+\()144 645.6 R F3 -.45(ro)C(ot).45 E F0 .422
+(.cmd\) and names of \214les)B .156
+(created when the shellscript is run.)144 657.6 R .157
 (Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 544.8 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-561.6 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
+5.157 F(as the)144 669.6 Q F3 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108
+686.4 Q F3(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
 he size of the page the plot will be centered on. If the user does not \
-set the plot)144 573.6 R .125(scale, the plot will be sized as lar)144
-585.6 R .125(ge as will \214t on the designated page. If the user sets \
+set the plot)144 698.4 R .125(scale, the plot will be sized as lar)144
+710.4 R .125(ge as will \214t on the designated page. If the user sets \
 the plot scale)-.18 F .948
 (such that the plot will not \214t on the designated page, a lar)144
-597.6 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-1.342(page sizes include ANSI A, B, C, D, E, F)144 609.6 R 3.842(,a)-.8
-G 1.343(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 621.6 R 3.81(wf)-.25 G
+722.4 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)198.45 E 0
+Cg EP
+%%Page: 3 3
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F 1.342
+(page sizes include ANSI A, B, C, D, E, F)144 84 R 3.842(,a)-.8 G 1.343
+(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
+(COMPLETE DESCRIPTION OF OPTIONS section belo)144 96 R 3.81(wf)-.25 G
 1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-633.6 Q(ault page size is A.)-.1 E F1<ad53>108 650.4 Q F2([color/shade])
-24.74 E F0 1.392(This option enables ef)144 662.4 R(fecti)-.25 E 1.692
--.15(ve h)-.25 H 1.392
-(istogram equalization of the color and/or shading of the gridded).15 F
-.628(data. The equalization is not achie)144 674.4 R -.15(ve)-.25 G
-3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
+108 Q(ault page size is A.)-.1 E/F1 10/Times-Bold at 0 SF<ad53>108 124.8 Q
+/F2 10/Times-Italic at 0 SF([color/shade])24.74 E F0 1.392
+(This option enables ef)144 136.8 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H
+1.392(istogram equalization of the color and/or shading of the gridded)
+.15 F .628(data. The equalization is not achie)144 148.8 R -.15(ve)-.25
+G 3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
 (alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
  shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 686.4 R .19(points. This serv)144 698.4 R .19
+actions of the data-)144 160.8 R .19(points. This serv)144 172.8 R .19
 (es to focus color or shading contrasts in v)-.15 F .19
 (alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
-(the data v)144 710.4 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
+(the data v)144 184.8 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
 (is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
 F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
-.838(nables equalization of the color table)-3.338 F 2.142
-(used for color or gray \214ll plots,)144 722.4 R 2.142
-(shaded or unshaded. If the plot is to be shaded,)7.142 F 2.141
-(either by)7.141 F(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)
--2.5 E(2)199.555 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F .254(synthetic illumination \()144 84 R/F1
-10/Times-Bold at 0 SF<ad47>A/F2 10/Times-Italic at 0 SF(2)A F0 2.754(\)o)C
-2.754(ru)-2.754 G .254(sing an intensity \214le \()-2.754 F F1<ad4b>A F0
-(and)2.754 E F1<ad47>2.754 E F2(3)A F0 .254(options\), then setting)
-2.754 F F2(shade)2.754 E F0(=)2.754 E 3.097(1w)144 96 S .597
-(ill cause the shading to be equalized.)-3.097 F(Using)5.597 E F1<ad53>
-3.097 E F2(0/1)A F0 .596(will equalize the shading without equaliz-)
-3.097 F(ing the color table.)144 108 Q F1<ad54>108 124.8 Q F0(If)23.63 E
-F1<ad54>2.7 E F0 .201(is gi)2.701 F -.15(ve)-.25 G .201
-(n, it causes a coastline to be dra).15 F .201(wn on the map. The def)
--.15 F .201(ault is to dra)-.1 F 2.701(wt)-.15 G .201(he coastline as)
--2.701 F .629(the thinnest possible line. T)144 136.8 R 3.129(oe)-.8 G
--.15(xe)-3.279 G .628(rcise greater control of the coastline plotting, \
-including color \214ll).15 F 2.068(of "dry" areas and display of lak)144
-148.8 R 2.068(es, ri)-.1 F -.15(ve)-.25 G 2.068
-(rs, and political boundaries, use the).15 F F1(\255MTC)4.568 E F0(,)A
-F1(\255MTD)4.568 E F0(,)A F1(\255MTG)144 160.8 Q F0(,)A F1(\255MTI)3.915
-E F0(,)A F1(\255MTN)3.915 E F0(,)A F1(\255MTS)3.915 E F0 3.915(,a)C(nd)
--3.915 E F1(\255MTW)3.915 E F0 1.414
+.838(nables equalization of the color table)-3.338 F .991
+(used for color or gray \214ll plots,)144 196.8 R .991
+(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
+(either by syn-)5.991 F .637(thetic illumination \()144 208.8 R F1<ad47>
+A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
+(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
+3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
+F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 220.8
+R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
+(will equalize the shading without equalizing)3 F(the color table.)144
+232.8 Q F1<ad54>108 249.6 Q F0(If)23.63 E F1<ad54>2.7 E F0 .201(is gi)
+2.701 F -.15(ve)-.25 G .201(n, it causes a coastline to be dra).15 F
+.201(wn on the map. The def)-.15 F .201(ault is to dra)-.1 F 2.701(wt)
+-.15 G .201(he coastline as)-2.701 F .629(the thinnest possible line. T)
+144 261.6 R 3.129(oe)-.8 G -.15(xe)-3.279 G .628(rcise greater control \
+of the coastline plotting, including color \214ll).15 F 2.068
+(of "dry" areas and display of lak)144 273.6 R 2.068(es, ri)-.1 F -.15
+(ve)-.25 G 2.068(rs, and political boundaries, use the).15 F F1(\255MTC)
+4.568 E F0(,)A F1(\255MTD)4.568 E F0(,)A F1(\255MTG)144 285.6 Q F0(,)A
+F1(\255MTI)3.915 E F0(,)A F1(\255MTN)3.915 E F0(,)A F1(\255MTS)3.915 E
+F0 3.915(,a)C(nd)-3.915 E F1(\255MTW)3.915 E F0 1.414
 (options described in the COMPLETE DESCRIP-)3.915 F
-(TION OF OPTIONS section belo)144 172.8 Q -.65(w.)-.25 G F1<ad55>108
-189.6 Q F2(orientation)23.08 E F0 .2(Normally the orientation of the pl\
+(TION OF OPTIONS section belo)144 297.6 Q -.65(w.)-.25 G F1<ad55>108
+314.4 Q F2(orientation)23.08 E F0 .2(Normally the orientation of the pl\
 ot \(portrait or landscape\) is selected automatically so as to maxi-)
-144 201.6 R .334(mize the plot scale.)144 213.6 R(The)5.333 E F1<ad55>
+144 326.4 R .334(mize the plot scale.)144 338.4 R(The)5.333 E F1<ad55>
 2.833 E F0 .333(option allo)2.833 F .333
 (ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
 E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 225.6 Q F2(orientation)2.5 E F0
+(portrait plot will be produced; if)144 350.4 Q F2(orientation)2.5 E F0
 2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 242.4 Q F0(Causes)23.08 E F1(mbm_grdplot)4.505 E F0 2.005
+<ad56>108 367.2 Q F0(Causes)23.08 E F1(mbm_grdplot)4.505 E F0 2.005
 (to operate in "v)4.505 F 2.006
 (erbose" mode so that it outputs more information than)-.15 F(usual.)144
-254.4 Q F1<ad57>108 271.2 Q F2([color_style)20.3 E F0([)A F2(/palette)A
-F0([)A F2(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
+379.2 Q F1<ad57>108 396 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0
+([)A F2(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
 (This option controls the color scheme used for color \214ll plots.)144
-283.2 Q(If)144 307.2 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
+408 Q(If)144 432 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
 -3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 319.2 Q F0 2.815(=2)2.815 G
+ading of colors. If)-.1 F F2(color_style)144 444 Q F0 2.815(=2)2.815 G
 2.815(,t)-2.815 G .315
 (he color scheme will be a set of discrete color interv)-2.815 F .316
-(als. The color palette used is)-.25 F(set using)144 331.2 Q F2(palette)
+(als. The color palette used is)-.25 F(set using)144 456 Q F2(palette)
 2.5 E F0 2.5(.F)C -2.15 -.25(iv e)-2.5 H(palettes are a)2.75 E -.25(va)
--.2 G(ilable:).25 E F2(palette)180 343.2 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5
-G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 355.2 Q F0 2.5
-(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)180
-367.2 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F2(palette)180 379.2 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 391.2 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E 4.384(Ac)144 403.2 S 1.883
+-.2 G(ilable:).25 E F2(palette)180 468 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5 G
+(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 480 Q F0 2.5(=2)
+2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)180 492 Q
+F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H(ntensity colors)
+.25 E F2(palette)180 504 Q F0 2.5(=4)2.5 G 26.36(:g)-2.5 G(rayscale)
+-26.36 E F2(palette)180 516 Q F0 2.5(=5)2.5 G 26.36(:u)-2.5 G
+(niform grayscale)-26.36 E 4.384(Ac)144 528 S 1.883
 (omplete description of the color palettes is gi)-4.384 F -.15(ve)-.25 G
 4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
-F(OPTIONS section belo)144 415.2 Q -.65(w.)-.25 G(The)144 439.2 Q F2
-(ncolor)2.606 E(s)-.1 E F0 .107(parameter sets the number of color v)
-2.606 F .107(alues used in plotting, whether the colors are rep-)-.25 F
-(resented in a continuous color scale or a stepped, discrete color scal\
-e [def)144 451.2 Q(ault is 11].)-.1 E .523(If the option ar)144 475.2 R
-.522(gument is the path to an e)-.18 F(xisting)-.15 E F1(GMT)3.022 E F0
-.522(color palette \(CPT\) \214le, then that CPT \214le)3.022 F
-(and its color scheme will be used for the plot)144 487.2 Q/F3 10.95
-/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 516 Q F1<ad41>108
-528 Q F2(ma)23.08 E(gnitude[/azimuth])-.1 E F0 1.15(Sets the parameters\
- which control the synthetic illumination of the gridded data \(shaded \
-relief\).)144 540 R .051(The v)144 552 R(alue)-.25 E F2(ma)2.551 E
+F(OPTIONS section belo)144 540 Q -.65(w.)-.25 G(The)144 564 Q F2(ncolor)
+2.606 E(s)-.1 E F0 .107(parameter sets the number of color v)2.606 F
+.107(alues used in plotting, whether the colors are rep-)-.25 F(resente\
+d in a continuous color scale or a stepped, discrete color scale [def)
+144 576 Q(ault is 11].)-.1 E .523(If the option ar)144 600 R .522
+(gument is the path to an e)-.18 F(xisting)-.15 E F1(GMT)3.022 E F0 .522
+(color palette \(CPT\) \214le, then that CPT \214le)3.022 F
+(and its color scheme will be used for the plot)144 612 Q/F3 10.95
+/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 640.8 Q F1<ad41>108
+652.8 Q F2(ma)23.08 E(gnitude[/azimuth])-.1 E F0 1.15(Sets the paramete\
+rs which control the synthetic illumination of the gridded data \(shade\
+d relief\).)144 664.8 R .051(The v)144 676.8 R(alue)-.25 E F2(ma)2.551 E
 (gnitude)-.1 E F0 .051(is an ef)2.551 F(fecti)-.25 E .351 -.15(ve ve)
 -.25 H .051(rtical e).15 F .05
 (xageration which modulates the intensity of the shad-)-.15 F .826
-(ing; typical v)144 564 R .826(alues are in the 0.1 to 0.5 range.)-.25 F
-.827(The v)5.827 F(alue)-.25 E F2(azimuth)3.327 E F0 .827
-(is the azimuth from which the)3.327 F(data is illuminated.)144 576 Q
+(ing; typical v)144 688.8 R .826(alues are in the 0.1 to 0.5 range.)-.25
+F .827(The v)5.827 F(alue)-.25 E F2(azimuth)3.327 E F0 .827
+(is the azimuth from which the)3.327 F(data is illuminated.)144 700.8 Q
 (Def)5 E(aults:)-.1 E F2(ma)2.5 E(gnitude)-.1 E F0 2.5(=0)2.5 G(.2;)-2.5
-E F2(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)-2.5 E F1<ad42>108 592.8 Q F2
+E F2(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)-2.5 E F1<ad42>108 717.6 Q F2
 (tic)23.63 E(kinfo)-.2 E F0 .219(Sets map boundary tickmark interv)144
-604.8 R .219(als. See the)-.25 F F1(psbasemap)2.719 E F0 .218
+729.6 R .219(als. See the)-.25 F F1(psbasemap)2.719 E F0 .218
 (manual page for details. By def)2.719 F .218(ault the)-.1 F
-(program chooses basemap annotations based on the map boundaries.)144
-616.8 Q F1<ad43>108 633.6 Q F2(contour_contr)23.08 E(ol)-.45 E F0(If)144
-645.6 Q F1<ad43>3.458 E F0 .958(is gi)3.458 F -.15(ve)-.25 G 3.458(na)
-.15 G .959(lone, it causes unannotated contours to be dra)-3.458 F .959
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
+Cg EP
+%%Page: 4 4
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F
+(program chooses basemap annotations based on the map boundaries.)144 84
+Q/F1 10/Times-Bold at 0 SF<ad43>108 100.8 Q/F2 10/Times-Italic at 0 SF
+(contour_contr)23.08 E(ol)-.45 E F0(If)144 112.8 Q F1<ad43>3.458 E F0
+.958(is gi)3.458 F -.15(ve)-.25 G 3.458(na).15 G .959
+(lone, it causes unannotated contours to be dra)-3.458 F .959
 (wn using a contour interv)-.15 F .959(al calcu-)-.25 F 1.281
-(lated from the data. If)144 657.6 R F2(contour_contr)3.781 E(ol)-.45 E
+(lated from the data. If)144 124.8 R F2(contour_contr)3.781 E(ol)-.45 E
 F0 1.281(is gi)3.781 F -.15(ve)-.25 G 1.28
 (n, it speci\214es the contours to be dra).15 F 1.28(wn in one of)-.15 F
-(three possible w)144 669.6 Q(ays:)-.1 E(If)144 693.6 Q F2
+(three possible w)144 136.8 Q(ays:)-.1 E(If)144 160.8 Q F2
 (contour_contr)3.697 E(ol)-.45 E F0 1.198(has the suf)3.697 F 1.198(\
 \214x ".cpt" and can be opened as a \214le, it is assumed to be a color)
--.25 F 1.006(palette table.)144 705.6 R 1.006
+-.25 F 1.006(palette table.)144 172.8 R 1.006
 (The color boundaries are then used as contour le)6.006 F -.15(ve)-.25 G
 3.506(ls. If).15 F 1.006(the cpt-\214le has anotation)3.506 F .557
 (\215ags in the last column then those contours will be anotated.)144
-717.6 R .558(By def)5.558 F .558(ault no contours are labeled;)-.1 F
-(use)144 729.6 Q F1(\255MCA)2.5 E F0(to anotate all contours.)2.5 E
-(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)-2.5 E(3)199.555 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F(If)144 84 Q/F1 10/Times-Italic at 0 SF
-(contour_contr)3.288 E(ol)-.45 E F0 .788(is a \214le b)3.288 F .787
-(ut not a cpt-\214le, it is e)-.2 F .787(xpected to contain contour le)
--.15 F -.15(ve)-.25 G .787(ls in column 1).15 F 1.391
-(and a C\(ontour\) OR A\(nnotate\) in col 2.)144 96 R 1.391(The le)6.391
-F -.15(ve)-.25 G 1.391(ls mark).15 F 1.391
-(ed C \(or c\) are contoured, the le)-.1 F -.15(ve)-.25 G(ls).15 E(mark)
-144 108 Q .202(ed A \(or a\) are contoured and annotated.)-.1 F
+184.8 R .558(By def)5.558 F .558(ault no contours are labeled;)-.1 F
+(use)144 196.8 Q F1(\255MCA)2.5 E F0(to anotate all contours.)2.5 E(If)
+144 220.8 Q F2(contour_contr)3.288 E(ol)-.45 E F0 .788(is a \214le b)
+3.288 F .787(ut not a cpt-\214le, it is e)-.2 F .787
+(xpected to contain contour le)-.15 F -.15(ve)-.25 G .787
+(ls in column 1).15 F 1.391(and a C\(ontour\) OR A\(nnotate\) in col 2.)
+144 232.8 R 1.391(The le)6.391 F -.15(ve)-.25 G 1.391(ls mark).15 F
+1.391(ed C \(or c\) are contoured, the le)-.1 F -.15(ve)-.25 G(ls).15 E
+(mark)144 244.8 Q .202(ed A \(or a\) are contoured and annotated.)-.1 F
 (Optionally)5.202 E 2.702(,at)-.65 G .202
-(hird column may be present and con-)-2.702 F(tain the \214x)144 120 Q
+(hird column may be present and con-)-2.702 F(tain the \214x)144 256.8 Q
 (ed anotation angle for this contour le)-.15 E -.15(ve)-.25 G(l.).15 E
-(If no \214le is found, then)144 144 Q F1(contour_contr)2.5 E(ol)-.45 E
-F0(is interpreted as a constant contour interv)2.5 E(al.)-.25 E .824
-(If a \214le is gi)144 168 R -.15(ve)-.25 G 3.324(na).15 G(nd)-3.324 E
-/F2 10/Times-Bold at 0 SF(\255MCT)3.324 E F0 .824
-(is set, then only contours mark)3.324 F .824
+(If no \214le is found, then)144 280.8 Q F2(contour_contr)2.5 E(ol)-.45
+E F0(is interpreted as a constant contour interv)2.5 E(al.)-.25 E .824
+(If a \214le is gi)144 304.8 R -.15(ve)-.25 G 3.324(na).15 G(nd)-3.324 E
+F1(\255MCT)3.324 E F0 .824(is set, then only contours mark)3.324 F .824
 (ed with upper case C or A will ha)-.1 F -.15(ve)-.2 G(tickmarks.)144
-180 Q F2<ad44>108 196.8 Q F1([\215ipcolor/\215ipshade])23.08 E F0
-(Normally)144 208.8 Q 3.321(,t)-.65 G .821(he color or grayscale tables\
+316.8 Q F1<ad44>108 333.6 Q F2([\215ipcolor/\215ipshade])23.08 E F0
+(Normally)144 345.6 Q 3.321(,t)-.65 G .821(he color or grayscale tables\
  used for color maps run from cool colors \(or dark grays\))-3.321 F
-1.289(for lo)144 220.8 R 3.789(wg)-.25 G 1.289(rid v)-3.789 F 1.289
+1.289(for lo)144 357.6 R 3.789(wg)-.25 G 1.289(rid v)-3.789 F 1.289
 (alues to hot colors \(or light grays\) for high grid v)-.25 F 3.79
 (alues. This)-.25 F 1.29(option re)3.79 F -.15(ve)-.25 G 1.29(rses the)
 .15 F .028
 (color table so that cool colors \(dark grays\) correspond to high v)144
-232.8 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 244.8
-Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F2<ad44>3.954 E F0 1.454
+369.6 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 381.6
+Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F1<ad44>3.954 E F0 1.454
 (is gi)3.954 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
 the color table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 256.8 R .216
-(either by synthetic illumination \()5.216 F F2<ad47>A F1(2)A F0 2.716
+(shaded or unshaded. If the plot is to be shaded,)144 393.6 R .216
+(either by synthetic illumination \()5.216 F F1<ad47>A F2(2)A F0 2.716
 (\)o)C 2.715(ru)-2.716 G .215(sing an)-2.715 F .021(intensity \214le \()
-144 268.8 R F2<ad4b>A F0(and)2.522 E F2<ad47>2.522 E F1(3)A F0 .022
-(options\), then setting)2.522 F F1(\215ipshade)2.522 E F0 2.522(=1w)
+144 405.6 R F1<ad4b>A F0(and)2.522 E F1<ad47>2.522 E F2(3)A F0 .022
+(options\), then setting)2.522 F F2(\215ipshade)2.522 E F0 2.522(=1w)
 2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .022
-(ntion to).15 F .088(be re)144 280.8 R -.15(ve)-.25 G .088
+(ntion to).15 F .088(be re)144 417.6 R -.15(ve)-.25 G .088
 (rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
-(rlaid as light shading\).).15 F(Using)5.087 E F2<ad44>2.587 E F1(0/1)A
-F0 .087(will \215ip the shading con-)2.587 F -.15(ve)144 292.8 S
+(rlaid as light shading\).).15 F(Using)5.087 E F1<ad44>2.587 E F2(0/1)A
+F0 .087(will \215ip the shading con-)2.587 F -.15(ve)144 429.6 S
 (ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E
-(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F2<ad46>108 309.6 Q F1
+(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F1<ad46>108 446.4 Q F2
 (contour_\214le)24.19 E F0 .893
 (Sets the name of the \214le to use for generating contour lines.)144
-321.6 R .894(The def)5.894 F .894(ault is to use the \214le being)-.1 F
-.288(plotted, b)144 333.6 R .287(ut in some situations, it can be usefu\
+458.4 R .894(The def)5.894 F .894(ault is to use the \214le being)-.1 F
+.288(plotted, b)144 470.4 R .287(ut in some situations, it can be usefu\
 l to specify a separate \214le for contouring. F)-.2 F .287(or e)-.15 F
-(xam-)-.15 E 1.224(ple, one might wish to o)144 345.6 R -.15(ve)-.15 G
+(xam-)-.15 E 1.224(ple, one might wish to o)144 482.4 R -.15(ve)-.15 G
 1.224(rlay a backscatter mosaic with bath).15 F 1.224
-(ymetry contours, or a shaded ba-)-.05 F(th)144 357.6 Q
-(ymetry map with gra)-.05 E(vity anomaly contours.)-.2 E F2<ad47>108
-374.4 Q F1(color_mode)22.52 E F0 -.45(Tu)144 386.4 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F1
-(color_mode)164 398.4 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
--2.5 E F1(color_mode)164 410.4 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 422.4 Q
-F1(color_mode)164 434.4 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 446.4 Q
-F2<ad4b>2.5 E F0(option must be used to specify)204 458.4 Q
-(the intensity \214le.)252 470.4 Q F1(color_mode)164 482.4 Q F0 2.5(=4)
+(ymetry contours, or a shaded ba-)-.05 F(th)144 494.4 Q
+(ymetry map with gra)-.05 E(vity anomaly contours.)-.2 E F1<ad47>108
+511.2 Q F2(color_mode)22.52 E F0 -.45(Tu)144 523.2 S
+(rns on color \214ll plot and sets the style of the plot.).45 E F2
+(color_mode)164 535.2 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
+-2.5 E F2(color_mode)164 547.2 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 559.2 Q
+F2(color_mode)164 571.2 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 583.2 Q
+F1<ad4b>2.5 E F0(option must be used to specify)204 595.2 Q
+(the intensity \214le.)252 607.2 Q F2(color_mode)164 619.2 Q F0 2.5(=4)
 2.5 G 2.5(:C)-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252
-494.4 Q F1(color_mode)164 506.4 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 518.4 Q(See the)
-144 530.4 Q F2(grdimage)2.5 E F0
-(manual page for information on shading with intensity \214les)2.5 E F2
-<ad48>108 547.2 Q F0 .162(This "help" \215ag cause the program to print\
- out a description of its operation and then e)22.52 F .161(xit immedi-)
--.15 F(ately)144 559.2 Q(.)-.65 E F2<ad49>108 576 Q F1(gr)26.41 E
+631.2 Q F2(color_mode)164 643.2 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
+(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 655.2 Q(See the)
+144 667.2 Q F1(grdimage)2.5 E F0
+(manual page for information on shading with intensity \214les)2.5 E F1
+<ad48>108 684 Q F0 .162(This "help" \215ag cause the program to print o\
+ut a description of its operation and then e)22.52 F .161(xit immedi-)
+-.15 F(ately)144 696 Q(.)-.65 E F1<ad49>108 712.8 Q F2(gr)26.41 E
 (d\214le)-.37 E F0 1.298
-(Sets the name of the gridded data \214le to be plotted.)144 588 R 1.299
-(The data must be in a form acceptable to)6.298 F F2(GMT)144 600 Q F0
--.15(ve)2.57 G .07(rsion 3 programs \(see the).15 F F2(GMT)2.57 E F0 .07
+(Sets the name of the gridded data \214le to be plotted.)144 724.8 R
+1.299(The data must be in a form acceptable to)6.298 F(MB-System 5.0)72
+768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(4)198.45 E 0 Cg EP
+%%Page: 5 5
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(GMT)144 84 Q F0 -.15
+(ve)2.57 G .07(rsion 3 programs \(see the).15 F F1(GMT)2.57 E F0 .07
 (Cookbook & T)2.57 F .07(echnical Reference\).)-.7 F(Alternati)5.07 E
--.15(ve)-.25 G(ly).15 E(,)-.65 E F1(gr)2.57 E(d\214le)-.37 E F0 .786(ma\
-y be a list of grid \214les \(one \214lename on each line\) to be plott\
-ed together)144 612 R 3.286(.T)-.55 G .786(his is useful when)-3.286 F
-(data from a re)144 624 Q(gion is brok)-.15 E(en up into se)-.1 E -.15
-(ve)-.25 G(ral grid \214les rather than a single v).15 E(ery lar)-.15 E
-(ge grid \214le.)-.18 E F2<ad4a>108 640.8 Q F1(pr)25.3 E(ojection)-.45 E
-F0([)A F1(/scale | /width)A F0(])A .368
-(Selects the map projection. By def)144 652.8 R .367
+-.15(ve)-.25 G(ly).15 E(,)-.65 E/F2 10/Times-Italic at 0 SF(gr)2.57 E
+(d\214le)-.37 E F0 .786(may be a list of grid \214les \(one \214lename \
+on each line\) to be plotted together)144 96 R 3.286(.T)-.55 G .786
+(his is useful when)-3.286 F(data from a re)144 108 Q(gion is brok)-.15
+E(en up into se)-.1 E -.15(ve)-.25 G
+(ral grid \214les rather than a single v).15 E(ery lar)-.15 E
+(ge grid \214le.)-.18 E F1<ad4a>108 124.8 Q F2(pr)25.3 E(ojection)-.45 E
+F0([)A F2(/scale | /width)A F0(])A .368
+(Selects the map projection. By def)144 136.8 R .367
 (ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.667(to \214t on the selected page size \(see)144 664.8 R F2<ad50>3.168
+.667(to \214t on the selected page size \(see)144 148.8 R F1<ad50>3.168
 E F0 .668(option\). The user may specify a dif)3.168 F .668
 (ferent projection to be)-.25 F .768(used, in which case the plot scale\
  is still automatically chosen to \214t the page. The user may also)144
-676.8 R .034(specify both the projection and the plot scale. If the pro\
-jection specifying character is upper case, a)144 688.8 R 1.509
-(plot width rather than a plot scale is used.)144 700.8 R 1.508
+160.8 R .034(specify both the projection and the plot scale. If the pro\
+jection specifying character is upper case, a)144 172.8 R 1.509
+(plot width rather than a plot scale is used.)144 184.8 R 1.508
 (The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.508
 (gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 712.8 R
-(plot will not \214t on the def)144 724.8 Q
+inches. If the user speci\214es a plot scale such that the)144 196.8 R
+(plot will not \214t on the def)144 208.8 Q
 (ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E(MB-System 5.0)72 768 Q 2.5(2A)
-141.215 G(ugust 2014)-2.5 E(4)199.555 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(CYLINDRICAL PR)144 84
-Q(OJECTIONS:)-.3 E(\255Jc)144 108 Q/F2 10/Times-Italic at 0 SF
-(lon0/lat0/scale)A F0(\(Cassini\))2.5 E F1(\255Jm)144 120 Q F2(scale)A
-F0(\(Mercator\))2.5 E F1<ad4a>144 132 Q(oa)-.15 E F2
-(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 144 Q(ob)
--.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)2.5
-E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 156 Q(oc)-.15 E F2
+(ger page size will be chosen.)-.18 E F1(CYLINDRICAL PR)144 232.8 Q
+(OJECTIONS:)-.3 E(\255Jc)144 256.8 Q F2(lon0/lat0/scale)A F0
+(\(Cassini\))2.5 E F1(\255Jm)144 268.8 Q F2(scale)A F0(\(Mercator\))2.5
+E F1<ad4a>144 280.8 Q(oa)-.15 E F2(lon0/lat0/azimuth/scale)A F0
+(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 292.8 Q
+(ob)-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
+2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 304.8 Q(oc)-.15 E F2
 (lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 168 Q F2
+(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 316.8 Q F2
 (lon0/scale)A F0
 (\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 180 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 192 Q(u)-.15 E F2(zone/scale)A F0
+(\255Jt)144 328.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
+(erse Mercator\))-.15 E F1<ad4a>144 340.8 Q(u)-.15 E F2(zone/scale)A F0
 (\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 204 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 228 Q
-(OJECTIONS:)-.3 E<ad4a>144 252 Q(a)-.15 E F2(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F1<ad4a>144 264 Q(e)-.15 E F2(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F1(\255Jg)144 276 Q F2(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F1(\255Js)144 288 Q F2(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F1(CONIC PR)144 312 Q(OJECTIONS:)-.3 E
-(\255Jb)144 336 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E F1
-(\255Jl)144 348 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5 E F1
-(MISCELLANEOUS PR)144 372 Q(OJECTIONS:)-.3 E(\255Jh)144 396 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 408 Q F2(lon0/scale)A F0
-(\(Sinusoidal\))2.5 E F1(\255Jk)144 420 Q F2(lon0/scale)A F0(\(Eck)2.5 E
-(ert VI\))-.1 E F1(\255Jn)144 432 Q F2(lon0/scale)A F0(\(Robinson\))2.5
-E F1(\255Jr)144 444 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E
-(ripel\))-.35 E F1(\255Jw)144 456 Q F2(lon0/scale)A F0(\(Moll)2.5 E
-(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144 480 Q(OJECTIONS:)-.3 E(\255Jp)
-144 504 Q F2(scale)A F0
+(erse Mercator\))-.15 E F1(\255Jy)144 352.8 Q F2(lon0/lats/scale)A F0
+(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 376.8 Q
+(OJECTIONS:)-.3 E<ad4a>144 400.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
+(\(Lambert\).)2.5 E F1<ad4a>144 412.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
+(\(Equidistant\).)2.5 E F1(\255Jg)144 424.8 Q F2(lon0/lat0/scale)A F0
+(\(Orthographic\).)2.5 E F1(\255Js)144 436.8 Q F2(lon0/lat0/scale)A F0
+(\(General Stereographic\))2.5 E F1(CONIC PR)144 460.8 Q(OJECTIONS:)-.3
+E(\255Jb)144 484.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
+F1(\255Jl)144 496.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
+E F1(MISCELLANEOUS PR)144 520.8 Q(OJECTIONS:)-.3 E(\255Jh)144 544.8 Q F2
+(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 556.8 Q F2(lon0/scale)A
+F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 568.8 Q F2(lon0/scale)A F0(\(Eck)
+2.5 E(ert VI\))-.1 E F1(\255Jn)144 580.8 Q F2(lon0/scale)A F0
+(\(Robinson\))2.5 E F1(\255Jr)144 592.8 Q F2(lon0/scale)A F0(\(W)2.5 E
+(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1(\255Jw)144 604.8 Q F2
+(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144
+628.8 Q(OJECTIONS:)-.3 E(\255Jp)144 652.8 Q F2(scale)A F0
 (\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 516 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
+(\255Jx)144 664.8 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
 (/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
 (og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 528 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 544.8 Q F2(intensity_\214le)22.52 E F0 .599
+(More details can be found in the)144 676.8 Q F1(psbasemap)2.5 E F0
+(manpages.)2.5 E F1<ad4b>108 693.6 Q F2(intensity_\214le)22.52 E F0 .599
 (Sets the name of the gridded data \214le containing intensity v)144
-556.8 R .599(alues to be used for shading the map.)-.25 F(Alternati)144
-568.8 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.703 E(d\214le)-.37 E F0
+705.6 R .599(alues to be used for shading the map.)-.25 F(Alternati)144
+717.6 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.703 E(d\214le)-.37 E F0
 .204(may be a list of grid \214les \(one \214lename on each line\) to b\
 e used together)2.703 F 2.704(.I)-.55 G 2.704(fa)-2.704 G .821(list of \
 \214les is supplied, the intensity \214les must conform in order to the\
- list of data grid \214les the)144 580.8 R(y)-.15 E(will shade.)144
-592.8 Q F1<ad4c>108 609.6 Q F2(title:scalelabel)23.63 E F0 .157(Sets th\
-e title and the label for the colorscale \(if used\) of the plot. Note \
-that a colon \(:\) rather than a)144 621.6 R 1.557(slash \(/\) is used \
-to separate the labels. Colons cannot be used in the labels themselv)144
-633.6 R 1.557(es. If this)-.15 F 1.367(option is not used, then a def)
-144 645.6 R 1.367(ault title and colorscale label are pro)-.1 F 1.367
-(vided. If the title is supplied)-.15 F .742(alone, a def)144 657.6 R
+ list of data grid \214les the)144 729.6 R(y)-.15 E(MB-System 5.0)72 768
+Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
+%%Page: 6 6
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F(will shade.)144 84 Q/F1 10/Times-Bold at 0 SF
+<ad4c>108 100.8 Q/F2 10/Times-Italic at 0 SF(title:scalelabel)23.63 E F0
+.157(Sets the title and the label for the colorscale \(if used\) of the\
+ plot. Note that a colon \(:\) rather than a)144 112.8 R 1.557(slash \(\
+/\) is used to separate the labels. Colons cannot be used in the labels\
+ themselv)144 124.8 R 1.557(es. If this)-.15 F 1.367
+(option is not used, then a def)144 136.8 R 1.367
+(ault title and colorscale label are pro)-.1 F 1.367
+(vided. If the title is supplied)-.15 F .742(alone, a def)144 148.8 R
 .742(ault colorscale label will be pro)-.1 F .742(vided. T)-.15 F 3.242
 (of)-.8 G .742(orce no title use)-3.242 F F1<ad4c>3.241 E F0 3.241("")C
 3.241(;t)-3.241 G 3.241(of)-3.241 G .741(orce no title or)-3.241 F
-(colorscale label use)144 669.6 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
-<ad4d>108 686.4 Q F0 3.055(As)20.86 G .555
+(colorscale label use)144 160.8 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
+<ad4d>108 177.6 Q F0 3.055(As)20.86 G .555
 (eries of "miscellaneous" options are pro)-3.055 F .555
 (vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055 E F1
 <ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1 G
-(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 698.4 R 3.829(,f)-.4
+(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 189.6 R 3.829(,f)-.4
 G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
 (ther parameters associated with that option.)-3.829 F(The)6.328 E F1
 <ad4d>3.828 E F0(options)3.828 E .636(may be strung together separated \
-by colons, e.g. "-MGQ100:GU:CA200/10", which is equi)144 710.4 R -.25
-(va)-.25 G(lent).25 E(to "-MGQ \255MGU \255MCA200/10".)144 722.4 Q
-(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)-2.5 E(5)199.555 E 0
-Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MGD)108 84 Q/F2 10
-/Times-Italic at 0 SF(gmtdef/value)5.86 E F0(Allo)144 96 Q .227
+by colons, e.g. "-MGQ100:GU:CA200/10", which is equi)144 201.6 R -.25
+(va)-.25 G(lent).25 E(to "-MGQ \255MGU \255MCA200/10".)144 213.6 Q F1
+(\255MGD)108 230.4 Q F2(gmtdef/value)5.86 E F0(Allo)144 242.4 Q .227
 (ws the user to set the)-.25 F F1(GMT)2.727 E F0(def)2.727 E .227
 (ault v)-.1 F .227
 (alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 108 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
+(be gi)144 254.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
 (epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
 1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 120 Q
-2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGF)108 136.8 Q F2(scale_loc)6.97 E F0
-(Sets the location of the color scale. The possible v)144 148.8 Q
-(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 160.8
+(xample, to set the basemap)-.15 F(annotation font to Courier)144 266.4
+Q 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
+(\255MGF)108 283.2 Q F2(scale_loc)6.97 E F0
+(Sets the location of the color scale. The possible v)144 295.2 Q
+(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 307.2
 Q F0 2.5(=b)2.5 G 15.81(:b)-2.5 G(ottom of plot)-15.81 E F2(scale_loc)
-180 172.8 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
-(scale_loc)180 184.8 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
--18.03 E F2(scale_loc)180 196.8 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
-(ight of plot)-17.48 E([Def)144 208.8 Q(ault)-.1 E F2(scale_loc)2.5 E F0
-2.5(=b)2.5 G(])-2.5 E F1(\255MGL)108 225.6 Q F0([)6.41 E F2(f)A F0(][)A
-F2(x)A F0(])A F2(lon0/lat0/slat/length)A F0([)A F2(m)A F0(])A(Dra)144
-237.6 Q 1.44(ws a simple map scale centered on)-.15 F F2(lon0/lat0)3.94
-E F0 6.44(.U)C(se)-6.44 E F1(\255Lx)3.94 E F0 1.44
-(to specify position in inch instead.)3.94 F 1.333
-(Scale is calculated at latitude)144 249.6 R F2(slat)3.833 E F0(,)A F2
-(length)3.833 E F0 1.333(is in km [miles if m is appended].)3.833 F(Use)
-6.333 E F1(\255Lf)3.833 E F0 1.334(to get a)3.834 F("f)144 261.6 Q(anc)
--.1 E(y" scale [Def)-.15 E(ault is plain].)-.1 E F1(\255MGQ)108 278.4 Q
-F2(dpi)5.3 E F0 .839(Sets the resolution in dots per inch of the raster\
- image used for color \214ll maps. Lar)144 290.4 R .838(ger v)-.18 F
-.838(alues of)-.25 F F2(dpi)144 302.4 Q F0(produce lar)2.5 E
-(ger Postscript plot \214les. [Def)-.18 E(ault is 100].)-.1 E F1
-(\255MGS)108 319.2 Q F2(scalefactor)7.52 E F0 .728
-(The gridded data is multiplied by)144 331.2 R F2(scalefactor)3.229 E F0
-5.729(.T)C .729(his option is most often used \215ip the sign of the)
--5.729 F(data \()144 343.2 Q F2(scalefactor)A F0 2.5<3dad>2.5 G
-(1\). [Def)-2.5 E(ault no scaling])-.1 E F1(\255MGT)108 360 Q F2
-(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .488(Causes a te)144 372
-R .488(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0 .487
-(is te)2.987 F .487(xt size in points,)-.15 F F2(angle)2.987 E F0 .487
-(is measured in de)2.987 F(grees)-.15 E(counter)144 384 Q .8
+180 319.2 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
+(scale_loc)180 331.2 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
+-18.03 E F2(scale_loc)180 343.2 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
+(ight of plot)-17.48 E([Def)144 355.2 Q(ault)-.1 E F2(scale_loc)2.5 E F0
+2.5(=b)2.5 G(])-2.5 E F1(\255MGL)108 372 Q F0([)6.41 E F2(f)A F0(][)A F2
+(x)A F0(])A F2(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2
+(+llabel)A F0(])A(Dra)144 384 Q .16(ws a simple map scale centered on)
+-.15 F F2(lon0/lat0)2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0
+.16(to get a "f)2.66 F(anc)-.1 E .16(y" scale [Def)-.15 F .16
+(ault is plain].)-.1 F(Use)144 396 Q F1(\255Lx)2.961 E F0 .461
+(to specify the position in inches instead of map units.)2.961 F .462
+(The scale is calculated at latitude)5.461 F F2(slat)144 408 Q F0 2.929
+(;i)C 2.929(ft)-2.929 G .429
+(he string "center" is used instead of a numerical v)-2.929 F .428
+(alue for)-.25 F F2(slat)2.928 E F0 2.928(,t)C .428
+(hen the macro will set the)-2.928 F 1.596
+(scaling according to the center of the plot bounds.)144 420 R 1.596
+(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.596
+(is in km by)4.096 F(def)144 432 Q .279(ault, b)-.1 F .278(ut the units\
+ can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet, \
+k = kilome-)-.2 F .911
+(ters, M = statue miles, n = nautical miles, and u = US surv)144 444 R
+1.212 -.15(ey f)-.15 H .912(eet. Append).15 F F2(+l)3.412 E F0 .912
+(to label the scale)3.412 F(with the rele)144 456 Q -.25(va)-.25 G
+(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
+(ferent label string.)-.25 E F1(\255MGQ)108 472.8 Q F2(dpi)5.3 E F0 .839
+(Sets the resolution in dots per inch of the raster image used for colo\
+r \214ll maps. Lar)144 484.8 R .838(ger v)-.18 F .838(alues of)-.25 F F2
+(dpi)144 496.8 Q F0(produce lar)2.5 E(ger Postscript plot \214les. [Def)
+-.18 E(ault is 100].)-.1 E F1(\255MGS)108 513.6 Q F2(scalefactor)7.52 E
+F0 .728(The gridded data is multiplied by)144 525.6 R F2(scalefactor)
+3.229 E F0 5.729(.T)C .729
+(his option is most often used \215ip the sign of the)-5.729 F(data \()
+144 537.6 Q F2(scalefactor)A F0 2.5<3dad>2.5 G(1\). [Def)-2.5 E
+(ault no scaling])-.1 E F1(\255MGT)108 554.4 Q F2
+(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .488(Causes a te)144
+566.4 R .488(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0
+.487(is te)2.987 F .487(xt size in points,)-.15 F F2(angle)2.987 E F0
+.487(is measured in de)2.987 F(grees)-.15 E(counter)144 578.4 Q .8
 (-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
 (sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
-3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.615(starts with a leading h)144 396
-R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0 1.615
-(is tak)4.115 F 1.614(en to be a te)-.1 F 1.614(xtstring with the)-.15 F
-1.022(desired fontname.)144 408 R 1.022(See the)6.022 F F1(gmtdefaults)
-3.522 E F0 1.022(man page for names and numbers of a)3.522 F -.25(va)-.2
-G 1.023(ilable fonts \(or).25 F(run)144 420 Q F1 .112(pstext \255L)2.612
-F F0 2.612(\). The)B .111(alignment number refers to the part of the te)
-2.611 F .111(xtstring that will be mapped onto)-.15 F .289(the \()144
-432 R F2(x,y)A F0 2.789(\)p)C .289(oint: 1 = Lo)-2.789 F .289
-(wer Left corner)-.25 F 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289
-(er Center).25 F 2.789(,3=L)-.4 G -.25(ow)-2.789 G .289
-(er Right, 5 = Mid Left, 6 = Mid).25 F(Center)144 444 Q 2.783(,7=M)-.4 G
-.283(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
+3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.615(starts with a leading h)144
+590.4 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
+1.615(is tak)4.115 F 1.614(en to be a te)-.1 F 1.614(xtstring with the)
+-.15 F 1.022(desired fontname.)144 602.4 R 1.022(See the)6.022 F F1
+(gmtdefaults)3.522 E F0 1.022(man page for names and numbers of a)3.522
+F -.25(va)-.2 G 1.023(ilable fonts \(or).25 F(run)144 614.4 Q F1 .112
+(pstext \255L)2.612 F F0 2.612(\). The)B .111
+(alignment number refers to the part of the te)2.611 F .111
+(xtstring that will be mapped onto)-.15 F .289(the \()144 626.4 R F2
+(x,y)A F0 2.789(\)p)C .289(oint: 1 = Lo)-2.789 F .289(wer Left corner)
+-.25 F 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789
+(,3=L)-.4 G -.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F
+(Center)144 638.4 Q 2.783(,7=M)-.4 G .283
+(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
 2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-456 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15 G
-(imes as needed.)-2.5 E F1(\255MGU)108 472.8 Q F0([)5.86 E F2(/dx/dy/)A
-F0(][)A F2(label)A F0(])A(Dra)144 484.8 Q 2.635(wU)-.15 G .135
+650.4 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
+G(imes as needed.)-2.5 E F1(\255MGU)108 667.2 Q F0([)5.86 E F2(/dx/dy/)A
+F0(][)A F2(label)A F0(])A(Dra)144 679.2 Q 2.635(wU)-.15 G .135
 (nix System time stamp on plot.)-2.635 F .135
 (User may specify where the lo)5.135 F .136
-(wer left corner of the stamp)-.25 F 1.926(should f)144 496.8 R 1.926
+(wer left corner of the stamp)-.25 F 1.926(should f)144 691.2 R 1.926
 (all on the page relati)-.1 F 2.226 -.15(ve t)-.25 H 4.426(ol).15 G -.25
 (ow)-4.426 G 1.925(er left corner of plot in inch [Def).25 F 1.925
-(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 508.8 Q 2.5(,a)-.65 G
+(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 703.2 Q 2.5(,a)-.65 G
 (ppend a label, or)-2.5 E F1(c)2.5 E F0
-(\(which will plot the command string.\))2.5 E F1(\255MCA)108 525.6 Q F2
-(anot_int/)6.42 E F0([)A F2 -.18(ff)C(ont_size).18 E F0(][)A F2(aangle)A
-F0(][)A F2(/r/g/b)A F0(][)A F2(o)A F0(]])A F2(anot_int)144 537.6 Q F0
-.415(is annotation interv)2.915 F .415(al in data units.)-.25 F .415
-(Ignored if contour le)5.415 F -.15(ve)-.25 G .415(ls are gi).15 F -.15
-(ve)-.25 G 2.915(ni).15 G 2.915(na\214)-2.915 G 2.915(le. [Def)-2.915 F
-(ault)-.1 E 1.744(is no annotations].)144 549.6 R(Se)6.744 E -.15(ve)
--.25 G 1.744
+(\(which will plot the command string.\))2.5 E(MB-System 5.0)72 768 Q
+2.5(9J)140.11 G(anuary 2015)-2.5 E(6)198.45 E 0 Cg EP
+%%Page: 7 7
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MCA)108 84 Q/F2 10
+/Times-Italic at 0 SF(anot_int/)6.42 E F0([)A F2 -.18(ff)C(ont_size).18 E
+F0(][)A F2(aangle)A F0(][)A F2(/r/g/b)A F0(][)A F2(o)A F0(]])A F2
+(anot_int)144 96 Q F0 .415(is annotation interv)2.915 F .415
+(al in data units.)-.25 F .415(Ignored if contour le)5.415 F -.15(ve)
+-.25 G .415(ls are gi).15 F -.15(ve)-.25 G 2.915(ni).15 G 2.915(na\214)
+-2.915 G 2.915(le. [Def)-2.915 F(ault)-.1 E 1.744(is no annotations].)
+144 108 R(Se)6.744 E -.15(ve)-.25 G 1.744
 (ral options can be set to modify the form of the annotation.).15 F
-(Append)6.744 E(f)144 561.6 Q F2(font_size)A F0 .519
+(Append)6.744 E(f)144 120 Q F2(font_size)A F0 .519
 (to change font size [9], append)3.019 F F2(/r/g/b)3.019 E F0 .519
 (to change color of te)3.019 F .52(xt \214ll box [P)-.15 F -.4(AG)-.92 G
-(E_COLOR],).4 E .698(append a)144 573.6 R F2(angle)A F0 .698
+(E_COLOR],).4 E .698(append a)144 132 R F2(angle)A F0 .698
 (to \214x annotation angle [Def)3.198 F .697(ault follo)-.1 F .697
 (ws contour], and append 'o' to dra)-.25 F 3.197(wt)-.15 G .697(he out-)
--3.197 F(line of the surrounding te)144 585.6 Q(xt box [Def)-.15 E
-(ault is no outline].)-.1 E F1(\255MCG)108 602.4 Q F2(gap/width)5.86 E
-F1(\255MCQ)2.5 E F2(cut)A(gap)144 614.4 Q F0 .03
+-3.197 F(line of the surrounding te)144 144 Q(xt box [Def)-.15 E
+(ault is no outline].)-.1 E F1(\255MCG)108 160.8 Q F2(gap/width)5.86 E
+F1(\255MCQ)2.5 E F2(cut)A(gap)144 172.8 Q F0 .03
 (is distance in inch between each annotation along the same contour)2.53
 F(.)-.55 E F2(width)5.03 E F0 .03(is number of points)2.53 F -.15(ove)
-144 626.4 S 2.5(rw).15 G
+144 184.8 S 2.5(rw).15 G
 (hich to estimate the best \214tting slope for contour labels)-2.5 E
-([Def)5 E(ault is 4/10].)-.1 E F1(\255MCQ)108 643.2 Q F2(cut)5.86 E F0
-(Do not dra)144 655.2 Q 2.5(wc)-.15 G(ontours with less than)-2.5 E F2
+([Def)5 E(ault is 4/10].)-.1 E F1(\255MCQ)108 201.6 Q F2(cut)5.86 E F0
+(Do not dra)144 213.6 Q 2.5(wc)-.15 G(ontours with less than)-2.5 E F2
 (cut)2.5 E F0(number of points [Dra)2.5 E 2.5(wa)-.15 G(ll contours].)
--2.5 E F1(\255MCT)108 672 Q F0([)6.97 E F2(+|-)A F0(][)A F2(gap/length)A
-F0(][)A F2(:LH)A F0(])A -.4(Wi)144 684 S 1.484(ll dra).4 F 3.984(wt)-.15
-G 1.484(ickmarks pointing in the do)-3.984 F(wnw)-.25 E 1.484
-(ard direction e)-.1 F -.15(ve)-.25 G(ry).15 E F2(gap)3.984 E F0 1.483
-(along the innermost closed)3.984 F 2.98(contours. Append)144 696 R F2
-(gap)2.98 E F0 .48(and tickmark length \(in inch\) or use def)2.98 F .48
-(aults [0.2/0.05].)-.1 F .48(User may choose)5.48 F .263
-(to tick only local highs or local lo)144 708 R .263(ws by specifying)
+-2.5 E F1(\255MCT)108 230.4 Q F0([)6.97 E F2(+|-)A F0(][)A F2
+(gap/length)A F0(][)A F2(:LH)A F0(])A -.4(Wi)144 242.4 S 1.484(ll dra).4
+F 3.984(wt)-.15 G 1.484(ickmarks pointing in the do)-3.984 F(wnw)-.25 E
+1.484(ard direction e)-.1 F -.15(ve)-.25 G(ry).15 E F2(gap)3.984 E F0
+1.483(along the innermost closed)3.984 F 2.98(contours. Append)144 254.4
+R F2(gap)2.98 E F0 .48(and tickmark length \(in inch\) or use def)2.98 F
+.48(aults [0.2/0.05].)-.1 F .48(User may choose)5.48 F .263
+(to tick only local highs or local lo)144 266.4 R .263(ws by specifying)
 -.25 F F1(\255T+)2.762 E F0(or)2.762 E F1<ad54>2.762 E(-)-.92 E F0 2.762
 (,r)C(especti)-2.762 E -.15(ve)-.25 G(ly).15 E 5.262(.A)-.65 G .262
 (ppending :LH will)-5.262 F .78(plot the characters L and H at the cent\
-er of closed innermost contours \(local lo)144 720 R .781
-(ws and highs\).)-.25 F(L)5.781 E(MB-System 5.0)72 768 Q 2.5(2A)141.215
-G(ugust 2014)-2.5 E(6)199.555 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F .534(and H can be an)144 84 R 3.033(ys)-.15
-G .533(ingle character \(e.g., LH, \255+, etc.\))-3.033 F .533
-(If a \214le is gi)5.533 F -.15(ve)-.25 G 3.033(nb).15 G(y)-3.033 E/F1
-10/Times-Bold at 0 SF<ad43>3.033 E F0(and)3.033 E F1<ad54>3.033 E F0 .533
-(is set, then)3.033 F(only contours mark)144 96 Q
-(ed with upper case C or A will ha)-.1 E .3 -.15(ve t)-.2 H
-(ickmarks [and anotation].).15 E F1(\255MCW)108 112.8 Q/F2 10
-/Times-Italic at 0 SF(type)144 124.8 Q F0([)A F2(pen)A F0(])A F2(type)144
-136.8 Q F0 2.531(,i)C 2.531(fp)-2.531 G .032
+er of closed innermost contours \(local lo)144 278.4 R .781
+(ws and highs\).)-.25 F(L)5.781 E .534(and H can be an)144 290.4 R 3.033
+(ys)-.15 G .533(ingle character \(e.g., LH, \255+, etc.\))-3.033 F .533
+(If a \214le is gi)5.533 F -.15(ve)-.25 G 3.033(nb).15 G(y)-3.033 E F1
+<ad43>3.033 E F0(and)3.033 E F1<ad54>3.033 E F0 .533(is set, then)3.033
+F(only contours mark)144 302.4 Q(ed with upper case C or A will ha)-.1 E
+.3 -.15(ve t)-.2 H(ickmarks [and anotation].).15 E F1(\255MCW)108 319.2
+Q F2(type)144 331.2 Q F0([)A F2(pen)A F0(])A F2(type)144 343.2 Q F0
+2.531(,i)C 2.531(fp)-2.531 G .032
 (resent, can be 'a' for annotated contours or 'c' for re)-2.531 F .032
 (gular contours [Def)-.15 F(ault].)-.1 E F2(pen)5.032 E F0 .032
-(sets the)2.532 F(attrib)144 148.8 Q .671(utes for the particular line.)
+(sets the)2.532 F(attrib)144 355.2 Q .671(utes for the particular line.)
 -.2 F(Def)5.671 E .671(ault v)-.1 F .67
 (alues for annotated contours: width = 3, color = black,)-.25 F(te)144
-160.8 Q(xture = solid.)-.15 E(Re)5 E(gular contours ha)-.15 E .3 -.15
-(ve d)-.2 H(ef).15 E(ault width = 1.)-.1 E F1(\255MN)108 177.6 Q(A)-.2 E
-F2([nhgt[/P] | P])6.62 E F0 -.45(Tu)144 189.6 S .426
+367.2 Q(xture = solid.)-.15 E(Re)5 E(gular contours ha)-.15 E .3 -.15
+(ve d)-.2 H(ef).15 E(ault width = 1.)-.1 E F1(\255MN)108 384 Q(A)-.2 E
+F2([nhgt[/P] | P])6.62 E F0 -.45(Tu)144 396 S .426
 (rns on \214lename annotation of na).45 F(vig)-.2 E .426
 (ation tracks. If)-.05 F F1(\255MN)2.926 E(A)-.2 E F0 .427(is gi)2.927 F
 -.15(ve)-.25 G 2.927(nw).15 G .427(ithout specifying an)-2.927 F 2.927
 (yc)-.15 G(on-)-2.927 E .681
-(trolling parameters, then the lettering height)144 201.6 R F2(nhgt)
-3.181 E F0 .68(is 0.15 and the \214lenames are plotted parallel to)3.181
-F .794(the na)144 213.6 R(vig)-.2 E .794(ation track from the start of \
-the track. The lettering height can be speci\214ed using either)-.05 F
-F1(\255MN)144 225.6 Q(A)-.2 E F2(nhgt)A F0(or)2.897 E F1(\255MN)2.897 E
-(A)-.2 E F2(nhgt/P)A F0 5.397(.I)C(f)-5.397 E F1(\255MN)2.897 E(A)-.2 E
-F2(P)A F0(or)2.897 E F1(\255MN)2.897 E(A)-.2 E F2(nhgt/P)A F0 .397
+(trolling parameters, then the lettering height)144 408 R F2(nhgt)3.181
+E F0 .68(is 0.15 and the \214lenames are plotted parallel to)3.181 F
+.794(the na)144 420 R(vig)-.2 E .794(ation track from the start of the \
+track. The lettering height can be speci\214ed using either)-.05 F F1
+(\255MN)144 432 Q(A)-.2 E F2(nhgt)A F0(or)2.897 E F1(\255MN)2.897 E(A)
+-.2 E F2(nhgt/P)A F0 5.397(.I)C(f)-5.397 E F1(\255MN)2.897 E(A)-.2 E F2
+(P)A F0(or)2.897 E F1(\255MN)2.897 E(A)-.2 E F2(nhgt/P)A F0 .397
 (is speci\214ed, the \214lename will be plot-)2.897 F .4
-(ted perpendicular to the na)144 237.6 R(vig)-.2 E .401(ation track.)
--.05 F .401(Filename annotation can also be speci\214ed using the)5.401
-F F1<ad4e>2.901 E F0 2.5(option. Def)144 249.6 R
-(aults: Filename annotation of)-.1 E(f.)-.25 E F1(\255MNF)108 266.4 Q F2
-(format)7.53 E F0 .606(Sets the data format for the input sw)144 278.4 R
+(ted perpendicular to the na)144 444 R(vig)-.2 E .401(ation track.)-.05
+F .401(Filename annotation can also be speci\214ed using the)5.401 F F1
+<ad4e>2.901 E F0 2.5(option. Def)144 456 R
+(aults: Filename annotation of)-.1 E(f.)-.25 E F1(\255MNF)108 472.8 Q F2
+(format)7.53 E F0 .606(Sets the data format for the input sw)144 484.8 R
 .606(ath data speci\214ed with the)-.1 F F1(\255MNI)3.106 E F0 .606
 (option. If)3.106 F F2(format)3.106 E F0 3.106(<0)3.106 G 3.106(,t)
--3.106 G(hen)-3.106 E .4(the input \214le speci\214ed with the)144 290.4
+-3.106 G(hen)-3.106 E .4(the input \214le speci\214ed with the)144 496.8
 R F1(\255MNI)2.9 E F0 .401
 (option will actually contain a list of input sw)2.9 F .401
-(ath sonar data)-.1 F 1.384(\214les. This program uses the)144 302.4 R
+(ath sonar data)-.1 F 1.384(\214les. This program uses the)144 508.8 R
 F1(MBIO)3.884 E F0 1.384(library and will read or write an)3.884 F 3.883
 (ys)-.15 G -.1(wa)-3.883 G 1.383(th sonar format sup-).1 F .748
-(ported by)144 314.4 R F1(MBIO)3.248 E F0 3.248(.Al)C .749
+(ported by)144 520.8 R F1(MBIO)3.248 E F0 3.248(.Al)C .749
 (ist of the sw)-3.248 F .749
 (ath sonar data formats currently supported by)-.1 F F1(MBIO)3.249 E F0
-.749(and their)3.249 F(identi\214er v)144 326.4 Q(alues is gi)-.25 E
+.749(and their)3.249 F(identi\214er v)144 532.8 Q(alues is gi)-.25 E
 -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
 (manual page.)2.5 E(Def)5 E(ault:)-.1 E F2(format)2.5 E F0 2.5<3dad>2.5
-G(1.)-2.5 E F1(\255MNI)108 343.2 Q F2(swathdata)9.75 E F0 1.042
-(This option causes the na)144 355.2 R(vig)-.2 E 1.041
+G(1.)-2.5 E F1(\255MNI)108 549.6 Q F2(swathdata)9.75 E F0 1.042
+(This option causes the na)144 561.6 R(vig)-.2 E 1.041
 (ation track of sw)-.05 F 1.041(ath data to be plotted. Here)-.1 F F2
 (swathdata)3.541 E F0 1.041(is the input)3.541 F .222
-(\214le, and may be either a single sw)144 367.2 R .223
+(\214le, and may be either a single sw)144 573.6 R .223
 (ath \214le or a list of sw)-.1 F .223(ath \214les. If)-.1 F F2(format)
 2.723 E F0 2.723(>0\()2.723 G .223(set with the)-2.723 F F1(\255MNF)
-2.723 E F0 .357(option\) then the sw)144 379.2 R .357
+2.723 E F0 .357(option\) then the sw)144 585.6 R .357
 (ath sonar data contained in)-.1 F F2(swathdata)2.857 E F0 .357
 (is read and processed. If)2.857 F F2(format)2.857 E F0 2.857(<0\()2.857
-G(the)-2.857 E(def)144 391.2 Q 3.405(ault\), then)-.1 F F2(swathdata)
+G(the)-2.857 E(def)144 597.6 Q 3.405(ault\), then)-.1 F F2(swathdata)
 3.405 E F0 .905
 (is assumed to be an ascii \214le containing a list of the input sw)
 3.405 F .906(ath sonar)-.1 F .678
-(data \214les to be processed and their formats.)144 403.2 R .678
+(data \214les to be processed and their formats.)144 609.6 R .678
 (The program will read the data in each one of these)5.678 F 2.5
-(\214les. In)144 415.2 R(the)2.5 E F2(swathdata)2.5 E F0
+(\214les. In)144 621.6 R(the)2.5 E F2(swathdata)2.5 E F0
 (\214le, each data \214le should be follo)2.5 E
 (wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 427.2 Q(data\214le2 24)180 439.2 Q .568
-(This program uses the)144 451.2 R F1(MBIO)3.068 E F0 .568
+(data\214le1 11)180 633.6 Q(data\214le2 24)180 645.6 Q .568
+(This program uses the)144 657.6 R F1(MBIO)3.068 E F0 .568
 (library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F1(MBIO)144 463.2 Q F0 3.428
+G .568(th sonar format supported by).1 F F1(MBIO)144 669.6 Q F0 3.428
 (.Al)C .928(ist of the sw)-3.428 F .928
 (ath sonar data formats currently supported by)-.1 F F1(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 475.2 S(lues is gi).25 E
+.928(and their identi\214er)3.428 F -.25(va)144 681.6 S(lues is gi).25 E
 -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page.)2.5 E F1(\255MNN)108 492 Q F0([)6.42 E F2(ttic)A
+(manual page.)2.5 E F1(\255MNN)108 698.4 Q F0([)6.42 E F2(ttic)A
 (k/tannot/dannot/tlen)-.2 E F0([)A F2(/nhgt/nperp)A F0 2.5(]|)C F2(F)A
 F0(|)2.5 E F2(FP)2.5 E F0(])A .525
-(This option sets the annotation of the sw)144 504 R .525(ath \214le na)
--.1 F(vig)-.2 E .526(ation plot speci\214ed using the)-.05 F F1(\255MNI)
-3.026 E F0(option.)3.026 E -.35(Ti)144 516 S .357(me marks are made wit\
-h "X" marks along the shiptrack; annotated time marks sho).35 F 2.857
-(wt)-.25 G .356(he time in)-2.857 F .689(HH:MM format ne)144 528 R .689
+(This option sets the annotation of the sw)144 710.4 R .525
+(ath \214le na)-.1 F(vig)-.2 E .526(ation plot speci\214ed using the)
+-.05 F F1(\255MNI)3.026 E F0(option.)3.026 E -.35(Ti)144 722.4 S .357(m\
+e marks are made with "X" marks along the shiptrack; annotated time mar\
+ks sho).35 F 2.857(wt)-.25 G .356(he time in)-2.857 F(MB-System 5.0)72
+768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(7)198.45 E 0 Cg EP
+%%Page: 8 8
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F .689(HH:MM format ne)144 84 R .689
 (xt to the time mark and annotated date marks sho)-.15 F 3.19(wt)-.25 G
-.69(he time and julian day in)-3.19 F .712(HH:MM/DDD format.)144 540 R
-.712(The "X" marks are)5.712 F F2(tlen)3.211 E F0 .711
-(inches high for normal time marks and 1.5 times)3.211 F F2(tlen)144 552
-Q F0 .22(inches high for annotated time or date marks.)2.72 F .22
+.69(he time and julian day in)-3.19 F .712(HH:MM/DDD format.)144 96 R
+.712(The "X" marks are)5.712 F/F1 10/Times-Italic at 0 SF(tlen)3.211 E F0
+.711(inches high for normal time marks and 1.5 times)3.211 F F1(tlen)144
+108 Q F0 .22(inches high for annotated time or date marks.)2.72 F .22
 (The interv)5.22 F .22(al of time ticks, annotated time ticks,)-.25 F
-.742(and annotated date ticks are gi)144 564 R -.15(ve)-.25 G 3.242(ni)
-.15 G 3.242(nh)-3.242 G .742(ours by)-3.242 F F2(ttic)3.242 E(k)-.2 E F0
-(,)A F2(tannot)3.242 E F0 3.242(,a)C(nd)-3.242 E F2(dannot)3.242 E F0
+.742(and annotated date ticks are gi)144 120 R -.15(ve)-.25 G 3.242(ni)
+.15 G 3.242(nh)-3.242 G .742(ours by)-3.242 F F1(ttic)3.242 E(k)-.2 E F0
+(,)A F1(tannot)3.242 E F0 3.242(,a)C(nd)-3.242 E F1(dannot)3.242 E F0
 3.242(,r)C(especti)-3.242 E -.15(ve)-.25 G(ly).15 E 5.742(.I)-.65 G
-3.241(ft)-5.742 G(he)-3.241 E F2(nhgt)3.241 E F0 .839
-(parameter is not gi)144 576 R -.15(ve)-.25 G 3.339(nw).15 G .839(hen t\
+3.241(ft)-5.742 G(he)-3.241 E F1(nhgt)3.241 E F0 .839
+(parameter is not gi)144 132 R -.15(ve)-.25 G 3.339(nw).15 G .839(hen t\
 he other parameters are speci\214ed, then no \214lename annotation will)
--3.339 F .657(be done. If gi)144 588 R -.15(ve)-.25 G(n,).15 E F2(nhgt)
+-3.339 F .657(be done. If gi)144 144 R -.15(ve)-.25 G(n,).15 E F1(nhgt)
 3.157 E F0 .657(sets the height in inches of the \214lename annotation \
-and turns that annota-)3.157 F 1.028(tion on. If gi)144 600 R -.15(ve)
--.25 G 3.528(na).15 G 3.529(s1)-3.528 G(,)-3.529 E F2(nperp)3.529 E F0
+and turns that annota-)3.157 F 1.028(tion on. If gi)144 156 R -.15(ve)
+-.25 G 3.528(na).15 G 3.529(s1)-3.528 G(,)-3.529 E F1(nperp)3.529 E F0
 1.029
 (causes the \214lename annotation to be perpendicular to the shiptrack)
-3.529 F .055(rather than parallel \(the def)144 612 R 2.555(ault\). If)
--.1 F(the)2.555 E F1(\255MNN)2.554 E F2(F)A F0 .054(is gi)2.554 F -.15
-(ve)-.25 G .054(n, then a na).15 F(vig)-.2 E .054
-(ation track will be generated)-.05 F 3.123(using the def)144 624 R
+3.529 F .055(rather than parallel \(the def)144 168 R 2.555(ault\). If)
+-.1 F(the)2.555 E/F2 10/Times-Bold at 0 SF(\255MNN)2.554 E F1(F)A F0 .054
+(is gi)2.554 F -.15(ve)-.25 G .054(n, then a na).15 F(vig)-.2 E .054
+(ation track will be generated)-.05 F 3.123(using the def)144 180 R
 3.123(ault parameters and also with \214lename annotation along the shi\
-ptrack. If the)-.1 F F1(\255MNN)144 636 Q F2(FP)A F0 .409(is gi)2.909 F
+ptrack. If the)-.1 F F2(\255MNN)144 192 Q F1(FP)A F0 .409(is gi)2.909 F
 -.15(ve)-.25 G .409(n, then a na).15 F(vig)-.2 E .409
 (ation track will be generated with the def)-.05 F .408
 (ault parameters and also)-.1 F .4
-(with \214lename annotation perpendicular to the shiptrack.)144 648 R
-(Def)5.401 E(aults:)-.1 E F2(ttic)2.901 E(k)-.2 E F0 2.901(=0)2.901 G
-(.25;)-2.901 E F2(tannot)2.901 E F0 2.901(=1)2.901 G(.0;)-2.901 E F2
-(dan-)2.901 E(not)144 660 Q F0 2.5(=4)2.5 G(.0;)-2.5 E F2(tlen)2.5 E F0
-2.5(=0)2.5 G(.1;)-2.5 E F2(nhgt)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F2
-(nperp)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1(\255MNP)108 676.8 Q F2
+(with \214lename annotation perpendicular to the shiptrack.)144 204 R
+(Def)5.401 E(aults:)-.1 E F1(ttic)2.901 E(k)-.2 E F0 2.901(=0)2.901 G
+(.25;)-2.901 E F1(tannot)2.901 E F0 2.901(=1)2.901 G(.0;)-2.901 E F1
+(dan-)2.901 E(not)144 216 Q F0 2.5(=4)2.5 G(.0;)-2.5 E F1(tlen)2.5 E F0
+2.5(=0)2.5 G(.1;)-2.5 E F1(nhgt)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F1
+(nperp)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F2(\255MNP)108 232.8 Q F1
 ([pingnumber_tic)7.53 E(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len])
--.2 E F0 -.45(Tu)144 688.8 S 1.421
+-.2 E F0 -.45(Tu)144 244.8 S 1.421
 (rns on ping number \(or shot number\) annotation of na).45 F(vig)-.2 E
 1.421(ation tracks.)-.05 F -.35(Ti)6.42 G 1.42(ck marks are made).35 F
-.287(along the shiptrack at)144 700.8 R F2(pingnumber_tic)2.787 E(k)-.2
-E F0(interv)2.787 E .287(als; these are)-.25 F F2(tlen)2.787 E F0 .287
+.287(along the shiptrack at)144 256.8 R F1(pingnumber_tic)2.787 E(k)-.2
+E F0(interv)2.787 E .287(als; these are)-.25 F F1(tlen)2.787 E F0 .287
 (inches long. Longer tick marks are)2.787 F 1.745
-(made along the shiptrack at)144 712.8 R F2(pingnumber_annot)4.245 E F0
-(interv)4.245 E 1.745(als; these are 1.5 times)-.25 F F2(tlen)4.244 E F0
-1.744(inches long.)4.244 F(Def)144 724.8 Q 3.215
-(aults: Pingnumber annotation of)-.1 F 3.215(f. If the)-.25 F F1
-(\255MNP)5.715 E F0 3.215(option is gi)5.715 F -.15(ve)-.25 G 5.715(nw)
-.15 G 3.215(ithout specifying the)-5.715 F(MB-System 5.0)72 768 Q 2.5
-(2A)141.215 G(ugust 2014)-2.5 E(7)199.555 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 2.579(controlling parameters, then)144 84 R
-/F1 10/Times-Italic at 0 SF(pingnumber_tic)5.079 E(k)-.2 E F0 5.079(=5)
-5.079 G(0,)-5.079 E F1(pingnumber_annot)5.079 E F0 5.079(=1)5.079 G
-2.579(00, and)-5.079 F F1(pingnum-)5.079 E(ber_tic)144 96 Q(k_len)-.2 E
-F0 2.5(=0)2.5 G(.1.)-2.5 E/F2 10/Times-Bold at 0 SF(\255MTC)108 112.8 Q F1
-(\214ll)6.97 E F0 2.234(Coastline plotting option.)144 124.8 R 2.234(Se\
-t the shade \(0-255\), color \(r/g/b\), or pattern \(p|Pdpi/pattern; se\
-e)7.234 F F2(\255MTG)144 136.8 Q F0 2.5(\)f)C(or lak)-2.5 E 2.5(es [Def)
--.1 F(ault is the \214ll chosen for "wet" areas \(-S\)].)-.1 E F2
-(\255MTD)108 153.6 Q F1 -.37(re)6.97 G(solution).37 E F0 1.621
-(Coastline plotting option.)144 165.6 R 1.621(Selects the resolution of\
+(made along the shiptrack at)144 268.8 R F1(pingnumber_annot)4.245 E F0
+(interv)4.245 E 1.745(als; these are 1.5 times)-.25 F F1(tlen)4.244 E F0
+1.744(inches long.)4.244 F(Def)144 280.8 Q .34
+(aults: Pingnumber annotation of)-.1 F .34(f. If the)-.25 F F2(\255MNP)
+2.84 E F0 .34(option is gi)2.84 F -.15(ve)-.25 G 2.84(nw).15 G .34
+(ithout specifying the control-)-2.84 F .766(ling parameters, then)144
+292.8 R F1(pingnumber_tic)3.266 E(k)-.2 E F0 3.266(=5)3.266 G(0,)-3.266
+E F1(pingnumber_annot)3.266 E F0 3.266(=1)3.266 G .766(00, and)-3.266 F
+F1(pingnumber_tic)3.266 E(k_len)-.2 E F0 2.5(=0)144 304.8 S(.1.)-2.5 E
+F2(\255MTC)108 321.6 Q F1(\214ll)6.97 E F0 2.234
+(Coastline plotting option.)144 333.6 R 2.234(Set the shade \(0-255\), \
+color \(r/g/b\), or pattern \(p|Pdpi/pattern; see)7.234 F F2(\255MTG)144
+345.6 Q F0 2.5(\)f)C(or lak)-2.5 E 2.5(es [Def)-.1 F
+(ault is the \214ll chosen for "wet" areas \(-S\)].)-.1 E F2(\255MTD)108
+362.4 Q F1 -.37(re)6.97 G(solution).37 E F0 1.621
+(Coastline plotting option.)144 374.4 R 1.621(Selects the resolution of\
  the coastline data set to use \(\(f\)ull, \(h\)igh,)6.621 F .693
-(\(i\)ntermediate, \(1\)o)144 177.6 R 1.993 -.65(w, a)-.25 H .694
+(\(i\)ntermediate, \(1\)o)144 386.4 R 1.993 -.65(w, a)-.25 H .694
 (nd \(c\)rude\).).65 F .694(The resolution drops of)5.694 F 3.194(fb)
 -.25 G 3.194(y8)-3.194 G .694(0% between data sets. [Def)-3.194 F(ault)
--.1 E(is l].)144 189.6 Q F2(\255MTG)108 206.4 Q F1(\214ll)6.41 E F0 .592
-(Coastline plotting option.)144 218.4 R .592
+-.1 E(is l].)144 398.4 Q F2(\255MTG)108 415.2 Q F1(\214ll)6.41 E F0 .592
+(Coastline plotting option.)144 427.2 R .592
 (Select painting or clipping of "dry" areas.)5.592 F .591
 (Append a shade, color)5.591 F 3.091(,p)-.4 G(at-)-3.091 E .998
-(tern, or c for clipping.)144 230.4 R .999
+(tern, or c for clipping.)144 439.2 R .999
 (Specify the shade \(0-255\) or color \(r/g/b\), or)5.998 F F2(\255MTG)
 3.499 E F1(pdpi/pattern)A F0 3.499(,w)C(here)-3.499 E .132(pattern gi)
-144 242.4 R -.15(ve)-.25 G 2.632(st).15 G .132(he number of the b)-2.632
+144 451.2 R -.15(ve)-.25 G 2.632(st).15 G .132(he number of the b)-2.632
 F .131
 (uilt-in pattern \(1-90\) OR the name of a Sun 1-, 8-, or 24-bit raster)
--.2 F 2.982(\214le. dpi)144 254.4 R .482
+-.2 F 2.982(\214le. dpi)144 463.2 R .482
 (sets the resolution of the image.)2.982 F(See)5.482 E F2(GMT)2.982 E F0
 .482(Cookbook & T)2.982 F .483(echnical Reference Appendix)-.7 F 2.5(Ef)
-144 266.4 S(or information on indi)-2.5 E(vidual patterns.)-.25 E F2
-(\255MTI)108 283.2 Q F1(river[/pen])10.3 E F0 1.457
-(Coastline plotting option.)144 295.2 R(Dra)6.457 E 3.957(wr)-.15 G
--2.15 -.25(iv e)-3.957 H 3.957(rs. Specify).25 F 1.457(the type of ri)
-3.957 F -.15(ve)-.25 G 1.457(rs and [optionally] append pen).15 F
-(attrib)144 307.2 Q 3.478(utes [Def)-.2 F .978
-(ault pen: width = 1, color = 0/0/0, te)-.1 F .978(xture = solid].)-.15
-F .979(Choose from the list of ri)5.978 F -.15(ve)-.25 G(r).15 E
-(types belo)144 319.2 Q 3.8 -.65(w. R)-.25 H
+144 475.2 S(or information on indi)-2.5 E(vidual patterns.)-.25 E F2
+(\255MTI)108 492 Q F1(river[/pen])10.3 E F0 1.457
+(Coastline plotting option.)144 504 R(Dra)6.457 E 3.957(wr)-.15 G -2.15
+-.25(iv e)-3.957 H 3.957(rs. Specify).25 F 1.457(the type of ri)3.957 F
+-.15(ve)-.25 G 1.457(rs and [optionally] append pen).15 F(attrib)144 516
+Q 3.478(utes [Def)-.2 F .978(ault pen: width = 1, color = 0/0/0, te)-.1
+F .978(xture = solid].)-.15 F .979(Choose from the list of ri)5.978 F
+-.15(ve)-.25 G(r).15 E(types belo)144 528 Q 3.8 -.65(w. R)-.25 H
 (epeat option \255I as often as necessary).65 E(.)-.65 E 2.5(1=P)156.5
-331.2 S(ermanent major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(2=A)156.5
-343.2 S(dditional major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(3=A)156.5
-355.2 S(dditional ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(4=M)156.5 367.2
-S(inor ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(5=I)156.5 379.2 S
+540 S(ermanent major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(2=A)156.5 552
+S(dditional major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(3=A)156.5 564 S
+(dditional ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(4=M)156.5 576 S
+(inor ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(5=I)156.5 588 S
 (ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 major).15 E 2.5(6=I)156.5
-391.2 S(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 additional).15 E
-2.5(7=I)156.5 403.2 S(ntermittent ri)-2.5 E -.15(ve)-.25 G
-(rs \255 minor).15 E 2.5(8=M)156.5 415.2 S(ajor canals)-2.5 E 2.5(9=M)
-156.5 427.2 S(inor canals)-2.5 E(10 = Irrig)156.5 439.2 Q(ation canals)
--.05 E 2.5(a=A)156.5 451.2 S(ll ri)-2.5 E -.15(ve)-.25 G
-(rs and canals \(1-10\)).15 E 2.5(r=A)156.5 463.2 S(ll permanent ri)-2.5
-E -.15(ve)-.25 G(rs \(1-4\)).15 E 2.5(i=A)156.5 475.2 S
-(ll intermittent ri)-2.5 E -.15(ve)-.25 G(rs \(5-7\)).15 E 2.5(c=A)156.5
-487.2 S(ll canals \(8-10\))-2.5 E F2(\255MTN)108 504 Q F1(bor)6.97 E
-(der[/pen])-.37 E F0 .84(Coastline plotting option.)144 516 R(Dra)5.839
-E 3.339(wp)-.15 G .839(olitical boundaries.)-3.339 F .839
-(Specify the type of boundary and [option-)5.839 F .546
-(ally] append pen attrib)144 528 R .546(utes [Def)-.2 F .546(ault pen:)
--.1 F .546(width = 1, color = 0/0/0, te)5.546 F .547(xture = solid].)
--.15 F .547(Choose from)5.547 F(the list of boundaries belo)144 540 Q
-3.8 -.65(w. R)-.25 H(epeat option).65 E F2(\255MTN)2.5 E F0
-(as often as necessary)2.5 E(.)-.65 E 2.5(1=N)156.5 552 S
-(ational boundaries)-2.5 E 2.5(2=S)156.5 564 S
-(tate boundaries within the Americas)-2.5 E 2.5(3=M)156.5 576 S
-(arine boundaries)-2.5 E 2.5(a=A)156.5 588 S(ll boundaries \(1-3\))-2.5
-E F2(\255MTS)108 604.8 Q F1(\214ll)8.63 E F0 .777
-(Coastline plotting option.)144 616.8 R .777
-(Select painting or clipping of "wet" areas.)5.777 F .777
-(Append the shade \(0-255\),)5.777 F(color \(r/g/b\), pattern \(see)144
-628.8 Q F2(\255MTG)2.5 E F0(\), or c for clipping.)A F2(\255MTW)108
-645.6 Q F1(pen)144 657.6 Q F0 1.078(Coastline plotting option.)144 669.6
-R 1.078(Append pen attrib)6.078 F 3.578(utes [Def)-.2 F 3.579
-(aults: width)-.1 F 3.579(=1)3.579 G 3.579(,c)-3.579 G 1.079
-(olor = 0/0/0, te)-3.579 F 1.079(xture =)-.15 F(solid].)144 681.6 Q F2
-(\255MXG)108 698.4 Q F1(\214ll)5.86 E F0 .393
-(Select \214lling of symbols for xy plotting.)144 710.4 R .393
-(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 722.4 T .948
-(eset no \214ll, use).8 F F1(\214ll)3.448 E F0 3.449(=")3.448 G 3.449
-(N". F)-3.449 F .949(or polygons, you may optionally specify)-.15 F F2
-(\255Gp)3.449 E F1(icon_size/pattern)A F0(,)A(MB-System 5.0)72 768 Q 2.5
-(2A)141.215 G(ugust 2014)-2.5 E(8)199.555 E 0 Cg EP
+600 S(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 additional).15 E 2.5
+(7=I)156.5 612 S(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 minor).15
+E 2.5(8=M)156.5 624 S(ajor canals)-2.5 E 2.5(9=M)156.5 636 S
+(inor canals)-2.5 E(10 = Irrig)156.5 648 Q(ation canals)-.05 E 2.5(a=A)
+156.5 660 S(ll ri)-2.5 E -.15(ve)-.25 G(rs and canals \(1-10\)).15 E 2.5
+(r=A)156.5 672 S(ll permanent ri)-2.5 E -.15(ve)-.25 G(rs \(1-4\)).15 E
+2.5(i=A)156.5 684 S(ll intermittent ri)-2.5 E -.15(ve)-.25 G(rs \(5-7\))
+.15 E 2.5(c=A)156.5 696 S(ll canals \(8-10\))-2.5 E F2(\255MTN)108 712.8
+Q F1(bor)6.97 E(der[/pen])-.37 E F0 4.072(Coastline plotting option.)144
+724.8 R(Dra)9.072 E 6.572(wp)-.15 G 4.072(olitical boundaries.)-6.572 F
+4.072(Specify the type of boundary and)9.072 F(MB-System 5.0)72 768 Q
+2.5(9J)140.11 G(anuary 2015)-2.5 E(8)198.45 E 0 Cg EP
 %%Page: 9 9
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F(where)144 84 Q/F1 10/Times-Italic at 0 SF
+(5.0 mbm_grdplot\(1\))2.5 F .119([optionally] append pen attrib)144 84 R
+.119(utes [Def)-.2 F .119(ault pen:)-.1 F .119
+(width = 1, color = 0/0/0, te)5.119 F .12(xture = solid].)-.15 F(Choose)
+5.12 E(from the list of boundaries belo)144 96 Q 3.8 -.65(w. R)-.25 H
+(epeat option).65 E/F1 10/Times-Bold at 0 SF(\255MTN)2.5 E F0
+(as often as necessary)2.5 E(.)-.65 E 2.5(1=N)156.5 108 S
+(ational boundaries)-2.5 E 2.5(2=S)156.5 120 S
+(tate boundaries within the Americas)-2.5 E 2.5(3=M)156.5 132 S
+(arine boundaries)-2.5 E 2.5(a=A)156.5 144 S(ll boundaries \(1-3\))-2.5
+E F1(\255MTS)108 160.8 Q/F2 10/Times-Italic at 0 SF(\214ll)8.63 E F0 .777
+(Coastline plotting option.)144 172.8 R .777
+(Select painting or clipping of "wet" areas.)5.777 F .777
+(Append the shade \(0-255\),)5.777 F(color \(r/g/b\), pattern \(see)144
+184.8 Q F1(\255MTG)2.5 E F0(\), or c for clipping.)A F1(\255MTW)108
+201.6 Q F2(pen)144 213.6 Q F0 1.078(Coastline plotting option.)144 225.6
+R 1.078(Append pen attrib)6.078 F 3.578(utes [Def)-.2 F 3.579
+(aults: width)-.1 F 3.579(=1)3.579 G 3.579(,c)-3.579 G 1.079
+(olor = 0/0/0, te)-3.579 F 1.079(xture =)-.15 F(solid].)144 237.6 Q F1
+(\255MXG)108 254.4 Q F2(\214ll)5.86 E F0 .393
+(Select \214lling of symbols for xy plotting.)144 266.4 R .393
+(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
+(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 278.4 T .948
+(eset no \214ll, use).8 F F2(\214ll)3.448 E F0 3.449(=")3.448 G 3.449
+(N". F)-3.449 F .949(or polygons, you may optionally specify)-.15 F F1
+(\255Gp)3.449 E F2(icon_size/pattern)A F0(,)A(where)144 290.4 Q F2
 (pattern)3.652 E F0(gi)3.652 E -.15(ve)-.25 G 3.652(st).15 G 1.151(he n\
 umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.652 F F1(icon_size)144 96 Q F0 1.128(sets the unit size in inch.)
-3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4(nv e).8 H 1.128
-(rt black and white pix).4 F 1.128(els, use)-.15 F/F2 10/Times-Bold at 0 SF
-(\255GP)3.629 E F0 1.129(instead of)3.629 F F2(\255Gp)3.629 E F0(.)A
-(See)144 108 Q F2(GMTs)2.5 E F0(Cookbook & T)2.5 E
+.)-3.652 F F2(icon_size)144 302.4 Q F0 1.128
+(sets the unit size in inch.)3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4
+(nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F1
+(\255GP)3.629 E F0 1.129(instead of)3.629 F F1(\255Gp)3.629 E F0(.)A
+(See)144 314.4 Q F1(GMTs)2.5 E F0(Cookbook & T)2.5 E
 (echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F2(\255MXI)108 124.8 Q F1(xy_\214le)9.75 E F0
+(vidual patterns.)-.25 E F1(\255MXI)108 331.2 Q F2(xy_\214le)9.75 E F0
 .481(Speci\214es a \214le containing \(x,y\) pairs to be plotted as lin\
-es or symbols. The line and symbol char)144 136.8 R(-)-.2 E .533
-(acteristics are set using the last)144 148.8 R F2(\255MXG)3.033 E F0(,)
-A F2(\255MXS)3.033 E F0 3.033(,a)C(nd)-3.033 E F2(\255MXW)3.033 E F0
-.533(options used. All of the)3.033 F F2(\255MX)3.034 E F0(com-)3.034 E
-.143(mands can be gi)144 160.8 R -.15(ve)-.25 G 2.643(nm).15 G .142(ult\
+es or symbols. The line and symbol char)144 343.2 R(-)-.2 E .533
+(acteristics are set using the last)144 355.2 R F1(\255MXG)3.033 E F0(,)
+A F1(\255MXS)3.033 E F0 3.033(,a)C(nd)-3.033 E F1(\255MXW)3.033 E F0
+.533(options used. All of the)3.033 F F1(\255MX)3.034 E F0(com-)3.034 E
+.143(mands can be gi)144 367.2 R -.15(ve)-.25 G 2.643(nm).15 G .142(ult\
 iple times, so by stringing series of these commands together the user \
-can)-2.643 F(plot dif)144 172.8 Q(ferent \214les using dif)-.25 E
+can)-2.643 F(plot dif)144 379.2 Q(ferent \214les using dif)-.25 E
 (ferent line or symbol characteristics.)-.25 E([Def)5 E
-(ault is a solid black line].)-.1 E F2(\255MXM)108 189.6 Q F0 -.8(To)144
-201.6 S 1.24(ggles e).8 F 1.24(xpectation for xy data \214les ha)-.15 F
+(ault is a solid black line].)-.1 E F1(\255MXM)108 396 Q F0 -.8(To)144
+408 S 1.24(ggles e).8 F 1.24(xpectation for xy data \214les ha)-.15 F
 1.24(ving multiple se)-.2 F 1.24(gments, in which each se)-.15 F 1.24
-(gment is to be)-.15 F 1.506(plotted separately)144 213.6 R 4.006(.S)
--.65 G -.15(eg)-4.006 G 1.506
+(gment is to be)-.15 F 1.506(plotted separately)144 420 R 4.006(.S)-.65
+G -.15(eg)-4.006 G 1.506
 (ments are separated by a record whose \214rst character is '>'. By def)
-.15 F(ault,)-.1 E(unse)144 225.6 Q 1.878(gmented \214les are e)-.15 F
+.15 F(ault,)-.1 E(unse)144 432 Q 1.878(gmented \214les are e)-.15 F
 1.878(xpected. Users may gi)-.15 F 2.178 -.15(ve t)-.25 H 1.879
 (his command multiple times, allo).15 F 1.879(wing some)-.25 F
-(input \214les to be handled as se)144 237.6 Q(gmented and others not.)
--.15 E F2(\255MXS)108 254.4 Q F1(symbol/size)8.08 E F0 .333
-(Selects symbol to be used for plotting the ne)144 266.4 R .332
-(xt xy data \214le. Setting)-.15 F F1(symbol)2.832 E F0 2.832(=")2.832 G
-.332(N" causes line plot-)-2.832 F 2.5(ting. Choose)144 278.4 R
-(between:)2.5 E F2(\255MXSa)108 295.2 Q F0(st)144 307.2 Q F2(a)A F0 -.55
-(r.)C F1(size)5.55 E F0(is radius of circumscribing circle.)2.5 E F2
-(\255MXSb)108 324 Q(b)144 336 Q F0 .921(ar e)B .921(xtending from)-.15 F
-F1(base)3.421 E F0 .921(to y)3.421 F(.)-.65 E F1(size)5.921 E F0 .921
-(is bar width.)3.421 F .921(By def)5.921 F(ault,)-.1 E F1(base)3.421 E
-F0 3.421(=0)3.421 G 5.921(.A)-3.421 G .921(ppend /)-5.921 F F1(base)A F0
-.922(to change)3.422 F(this v)144 348 Q 2.5(alue. Append)-.25 F F2(u)2.5
-E F0(if)2.5 E F1(size)2.5 E F0(is in x-units [Def)2.5 E(ault is inch].)
--.1 E F2(\255MXSc)108 364.8 Q(c)144 376.8 Q F0(ircle.)A F1(size)5 E F0
-(is diameter of circle.)2.5 E F2(\255MXSd)108 393.6 Q(d)144 405.6 Q F0
-(iamond.)A F1(size)5 E F0(is side of diamond.)2.5 E F2(\255MXSe)108
-422.4 Q(e)144 434.4 Q F0 5.678(llipse. Direction)B 3.178(\(in de)5.678 F
-3.178
+(input \214les to be handled as se)144 444 Q(gmented and others not.)
+-.15 E F1(\255MXS)108 460.8 Q F2(symbol/size)8.08 E F0 .333
+(Selects symbol to be used for plotting the ne)144 472.8 R .332
+(xt xy data \214le. Setting)-.15 F F2(symbol)2.832 E F0 2.832(=")2.832 G
+.332(N" causes line plot-)-2.832 F 2.5(ting. Choose)144 484.8 R
+(between:)2.5 E F1(\255MXSa)108 501.6 Q F0(st)144 513.6 Q F1(a)A F0 -.55
+(r.)C F2(size)5.55 E F0(is radius of circumscribing circle.)2.5 E F1
+(\255MXSb)108 530.4 Q(b)144 542.4 Q F0 .921(ar e)B .921(xtending from)
+-.15 F F2(base)3.421 E F0 .921(to y)3.421 F(.)-.65 E F2(size)5.921 E F0
+.921(is bar width.)3.421 F .921(By def)5.921 F(ault,)-.1 E F2(base)3.421
+E F0 3.421(=0)3.421 G 5.921(.A)-3.421 G .921(ppend /)-5.921 F F2(base)A
+F0 .922(to change)3.422 F(this v)144 554.4 Q 2.5(alue. Append)-.25 F F1
+(u)2.5 E F0(if)2.5 E F2(size)2.5 E F0(is in x-units [Def)2.5 E
+(ault is inch].)-.1 E F1(\255MXSc)108 571.2 Q(c)144 583.2 Q F0(ircle.)A
+F2(size)5 E F0(is diameter of circle.)2.5 E F1(\255MXSd)108 600 Q(d)144
+612 Q F0(iamond.)A F2(size)5 E F0(is side of diamond.)2.5 E F1(\255MXSe)
+108 628.8 Q(e)144 640.8 Q F0 5.678(llipse. Direction)B 3.178(\(in de)
+5.678 F 3.178
 (grees counterclockwise from horizontal\), major_axis \(in inch\), and)
 -.15 F(minor_axis \(in inch\) must be found in columns 3, 4, and 5.)144
-446.4 Q F2(\255MXSf)108 463.2 Q(f)144 475.2 Q F0 2.528(ault. Gi)B .328
+652.8 Q F1(\255MXSf)108 669.6 Q(f)144 681.6 Q F0 2.528(ault. Gi)B .328
 -.15(ve d)-.25 H .028(istance g).15 F .029
 (ap between ticks and ticklength in inch.)-.05 F .029(If g)5.029 F .029
 (ap is ne)-.05 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 2.529(,i).15 G
 2.529(ti)-2.529 G 2.529(si)-2.529 G .029(nterpreted to)-2.529 F .399
-(mean number of ticks instead.)144 487.2 R(Append)5.399 E F2(l)2.899 E
-F0(or)2.899 E F2(r)2.899 E F0 .399(to dra)2.899 F 2.899(wt)-.15 G .399
+(mean number of ticks instead.)144 693.6 R(Append)5.399 E F1(l)2.899 E
+F0(or)2.899 E F1(r)2.899 E F0 .399(to dra)2.899 F 2.899(wt)-.15 G .399
 (ick on the left or right side of line [Def)-2.899 F(ault)-.1 E
-(is centered].)144 499.2 Q(Upper case)5 E F2(L)2.5 E F0(or)2.5 E F2(R)
+(is centered].)144 705.6 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
 2.5 E F0(dra)2.5 E(ws a triangle instead of line se)-.15 E(gment.)-.15 E
-F2(\255MXSh)108 516 Q(h)144 528 Q F0 -.15(ex)C 2.5(agon. Gi).15 F .3
--.15(ve s)-.25 H(ide in inch.).15 E F2 2.8(\255MXSi i)108 544.8 R F0
--1.85 -.4(nv e)D(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H
-(ide in inch.).15 E F2 2.8(\255MXSl l)108 561.6 R F0 .405(etter or te)B
-.405(xt string.)-.15 F(Gi)5.405 E .706 -.15(ve s)-.25 H .406
-(ize in inch, and append /).15 F F1(string)A F0 .406(after the size.)
-2.906 F .406(Note that the size is only)5.406 F .92
-(approximate; no indi)144 573.6 R .919(vidual scaling is done for dif)
--.25 F .919(ferent characters.)-.25 F .919(Remember to escape special)
-5.919 F(characters lik)144 585.6 Q 2.5(e*)-.1 G(.)-2.5 E F2(\255MXSp)108
-602.4 Q(p)144 614.4 Q F0 2.5(oint. No)B
-(size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)-.15 E F2
-(\255MXSs)108 631.2 Q(s)144 643.2 Q F0 2.5(quare. Gi)B .3 -.15(ve s)-.25
-H(ide in inch.).15 E F2(\255MXSt)108 660 Q(t)144 672 Q F0 2.5
-(riangle. Gi)B .3 -.15(ve s)-.25 H(ide in inch.).15 E F2(\255MXSv)108
-688.8 Q(v)144 700.8 Q F0(ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(\
-grees counterclockwise from horizontal\) and length \(in inch\) must be)
--.15 F .036(found in columns 3 and 4.)144 712.8 R F1(size)5.036 E F0
-2.536(,i)C 2.536(fp)-2.536 G .036(resent, will be interpreted as arro)
--2.536 F(wwidth/headlength/headwidth)-.25 E 2.103(\(in inch\) [Def)144
-724.8 R 2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F
-2.104(ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104
-(utes remains in)-.2 F -.25(va)-.4 G 2.104(riant to the).25 F
-(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)-2.5 E(9)199.555 E 0
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(9)198.45 E 0
 Cg EP
 %%Page: 10 10
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F .029(length of the arro)144 84 R 3.829 -.65
-(w. T)-.25 H 2.529(oh)-.15 G -2.25 -.2(av e)-2.529 H .029
-(the size of the v)2.729 F .029(ector scale do)-.15 F .028
-(wn with decreasing size, append n)-.25 F/F1 10/Times-Italic at 0 SF(norm)A
-F0(,)A(where v)144 96 Q(ectors shorter than)-.15 E F1(norm)2.5 E F0
-(will ha)2.5 E .3 -.15(ve t)-.2 H(heir attrib).15 E
-(utes scaled by length/)-.2 E F1(norm)A F0(.)A/F2 10/Times-Bold at 0 SF
-(\255MXSV)108 112.8 Q F0 .793(Same as)144 124.8 R F2(\255MXSv)3.293 E F0
-3.293(,e)C .793(xcept azimuth \(in de)-3.443 F .793
-(grees east of north\) should be gi)-.15 F -.15(ve)-.25 G 3.294(ni).15 G
-.794(nstead of direction.)-3.294 F .079(The azimuth will be mapped into\
- an angle based on the chosen map projection \()144 136.8 R F2(\255MXSv)
-A F0(lea)2.579 E -.15(ve)-.2 G 2.579(st).15 G(he)-2.579 E
-(directions unchanged.\))144 148.8 Q F2(\255MXSx)108 165.6 Q F0 2.5
-(cross. Gi)144 177.6 R .3 -.15(ve l)-.25 H(ength in inch.).15 E F2
-(\255MXW)108 194.4 Q F1(pen)144 206.4 Q F0 .783(Set pen attrib)144 218.4
-R .784(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .784
-(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 230.4 Q
+(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MXSh)108 84 Q(h)
+144 96 Q F0 -.15(ex)C 2.5(agon. Gi).15 F .3 -.15(ve s)-.25 H
+(ide in inch.).15 E F1 2.8(\255MXSi i)108 112.8 R F0 -1.85 -.4(nv e)D
+(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H(ide in inch.).15 E F1
+2.8(\255MXSl l)108 129.6 R F0 .405(etter or te)B .405(xt string.)-.15 F
+(Gi)5.405 E .706 -.15(ve s)-.25 H .406(ize in inch, and append /).15 F
+/F2 10/Times-Italic at 0 SF(string)A F0 .406(after the size.)2.906 F .406
+(Note that the size is only)5.406 F .92(approximate; no indi)144 141.6 R
+.919(vidual scaling is done for dif)-.25 F .919(ferent characters.)-.25
+F .919(Remember to escape special)5.919 F(characters lik)144 153.6 Q 2.5
+(e*)-.1 G(.)-2.5 E F1(\255MXSp)108 170.4 Q(p)144 182.4 Q F0 2.5
+(oint. No)B(size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)
+-.15 E F1(\255MXSs)108 199.2 Q(s)144 211.2 Q F0 2.5(quare. Gi)B .3 -.15
+(ve s)-.25 H(ide in inch.).15 E F1(\255MXSt)108 228 Q(t)144 240 Q F0 2.5
+(riangle. Gi)B .3 -.15(ve s)-.25 H(ide in inch.).15 E F1(\255MXSv)108
+256.8 Q(v)144 268.8 Q F0(ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(\
+grees counterclockwise from horizontal\) and length \(in inch\) must be)
+-.15 F .036(found in columns 3 and 4.)144 280.8 R F2(size)5.036 E F0
+2.536(,i)C 2.536(fp)-2.536 G .036(resent, will be interpreted as arro)
+-2.536 F(wwidth/headlength/headwidth)-.25 E 2.103(\(in inch\) [Def)144
+292.8 R 2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F
+2.104(ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104
+(utes remains in)-.2 F -.25(va)-.4 G 2.104(riant to the).25 F .029
+(length of the arro)144 304.8 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G
+-2.25 -.2(av e)-2.529 H .029(the size of the v)2.729 F .029
+(ector scale do)-.15 F .028(wn with decreasing size, append n)-.25 F F2
+(norm)A F0(,)A(where v)144 316.8 Q(ectors shorter than)-.15 E F2(norm)
+2.5 E F0(will ha)2.5 E .3 -.15(ve t)-.2 H(heir attrib).15 E
+(utes scaled by length/)-.2 E F2(norm)A F0(.)A F1(\255MXSV)108 333.6 Q
+F0 .793(Same as)144 345.6 R F1(\255MXSv)3.293 E F0 3.293(,e)C .793
+(xcept azimuth \(in de)-3.443 F .793(grees east of north\) should be gi)
+-.15 F -.15(ve)-.25 G 3.294(ni).15 G .794(nstead of direction.)-3.294 F
+.079(The azimuth will be mapped into an angle based on the chosen map p\
+rojection \()144 357.6 R F1(\255MXSv)A F0(lea)2.579 E -.15(ve)-.2 G
+2.579(st).15 G(he)-2.579 E(directions unchanged.\))144 369.6 Q F1
+(\255MXSx)108 386.4 Q F0 2.5(cross. Gi)144 398.4 R .3 -.15(ve l)-.25 H
+(ength in inch.).15 E F1(\255MXW)108 415.2 Q F2(pen)144 427.2 Q F0 .783
+(Set pen attrib)144 439.2 R .784
+(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .784
+(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 451.2 Q
 2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F2<ad4f>108 247.2 Q F1 -.45(ro)22.52 G(ot).45 E
-F0 .423(Sets the root used to construct the \214lename of the output sh\
-ellscript \()144 259.2 R F1 -.45(ro)C(ot).45 E F0 .422
+(xture = solid].)-.15 E F1<ad4f>108 468 Q F2 -.45(ro)22.52 G(ot).45 E F0
+.423(Sets the root used to construct the \214lename of the output shell\
+script \()144 480 R F2 -.45(ro)C(ot).45 E F0 .422
 (.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 271.2 R .157
+(created when the shellscript is run.)144 492 R .157
 (Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 283.2 Q F1 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108
-300 Q F1(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the\
- size of the page the plot will be centered on. If the user does not se\
-t the plot)144 312 R .125(scale, the plot will be sized as lar)144 324 R
-.125(ge as will \214t on the designated page. If the user sets the plot\
- scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144 336
-R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(page sizes are:)144 348 Q(American ANSI sizes:)169 372 Q 12.5(A8)169
-384 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))5 E 10
-(B1)169 396 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 408 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 420 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 432 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 444 S
+5.157 F(as the)144 504 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
+520.8 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
+he size of the page the plot will be centered on. If the user does not \
+set the plot)144 532.8 R .125(scale, the plot will be sized as lar)144
+544.8 R .125(ge as will \214t on the designated page. If the user sets \
+the plot scale)-.18 F .948
+(such that the plot will not \214t on the designated page, a lar)144
+556.8 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
+(page sizes are:)144 568.8 Q(American ANSI sizes:)169 592.8 Q 12.5(A8)
+169 604.8 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
+5 E 10(B1)169 616.8 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
+(431.8 mm\))5 E 10(C1)169 628.8 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
+(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 640.8 S(2.0 x 34.0 in.)-10 E 2.5
+(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 652.8 S(4.0 x 44.0 in.)
+-10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 664.8 S
 (8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
-169 456 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
-(Metric ISO A sizes:)169 480 Q 5(A0 841.0)169 492 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 504 R 5(x8)2.5
-G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 516 R 5(x5)2.5 G
-(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 528 R 5(x4)2.5 G
-(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 540 R 5(x2)2.5 G
-(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 552 R
-5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5
-(A6 105.0)169 564 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E
-(5.83 in.\))5 E 7.5(A7 74.0)169 576 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5
-G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 588 R 7.5(x7)2.5 G(4.0 mm)
--7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 600 R 7.5
-(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5
-(A10 26.0)169 612 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E
-(1.46 in.\))5 E(Metric ISO B sizes:)169 636 Q 5(B0 1000.0x)169 648 R
-(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 660 R 2.5(x1)
-2.5 G(000.0 mm)-2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 672 R 5
-(x7)2.5 G(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 684 R 5
-(x5)2.5 G(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 696 R 5
-(x3)2.5 G(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)
-169 708 R 5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5
-E 5(B6 125.0)169 720 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
-(6.93 in.\))5 E(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)-2.5
-E(10)194.555 E 0 Cg EP
+169 676.8 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
+(Metric ISO A sizes:)169 700.8 Q 5(A0 841.0)169 712.8 R 2.5(x1)2.5 G
+(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 724.8 R 5(x8)
+2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E(MB-System 5.0)72 768 Q 2.5
+(9J)140.11 G(anuary 2015)-2.5 E(10)193.45 E 0 Cg EP
 %%Page: 11 11
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 7.5(B7 88.0)169 84 R 5(x1)2.5 G(25.0 mm)-5 E
-2.5(\(3)5 G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 96 R 7.5(x8)2.5
-G(8.0 mm)-7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169
-108 R 7.5(x6)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E
-5(B10 31.0)169 120 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
-(1.73 in.\))5 E(Metric ISO C sizes:)169 144 Q 5(C0 914.4)169 156 R 2.5
-(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 168 R
-5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 180 R 5
-(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 192 R 5
-(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 204 R 5
+(5.0 mbm_grdplot\(1\))2.5 F 5(A2 420.0)169 84 R 5(x5)2.5 G(94.0 mm)-5 E
+(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 96 R 5(x4)2.5 G(20.0 mm)-5 E
+(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 108 R 5(x2)2.5 G(97.0 mm)-5 E
+2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 120 R 5(x2)2.5 G
+(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5(A6 105.0)169 132
+R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E(5.83 in.\))5 E 7.5
+(A7 74.0)169 144 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5 G(.91 x)-2.5 E
+(4.13 in.\))5 E 7.5(A8 52.0)169 156 R 7.5(x7)2.5 G(4.0 mm)-7.5 E 2.5
+(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 168 R 7.5(x5)2.5 G
+(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5(A10 26.0)169
+180 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E
+(Metric ISO B sizes:)169 204 Q 5(B0 1000.0x)169 216 R(1414.0 mm)2.5 E
+(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 228 R 2.5(x1)2.5 G(000.0 mm)
+-2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 240 R 5(x7)2.5 G
+(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 252 R 5(x5)2.5 G
+(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 264 R 5(x3)2.5 G
+(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 276 R
+5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5
+(B6 125.0)169 288 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
+(6.93 in.\))5 E 7.5(B7 88.0)169 300 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5
+G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 312 R 7.5(x8)2.5 G(8.0 mm)
+-7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 324 R 7.5
+(x6)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5
+(B10 31.0)169 336 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
+(1.73 in.\))5 E(Metric ISO C sizes:)169 360 Q 5(C0 914.4)169 372 R 2.5
+(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 384 R
+5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 396 R 5
+(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 408 R 5
+(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 420 R 5
 (x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
-169 216 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
-E 5(C6 114.3)169 228 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
-(6.40 in.\))5 E 7.5(C7 81.3)169 240 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
-G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 264 Q(ge format sizes:)
--.18 E 2.5(m1 1371.6)169 276 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 288 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 300 R 2.5
+169 432 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
+E 5(C6 114.3)169 444 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
+(6.40 in.\))5 E 7.5(C7 81.3)169 456 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
+G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 480 Q(ge format sizes:)
+-.18 E 2.5(m1 1371.6)169 492 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
+(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 504 R 2.5(x2)2.5 G
+(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 516 R 2.5
 (x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-312 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 324 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 336 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(The def)144 360 Q(ault page size is A.)-.1 E
-/F1 10/Times-Bold at 0 SF<ad51>108 376.8 Q F0(Normally)22.52 E 2.866(,t)
+528 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
+(m5 1524.0)169 540 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
+5 E 2.5(m6 1524.0)169 552 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
+(\(60.00 x 96.00 in.\))5 E(The def)144 576 Q(ault page size is A.)-.1 E
+/F1 10/Times-Bold at 0 SF<ad51>108 592.8 Q F0(Normally)22.52 E 2.866(,t)
 -.65 G .367
 (he output plot generation shellscript includes lines which e)-2.866 F
 -.15(xe)-.15 G .367(cute a program to display).15 F 1.072
-(the Postscript image on the screen.)144 388.8 R 1.071
+(the Postscript image on the screen.)144 604.8 R 1.071
 (This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 400.8 S .147
+(exe)144 616.8 S .147
 (cuting the shellscript produces a Postscript plot b).15 F .148
-(ut does not attempt to display it on the screen.)-.2 F .327
-(The program to be used to display the Postscript is set using)144 412.8
-R F1(mbdefaults)2.826 E F0 2.826(;t)C .326(he def)-2.826 F .326(ault v)
--.1 F .326(alue can be)-.25 F -.15(ove)144 424.8 S
-(rridden by setting the en).15 E(vironment v)-.4 E
-(ariable $MB_PS_VIEWER.)-.25 E F1<ad52>108 441.6 Q/F2 10/Times-Italic at 0
-SF(west/east/south/north)23.08 E .736(west, east, south,)144 453.6 R F0
+(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
+628.8 Q -.15(ve)-.25 G(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H
+.392(king the plot generation shellscript with a).4 F F1(-N)2.891 E F0
+.391(command line ar)2.891 F .391(gument also sup-)-.18 F .088
+(presses the screen display of the plot.)144 640.8 R .089
+(The program to be used to display the Postscript is set using)5.088 F
+F1(mbdefaults)144 652.8 Q F0 7.891(;t)C 5.391(he def)-7.891 F 5.391
+(ault v)-.1 F 5.391(alue can be o)-.25 F -.15(ve)-.15 G 5.391
+(rridden by setting the en).15 F 5.39(vironment v)-.4 F(ariable)-.25 E
+($MB_PS_VIEWER.)144 664.8 Q F1<ad52>108 681.6 Q/F2 10/Times-Italic at 0 SF
+(west/east/south/north)23.08 E .736(west, east, south,)144 693.6 R F0
 (and)3.236 E F2(north)3.236 E F0 .736(specify the Re)3.236 F .736
 (gion of interest.)-.15 F 2.336 -.8(To s)5.736 H .736
 (pecify boundaries in de).8 F .736(grees and)-.15 F 1.162
-(minutes [and seconds], use the dd:mm[:ss] format.)144 465.6 R(Append)
+(minutes [and seconds], use the dd:mm[:ss] format.)144 705.6 R(Append)
 6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.161
-(wer left and upper right map)-.25 F .208(coordinates are gi)144 477.6 R
+(wer left and upper right map)-.25 F .208(coordinates are gi)144 717.6 R
 -.15(ve)-.25 G 2.708(ni).15 G .208(nstead of wesn.)-2.708 F -1.1(Yo)
 5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E F2
 (w/e/s/n)2.708 E F0(re)2.708 E .209(gion to ha)-.15 F .509 -.15(ve m)-.2
-H .209(ore room).15 F .199(between the image and the ax)144 489.6 R
-2.699(es. A)-.15 F .199(smaller re)2.699 F .199
-(gion than speci\214ed in the grd\214le will result in a sub-)-.15 F
-(set of the grid [Def)144 501.6 Q(ault is re)-.1 E(gion gi)-.15 E -.15
-(ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G(he grd\214le].)-2.5 E F1<ad53>108
-518.4 Q F2([color/shade])24.74 E F0 1.392(This option enables ef)144
-530.4 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H 1.392
-(istogram equalization of the color and/or shading of the gridded).15 F
-.628(data. The equalization is not achie)144 542.4 R -.15(ve)-.25 G
-3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
+H .209(ore room).15 F 1.371(between the image and the ax)144 729.6 R
+3.871(es. A)-.15 F 1.371(smaller re)3.871 F 1.37
+(gion than speci\214ed in the grd\214le will result in a)-.15 F
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(11)193.45 E 0
+Cg EP
+%%Page: 12 12
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F(subset of the grid [Def)144 84 Q(ault is re)
+-.1 E(gion gi)-.15 E -.15(ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G
+(he grd\214le].)-2.5 E/F1 10/Times-Bold at 0 SF<ad53>108 100.8 Q/F2 10
+/Times-Italic at 0 SF([color/shade])24.74 E F0 1.392
+(This option enables ef)144 112.8 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H
+1.392(istogram equalization of the color and/or shading of the gridded)
+.15 F .628(data. The equalization is not achie)144 124.8 R -.15(ve)-.25
+G 3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
 (alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
  shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 554.4 R .19(points. This serv)144 566.4 R .19
+actions of the data-)144 136.8 R .19(points. This serv)144 148.8 R .19
 (es to focus color or shading contrasts in v)-.15 F .19
 (alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
-(the data v)144 578.4 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
+(the data v)144 160.8 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
 (is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
 F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
 .838(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 590.4 R .991
+(used for color or gray \214ll plots,)144 172.8 R .991
 (shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .637(thetic illumination \()144 602.4 R F1<ad47>
+(either by syn-)5.991 F .637(thetic illumination \()144 184.8 R F1<ad47>
 A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
 (sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
 3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
-F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 614.4
+F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 196.8
 R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
 (will equalize the shading without equalizing)3 F(the color table.)144
-626.4 Q F1<ad54>108 643.2 Q F0(If)23.63 E F1<ad54>2.7 E F0 .201(is gi)
+208.8 Q F1<ad54>108 225.6 Q F0(If)23.63 E F1<ad54>2.7 E F0 .201(is gi)
 2.701 F -.15(ve)-.25 G .201(n, it causes a coastline to be dra).15 F
 .201(wn on the map. The def)-.15 F .201(ault is to dra)-.1 F 2.701(wt)
 -.15 G .201(he coastline as)-2.701 F .629(the thinnest possible line. T)
-144 655.2 R 3.129(oe)-.8 G -.15(xe)-3.279 G .628(rcise greater control \
+144 237.6 R 3.129(oe)-.8 G -.15(xe)-3.279 G .628(rcise greater control \
 of the coastline plotting, including color \214ll).15 F 2.068
-(of "dry" areas and display of lak)144 667.2 R 2.068(es, ri)-.1 F -.15
+(of "dry" areas and display of lak)144 249.6 R 2.068(es, ri)-.1 F -.15
 (ve)-.25 G 2.068(rs, and political boundaries, use the).15 F F1(\255MTC)
-4.568 E F0(,)A F1(\255MTD)4.568 E F0(,)A F1(\255MTG)144 679.2 Q F0(,)A
+4.568 E F0(,)A F1(\255MTD)4.568 E F0(,)A F1(\255MTG)144 261.6 Q F0(,)A
 F1(\255MTI)2.5 E F0(,)A F1(\255MTN)2.5 E F0(,)A F1(\255MTS)2.5 E F0 2.5
-(,a)C(nd)-2.5 E F1(\255MTW)2.5 E F0(options.)2.5 E F1<ad55>108 696 Q F2
-(orientation)23.08 E F0 .2(Normally the orientation of the plot \(portr\
-ait or landscape\) is selected automatically so as to maxi-)144 708 R
-.333(mize the plot scale.)144 720 R(The)5.333 E F1<ad55>2.833 E F0 .333
-(option allo)2.833 F .333(ws the user to set the plot orientation. If)
--.25 F F2(orientation)2.833 E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)-2.5 E(11)194.555 E
-0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F(portrait plot will be produced; if)144 84 Q
-/F1 10/Times-Italic at 0 SF(orientation)2.5 E F0 2.5(=2)2.5 G 2.5(,al)-2.5
-G(andscape plot will be produced.)-2.5 E/F2 10/Times-Bold at 0 SF<ad56>108
-100.8 Q F0(Causes)23.08 E F2(mbm_grdplot)4.506 E F0 2.006
+(,a)C(nd)-2.5 E F1(\255MTW)2.5 E F0(options.)2.5 E F1<ad55>108 278.4 Q
+F2(orientation)23.08 E F0 .2(Normally the orientation of the plot \(por\
+trait or landscape\) is selected automatically so as to maxi-)144 290.4
+R .333(mize the plot scale.)144 302.4 R(The)5.333 E F1<ad55>2.833 E F0
+.333(option allo)2.833 F .333
+(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
+E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
+(portrait plot will be produced; if)144 314.4 Q F2(orientation)2.5 E F0
+2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
+<ad56>108 331.2 Q F0(Causes)23.08 E F1(mbm_grdplot)4.506 E F0 2.006
 (to operate in "v)4.506 F 2.005
 (erbose" mode so that it outputs more information than)-.15 F(usual.)144
-112.8 Q F2<ad57>108 129.6 Q F1([color_style)20.3 E F0([)A F1(/palette)A
-F0([)A F1(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
+343.2 Q F1<ad57>108 360 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0
+([)A F2(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
 (This option controls the color scheme used for color \214ll plots.)144
-141.6 Q(If)144 165.6 Q F1(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
+372 Q(If)144 396 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
 -3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F1(color_style)144 177.6 Q F0 2.816(=2)2.816 G
+ading of colors. If)-.1 F F2(color_style)144 408 Q F0 2.816(=2)2.816 G
 2.816(,t)-2.816 G .316
 (he color scheme will be a set of discrete color interv)-2.816 F .315
-(als. The color palette used is)-.25 F(set using)144 189.6 Q F1(palette)
+(als. The color palette used is)-.25 F(set using)144 420 Q F2(palette)
 2.5 E F0 2.5(.S)C -2.15 -.25(ev e)-2.5 H 2.5(np).25 G(alettes are a)-2.5
-E -.25(va)-.2 G(ilable:).25 E F1(palette)180 201.6 Q F0 2.5(=1)2.5 G
-26.36(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E F1(palette)180
-213.6 Q F0 2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F1
-(palette)180 225.6 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36
-H(ntensity colors).25 E F1(palette)180 237.6 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F1(palette)180 249.6 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E F1(palette)180 261.6 Q F0 2.5(=6)
-2.5 G 26.36(:u)-2.5 G(niform black)-26.36 E F1(palette)180 273.6 Q F0
-2.5(=7)2.5 G 26.36(:u)-2.5 G(niform white)-26.36 E F1(palette)180 285.6
-Q F0 2.5(=8)2.5 G 26.36(:s)-2.5 G(eale)-26.36 E -.15(ve)-.25 G 2.5(l1)
-.15 G F1(palette)180 297.6 Q F0 2.5(=9)2.5 G 26.36(:s)-2.5 G(eale)-26.36
-E -.15(ve)-.25 G 2.5(l2).15 G
-(The RGB de\214nitions of the color palettes are:)144 321.6 Q
-(color palette 1 \255 Haxby Color T)144 345.6 Q(able)-.8 E 5(red: 255)
-149 357.6 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
-(green: 255 186 161 189 236 255 236 235 190 127)149 369.6 Q(57)5 E 2.5
-(blue: 255)149 381.6 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)
-2.5 E(color palette 2 \255 High Intensity Colors)144 405.6 Q 5(red: 255)
-149 417.6 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5
-(green: 0)149 429.6 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5
-(blue: 0)149 441.6 R 7.5(00000)7.5 G(255 255 255 255 255)-5 E
-(color palette 3 \255 Lo)144 465.6 Q 2.5(wI)-.25 G(ntensity Colors)-2.5
-E 5(red: 200)149 477.6 R(194 179 141)2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5
-(green: 0)149 489.6 R 2.5(49 90)5 F(141 179 200 141)2.5 E 5(90 0 0 0)5 F
-7.5(blue: 0)149 501.6 R 7.5(00000)7.5 G(141 179 200 179 141)-5 E
-(color palette 4 \255 Grayscale)144 525.6 Q 5(red: 255)149 537.6 R
-(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)7.5 E
-(green: 255 230 204 179 153 128 102)149 549.6 Q 2.5(77 51 26)5 F(0)7.5 E
-2.5(blue: 255)149 561.6 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F
-(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 585.6 Q 5(red: 128)
-149 597.6 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(green: 128 128 128 128 128 128 128 128 128 128 128)149 609.6 Q 2.5
-(blue: 128)149 621.6 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(color palette 6 \255 Uniform Black)144 645.6 Q 10(red: 0)149 657.6 R
-7.5(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 669.6 R 7.5
-(blue: 0)149 681.6 R 7.5(0000000000)7.5 G
-(color palette 7 \255 Uniform White)144 705.6 Q 5(red: 255)149 717.6 R
-(255 255 255 255 255 255 255 255 255 255)2.5 E
-(green: 255 255 255 255 255 255 255 255 255 255 255)149 729.6 Q
-(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)-2.5 E(12)194.555 E
-0 Cg EP
+E -.25(va)-.2 G(ilable:).25 E F2(palette)180 432 Q F0 2.5(=1)2.5 G 26.36
+(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 444 Q F0
+2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)
+180 456 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
+(ntensity colors).25 E F2(palette)180 468 Q F0 2.5(=4)2.5 G 26.36(:g)
+-2.5 G(rayscale)-26.36 E F2(palette)180 480 Q F0 2.5(=5)2.5 G 26.36(:u)
+-2.5 G(niform grayscale)-26.36 E F2(palette)180 492 Q F0 2.5(=6)2.5 G
+26.36(:u)-2.5 G(niform black)-26.36 E F2(palette)180 504 Q F0 2.5(=7)2.5
+G 26.36(:u)-2.5 G(niform white)-26.36 E F2(palette)180 516 Q F0 2.5(=8)
+2.5 G 26.36(:s)-2.5 G(eale)-26.36 E -.15(ve)-.25 G 2.5(l1).15 G F2
+(palette)180 528 Q F0 2.5(=9)2.5 G 26.36(:s)-2.5 G(eale)-26.36 E -.15
+(ve)-.25 G 2.5(l2).15 G
+(The RGB de\214nitions of the color palettes are:)144 552 Q
+(color palette 1 \255 Haxby Color T)144 576 Q(able)-.8 E 5(red: 255)149
+588 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
+(green: 255 186 161 189 236 255 236 235 190 127)149 600 Q(57)5 E 2.5
+(blue: 255)149 612 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)2.5
+E(color palette 2 \255 High Intensity Colors)144 636 Q 5(red: 255)149
+648 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5(green: 0)149
+660 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5(blue: 0)149 672 R
+7.5(00000)7.5 G(255 255 255 255 255)-5 E(color palette 3 \255 Lo)144 696
+Q 2.5(wI)-.25 G(ntensity Colors)-2.5 E 5(red: 200)149 708 R(194 179 141)
+2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5(green: 0)149 720 R 2.5(49 90)5 F
+(141 179 200 141)2.5 E 5(90 0 0 0)5 F(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(12)193.45 E 0 Cg EP
 %%Page: 13 13
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 2.5(blue: 255)149 84 R
-(255 255 255 255 255 255 255 255 255 255)2.5 E
-(color pallette 8 \255 Seale)144 108 Q -.15(ve)-.25 G 2.5(l1).15 G
-(\(colors here used abo)149 120 Q .3 -.15(ve z)-.15 H
-(ero Haxby colors belo).15 E(w\))-.25 E 5(red: 250)149 132 R
+(5.0 mbm_grdplot\(1\))2.5 F 7.5(blue: 0)149 84 R 7.5(00000)7.5 G
+(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 108 Q 5
+(red: 255)149 120 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)7.5
+E(green: 255 230 204 179 153 128 102)149 132 Q 2.5(77 51 26)5 F(0)7.5 E
+2.5(blue: 255)149 144 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F
+(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 168 Q 5(red: 128)149
+180 R(128 128 128 128 128 128 128 128 128 128)2.5 E
+(green: 128 128 128 128 128 128 128 128 128 128 128)149 192 Q 2.5
+(blue: 128)149 204 R(128 128 128 128 128 128 128 128 128 128)2.5 E
+(color palette 6 \255 Uniform Black)144 228 Q 10(red: 0)149 240 R 7.5
+(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 252 R 7.5(blue: 0)
+149 264 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
+288 Q 5(red: 255)149 300 R(255 255 255 255 255 255 255 255 255 255)2.5 E
+(green: 255 255 255 255 255 255 255 255 255 255 255)149 312 Q 2.5
+(blue: 255)149 324 R(255 255 255 255 255 255 255 255 255 255)2.5 E
+(color pallette 8 \255 Seale)144 348 Q -.15(ve)-.25 G 2.5(l1).15 G
+(\(colors here used abo)149 360 Q .3 -.15(ve z)-.15 H
+(ero Haxby colors belo).15 E(w\))-.25 E 5(red: 250)149 372 R
 (245 240 235 230 221 212 211 210 205 200)2.5 E
-(green: 250 240 230 221 212 201 190 180 170 160 150)149 144 Q 2.5
-(blue: 120)149 156 R(112 104)2.5 E 2.5(96 88 80 72 64 56 48 40)5 F
-(color pallette 9 \255 Seale)144 180 Q -.15(ve)-.25 G 2.5(l2).15 G
-(\(colors here used abo)149 192 Q .3 -.15(ve z)-.15 H
-(ero Haxby colors belo).15 E(w\))-.25 E 5(red: 255)149 204 R
+(green: 250 240 230 221 212 201 190 180 170 160 150)149 384 Q 2.5
+(blue: 120)149 396 R(112 104)2.5 E 2.5(96 88 80 72 64 56 48 40)5 F
+(color pallette 9 \255 Seale)144 420 Q -.15(ve)-.25 G 2.5(l2).15 G
+(\(colors here used abo)149 432 Q .3 -.15(ve z)-.15 H
+(ero Haxby colors belo).15 E(w\))-.25 E 5(red: 255)149 444 R
 (210 170 145 120 120 104)2.5 E 2.5(67 33)5 F 7.5(00)7.5 G
-(green: 255 200 160 145 130 100 107 123 140 160 230)149 216 Q 2.5
-(blue: 100 75 50 45 40 30 24)149 228 R 7.5(7000)7.5 G .365
-(The Haxby colors ha)144 252 R .665 -.15(ve b)-.2 H .366
+(green: 255 200 160 145 130 100 107 123 140 160 230)149 456 Q 2.5
+(blue: 100 75 50 45 40 30 24)149 468 R 7.5(7000)7.5 G .365
+(The Haxby colors ha)144 492 R .665 -.15(ve b)-.2 H .366
 (een adapted from a palette de).15 F -.15(ve)-.25 G .366(loped by Dr).15
 F 2.866(.W)-.55 G .366(illiam Haxby of the Lam-)-3.266 F .32
-(ont-Doherty Earth Observ)144 264 R .319
+(ont-Doherty Earth Observ)144 504 R .319
 (atory; this palette is pleasing to the e)-.25 F .319
 (ye and well suited for shading. The)-.15 F .309(high intensity colors \
 describe linear paths through RGB space from red to blue to green to pu\
-rple;)144 276 R .438(because the colors are high intensity the)144 288 R
+rple;)144 516 R .438(because the colors are high intensity the)144 528 R
 2.938(ya)-.15 G .437(re not well suited to shading.)-2.938 F .437
 (The lo)5.437 F 2.937(wi)-.25 G .437(ntensity colors)-2.937 F .517
-(are similar to the high intensity)144 300 R 3.017(,b)-.65 G .517
+(are similar to the high intensity)144 540 R 3.017(,b)-.65 G .517
 (ut muted and thus well suited to shading.)-3.217 F .517
 (The grayscale palette)5.517 F .499(runs linearly from white to black a\
-nd is commonly used for plots of sidescan and amplitude data.)144 312 R
+nd is commonly used for plots of sidescan and amplitude data.)144 552 R
 (The uniform grayscale is useful for non-color shaded relief plots.)144
-324 Q(The)144 348 Q/F1 10/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0
+564 Q(The)144 588 Q/F1 10/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0
 .107(parameter sets the number of color v)2.606 F .107
 (alues used in plotting, whether the colors are rep-)-.25 F(resented in\
  a continuous color scale or a stepped, discrete color scale [def)144
-360 Q(ault is 11].)-.1 E .523(If the option ar)144 384 R .522
+600 Q(ault is 11].)-.1 E .523(If the option ar)144 624 R .522
 (gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
 (GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 396 Q F2
-<ad58>108 412.8 Q F0(Normally)23.08 E(,)-.65 E F2(mbm_grdplot)3.304 E F0
+3.022 F(and its color scheme will be used for the plot)144 636 Q F2
+<ad58>108 652.8 Q F0(Normally)23.08 E(,)-.65 E F2(mbm_grdplot)3.304 E F0
 .804(creates an e)3.304 F -.15(xe)-.15 G .804
 (cutable shellscript and then e).15 F 3.304(xits. This)-.15 F .805
-(option will cause)3.304 F(the shellscript to be e)144 424.8 Q -.15(xe)
+(option will cause)3.304 F(the shellscript to be e)144 664.8 Q -.15(xe)
 -.15 G(cuted in the background before).15 E F2(mbm_grdplot)2.5 E F0 -.15
-(ex)2.5 G(its.).15 E F2<ad59>108 441.6 Q F0(Normally)23.08 E(,)-.65 E F2
+(ex)2.5 G(its.).15 E F2<ad59>108 681.6 Q F0(Normally)23.08 E(,)-.65 E F2
 (mbm_grdplot)5.333 E F0 2.833
 (generates nicely rounded numbers for the boundaries of the color)5.333
-F .654(palette. Often, the resulting color bounds e)144 453.6 R .655
+F .654(palette. Often, the resulting color bounds e)144 693.6 R .655
 (xtend well outside the range of the gridded data.)-.15 F(This)5.655 E
 .923(option causes the minimum and maximum color boundaries to e)144
-465.6 R .923(xactly conform to the minimum)-.15 F .495(and maximum v)144
-477.6 R .496(alues of the grid, or)-.25 F 2.996(,i)-.4 G 2.996(ft)-2.996
+705.6 R .923(xactly conform to the minimum)-.15 F .495(and maximum v)144
+717.6 R .496(alues of the grid, or)-.25 F 2.996(,i)-.4 G 2.996(ft)-2.996
 G(he)-2.996 E F2<ad5a>2.996 E F0 .496
 (option is used, the minimum and maximum v)2.996 F(alues)-.25 E
-(speci\214ed by the user)144 489.6 Q(.)-.55 E F2<ad5a>108 506.4 Q F1
-(min/max[/mode])23.63 E F0 .787(This option o)144 518.4 R -.15(ve)-.15 G
-.787(rrides the minimum and maximum v).15 F .786
+(speci\214ed by the user)144 729.6 Q(.)-.55 E(MB-System 5.0)72 768 Q 2.5
+(9J)140.11 G(anuary 2015)-2.5 E(13)193.45 E 0 Cg EP
+%%Page: 14 14
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
+(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad5a>108 84 Q/F2 10
+/Times-Italic at 0 SF(min/max[/mode])23.63 E F0 .787(This option o)144 96 R
+-.15(ve)-.15 G .787(rrides the minimum and maximum v).15 F .786
 (alues of the gridded data, af)-.25 F .786(fecting the color)-.25 F .905
-(palette and the contour interv)144 530.4 R .905
+(palette and the contour interv)144 108 R .905
 (al if those parameters are not speci\214ed by the user)-.25 F 3.405(.B)
--.55 G 3.405(yd)-3.405 G(ef)-3.405 E .905(ault \(i.e.)-.1 F F1(mode)144
-542.4 Q F0 .528(is omitted or equal to 0\), the macro selects the color\
- palette bounds so that the)3.029 F 3.028(ye)-.15 G(ncompass)-3.028 E F1
-(min)144 554.4 Q F0(and)2.836 E F1(max)2.836 E F0 .336
-(while using nicely rounded numbers. If)2.836 F F1(mode)2.836 E F0 .336
+-.55 G 3.405(yd)-3.405 G(ef)-3.405 E .905(ault \(i.e.)-.1 F F2(mode)144
+120 Q F0 .528(is omitted or equal to 0\), the macro selects the color p\
+alette bounds so that the)3.029 F 3.028(ye)-.15 G(ncompass)-3.028 E F2
+(min)144 132 Q F0(and)2.836 E F2(max)2.836 E F0 .336
+(while using nicely rounded numbers. If)2.836 F F2(mode)2.836 E F0 .336
 (is omitted or equal to 0, then the color)2.836 F .272
-(palette will end near)144 566.4 R F1(min)2.771 E F0(and)2.771 E F1(max)
+(palette will end near)144 144 R F2(min)2.771 E F0(and)2.771 E F2(max)
 2.771 E F0 .271(whether it is linear stretched or histogram equalized.)
-2.771 F(If)5.271 E F1(mode)2.771 E F0(=)2.771 E .315
-(1, then the color stretching calculations will be done using)144 578.4
-R F1(min)2.816 E F0(and)2.816 E F1(max)2.816 E F0 2.816(,b)C .316
-(ut then the \214rst and last)-3.016 F -.25(va)144 590.4 S .776(lues in\
- the color palette will be set to the actual minimum and maximum v).25 F
-.775(alues.so that all the)-.25 F(data are displayed.)144 602.4 Q/F3
-10.95/Times-Bold at 0 SF(EXAMPLES)72 631.2 Q F0 .106(Suppose we ha)108
-643.2 R .406 -.15(ve o)-.2 H .106(btained tw).15 F 2.606(oG)-.1 G .106
+2.771 F(If)5.271 E F2(mode)2.771 E F0(=)2.771 E .315
+(1, then the color stretching calculations will be done using)144 156 R
+F2(min)2.816 E F0(and)2.816 E F2(max)2.816 E F0 2.816(,b)C .316
+(ut then the \214rst and last)-3.016 F -.25(va)144 168 S .776(lues in t\
+he color palette will be set to the actual minimum and maximum v).25 F
+.775(alues.so that all the)-.25 F(data are displayed.)144 180 Q/F3 10.95
+/Times-Bold at 0 SF(EXAMPLES)72 208.8 Q F0 .106(Suppose we ha)108 220.8 R
+.406 -.15(ve o)-.2 H .106(btained tw).15 F 2.606(oG)-.1 G .106
 (RD \214les with dimensions of 127 by 194, one containing gridded bath)
--2.606 F(yme-)-.05 E .369(try \(grd_sb2112_e)108 655.2 R .368
+-2.606 F(yme-)-.05 E .369(try \(grd_sb2112_e)108 232.8 R .368
 (xample_bath\) and the other gridded sidescan \(grd_sb2112_e)-.15 F .368
 (xample_ss\). In order to gen-)-.15 F(erate a shellscript which will in\
- turn generate a contour plot of the bath)108 667.2 Q(ymetry)-.05 E 2.5
+ turn generate a contour plot of the bath)108 244.8 Q(ymetry)-.05 E 2.5
 (,t)-.65 G(he follo)-2.5 E(wing will suf)-.25 E(\214ce:)-.25 E
-(mbm_grdplot \255Igrd_sb2112_e)144 691.2 Q(xample_bath \255C \\)-.15 E
-(\255V \255Ogrd_sb2112_e)154 703.2 Q(xample_bathcont)-.15 E .012
-(In order to generate a color \214ll plot o)108 727.2 R -.15(ve)-.15 G
+(mbm_grdplot \255Igrd_sb2112_e)144 268.8 Q(xample_bath \255C \\)-.15 E
+(\255V \255Ogrd_sb2112_e)154 280.8 Q(xample_bathcont)-.15 E .012
+(In order to generate a color \214ll plot o)108 304.8 R -.15(ve)-.15 G
 .013(rlaid by contours, we use both the \255G1 and \255C options.).15 F
-.013(Because the)5.013 F(MB-System 5.0)72 768 Q 2.5(2A)141.215 G
-(ugust 2014)-2.5 E(13)194.555 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 1.111(data has been gridded as bath)108 84 R
+.013(Because the)5.013 F 1.111(data has been gridded as bath)108 316.8 R
 1.111(ymetry \(positi)-.05 F 1.411 -.15(ve d)-.25 H -.25(ow).15 G 1.111
 (n\) rather than as topograph).25 F 3.61(y\()-.05 G(positi)-3.61 E 1.41
 -.15(ve u)-.25 H 1.11(p\), the def).15 F(ault)-.1 E .158(plot will ha)
-108 96 R .458 -.15(ve ")-.2 H .158(hot" colors for deep re).15 F .158
+108 328.8 R .458 -.15(ve ")-.2 H .158(hot" colors for deep re).15 F .158
 (gions and "cold" colors for shallo)-.15 F 2.659(wr)-.25 G -.15(eg)
--2.659 G .159(ions; this is the opposite of the).15 F(con)108 108 Q -.15
-(ve)-.4 G .58(ntion we usually use. In order to \214x the colors, we ha)
-.15 F .88 -.15(ve t)-.2 H 3.08(oe).15 G .58
-(ither rescale the data by multiplying the)-3.08 F(bath)108 120 Q .566(\
-ymetry by \2551 \(accomplished with \255MGS-1\), or \215ip the color pa\
-lette \(accomplished with \255D\). W)-.05 F 3.066(eu)-.8 G(se)-3.066 E
-(the latter approach:)108 132 Q(mbm_grdplot \255Igrd_sb2112_e)144 156 Q
-(xample_bath \255G1 \255C \255D \\)-.15 E(\255V \255Ogrd_sb2112_e)154
-168 Q(xample_bath\214ll)-.15 E .51(In order to generate a grayscale plo\
-t of the sidescan grid, we use \255G1 and \255W1/4. W)108 192 R 3.009
-(ea)-.8 G .509(lso use \255D so that)-3.009 F
-(high sidescan amplitudes are sho)108 204 Q(wn as dark.)-.25 E
-(mbm_grdplot \255Igrd_sb2112_e)144 228 Q(xample_ss \255G1 \255D \\)-.15
-E(\255V \255Ogrd_sb2112_e)154 240 Q(xample_ss\214ll)-.15 E(No)108 264 Q
-3.224(wc)-.25 G .724(onsider generating a shaded relief vie)-3.224 F
-3.224(wo)-.25 G 3.224(ft)-3.224 G .724(he gridded bath)-3.224 F(ymetry)
--.05 E 3.225(.W)-.65 G 3.225(ec)-4.025 G .725
-(hoose to illuminate the ba-)-3.225 F(th)108 276 Q 1.305
+-2.659 G .159(ions; this is the opposite of the).15 F(con)108 340.8 Q
+-.15(ve)-.4 G .58
+(ntion we usually use. In order to \214x the colors, we ha).15 F .88
+-.15(ve t)-.2 H 3.08(oe).15 G .58
+(ither rescale the data by multiplying the)-3.08 F(bath)108 352.8 Q .566
+(ymetry by \2551 \(accomplished with \255MGS-1\), or \215ip the color p\
+alette \(accomplished with \255D\). W)-.05 F 3.066(eu)-.8 G(se)-3.066 E
+(the latter approach:)108 364.8 Q(mbm_grdplot \255Igrd_sb2112_e)144
+388.8 Q(xample_bath \255G1 \255C \255D \\)-.15 E
+(\255V \255Ogrd_sb2112_e)154 400.8 Q(xample_bath\214ll)-.15 E .51(In or\
+der to generate a grayscale plot of the sidescan grid, we use \255G1 an\
+d \255W1/4. W)108 424.8 R 3.009(ea)-.8 G .509(lso use \255D so that)
+-3.009 F(high sidescan amplitudes are sho)108 436.8 Q(wn as dark.)-.25 E
+(mbm_grdplot \255Igrd_sb2112_e)144 460.8 Q(xample_ss \255G1 \255D \\)
+-.15 E(\255V \255Ogrd_sb2112_e)154 472.8 Q(xample_ss\214ll)-.15 E(No)108
+496.8 Q 3.224(wc)-.25 G .724(onsider generating a shaded relief vie)
+-3.224 F 3.224(wo)-.25 G 3.224(ft)-3.224 G .724(he gridded bath)-3.224 F
+(ymetry)-.05 E 3.225(.W)-.65 G 3.225(ec)-4.025 G .725
+(hoose to illuminate the ba-)-3.225 F(th)108 508.8 Q 1.305
 (ymetry from the northeast \(azimuth of 45 de)-.05 F 1.305
 (grees\) and to use a shading magnitude of 0.4 \(-A0.4/45\).)-.15 F .428
-(Because this grid is so small, the def)108 288 R .428
+(Because this grid is so small, the def)108 520.8 R .428
 (ault shaded relief image is lik)-.1 F .428(ely to be grain)-.1 F 1.728
 -.65(y. T)-.15 H 2.928<6f8c>-.15 G 2.928(xt)-2.928 G .428
 (his problem, we)-2.928 F .62
 (specify a dots per inch resolution of 72 \(-MGQ72\); this will tak)108
-300 R 3.12(el)-.1 G .62(onger and generate a lar)-3.12 F .62
+532.8 R 3.12(el)-.1 G .62(onger and generate a lar)-3.12 F .62
 (ger plot\214le, b)-.18 F(ut)-.2 E .124(the plot will look better)108
-312 R 2.624(.W)-.55 G 2.624(ea)-3.424 G .124(lso use the \255L option t\
-o specify the title and color scale label for the plot.)-2.624 F -.8(We)
-5.125 G .856(also use the \255X \215ag this so that the plot generation\
- shellscript is e)108 324 R -.15(xe)-.15 G .856(cuted immediately).15 F
-3.356(.H)-.65 G .856(ere is the com-)-3.356 F(mand:)108 336 Q
-(mbm_grdplot \255Igrd_sb2112_e)144 360 Q(xample_bath \\)-.15 E
-(\255G2 \255A0.4/45 \255D \255MGQ72 \255X \255V \\)154 372 Q
-(\255L"Shaded Relief Bath)154 384 Q(ymetry":"Depth \(meters\)" \\)-.05 E
-(\255Osb2112_e)154 396 Q(xample_bathshade)-.15 E(No)108 420 Q 1.32 -.65
-(w, c)-.25 H .02(onsider generating a plot of the bath).65 F .02
+544.8 R 2.624(.W)-.55 G 2.624(ea)-3.424 G .124(lso use the \255L option\
+ to specify the title and color scale label for the plot.)-2.624 F -.8
+(We)5.125 G .856(also use the \255X \215ag this so that the plot genera\
+tion shellscript is e)108 556.8 R -.15(xe)-.15 G .856(cuted immediately)
+.15 F 3.356(.H)-.65 G .856(ere is the com-)-3.356 F(mand:)108 568.8 Q
+(mbm_grdplot \255Igrd_sb2112_e)144 592.8 Q(xample_bath \\)-.15 E
+(\255G2 \255A0.4/45 \255D \255MGQ72 \255X \255V \\)154 604.8 Q
+(\255L"Shaded Relief Bath)154 616.8 Q(ymetry":"Depth \(meters\)" \\)-.05
+E(\255Osb2112_e)154 628.8 Q(xample_bathshade)-.15 E(No)108 652.8 Q 1.32
+-.65(w, c)-.25 H .02(onsider generating a plot of the bath).65 F .02
 (ymetry o)-.05 F -.15(ve)-.15 G .02(rlaid with the gridded sidescan.).15
 F .02(The sidescan o)5.02 F -.15(ve)-.15 G(rlay).15 E .939
-(is speci\214ed using the \255K option.)108 432 R 2.539 -.8(We w)5.939 H
-.939(ant the colors for the bath).7 F .938
+(is speci\214ed using the \255K option.)108 664.8 R 2.539 -.8(We w)5.939
+H .939(ant the colors for the bath).7 F .938
 (ymetry to be chosen without histogram)-.05 F .703(equalization, b)108
-444 R .703(ut we also w)-.2 F .703(ant histogram equalization to be app\
-lied to the sidescan data used for shading.)-.1 F 2.125 -.8(To d)108 456
-T 3.025(ot).8 G .524(his, we use \255S0/1, where the \214rst number \(0\
-\) speci\214es no histogram equalization of the color scale)-3.025 F
-.583(and the second number \(1\) causes histogram equalization of the s\
-hading sidescan data to be implemented.)108 468 R .709
-(In order to maintain the con)108 480 R -.15(ve)-.4 G .709(ntion that h\
-igh sidescan amplitudes are black, we \215ip both the color palette).15
-F .037(\(as in the pre)108 492 R .037(vious e)-.25 F .037
+676.8 R .703(ut we also w)-.2 F .703(ant histogram equalization to be a\
+pplied to the sidescan data used for shading.)-.1 F 2.125 -.8(To d)108
+688.8 T 3.025(ot).8 G .524(his, we use \255S0/1, where the \214rst numb\
+er \(0\) speci\214es no histogram equalization of the color scale)-3.025
+F .583(and the second number \(1\) causes histogram equalization of the\
+ shading sidescan data to be implemented.)108 700.8 R .709
+(In order to maintain the con)108 712.8 R -.15(ve)-.4 G .709(ntion that\
+ high sidescan amplitudes are black, we \215ip both the color palette)
+.15 F .037(\(as in the pre)108 724.8 R .037(vious e)-.25 F .037
 (xample\) and the shading scale with \255D1/1. W)-.15 F 2.537(ec)-.8 G
-.038(ould also \215ip the shading by specifying)-2.537 F 2.912(an)108
-504 S -2.25 -.15(eg a)-2.912 H(ti).15 E .712 -.15(ve s)-.25 H .412
-(hading magnitude \(-A-0.4\).).15 F .412(In this case, we for)5.412 F
-.412(go specifying the image resolution, resulting in)-.18 F 2.5(ag)108
-516 S(rain)-2.5 E 2.5(yp)-.15 G(lot:)-2.5 E
-(mbm_grdplot \255Igrd_sb2112_e)144 540 Q(xample_bath \\)-.15 E
-(\255G3 \255Kgrd_sb2112_e)154 552 Q(xample_ss \\)-.15 E
-(\255S0/1 \255D1/1 \255A0.4 \255X \255V \\)154 564 Q(\255L"Bath)154 576
-Q(ymetry Ov)-.05 E(erlaid W)-.15 E(ith Sidescan":"Depth \(meters\)" \\)
--.4 E(\255Osb2112_e)154 588 Q(xample_bathss)-.15 E(As an e)108 612 Q
-(xample, the contents of the plotting shellscript "grd_sb2112_e)-.15 E
-(xample_bath\214ll.cmd" are:)-.15 E(#)110.5 636 Q 2.5(#S)110.5 648 S
-(hellscript to create Postscript plot of data in grd \214le)-2.5 E 2.5
-(#C)110.5 660 S(reated by macro mbm_grdplot)-2.5 E(#)110.5 672 Q 2.5(#T)
-110.5 684 S(his shellscript created by follo)-2.5 E(wing command line:)
--.25 E 2.5(#m)110.5 696 S(bm_grdplot \255Igrd_sb2112_e)-2.5 E
-(xample_bath \255G1 \255C \255D \\)-.15 E 28.5(#-)110.5 708 S 2.5<56ad>
--28.5 G(Ogrd_sb2112_e)-2.5 E(xample_bath\214ll)-.15 E(#)110.5 720 Q
-(MB-System 5.0)72 768 Q 2.5(2A)141.215 G(ugust 2014)-2.5 E(14)194.555 E
-0 Cg EP
+.038(ould also \215ip the shading by specifying)-2.537 F(MB-System 5.0)
+72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(14)193.45 E 0 Cg EP
 %%Page: 15 15
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 2.5(#S)110.5 84 S -2.25 -.2(av e)-2.5 H -.15
-(ex)2.7 G(isting GMT def).15 E(aults)-.1 E(echo Sa)110.5 96 Q
-(ving GMT def)-.2 E(aults...)-.1 E(gmtdef)110.5 108 Q
-(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 120 Q 2.5(#S)110.5 132
-S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1 E(echo Setting ne)
-110.5 144 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E(gmtset ANO)110.5
-156 Q(T_FONT Helv)-.4 E(etica)-.15 E(gmtset LABEL_FONT Helv)110.5 168 Q
-(etica)-.15 E(gmtset HEADER_FONT Helv)110.5 180 Q(etica)-.15 E
-(gmtset ANO)110.5 192 Q(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)
-110.5 204 Q(gmtset HEADER_FONT_SIZE 10)110.5 216 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 228 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 240 Q(gmtset P)110.5 252
+(5.0 mbm_grdplot\(1\))2.5 F 2.912(an)108 84 S -2.25 -.15(eg a)-2.912 H
+(ti).15 E .712 -.15(ve s)-.25 H .412(hading magnitude \(-A-0.4\).).15 F
+.412(In this case, we for)5.412 F .412
+(go specifying the image resolution, resulting in)-.18 F 2.5(ag)108 96 S
+(rain)-2.5 E 2.5(yp)-.15 G(lot:)-2.5 E(mbm_grdplot \255Igrd_sb2112_e)144
+120 Q(xample_bath \\)-.15 E(\255G3 \255Kgrd_sb2112_e)154 132 Q
+(xample_ss \\)-.15 E(\255S0/1 \255D1/1 \255A0.4 \255X \255V \\)154 144 Q
+(\255L"Bath)154 156 Q(ymetry Ov)-.05 E(erlaid W)-.15 E
+(ith Sidescan":"Depth \(meters\)" \\)-.4 E(\255Osb2112_e)154 168 Q
+(xample_bathss)-.15 E(As an e)108 192 Q
+(xample, the contents of the plotting shellscript "grd_sb2112_e)-.15 E
+(xample_bath\214ll.cmd" are:)-.15 E(#)110.5 216 Q 2.5(#S)110.5 228 S
+(hellscript to create Postscript plot of data in grd \214le)-2.5 E 2.5
+(#C)110.5 240 S(reated by macro mbm_grdplot)-2.5 E(#)110.5 252 Q 2.5(#T)
+110.5 264 S(his shellscript created by follo)-2.5 E(wing command line:)
+-.25 E 2.5(#m)110.5 276 S(bm_grdplot \255Igrd_sb2112_e)-2.5 E
+(xample_bath \255G1 \255C \255D \\)-.15 E 28.5(#-)110.5 288 S 2.5<56ad>
+-28.5 G(Ogrd_sb2112_e)-2.5 E(xample_bath\214ll)-.15 E(#)110.5 300 Q 2.5
+(#S)110.5 312 S -2.25 -.2(av e)-2.5 H -.15(ex)2.7 G(isting GMT def).15 E
+(aults)-.1 E(echo Sa)110.5 324 Q(ving GMT def)-.2 E(aults...)-.1 E
+(gmtdef)110.5 336 Q(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 348
+Q 2.5(#S)110.5 360 S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1
+E(echo Setting ne)110.5 372 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E
+(gmtset ANO)110.5 384 Q(T_FONT Helv)-.4 E(etica)-.15 E
+(gmtset LABEL_FONT Helv)110.5 396 Q(etica)-.15 E
+(gmtset HEADER_FONT Helv)110.5 408 Q(etica)-.15 E(gmtset ANO)110.5 420 Q
+(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 432 Q
+(gmtset HEADER_FONT_SIZE 10)110.5 444 Q
+(gmtset FRAME_WIDTH 0.074999999999999997)110.5 456 Q
+(gmtset TICK_LENGTH 0.074999999999999997)110.5 468 Q(gmtset P)110.5 480
 Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 264 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 276 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
-110.5 288 Q(AN 255/255/255)-.35 E(#)110.5 300 Q 2.5(#M)110.5 312 S(ak)
+(gmtset COLOR_B)110.5 492 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
+(gmtset COLOR_FOREGR)110.5 504 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
+110.5 516 Q(AN 255/255/255)-.35 E(#)110.5 528 Q 2.5(#M)110.5 540 S(ak)
 -2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 324 Q 5(echo 3000)110.5
-336 R(255 255 255)2.5 E(3150 255 186 133 > \\)7.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3150)110.5 348 R(255 186 133)2.5 E
+(echo Making color palette table \214le...)110.5 552 Q 5(echo 3000)110.5
+564 R(255 255 255)2.5 E(3150 255 186 133 > \\)7.5 E(grd_sb2112_e)74.5 E
+(xample_bath\214ll.cpt)-.15 E 5(echo 3150)110.5 576 R(255 186 133)2.5 E
 (3300 255 161)7.5 E(68 >> \\)5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3300)110.5 360 R(255 161)2.5 E 5
+(xample_bath\214ll.cpt)-.15 E 5(echo 3300)110.5 588 R(255 161)2.5 E 5
 (68 3450)5 F(255 189)2.5 E(87 >> \\)5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3450)110.5 372 R(255 189)2.5 E 5
+(xample_bath\214ll.cpt)-.15 E 5(echo 3450)110.5 600 R(255 189)2.5 E 5
 (87 3600)5 F(240 236 121 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3600)110.5 384 R(240 236 121)2.5 E
+(xample_bath\214ll.cpt)-.15 E 5(echo 3600)110.5 612 R(240 236 121)2.5 E
 (3750 205 255 162 >> \\)7.5 E(grd_sb2112_e)74.5 E(xample_bath\214ll.cpt)
--.15 E 5(echo 3750)110.5 396 R(205 255 162)2.5 E(3900 138 236 174 >> \\)
+-.15 E 5(echo 3750)110.5 624 R(205 255 162)2.5 E(3900 138 236 174 >> \\)
 7.5 E(grd_sb2112_e)74.5 E(xample_bath\214ll.cpt)-.15 E 5(echo 3900)110.5
-408 R(138 236 174)2.5 E(4050 106 235 255 >> \\)7.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 4050)110.5 420 R(106 235 255)2.5 E
+636 R(138 236 174)2.5 E(4050 106 235 255 >> \\)7.5 E(grd_sb2112_e)74.5 E
+(xample_bath\214ll.cpt)-.15 E 5(echo 4050)110.5 648 R(106 235 255)2.5 E
 2.5(4200 50)7.5 F(190 255 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 4200)110.5 432 R(50 190 255)5 E 2.5
+(xample_bath\214ll.cpt)-.15 E 5(echo 4200)110.5 660 R(50 190 255)5 E 2.5
 (4350 40)7.5 F(127 251 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 4350)110.5 444 R(40 127 251)5 E 2.5
+(xample_bath\214ll.cpt)-.15 E 5(echo 4350)110.5 672 R(40 127 251)5 E 2.5
 (4500 37 57)7.5 F(175 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E(#)110.5 456 Q 2.5(#M)110.5 468 S(ak)-2.5 E
-2.5(ec)-.1 G(olor image)-2.5 E(echo Running grdimage...)110.5 480 Q
-(grdimage grd_sb2112_e)110.5 492 Q
-(xample_bath \255Jm24.418434289993325 \\)-.15 E
-(\255R114.221/114.421/-31.9001/-31.6377 \\)128 504 Q(\255Cgrd_sb2112_e)
-128 516 Q(xample_bath\214ll.cpt \\)-.15 E
-(\255P \255X1.8081565710006675 \255Y2 \255K \255V \\)128 528 Q 2.5(>g)
-128 540 S(rd_sb2112_e)-2.5 E(xample_bath\214ll.ps)-.15 E(#)110.5 552 Q
-2.5(#M)110.5 564 S(ak)-2.5 E 2.5(ec)-.1 G(ontour plot)-2.5 E
-(echo Running grdcontour)110.5 576 Q(...)-.55 E(grdcontour grd_sb2112_e)
-110.5 588 Q(xample_bath \255Jm24.418434289993325 \\)-.15 E
-(\255R114.221/114.421/-31.9001/-31.6377 \\)128 600 Q(\255C50 \\)128 612
-Q(\255L3144.51/4499.44 \255Wc1p \\)128 624 Q
-(\255P \255K \255O \255V >> grd_sb2112_e)128 636 Q(xample_bath\214ll.ps)
--.15 E(#)110.5 648 Q 2.5(#M)110.5 660 S(ak)-2.5 E 2.5(ec)-.1 G
-(olor scale)-2.5 E(echo Running psscale...)110.5 672 Q
-(psscale \255Cgrd_sb2112_e)110.5 684 Q(xample_bath\214ll.cpt \\)-.15 E
-(\255D2.4418/-0.5000/4.8837/0.1500h \\)128 696 Q(\255B":.Data V)128 708
-Q(alues:" \\)-1.11 E(\255P \255K \255O \255V >> grd_sb2112_e)128 720 Q
-(xample_bath\214ll.ps)-.15 E(MB-System 5.0)72 768 Q 2.5(2A)141.215 G
-(ugust 2014)-2.5 E(15)194.555 E 0 Cg EP
+(xample_bath\214ll.cpt)-.15 E(#)110.5 684 Q 2.5(#M)110.5 696 S(ak)-2.5 E
+2.5(ec)-.1 G(olor image)-2.5 E(echo Running grdimage...)110.5 708 Q
+(grdimage grd_sb2112_e)110.5 720 Q
+(xample_bath \255Jm24.418434289993325 \\)-.15 E(MB-System 5.0)72 768 Q
+2.5(9J)140.11 G(anuary 2015)-2.5 E(15)193.45 E 0 Cg EP
 %%Page: 16 16
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F(#)110.5 84 Q 2.5(#M)110.5 96 S(ak)-2.5 E 2.5
-(eb)-.1 G(asemap)-2.5 E(echo Running psbasemap...)110.5 108 Q
-(psbasemap \255Jm24.418434289993325 \\)110.5 120 Q
-(\255R114.221/114.421/-31.9001/-31.6377 \\)128 132 Q
-(\255B5m/5m:."Data File grd_sb2112_e)128 144 Q(xample_bath": \\)-.15 E
-(\255P \255O \255V >> grd_sb2112_e)128 156 Q(xample_bath\214ll.ps)-.15 E
-(#)110.5 168 Q 2.5(#D)110.5 180 S(elete surplus \214les)-2.5 E
-(echo Deleting surplus \214les...)110.5 192 Q(rm \255f grd_sb2112_e)
-110.5 204 Q(xample_bath\214ll.cpt)-.15 E(#)110.5 216 Q 2.5(#R)110.5 228
+(5.0 mbm_grdplot\(1\))2.5 F(\255R114.221/114.421/-31.9001/-31.6377 \\)
+128 84 Q(\255Cgrd_sb2112_e)128 96 Q(xample_bath\214ll.cpt \\)-.15 E
+(\255P \255X1.8081565710006675 \255Y2 \255K \255V \\)128 108 Q 2.5(>g)
+128 120 S(rd_sb2112_e)-2.5 E(xample_bath\214ll.ps)-.15 E(#)110.5 132 Q
+2.5(#M)110.5 144 S(ak)-2.5 E 2.5(ec)-.1 G(ontour plot)-2.5 E
+(echo Running grdcontour)110.5 156 Q(...)-.55 E(grdcontour grd_sb2112_e)
+110.5 168 Q(xample_bath \255Jm24.418434289993325 \\)-.15 E
+(\255R114.221/114.421/-31.9001/-31.6377 \\)128 180 Q(\255C50 \\)128 192
+Q(\255L3144.51/4499.44 \255Wc1p \\)128 204 Q
+(\255P \255K \255O \255V >> grd_sb2112_e)128 216 Q(xample_bath\214ll.ps)
+-.15 E(#)110.5 228 Q 2.5(#M)110.5 240 S(ak)-2.5 E 2.5(ec)-.1 G
+(olor scale)-2.5 E(echo Running psscale...)110.5 252 Q
+(psscale \255Cgrd_sb2112_e)110.5 264 Q(xample_bath\214ll.cpt \\)-.15 E
+(\255D2.4418/-0.5000/4.8837/0.1500h \\)128 276 Q(\255B":.Data V)128 288
+Q(alues:" \\)-1.11 E(\255P \255K \255O \255V >> grd_sb2112_e)128 300 Q
+(xample_bath\214ll.ps)-.15 E(#)110.5 312 Q 2.5(#M)110.5 324 S(ak)-2.5 E
+2.5(eb)-.1 G(asemap)-2.5 E(echo Running psbasemap...)110.5 336 Q
+(psbasemap \255Jm24.418434289993325 \\)110.5 348 Q
+(\255R114.221/114.421/-31.9001/-31.6377 \\)128 360 Q
+(\255B5m/5m:."Data File grd_sb2112_e)128 372 Q(xample_bath": \\)-.15 E
+(\255P \255O \255V >> grd_sb2112_e)128 384 Q(xample_bath\214ll.ps)-.15 E
+(#)110.5 396 Q 2.5(#D)110.5 408 S(elete surplus \214les)-2.5 E
+(echo Deleting surplus \214les...)110.5 420 Q(rm \255f grd_sb2112_e)
+110.5 432 Q(xample_bath\214ll.cpt)-.15 E(#)110.5 444 Q 2.5(#R)110.5 456
 S(eset GMT def)-2.5 E(ault fonts)-.1 E(echo Resetting GMT fonts...)110.5
-240 Q(mv gmtdef)110.5 252 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5
-264 Q 2.5(#R)110.5 276 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)
-110.5 288 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5
-300 Q 2.5<77ad>-.25 G(ps a \255maxp 4m grd_sb2112_e)-2.5 E
-(xample_bath\214ll.ps &)-.15 E(#)110.5 312 Q 2.5(#A)110.5 324 S
-(ll done!)-2.5 E(echo All done!)110.5 336 Q/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 364.8 Q/F2 10/Times-Bold at 0 SF(grdimage)108 376.8 Q F0
+468 Q(mv gmtdef)110.5 480 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5
+492 Q 2.5(#R)110.5 504 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)
+110.5 516 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5
+528 Q 2.5<77ad>-.25 G(ps a \255maxp 4m grd_sb2112_e)-2.5 E
+(xample_bath\214ll.ps &)-.15 E(#)110.5 540 Q 2.5(#A)110.5 552 S
+(ll done!)-2.5 E(echo All done!)110.5 564 Q/F1 10.95/Times-Bold at 0 SF
+(SEE ALSO)72 592.8 Q/F2 10/Times-Bold at 0 SF(grdimage)108 604.8 Q F0
 (\(1\),)A F2(grdcontour)13.298 E F0(\(1\),)A F2(mbdefaults)13.298 E F0
 (\(1\),)A F2(mbgrid)13.298 E F0(\(1\),)A F2(mbsystem)13.298 E F0(\(1\),)
-A F2(mbm_grd3dplot)13.298 E F0(\(1\),)A F2(mbm_plot)108 388.8 Q F0
+A F2(mbm_grd3dplot)13.298 E F0(\(1\),)A F2(mbm_plot)108 616.8 Q F0
 (\(1\),)A F2(psbasemap)2.5 E F0(\(1\),)A F2(pstext)2.5 E F0(\(1\),)A F2
-(psxy)2.5 E F0(\(1\))A F1 -.11(BU)72 417.6 S(GS).11 E F0
-(By making this macro more useful, we ha)108 429.6 Q .3 -.15(ve a)-.2 H
-(lso made it more comple).15 E(x.)-.15 E(MB-System 5.0)72 768 Q 2.5(2A)
-141.215 G(ugust 2014)-2.5 E(16)194.555 E 0 Cg EP
+(psxy)2.5 E F0(\(1\))A F1 -.11(BU)72 645.6 S(GS).11 E F0
+(By making this macro more useful, we ha)108 657.6 Q .3 -.15(ve a)-.2 H
+(lso made it more comple).15 E(x.)-.15 E(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(16)193.45 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbm_grdtiff.ps b/src/ps/mbm_grdtiff.ps
index edf80f1..2adeb94 100644
--- a/src/ps/mbm_grdtiff.ps
+++ b/src/ps/mbm_grdtiff.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_grid.ps b/src/ps/mbm_grid.ps
index 2be94ca..34c2c1a 100644
--- a/src/ps/mbm_grid.ps
+++ b/src/ps/mbm_grid.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:28 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_histplot.ps b/src/ps/mbm_histplot.ps
index 48fd0db..0436dc5 100644
--- a/src/ps/mbm_histplot.ps
+++ b/src/ps/mbm_histplot.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -260,237 +260,256 @@ G .421(he plot appearance, a number of additional)-2.921 F .946
 (optional ar)108 314.4 R .946(guments are pro)-.18 F .946(vided. T)-.15
 F .946(ruly ambitious users may edit the plot shellscript to tak)-.35 F
 3.446(ea)-.1 G(dv)-3.446 E .946(antage of)-.25 F
-(GMT capabilities not supported by this macro.)108 326.4 Q F1 -.548(AU)
-72 355.2 S(THORSHIP).548 E F0(Da)108 367.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 379.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 391.2 Q
-(Lamont-Doherty Earth Observ)113 403.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 415.2 Q
-(Lamont-Doherty Earth Observ)113 427.2 Q(atory)-.25 E F1(OPTIONS)72 456
-Q F2<ad42>108 468 Q F3(tic)23.63 E(kinfo)-.2 E F0 .219
-(Sets map boundary tickmark interv)144 480 R .219(als. See the)-.25 F F2
+(GMT capabilities not supported by this macro.)108 326.4 Q .084(By def)
+108 350.4 R .083
+(ault the output plot generation shellscript includes lines which e)-.1
+F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
+ript image on the screen. The program to be used to display the Postscr\
+ipt is set using)108 362.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
+-3.308 E(def)108 374.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
+-.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
+F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
+(king the plot).2 F(generation shellscript with a)108 386.4 Q F2(-N)2.5
+E F0(command line ar)2.5 E
+(gument suppresses the screen display of the plot.)-.18 E .305
+(The plot scripts generated by this macro will w)108 410.4 R .305
+(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
+.305(nd are not compatible)-2.805 F(with earlier v)108 422.4 Q
+(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 451.2 S(THORSHIP).548 E
+F0(Da)108 463.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
+E(g\))-.18 E(Montere)113 475.2 Q 2.5(yB)-.15 G
+(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 487.2 Q
+(Lamont-Doherty Earth Observ)113 499.2 Q(atory)-.25 E
+(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 511.2 Q
+(Lamont-Doherty Earth Observ)113 523.2 Q(atory)-.25 E F1(OPTIONS)72 552
+Q F2<ad42>108 564 Q F3(tic)23.63 E(kinfo)-.2 E F0 .219
+(Sets map boundary tickmark interv)144 576 R .219(als. See the)-.25 F F2
 (psbasemap)2.719 E F0 .218(manual page for details. By def)2.719 F .218
 (ault the)-.1 F
 (program chooses basemap annotations based on the map boundaries.)144
-492 Q F2<ad43>108 508.8 Q F3(cellwidth)23.08 E F0 .236(Sets the width o\
+588 Q F2<ad43>108 604.8 Q F3(cellwidth)23.08 E F0 .236(Sets the width o\
 f the cells into which the data are binned to form the histogram. The d\
-ef)144 520.8 R .236(ault is use)-.1 F 2.5(ac)144 532.8 S
-(ell width that is 1/10 the data range.)-2.5 E F2<ad47>108 549.6 Q F3
-(\214ll)22.52 E F0 .638(Select \214lling of the histogram.)144 561.6 R
+ef)144 616.8 R .236(ault is use)-.1 F 2.5(ac)144 628.8 S
+(ell width that is 1/10 the data range.)-2.5 E F2<ad47>108 645.6 Q F3
+(\214ll)22.52 E F0 .638(Select \214lling of the histogram.)144 657.6 R
 .638(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.638 F .637
 (ault is a light gray]. T)-.1 F(o)-.8 E .096(reset no \214ll, use)144
-573.6 R F3(\214ll)2.596 E F0 2.596(=")2.596 G 2.596(N". Y)-2.596 F .097
+669.6 R F3(\214ll)2.596 E F0 2.596(=")2.596 G 2.596(N". Y)-2.596 F .097
 (ou may optionally specify)-1.1 F F2(\255Gp)2.597 E F3
 (icon_size/pattern)A F0 2.597(,w)C(here)-2.597 E F3(pattern)2.597 E F0
 (gi)2.597 E -.15(ve)-.25 G(s).15 E .438(the number of the image pattern\
- \(1-32\) OR the name of a icon-format \214le.)144 585.6 R F3(icon_size)
-5.438 E F0 .438(sets the unit)2.938 F .294(size in inch.)144 597.6 R
+ \(1-32\) OR the name of a icon-format \214le.)144 681.6 R F3(icon_size)
+5.438 E F0 .438(sets the unit)2.938 F .294(size in inch.)144 693.6 R
 1.894 -.8(To i)5.294 H -1.85 -.4(nv e).8 H .295(rt black and white pix)
 .4 F .295(els, use)-.15 F F2(\255GP)2.795 E F0 .295(instead of)2.795 F
 F2(\255Gp)2.795 E F0 5.295(.S)C(ee)-5.295 E F2(GMTs)2.795 E F0 .295
-(Cookbook &)2.795 F -.7(Te)144 609.6 S
+(Cookbook &)2.795 F -.7(Te)144 705.6 S
 (chnical Reference Appendix E for information on indi).7 E
-(vidual patterns.)-.25 E F2<ad48>108 626.4 Q F0 .162(This "help" \215ag\
- cause the program to print out a description of its operation and then\
- e)22.52 F .161(xit immedi-)-.15 F(ately)144 638.4 Q(.)-.65 E F2<ad49>
-108 655.2 Q F3([\214lepar)26.41 E(s:]xy_\214le)-.1 E F0 1.694(Speci\214\
-es the \214le containing the data to be plotted in a histogram. A singl\
-e column of data is)144 679.2 R -.15(ex)144 691.2 S(pected.).15 E F2
-<ad4a>108 708 Q F3(pr)25.3 E(ojection)-.45 E F0([)A F3(/width/height)A
-F0(])A .993(Sets the plot scale. The projection is linear \()144 720 R
-F2<ad4a>A F3 .993(X\), and the user can optionally specify the width)B
-F0(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
+(vidual patterns.)-.25 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
-(5.0 mbm_histplot\(1\))2.5 F/F1 10/Times-Italic at 0 SF(and height.)144 84
-Q/F2 10/Times-Bold at 0 SF<ad4c>108 100.8 Q F1(title[:xlabel[:ylabel]])
+(5.0 mbm_histplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad48>108 84 Q F0 .162
+(This "help" \215ag cause the program to print out a description of its\
+ operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 96 Q(.)
+-.65 E F1<ad49>108 112.8 Q/F2 10/Times-Italic at 0 SF([\214lepar)26.41 E
+(s:]xy_\214le)-.1 E F0 1.694(Speci\214es the \214le containing the data\
+ to be plotted in a histogram. A single column of data is)144 136.8 R
+-.15(ex)144 148.8 S(pected.).15 E F1<ad4a>108 165.6 Q F2(pr)25.3 E
+(ojection)-.45 E F0([)A F2(/width/height)A F0(])A .993
+(Sets the plot scale. The projection is linear \()144 177.6 R F1<ad4a>A
+F2 .993(X\), and the user can optionally specify the width)B
+(and height.)144 189.6 Q F1<ad4c>108 206.4 Q F2(title[:xlabel[:ylabel]])
 23.63 E F0 .173(Sets the title and the labels for the x and y ax)144
-112.8 R .174
+218.4 R .174
 (es of the plot. Note that a colon \(:\) rather than a slash)-.15 F .652
 (\(/\) is used to separate the labels. Colons cannot be used in the lab\
-els themselv)144 124.8 R .652(es. If this option is)-.15 F .156
-(not used, then a def)144 136.8 R .157
+els themselv)144 230.4 R .652(es. If this option is)-.15 F .156
+(not used, then a def)144 242.4 R .157
 (ault title and colorscale label are pro)-.1 F .157
 (vided. If the title is supplied alone, no x or)-.15 F
-(y-axis labels will be pro)144 148.8 Q(vided.)-.15 E F2<ad4f>108 165.6 Q
-F1 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the root used to construct the\
- \214lename of the output shellscript \()144 177.6 R F1 -.45(ro)C(ot).45
+(y-axis labels will be pro)144 254.4 Q(vided.)-.15 E F1<ad4f>108 271.2 Q
+F2 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the root used to construct the\
+ \214lename of the output shellscript \()144 283.2 R F2 -.45(ro)C(ot).45
 E F0 .422(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 189.6 R .157
+(created when the shellscript is run.)144 295.2 R .157
 (Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 201.6 Q F1 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108
-218.4 Q F1(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
-he size of the page the plot will be centered on. If the user does not \
-set the plot)144 230.4 R .125(scale, the plot will be sized as lar)144
-242.4 R .125(ge as will \214t on the designated page. If the user sets \
-the plot scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-254.4 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(page sizes are:)144 266.4 Q(American ANSI sizes:)169 290.4 Q 12.5(A8)
-169 302.4 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
-5 E 10(B1)169 314.4 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 326.4 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 338.4 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 350.4 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 362.4 S
+5.157 F(as the)144 307.2 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
+324 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the\
+ size of the page the plot will be centered on. If the user does not se\
+t the plot)144 336 R .125(scale, the plot will be sized as lar)144 348 R
+.125(ge as will \214t on the designated page. If the user sets the plot\
+ scale)-.18 F .948
+(such that the plot will not \214t on the designated page, a lar)144 360
+R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
+(page sizes are:)144 372 Q(American ANSI sizes:)169 396 Q 12.5(A8)169
+408 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))5 E 10
+(B1)169 420 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
+(431.8 mm\))5 E 10(C1)169 432 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
+(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 444 S(2.0 x 34.0 in.)-10 E 2.5
+(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 456 S(4.0 x 44.0 in.)
+-10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 468 S
 (8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
-169 374.4 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
-(Metric ISO A sizes:)169 398.4 Q 5(A0 841.0)169 410.4 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 422.4 R 5(x8)
-2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 434.4 R 5
-(x5)2.5 G(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 446.4 R
-5(x4)2.5 G(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 458.4 R
-5(x2)2.5 G(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)
-169 470.4 R 5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))
-5 E 5(A6 105.0)169 482.4 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)
--2.5 E(5.83 in.\))5 E 7.5(A7 74.0)169 494.4 R 5(x1)2.5 G(05.0 mm)-5 E
-2.5(\(2)5 G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 506.4 R 7.5(x7)
-2.5 G(4.0 mm)-7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)
-169 518.4 R 7.5(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E
-(2.05 in.\))5 E 5(A10 26.0)169 530.4 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5
-(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E(Metric ISO B sizes:)169 554.4 Q 5
-(B0 1000.0x)169 566.4 R(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5
-(B1 707.0)169 578.4 R 2.5(x1)2.5 G(000.0 mm)-2.5 E
-(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 590.4 R 5(x7)2.5 G(07.0 mm)-5
-E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 602.4 R 5(x5)2.5 G(00.0 mm)-5
-E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 614.4 R 5(x3)2.5 G(53.0 mm)-5
-E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 626.4 R 5(x2)2.5 G
-(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5(B6 125.0)169
-638.4 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E(6.93 in.\))5 E
-7.5(B7 88.0)169 650.4 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5 G(.46 x)-2.5 E
-(4.92 in.\))5 E 7.5(B8 62.0)169 662.4 R 7.5(x8)2.5 G(8.0 mm)-7.5 E 2.5
-(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 674.4 R 7.5(x6)2.5
-G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5(B10 31.0)169
-686.4 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E(1.73 in.\))5
-E(Metric ISO C sizes:)169 710.4 Q 5(C0 914.4)169 722.4 R 2.5(x1)2.5 G
-(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
+169 480 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
+(Metric ISO A sizes:)169 504 Q 5(A0 841.0)169 516 R 2.5(x1)2.5 G
+(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 528 R 5(x8)2.5
+G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 540 R 5(x5)2.5 G
+(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 552 R 5(x4)2.5 G
+(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 564 R 5(x2)2.5 G
+(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 576 R
+5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5
+(A6 105.0)169 588 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E
+(5.83 in.\))5 E 7.5(A7 74.0)169 600 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5
+G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 612 R 7.5(x7)2.5 G(4.0 mm)
+-7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 624 R 7.5
+(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5
+(A10 26.0)169 636 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E
+(1.46 in.\))5 E(Metric ISO B sizes:)169 660 Q 5(B0 1000.0x)169 672 R
+(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 684 R 2.5(x1)
+2.5 G(000.0 mm)-2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 696 R 5
+(x7)2.5 G(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 708 R 5
+(x5)2.5 G(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 720 R 5
+(x3)2.5 G(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)198.45 E 0
+Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
-(5.0 mbm_histplot\(1\))2.5 F 5(C1 650.2)169 84 R 5(x9)2.5 G(14.4 mm)-5 E
-(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 96 R 5(x6)2.5 G(50.2 mm)-5 E
-(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 108 R 5(x4)2.5 G(57.2 mm)-5 E
-(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 120 R 5(x3)2.5 G(25.1 mm)-5 E
-2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)169 132 R 5(x2)2.5 G
-(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5 E 5(C6 114.3)169 144
-R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E(6.40 in.\))5 E 7.5
-(C7 81.3)169 156 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5 G(.20 x)-2.5 E
-(4.50 in.\))5 E(MB-System lar)185 180 Q(ge format sizes:)-.18 E 2.5
-(m1 1371.6)169 192 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(54.00 x 72.00 in.\))
-5 E 2.5(m2 1371.6)169 204 R 2.5(x2)2.5 G(133.6 mm)-2.5 E
-(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 216 R 2.5(x2)2.5 G
-(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169 228 R 2.5
-(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5(m5 1524.0)169
-240 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))5 E 2.5
-(m6 1524.0)169 252 R 2.5(x2)2.5 G(438.4 mm)-2.5 E(\(60.00 x 96.00 in.\))
-5 E(The def)144 276 Q(ault page size is A.)-.1 E/F1 10/Times-Bold at 0 SF
-<ad51>108 292.8 Q F0(Normally)22.52 E 2.866(,t)-.65 G .367
+(5.0 mbm_histplot\(1\))2.5 F 5(B5 176.0)169 84 R 5(x2)2.5 G(50.0 mm)-5 E
+2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5(B6 125.0)169 96 R 5(x1)2.5 G
+(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E(6.93 in.\))5 E 7.5(B7 88.0)169
+108 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5 G(.46 x)-2.5 E(4.92 in.\))5 E
+7.5(B8 62.0)169 120 R 7.5(x8)2.5 G(8.0 mm)-7.5 E 2.5(\(2)5 G(.44 x)-2.5
+E(3.46 in.\))5 E 7.5(B9 44.0)169 132 R 7.5(x6)2.5 G(2.0 mm)-7.5 E 2.5
+(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5(B10 31.0)169 144 R 7.5(x4)2.5 G
+(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E(1.73 in.\))5 E
+(Metric ISO C sizes:)169 168 Q 5(C0 914.4)169 180 R 2.5(x1)2.5 G
+(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 192 R 5(x9)2.5
+G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 204 R 5(x6)2.5 G
+(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 216 R 5(x4)2.5 G
+(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 228 R 5(x3)2.5 G
+(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)169 240 R
+5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5 E 5
+(C6 114.3)169 252 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
+(6.40 in.\))5 E 7.5(C7 81.3)169 264 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
+G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 288 Q(ge format sizes:)
+-.18 E 2.5(m1 1371.6)169 300 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
+(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 312 R 2.5(x2)2.5 G
+(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 324 R 2.5
+(x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
+336 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
+(m5 1524.0)169 348 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
+5 E 2.5(m6 1524.0)169 360 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
+(\(60.00 x 96.00 in.\))5 E(The def)144 384 Q(ault page size is A.)-.1 E
+/F1 10/Times-Bold at 0 SF<ad51>108 400.8 Q F0(Normally)22.52 E 2.866(,t)
+-.65 G .367
 (he output plot generation shellscript includes lines which e)-2.866 F
 -.15(xe)-.15 G .367(cute a program to display).15 F 1.072
-(the Postscript image on the screen.)144 304.8 R 1.071
+(the Postscript image on the screen.)144 412.8 R 1.071
 (This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 316.8 S .147
+(exe)144 424.8 S .147
 (cuting the shellscript produces a Postscript plot b).15 F .148
-(ut does not attempt to display it on the screen.)-.2 F .327
-(The program to be used to display the Postscript is set using)144 328.8
-R F1(mbdefaults)2.826 E F0 2.826(;t)C .326(he def)-2.826 F .326(ault v)
--.1 F .326(alue can be)-.25 F -.15(ove)144 340.8 S
-(rridden by setting the en).15 E(vironment v)-.4 E
-(ariable $MB_PS_VIEWER.)-.25 E F1<ad52>108 357.6 Q/F2 10/Times-Italic at 0
-SF(west/east/south/north)23.08 E .196(west, east, south,)144 369.6 R F0
-(and)2.696 E F2(north)2.696 E F0 .196(specify the Re)2.696 F .196
-(gion of interest. [Def)-.15 F .196
-(ault is the range of the data and the)-.1 F(histogram distrib)144 381.6
-Q(ution].)-.2 E F1<ad55>108 398.4 Q F2(orientation)23.08 E F0 .2(Normal\
+(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
+436.8 Q -.15(ve)-.25 G(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H
+.392(king the plot generation shellscript with a).4 F F1(-N)2.891 E F0
+.391(command line ar)2.891 F .391(gument also sup-)-.18 F .227(presses \
+the screen display of the plot. The program to be used to display the P\
+ostscript is set using)144 448.8 R F1(mbdefaults)144 460.8 Q F0 7.891
+(;t)C 5.391(he def)-7.891 F 5.391(ault v)-.1 F 5.391(alue can be o)-.25
+F -.15(ve)-.15 G 5.391(rridden by setting the en).15 F 5.39(vironment v)
+-.4 F(ariable)-.25 E($MB_PS_VIEWER.)144 472.8 Q F1<ad52>108 489.6 Q/F2
+10/Times-Italic at 0 SF(west/east/south/north)23.08 E .196
+(west, east, south,)144 501.6 R F0(and)2.696 E F2(north)2.696 E F0 .196
+(specify the Re)2.696 F .196(gion of interest. [Def)-.15 F .196
+(ault is the range of the data and the)-.1 F(histogram distrib)144 513.6
+Q(ution].)-.2 E F1<ad55>108 530.4 Q F2(orientation)23.08 E F0 .2(Normal\
 ly the orientation of the plot \(portrait or landscape\) is selected au\
-tomatically so as to maxi-)144 410.4 R .333(mize the plot scale.)144
-422.4 R(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
+tomatically so as to maxi-)144 542.4 R .333(mize the plot scale.)144
+554.4 R(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
 (ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
 E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 434.4 Q F2(orientation)2.5 E F0
+(portrait plot will be produced; if)144 566.4 Q F2(orientation)2.5 E F0
 2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 451.2 Q F0(Causes)23.08 E F1(mbm_histplot)4.463 E F0 1.963
+<ad56>108 583.2 Q F0(Causes)23.08 E F1(mbm_histplot)4.463 E F0 1.963
 (to operate in "v)4.463 F 1.962
 (erbose" mode so that it outputs more information than)-.15 F(usual.)144
-463.2 Q F1<ad57>108 480 Q F2(pen)20.3 E F0 .054(Set pen attrib)144 492 R
+595.2 Q F1<ad57>108 612 Q F2(pen)20.3 E F0 .054(Set pen attrib)144 624 R
 .054(utes for plotting. See chapter 4.12 in the GMT T)-.2 F .055
-(echnical reference for a discussion of)-.7 F(GMT pen v)144 504 Q 2.5
+(echnical reference for a discussion of)-.7 F(GMT pen v)144 636 Q 2.5
 (alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1<ad58>108 520.8 Q F0(Normally)23.08 E(,)-.65 E
+(xture = solid].)-.15 E F1<ad58>108 652.8 Q F0(Normally)23.08 E(,)-.65 E
 F1(mbm_histplot)3.258 E F0 .758(creates an e)3.258 F -.15(xe)-.15 G .758
 (cutable shellscript and then e).15 F 3.257(xits. This)-.15 F .757
-(option will cause)3.257 F(the shellscript to be e)144 532.8 Q -.15(xe)
+(option will cause)3.257 F(the shellscript to be e)144 664.8 Q -.15(xe)
 -.15 G(cuted in the background before).15 E F1(mbm_histplot)2.5 E F0
--.15(ex)2.5 G(its.).15 E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 561.6 Q F0
-.2(Suppose we ha)108 573.6 R .5 -.15(ve a s)-.2 H .201(ingle column asc\
+-.15(ex)2.5 G(its.).15 E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 693.6 Q F0
+.2(Suppose we ha)108 705.6 R .5 -.15(ve a s)-.2 H .201(ingle column asc\
 ii \214le of time lag estimates called timelag.dat. In order to generat\
 e a 6).15 F
 (inch wide and 4 inches high simple histogram plot of these data, use:)
-108 585.6 Q .971(mbm_histplot \255Itimelag.dat \255Otimelaghist \255JX6\
-/4 \255V to generate a GMT plot shellscript called)144 597.6 R
-(timelaghist.cmd.)108 609.6 Q(As an e)108 633.6 Q(xample, the contents \
-of the plotting shellscript "timelaghist.cmd" are:)-.15 E .152(#! /bin/\
-csh \255f # # Shellscript to create Postscript plot of data in grd \214\
-le # Created by macro mbm_histplot #)108 657.6 R 2.69(#T)108 669.6 S .19
-(his shellscript created by follo)-2.69 F .19(wing command line: # mbm_\
-histplot \255Itimelag.dat \255Otimelaghist \255JX6/4)-.25 F .003
-(\255V # # De\214ne shell v)108 681.6 R .003
+108 717.6 Q .971(mbm_histplot \255Itimelag.dat \255Otimelaghist \255JX6\
+/4 \255V to generate a GMT plot shellscript called)144 729.6 R
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
+Cg EP
+%%Page: 4 4
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
+(5.0 mbm_histplot\(1\))2.5 F(timelaghist.cmd.)108 84 Q(As an e)108 108 Q
+(xample, the contents of the plotting shellscript "timelaghist.cmd" are\
+:)-.15 E .152(#! /bin/csh \255f # # Shellscript to create Postscript pl\
+ot of data in grd \214le # Created by macro mbm_histplot #)108 132 R
+2.69(#T)108 144 S .19(his shellscript created by follo)-2.69 F .19(wing\
+ command line: # mbm_histplot \255Itimelag.dat \255Otimelaghist \255JX6\
+/4)-.25 F .003(\255V # # De\214ne shell v)108 156 R .003
 (ariables used in this script: set PS_FILE)-.25 F 2.503(=t)22.503 G .003
 (imelaghist.ps set CPT_FILE)-2.503 F 2.503(=s)20.003 G(et)-2.503 E
-(MAP_PR)108 693.6 Q 5.339(OJECTION =)-.4 F 5.338(Xs)5.339 G 2.838
+(MAP_PR)108 168 Q 5.339(OJECTION =)-.4 F 5.338(Xs)5.339 G 2.838
 (et MAP_SCALE)-5.338 F 5.338(=6)20.338 G 2.838(/4 set MAP_REGION)-5.338
 F 5.338<3dad>17.838 G 2.838(0.57/0.12/0/50 set)-5.338 F 18.99
-(X_OFFSET =)108 705.6 R 1.49(2.5 set Y_OFFSET)3.99 F 3.991(=2)21.49 G
+(X_OFFSET =)108 180 R 1.49(2.5 set Y_OFFSET)3.99 F 3.991(=2)21.49 G
 1.491(.375 # # Sa)-3.991 F 1.791 -.15(ve ex)-.2 H 1.491(isting GMT def)
-.15 F 1.491(aults echo Sa)-.1 F 1.491(ving GMT)-.2 F(def)108 717.6 Q
-3.174(aults... gmtdef)-.1 F .674(aults \255L >! gmtdef)-.1 F .673
+.15 F 1.491(aults echo Sa)-.1 F 1.491(ving GMT)-.2 F(def)108 192 Q 3.174
+(aults... gmtdef)-.1 F .674(aults \255L >! gmtdef)-.1 F .673
 (aults$$ # # Set ne)-.1 F 3.173(wG)-.25 G .673(MT def)-3.173 F .673
 (aults echo Setting ne)-.1 F 3.173(wG)-.25 G .673(MT def)-3.173 F
-(aults...)-.1 E 1.583(gmtset MEASURE_UNIT inch gmtset P)108 729.6 R
-1.583(APER_MEDIA archA+ gmtset ANO)-.92 F 1.584(T_FONT Helv)-.4 F 1.584
-(etica gmtset)-.15 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
-(5.0 mbm_histplot\(1\))2.5 F 3.884(LABEL_FONT Helv)108 84 R 3.884
+(aults...)-.1 E 1.583(gmtset MEASURE_UNIT inch gmtset P)108 204 R 1.583
+(APER_MEDIA archA+ gmtset ANO)-.92 F 1.584(T_FONT Helv)-.4 F 1.584
+(etica gmtset)-.15 F 3.884(LABEL_FONT Helv)108 216 R 3.884
 (etica gmtset HEADER_FONT Helv)-.15 F 3.884(etica gmtset ANO)-.15 F
 3.883(T_FONT_SIZE 8 gmtset)-.4 F 4.314(LABEL_FONT_SIZE 8 gmtset HEADER_\
-FONT_SIZE 10 gmtset FRAME_WIDTH 0.075 gmtset)108 96 R 1.692
-(TICK_LENGTH 0.075 gmtset P)108 108 R -.4(AG)-.92 G(E_ORIENT).4 E -1.11
+FONT_SIZE 10 gmtset FRAME_WIDTH 0.075 gmtset)108 228 R 1.692
+(TICK_LENGTH 0.075 gmtset P)108 240 R -.4(AG)-.92 G(E_ORIENT).4 E -1.11
 (AT)-.93 G 1.691(ION LANDSCAPE gmtset COLOR_B)1.11 F -.4(AC)-.35 G(KGR)
-.4 E(OUND)-.4 E 6.541(0/0/0 gmtset COLOR_FOREGR)108 120 R 6.541
+.4 E(OUND)-.4 E 6.541(0/0/0 gmtset COLOR_FOREGR)108 252 R 6.541
 (OUND 255/255/255 gmtset COLOR_N)-.4 F 6.542(AN 255/255/255 gmtset)-.35
-F(DEGREE_FORMA)108 132 Q 6.35(T3##M)-1.11 G(ak)-6.35 E 6.35(eh)-.1 G
+F(DEGREE_FORMA)108 264 Q 6.35(T3##M)-1.11 G(ak)-6.35 E 6.35(eh)-.1 G
 3.85(istogram echo Running pshistogram...)-6.35 F 3.85
-(pshistogram timelag.dat)8.85 F(-J$MAP_PR)117.39 144 Q 27.066
+(pshistogram timelag.dat)8.85 F(-J$MAP_PR)117.39 276 Q 27.066
 (OJECTION$MAP_SCALE -R$MAP_REGION)-.4 F 11.397(-B0.05:" ":/5:"Frequenc)
-39.957 F(y)-.15 E(%"::."Frequenc)108 156 Q 6.84(yH)-.15 G 4.34
+39.957 F(y)-.15 E(%"::."Frequenc)108 288 Q 6.84(yH)-.15 G 4.34
 (istogram of timelag.dat":)-6.84 F 4.34(-W0.069 \255Z1)17.49 F 18.4
 (-L1p -Ggray)21.82 F(-X$X_OFFSET)12.02 E 2.698(\255Y$Y_OFFSET \255V >! \
 $PS_FILE # # Delete surplus \214les echo Deleting surplus \214les...)108
-168 R 2.699(/bin/rm \255f)7.699 F .093($CPT_FILE # # Reset GMT def)108
-180 R .092(ault fonts echo Resetting GMT fonts...)-.1 F .092
+300 R 2.699(/bin/rm \255f)7.699 F .093($CPT_FILE # # Reset GMT def)108
+312 R .092(ault fonts echo Resetting GMT fonts...)-.1 F .092
 (/bin/mv gmtdef)5.092 F .092(aults$$ .gmtdef)-.1 F(aults)-.1 E 3.017
-(##R)108 192 S .517(un gv echo Running gv in background...)-3.017 F .517
+(##R)108 324 S .517(un gv echo Running gv in background...)-3.017 F .517
 (gv \255-orientation=landscape \255-media=BBox $PS_FILE & #)5.517 F 2.5
-(#A)108 204 S(ll done!)-2.5 E(echo All done!)5 E/F1 10.95/Times-Bold at 0
-SF(SEE ALSO)72 232.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 244.8 Q F0
+(#A)108 336 S(ll done!)-2.5 E(echo All done!)5 E/F1 10.95/Times-Bold at 0
+SF(SEE ALSO)72 364.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 376.8 Q F0
 (\(1\),)A F2(mbdefaults)2.5 E F0(\(1\),)A F2(mbm_grdplot)2.5 E F0
 (\(1\),)A F2(mbm_grd3dplot)2.5 E F0(\(1\),)A F2(mbm_plot)2.5 E F0(\(1\))
-A F1 -.11(BU)72 273.6 S(GS).11 E F0(Please let us kno)108 285.6 Q -.65
-(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)
-204.835 E 0 Cg EP
+A F1 -.11(BU)72 405.6 S(GS).11 E F0(Please let us kno)108 417.6 Q -.65
+(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(4)
+198.45 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbm_makedatalist.ps b/src/ps/mbm_makedatalist.ps
index 991e591..676693c 100644
--- a/src/ps/mbm_makedatalist.ps
+++ b/src/ps/mbm_makedatalist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_makesvp.ps b/src/ps/mbm_makesvp.ps
index 1cd604e..421fca8 100644
--- a/src/ps/mbm_makesvp.ps
+++ b/src/ps/mbm_makesvp.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_multicopy.ps b/src/ps/mbm_multicopy.ps
index 5d2146c..b69526a 100644
--- a/src/ps/mbm_multicopy.ps
+++ b/src/ps/mbm_multicopy.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:17 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_multidatalist.ps b/src/ps/mbm_multidatalist.ps
index e994e50..09a7fcb 100644
--- a/src/ps/mbm_multidatalist.ps
+++ b/src/ps/mbm_multidatalist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -340,10 +340,10 @@ F F1(mbm_multidatalist)4.368 E F0(macro:)108 278.4 Q
 (ecuting mbdatalist \255I20110805_053612.mb88 \255O \255V)-.15 E(Ex)144
 350.4 Q(ecuting mbdatalist \255I20110805_054149.mb88 \255O \255V)-.15 E
 (Program mbdatalist)144 374.4 Q -1.11(Ve)144 398.4 S
-(rsion $Id: mbm_multidatalist.ps 2219 2014-12-11 21:22:25Z caress $)1.11
+(rsion $Id: mbm_multidatalist.ps 2252 2015-07-01 19:35:37Z caress $)1.11
 E(Program mbdatalist)144 410.4 Q(MB-system V)144 422.4 Q
 (ersion 5.3.1904)-1.11 E -1.11(Ve)144 434.4 S
-(rsion $Id: mbm_multidatalist.ps 2219 2014-12-11 21:22:25Z caress $)1.11
+(rsion $Id: mbm_multidatalist.ps 2252 2015-07-01 19:35:37Z caress $)1.11
 E(MB-system V)144 446.4 Q(ersion 5.3.1904)-1.11 E
 (Generating inf \214le for 20110805_054149.mb88)144 470.4 Q
 (Generating inf \214le for 20110805_053612.mb88)144 494.4 Q
diff --git a/src/ps/mbm_multiprocess.ps b/src/ps/mbm_multiprocess.ps
index ca58926..bbaefbf 100644
--- a/src/ps/mbm_multiprocess.ps
+++ b/src/ps/mbm_multiprocess.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -308,9 +308,9 @@ BP
 (wing as the processing proceeds:)-.25 E(Running mbm_multiprocess...)144
 132 Q(Program <mbprocess>)144 156 Q(Program <mbprocess>)144 180 Q -1.11
 (Ve)144 192 S
-(rsion $Id: mbm_multiprocess.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbm_multiprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 -1.11(Ve)144 204 S
-(rsion $Id: mbm_multiprocess.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbm_multiprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)144 216 Q(ersion 5.3.1904)-1.11 E(MB-system V)144 228 Q
 (ersion 5.3.1904)-1.11 E(Program Operation:)144 252 Q
 (Program Operation:)144 276 Q(Input \214le:)149 288 Q
diff --git a/src/ps/mbm_plot.ps b/src/ps/mbm_plot.ps
index c176bb1..2da2953 100644
--- a/src/ps/mbm_plot.ps
+++ b/src/ps/mbm_plot.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -252,18 +252,19 @@ Q F0([)A F3(\215ipcolor/\215ipshade)A F0(])A F2<ad47>3.29 E F3
 F0(])A F2<ad4c>2.5 E F3(title)A F0([)A F3(:scale_label)A F0(])A F2<ad4d>
 2.5 E F3(misc)A F2<ad5120ad52>2.5 E F3(w/e/s/n)A F2<ad5820ad5920ad5a>2.5
 E F3(min/max)A F0(])2.5 E(Miscellaneous Options:)108 261.6 Q([)108 273.6
-Q F2(\255MGD)A F3(gmtdef/value)A F2(\255MGF)30.484 E F3(scale_loc)A F2
-(\255MGL)30.483 E F0([)A F3(f)A F0(][)A F3(x)A F0(])A F3
-(lon0/lat0/slat/length)A F0([)A F3(m)A F0(])A F2(\255MGQ)30.483 E F3
-(dpi)A F2(\255MGT)108 285.6 Q F3(x/y/size/angle/font/just/te)A(xt)-.2 E
-F2(\255MGU[)49.785 E F3(/dx/dy/)A F2(][)A F3(label)A F2 49.785<5dad>C
-(MMA)-49.785 E F3(factor/mode/depth)A F2(\255MMB)108 297.6 Q F3
-(yr/mo/da/hr/mn/sc)A F2(\255MMD)14.374 E F3(mode/scale[/min/max])A F2
-(\255MME)14.373 E F3(yr/mo/da/hr/mn/sc)A F2(\255MML)14.373 E F3
-(lon\215ip)A F2(\255MMN)108 309.6 Q F3(nplot)A F2(\255MMP)6.447 E F3
-(pings)A F2(\255MMS)6.447 E F3(speedmin)A F2(\255MMT)6.447 E F3(time)A
-(gap)-.4 E F2(\255MMZ)6.447 E F3(algorithm)A F2(\255MN)6.447 E(A)-.2 E
-F3 3.947([nhgt[/P] | P])B F2(\255MNP)108 321.6 Q F3([pingnumber_tic)A
+Q F2(\255MGD)A F3(gmtdef/value)A F2(\255MGF)14.344 E F3(scale_loc)A F2
+(\255MGL)14.343 E F0([)A F3(f)A F0(][)A F3(x)A F0(])A F3
+(lon0/lat0/slat/length)A F0([)A F3(units)A F0(][)A F3(+llabel)A F0(])A
+F2(\255MGQ)14.343 E F3(dpi)A F2(\255MGT)108 285.6 Q F3
+(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)49.785 E F3(/dx/dy/)
+A F2(][)A F3(label)A F2 49.785<5dad>C(MMA)-49.785 E F3
+(factor/mode/depth)A F2(\255MMB)108 297.6 Q F3(yr/mo/da/hr/mn/sc)A F2
+(\255MMD)14.374 E F3(mode/scale[/min/max])A F2(\255MME)14.373 E F3
+(yr/mo/da/hr/mn/sc)A F2(\255MML)14.373 E F3(lon\215ip)A F2(\255MMN)108
+309.6 Q F3(nplot)A F2(\255MMP)6.447 E F3(pings)A F2(\255MMS)6.447 E F3
+(speedmin)A F2(\255MMT)6.447 E F3(time)A(gap)-.4 E F2(\255MMZ)6.447 E F3
+(algorithm)A F2(\255MN)6.447 E(A)-.2 E F3 3.947([nhgt[/P] | P])B F2
+(\255MNP)108 321.6 Q F3([pingnumber_tic)A
 (k/pingnumber_annot/pingnumber_tic)-.2 E(k_len])-.2 E F2(\255MTC)4.254 E
 F3(\214ll)A F2(\255MTD)4.253 E F3 -.37(re)C(solution).37 E F2(\255MTG)
 4.253 E F3(\214ll)A F2(\255MTI)108 333.6 Q F3(river[/pen])A F2(\255MTN)
@@ -300,1356 +301,1392 @@ n in accordance with the plot size. The primary purpose of this)108
 -.18 E 1.081(ments are pro)108 494.4 R 1.081(vided. T)-.15 F 1.081
 (ruly ambitious users may edit the plot shellscript to tak)-.35 F 3.582
 (ea)-.1 G(dv)-3.582 E 1.082(antage of MB-System)-.25 F
-(and GMT capabilities not supported by this macro.)108 506.4 Q F1 -.548
-(AU)72 535.2 S(THORSHIP).548 E F0(Da)108 547.2 Q(vid W)-.2 E 2.5(.C)-.92
-G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 559.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 571.2 Q
-(Lamont-Doherty Earth Observ)113 583.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))113 595.2 Q
-(Lamont-Doherty Earth Observ)113 607.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 636 Q(ASIC OPTIONS)-.329 E F2<ad41>108 648 Q
-F3(ma)23.08 E(gnitude/azimuth)-.1 E F0(or)2.5 E F3(ma)2.5 E
-(gnitude/median)-.1 E F0 .535(Sets the parameters which control ho)144
-660 R(w)-.25 E F2(mbswath)3.035 E F0 .534
-(generates simulated illumination of bath)3.034 F(ymetry)-.05 E(,)-.65 E
-.521(which can be either shaded relief bath)144 672 R .521
-(ymetry or bath)-.05 F .522(ymetry draped with amplitude data.)-.05 F
-(If)5.522 E F3(mode)3.022 E F0 .181(is set to 2 \(shaded relief bath)144
-684 R .181(ymetry\) using the)-.05 F F2<ad47>2.681 E F0 .18
-(option, then the v)2.681 F(alue)-.25 E F3(ma)2.68 E(gnitude)-.1 E F0
-.18(is an ef)2.68 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 696 S 1.424
-(rtical e).15 F 1.424
-(xageration which modulates the intensity of the shading; typical v)-.15
-F 1.425(alues are in the 1-5)-.25 F 2.758(range. The)144 708 R -.25(va)
-2.758 G(lue).25 E F3(azimuth)2.758 E F0 .258
-(is the azimuth from which the bath)2.758 F .257(ymetry is illuminated.)
--.05 F(If)5.257 E F3(mode)2.757 E F0 .257(is set)2.757 F 2.833
-(to 3 \(bath)144 720 R 2.833(ymetry shaded using amplitudes\) using the)
--.05 F F2<ad47>5.333 E F0 2.833(option, then the v)5.333 F(alue)-.25 E
-F3(ma)5.334 E(gnitude)-.1 E F0(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(1)204.835 E 0 Cg EP
+(and GMT capabilities not supported by this macro.)108 506.4 Q .084
+(By def)108 530.4 R .083
+(ault the output plot generation shellscript includes lines which e)-.1
+F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
+ript image on the screen. The program to be used to display the Postscr\
+ipt is set using)108 542.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
+-3.308 E(def)108 554.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
+-.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
+F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
+(king the plot).2 F(generation shellscript with a)108 566.4 Q F2(-N)2.5
+E F0(command line ar)2.5 E
+(gument suppresses the screen display of the plot.)-.18 E .305
+(The plot scripts generated by this macro will w)108 590.4 R .305
+(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
+.305(nd are not compatible)-2.805 F(with earlier v)108 602.4 Q
+(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 631.2 S(THORSHIP).548 E
+F0(Da)108 643.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
+E(g\))-.18 E(Montere)113 655.2 Q 2.5(yB)-.15 G
+(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 667.2 Q
+(Lamont-Doherty Earth Observ)113 679.2 Q(atory)-.25 E
+(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))113 691.2 Q
+(Lamont-Doherty Earth Observ)113 703.2 Q(atory)-.25 E(MB-System 5.0)72
+768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F .465
-(modulates the intensity of the shading; the v)144 84 R(alue)-.25 E/F1
-10/Times-Italic at 0 SF(median)2.965 E F0 .464(sets the amplitude v)2.965 F
-.464(alue which serv)-.25 F .464(es as)-.15 F(the zero or neutral le)144
-96 Q -.15(ve)-.25 G(l.).15 E/F2 10/Times-Bold at 0 SF<ad43>108 112.8 Q F0
-(Gi)23.08 E -.15(ve)-.25 G 2.657(nb).15 G 2.657(yi)-2.657 G .157
-(tself, the)-2.657 F F2<ad43>2.657 E F0 .157
-(option produces a contour plot of the bath)2.657 F .157
-(ymetry data with a contour inter)-.05 F(-)-.2 E -.25(va)144 124.8 S
+(5.0 mbm_plot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
+(SIMPLE DESCRIPTION OF B)72 84 Q(ASIC OPTIONS)-.329 E/F2 10/Times-Bold at 0
+SF<ad41>108 96 Q/F3 10/Times-Italic at 0 SF(ma)23.08 E(gnitude/azimuth)-.1
+E F0(or)2.5 E F3(ma)2.5 E(gnitude/median)-.1 E F0 .535
+(Sets the parameters which control ho)144 108 R(w)-.25 E F2(mbswath)
+3.035 E F0 .534(generates simulated illumination of bath)3.034 F(ymetry)
+-.05 E(,)-.65 E .521(which can be either shaded relief bath)144 120 R
+.521(ymetry or bath)-.05 F .522(ymetry draped with amplitude data.)-.05
+F(If)5.522 E F3(mode)3.022 E F0 .181(is set to 2 \(shaded relief bath)
+144 132 R .181(ymetry\) using the)-.05 F F2<ad47>2.681 E F0 .18
+(option, then the v)2.681 F(alue)-.25 E F3(ma)2.68 E(gnitude)-.1 E F0
+.18(is an ef)2.68 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 144 S 1.424
+(rtical e).15 F 1.424
+(xageration which modulates the intensity of the shading; typical v)-.15
+F 1.425(alues are in the 1-5)-.25 F 2.758(range. The)144 156 R -.25(va)
+2.758 G(lue).25 E F3(azimuth)2.758 E F0 .258
+(is the azimuth from which the bath)2.758 F .257(ymetry is illuminated.)
+-.05 F(If)5.257 E F3(mode)2.757 E F0 .257(is set)2.757 F .587
+(to 3 \(bath)144 168 R .587(ymetry shaded using amplitudes\) using the)
+-.05 F F2<ad47>3.087 E F0 .587(option, then the v)3.087 F(alue)-.25 E F3
+(ma)3.088 E(gnitude)-.1 E F0(modu-)3.088 E .94
+(lates the intensity of the shading; the v)144 180 R(alue)-.25 E F3
+(median)3.439 E F0 .939(sets the amplitude v)3.439 F .939
+(alue which serv)-.25 F .939(es as the)-.15 F(zero or neutral le)144 192
+Q -.15(ve)-.25 G(l.).15 E F2<ad43>108 208.8 Q F0(Gi)23.08 E -.15(ve)-.25
+G 2.657(nb).15 G 2.657(yi)-2.657 G .157(tself, the)-2.657 F F2<ad43>
+2.657 E F0 .157(option produces a contour plot of the bath)2.657 F .157
+(ymetry data with a contour inter)-.05 F(-)-.2 E -.25(va)144 220.8 S
 3.166(lc).25 G .665
 (hosen according to the data in the \214le or \214les. If the)-3.166 F
 F2<ad47>3.165 E F0 .665(option is used, the def)3.165 F .665
-(ault contours)-.1 F 1.046(will be dra)144 136.8 R 1.047
+(ault contours)-.1 F 1.046(will be dra)144 232.8 R 1.047
 (wn in black; otherwise, the def)-.15 F 1.047(ault contours will be dra)
 -.1 F 1.047(wn in four colors \(black, red,)-.15 F 1.764
 (green, and blue\) with color changes, annotations, and tickmarks e)144
-148.8 R -.15(ve)-.25 G 1.764(ry fourth contour interv).15 F(al.)-.25 E
+244.8 R -.15(ve)-.25 G 1.764(ry fourth contour interv).15 F(al.)-.25 E
 .826(Additional optional parameters are described in the COMPLETE DESCR\
-IPTION OF OPTIONS)144 160.8 R(section belo)144 172.8 Q -.65(w.)-.25 G F2
-<ad44>108 189.6 Q F1([\215ipcolor/\215ipshade])23.08 E F0 1.131
-(This option \215ips the color and shading con)144 201.6 R -.15(ve)-.4 G
+IPTION OF OPTIONS)144 256.8 R(section belo)144 268.8 Q -.65(w.)-.25 G F2
+<ad44>108 285.6 Q F3([\215ipcolor/\215ipshade])23.08 E F0 1.131
+(This option \215ips the color and shading con)144 297.6 R -.15(ve)-.4 G
 1.131(ntions used by).15 F F2(mbm_plot)3.631 E F0 6.13(.N)C(ormally)
 -6.13 E 3.63(,t)-.65 G 1.13(he color or)-3.63 F 1.329
-(grayscale tables used for color bath)144 213.6 R 1.329
+(grayscale tables used for color bath)144 309.6 R 1.329
 (ymetry maps run from cool colors \(or dark grays\) for lar)-.05 F(ge)
--.18 E .636(depth v)144 225.6 R .636
+-.18 E .636(depth v)144 321.6 R .636
 (alues to hot colors \(or light grays\) for small depth v)-.25 F 3.135
 (alues. In)-.25 F .635(contrast, sidescan and beam)3.135 F .531(amplitu\
 de data is normally plotted using light grays \(or hot colors\) for sma\
-ll amplitudes and dark)144 237.6 R .279
-(grays \(or cool colors\) for lar)144 249.6 R .279(ge amplitudes.)-.18 F
+ll amplitudes and dark)144 333.6 R .279
+(grays \(or cool colors\) for lar)144 345.6 R .279(ge amplitudes.)-.18 F
 (If)5.279 E F2<ad44>2.779 E F0 .278(is gi)2.778 F -.15(ve)-.25 G 2.778
-(na).15 G .278(lone or with)-2.778 F F1(\215ipcolor)2.778 E F0 2.778(=1)
+(na).15 G .278(lone or with)-2.778 F F3(\215ipcolor)2.778 E F0 2.778(=1)
 2.778 G 2.778(,i)-2.778 G 2.778(ta)-2.778 G .278(pplies to)-2.778 F
-1.006(the color table used for color or gray \214ll plots,)144 261.6 R
+1.006(the color table used for color or gray \214ll plots,)144 357.6 R
 1.006(shaded or unshaded. If the plot is to be shaded,)6.006 F .464
-(either by synthetic illumination \()144 273.6 R F2<ad47>A F1(2)A F0
+(either by synthetic illumination \()144 369.6 R F2<ad47>A F3(2)A F0
 2.964(\)o)C 2.964(rb)-2.964 G 2.964(yo)-2.964 G -.15(ve)-3.114 G .464
-(rlaying amplitude data \().15 F F2<ad47>A F1(3)A F0 .463
-(option\), then setting)2.964 F F1(\215ipshade)144 285.6 Q F0 3.555(=1w)
+(rlaying amplitude data \().15 F F2<ad47>A F3(3)A F0 .463
+(option\), then setting)2.964 F F3(\215ipshade)144 381.6 Q F0 3.555(=1w)
 3.555 G 1.055(ill cause the shading con)-3.555 F -.15(ve)-.4 G 1.055
 (ntion to be re).15 F -.15(ve)-.25 G 1.056
 (rsed \(e.g. high amplitudes o).15 F -.15(ve)-.15 G 1.056(rlaid as).15 F
-.863(light shading\).)144 297.6 R(Using)5.863 E F2<ad44>3.363 E F1(0/1)A
+.863(light shading\).)144 393.6 R(Using)5.863 E F2<ad44>3.363 E F3(0/1)A
 F0 .863(will \215ip the shading con)3.363 F -.15(ve)-.4 G .863(ntion b)
 .15 F .863(ut lea)-.2 F 1.163 -.15(ve t)-.2 H .863(he def).15 F .862
-(ault color con)-.1 F -.15(ve)-.4 G(n-).15 E(tion.)144 309.6 Q F2<ad46>
-108 326.4 Q F1(format)24.19 E F0 1.358
-(Sets the data format for the input data.)144 338.4 R(If)6.358 E F1
+(ault color con)-.1 F -.15(ve)-.4 G(n-).15 E(tion.)144 405.6 Q F2<ad46>
+108 422.4 Q F3(format)24.19 E F0 1.358
+(Sets the data format for the input data.)144 434.4 R(If)6.358 E F3
 (format)3.858 E F0 3.858(<0)3.858 G 3.858(,t)-3.858 G 1.358
 (hen the input \214le speci\214ed with the)-3.858 F F2<ad49>3.858 E F0
-1.164(option will actually contain a list of input sw)144 350.4 R 1.164
+1.164(option will actually contain a list of input sw)144 446.4 R 1.164
 (ath sonar data \214les. This program uses the)-.1 F F2(MBIO)3.663 E F0
-1.291(library and will read or write an)144 362.4 R 3.792(ys)-.15 G -.1
+1.291(library and will read or write an)144 458.4 R 3.792(ys)-.15 G -.1
 (wa)-3.792 G 1.292(th sonar format supported by).1 F F2(MBIO)3.792 E F0
 3.792(.Al)C 1.292(ist of the sw)-3.792 F(ath)-.1 E .391
-(sonar data formats currently supported by)144 374.4 R F2(MBIO)2.891 E
+(sonar data formats currently supported by)144 470.4 R F2(MBIO)2.891 E
 F0 .391(and their identi\214er v)2.891 F .39(alues is gi)-.25 F -.15(ve)
 -.25 G 2.89(ni).15 G 2.89(nt)-2.89 G(he)-2.89 E F2(MBIO)2.89 E F0
-(manual page. Def)144 386.4 Q(ault:)-.1 E F1(format)2.5 E F0 2.5<3dad>
-2.5 G(1.)-2.5 E F2<ad47>108 403.2 Q F1(mode[F])22.52 E F0 -.45(Tu)144
-415.2 S(rns on color \214ll sw).45 E
-(ath plot and sets the style of the plot.)-.1 E F1(mode)180 427.2 Q F0
+(manual page. Def)144 482.4 Q(ault:)-.1 E F3(format)2.5 E F0 2.5<3dad>
+2.5 G(1.)-2.5 E F2<ad47>108 499.2 Q F3(mode[F])22.52 E F0 -.45(Tu)144
+511.2 S(rns on color \214ll sw).45 E
+(ath plot and sets the style of the plot.)-.1 E F3(mode)180 523.2 Q F0
 2.5(=1)2.5 G 31.92(:C)-2.5 G(olor \214ll of bath)-31.92 E(ymetry data.)
--.05 E F1(mode)180 439.2 Q F0 2.5(=2)2.5 G 31.92(:C)-2.5 G
-(olor shaded relief bath)-31.92 E(ymetry)-.05 E(.)-.65 E F1(mode)180
-451.2 Q F0 2.5(=3)2.5 G 31.92(:B)-2.5 G(ath)-31.92 E
-(ymetry shaded using amplitude data.)-.05 E F1(mode)180 463.2 Q F0 2.5
-(=4)2.5 G 31.92(:G)-2.5 G(rayscale \214ll of amplitude data.)-31.92 E F1
-(mode)180 475.2 Q F0 2.5(=5)2.5 G 31.92(:G)-2.5 G
+-.05 E F3(mode)180 535.2 Q F0 2.5(=2)2.5 G 31.92(:C)-2.5 G
+(olor shaded relief bath)-31.92 E(ymetry)-.05 E(.)-.65 E F3(mode)180
+547.2 Q F0 2.5(=3)2.5 G 31.92(:B)-2.5 G(ath)-31.92 E
+(ymetry shaded using amplitude data.)-.05 E F3(mode)180 559.2 Q F0 2.5
+(=4)2.5 G 31.92(:G)-2.5 G(rayscale \214ll of amplitude data.)-31.92 E F3
+(mode)180 571.2 Q F0 2.5(=5)2.5 G 31.92(:G)-2.5 G
 (rayscale \214ll of sidescan data.)-31.92 E .925(If "F" is appended to)
-144 487.2 R F1(mode)3.425 E F0 3.425(,t)C(hen)-3.425 E F2(mbm_plot)3.426
+144 583.2 R F3(mode)3.425 E F0 3.425(,t)C(hen)-3.425 E F2(mbm_plot)3.426
 E F0 .926(will attempt to plot amplitude or sidescan data that)3.426 F
-(ha)144 499.2 Q 1.49 -.15(ve b)-.2 H 1.19(een \214ltered with).15 F F2
+(ha)144 595.2 Q 1.49 -.15(ve b)-.2 H 1.19(een \214ltered with).15 F F2
 (mb\214lter)3.69 E F0 6.19(.I)C 3.69(ft)-6.19 G 1.19
 (he desired \214ltered data \214les do not e)-3.69 F 1.19
-(xist, then the plotting)-.15 F 2.023(script generated by)144 511.2 R F2
+(xist, then the plotting)-.15 F 2.023(script generated by)144 607.2 R F2
 (mbm_plot)4.523 E F0 2.023(will f)4.523 F 2.023(ail when)-.1 F F2
 (mbswath)4.523 E F0 -.15(ex)4.523 G 2.023
 (its with an error message. Filtered).15 F 1.235
 (amplitude data are stored in ancilliary \214les ending with ".f)144
-523.2 R -.1(fa)-.25 G 1.234(", and \214ltered sidescan \214les end in).1
-F(".f)144 535.2 Q .061(fs". Filtering of bath)-.25 F .061
-(ymetry data is not supported, and so appending "F" to)-.05 F F1(mode)
-2.561 E F0 -.25(va)2.561 G .061(lues of 1 or 2).25 F(will ha)144 547.2 Q
+619.2 R -.1(fa)-.25 G 1.234(", and \214ltered sidescan \214les end in).1
+F(".f)144 631.2 Q .061(fs". Filtering of bath)-.25 F .061
+(ymetry data is not supported, and so appending "F" to)-.05 F F3(mode)
+2.561 E F0 -.25(va)2.561 G .061(lues of 1 or 2).25 F(will ha)144 643.2 Q
 .3 -.15(ve n)-.2 H 2.5(oe).15 G -.25(ff)-2.5 G(ect.).25 E F2<ad48>108
-564 Q F0 .162(This "help" \215ag cause the program to print out a descr\
+660 Q F0 .162(This "help" \215ag cause the program to print out a descr\
 iption of its operation and then e)22.52 F .161(xit immedi-)-.15 F
-(ately)144 576 Q(.)-.65 E F2<ad49>108 592.8 Q F1(\214lename)26.41 E F0
-.467(Sets the input \214lename. If)144 604.8 R F1(format)2.967 E F0
+(ately)144 672 Q(.)-.65 E F2<ad49>108 688.8 Q F3(\214lename)26.41 E F0
+.467(Sets the input \214lename. If)144 700.8 R F3(format)2.967 E F0
 2.967(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
 (option\) then the sw)2.967 F .468(ath sonar data contained)-.1 F(in)144
-616.8 Q F1(in\214le)2.943 E F0 .443(is read and processed. If)2.943 F F1
+712.8 Q F3(in\214le)2.943 E F0 .443(is read and processed. If)2.943 F F3
 (format)2.943 E F0 2.943(<0\()2.943 G .442(the def)-2.943 F .442
-(ault\), then)-.1 F F1(in\214le)2.942 E F0 .442
+(ault\), then)-.1 F F3(in\214le)2.942 E F0 .442
 (is assumed to be an ascii \214le)2.942 F .051
-(containing a list of the input sw)144 628.8 R .052
+(containing a list of the input sw)144 724.8 R .052
 (ath sonar data \214les to be processed and their formats.)-.1 F .052
-(The program)5.052 F .063
-(will read the data in each one of these \214les.)144 640.8 R .063
-(In the)5.063 F F1(in\214le)2.563 E F0 .063
-(\214le, each data \214le should be follo)2.563 F .062(wed by a)-.25 F
-(data format identi\214er)144 652.8 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 664.8 Q(data\214le2 24)180 676.8 Q .568
-(This program uses the)144 688.8 R F2(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F2(MBIO)144 700.8 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 712.8 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. The def)2.5 E(ault input \214lename is "datalist.mb-1".)
--.1 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835
-E 0 Cg EP
+(The program)5.052 F(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)
+-2.5 E(2)198.45 E 0 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4e>108 84 Q F0(Gi)23.08
-E -.15(ve)-.25 G 3.91(nb).15 G 3.91(yi)-3.91 G 1.41
-(tself, this option causes a na)-3.91 F(vig)-.2 E 1.41
-(ation track plot to be generated.)-.05 F 1.41(Additional optional)6.41
-F 1.271(parameters, including annotation control, are described in the \
-COMPLETE DESCRIPTION OF)144 96 R(OPTIONS section belo)144 108 Q -.65(w.)
--.25 G F1<ad4f>108 124.8 Q/F2 10/Times-Italic at 0 SF -.45(ro)22.52 G(ot)
-.45 E F0 .422(Sets the root used to construct the \214lename of the out\
-put shellscript \()144 136.8 R F2 -.45(ro)C(ot).45 E F0 .423
+(5.0 mbm_plot\(1\))2.5 F .063
+(will read the data in each one of these \214les.)144 84 R .063(In the)
+5.063 F/F1 10/Times-Italic at 0 SF(in\214le)2.563 E F0 .063
+(\214le, each data \214le should be follo)2.563 F .062(wed by a)-.25 F
+(data format identi\214er)144 96 Q 2.5(,e)-.4 G(.g.:)-2.5 E
+(data\214le1 11)180 108 Q(data\214le2 24)180 120 Q .568
+(This program uses the)144 132 R/F2 10/Times-Bold at 0 SF(MBIO)3.068 E F0
+.568(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)
+-3.068 G .568(th sonar format supported by).1 F F2(MBIO)144 144 Q F0
+3.428(.Al)C .928(ist of the sw)-3.428 F .928
+(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
+.928(and their identi\214er)3.428 F -.25(va)144 156 S(lues is gi).25 E
+-.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
+(manual page. The def)2.5 E(ault input \214lename is "datalist.mb-1".)
+-.1 E F2<ad4e>108 172.8 Q F0(Gi)23.08 E -.15(ve)-.25 G 3.91(nb).15 G
+3.91(yi)-3.91 G 1.41(tself, this option causes a na)-3.91 F(vig)-.2 E
+1.41(ation track plot to be generated.)-.05 F 1.41(Additional optional)
+6.41 F 1.271(parameters, including annotation control, are described in\
+ the COMPLETE DESCRIPTION OF)144 184.8 R(OPTIONS section belo)144 196.8
+Q -.65(w.)-.25 G F2<ad4f>108 213.6 Q F1 -.45(ro)22.52 G(ot).45 E F0 .422
+(Sets the root used to construct the \214lename of the output shellscri\
+pt \()144 225.6 R F1 -.45(ro)C(ot).45 E F0 .423
 (.cmd\) and names of \214les)B .21(created when the shellscript is run.)
-144 148.8 R .21(By def)5.21 F .21
+144 237.6 R .21(By def)5.21 F .21
 (ault, the name of the input data \214le or list \214le is used as)-.1 F
-(the)144 160.8 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108 177.6 Q F2
+(the)144 249.6 Q F1 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108 266.4 Q F1
 (pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the size of\
  the page the plot will be centered on. If the user does not set the pl\
-ot)144 189.6 R .126(scale, the plot will be sized as lar)144 201.6 R
+ot)144 278.4 R .126(scale, the plot will be sized as lar)144 290.4 R
 .125(ge as will \214t on the designated page. If the user sets the plot\
  scale)-.18 F .948
 (such that the plot will not \214t on the designated page, a lar)144
-213.6 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
-1.343(page sizes include ANSI A, B, C, D, E, F)144 225.6 R 3.843(,a)-.8
+302.4 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
+1.343(page sizes include ANSI A, B, C, D, E, F)144 314.4 R 3.843(,a)-.8
 G 1.342(nd E1, as well as most metric page sizes. See the)-3.843 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 237.6 R 3.81(wf)-.25 G
+(COMPLETE DESCRIPTION OF OPTIONS section belo)144 326.4 R 3.81(wf)-.25 G
 1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-249.6 Q(ault page size is A.)-.1 E F1<ad53>108 266.4 Q F2([color/shade])
-24.74 E F0 1.073(This option enables ef)144 278.4 R(fecti)-.25 E 1.373
+338.4 Q(ault page size is A.)-.1 E F2<ad53>108 355.2 Q F1([color/shade])
+24.74 E F0 1.073(This option enables ef)144 367.2 R(fecti)-.25 E 1.373
 -.15(ve h)-.25 H 1.072
 (istogram equalization of the color and/or shading of thedata. The).15 F
-1.016(equalization is not achie)144 290.4 R -.15(ve)-.25 G 3.516(db).15
+1.016(equalization is not achie)144 379.2 R -.15(ve)-.25 G 3.516(db).15
 G 3.516(yc)-3.516 G 1.017(hanging the data v)-3.516 F 1.017(alues, b)
 -.25 F 1.017(ut rather by constructing the color or)-.2 F 1.325(shading\
  tables so that the boundaries in the tables encompass equal fractions \
-of the datapoints.)144 302.4 R 1.11(This serv)144 314.4 R 1.11
+of the datapoints.)144 391.2 R 1.11(This serv)144 403.2 R 1.11
 (es to focus color or shading contrasts in v)-.15 F 1.111
 (alue ranges corresponding to the b)-.25 F 1.111(ulk of the)-.2 F .71
-(data v)144 326.4 R .71(alues, and is particularly useful for enhancing\
+(data v)144 415.2 R .71(alues, and is particularly useful for enhancing\
  the contrast of sidescan and beam amplitude)-.25 F 3.587(plots. If)144
-338.4 R F1<ad53>3.587 E F0 1.087(is gi)3.587 F -.15(ve)-.25 G 3.587(na)
-.15 G 1.087(lone or with)-3.587 F F2(color)3.587 E F0 3.587(=1)3.587 G
+427.2 R F2<ad53>3.587 E F0 1.087(is gi)3.587 F -.15(ve)-.25 G 3.587(na)
+.15 G 1.087(lone or with)-3.587 F F1(color)3.587 E F0 3.587(=1)3.587 G
 3.587(,i)-3.587 G 3.587(te)-3.587 G 1.088
 (nables equalization of the color table used for)-3.587 F .289
-(color or gray \214ll plots,)144 350.4 R .289
+(color or gray \214ll plots,)144 439.2 R .289
 (shaded or unshaded. If the plot is to be shaded,)5.289 F .288
-(either by synthetic illumi-)5.289 F .459(nation \()144 362.4 R F1<ad47>
-A F2(2)A F0 2.959(\)o)C 2.959(rb)-2.959 G 2.959(yo)-2.959 G -.15(ve)
--3.109 G .459(rlaying amplitude data \().15 F F1<ad47>A F2(3)A F0 .459
-(option\), then setting)2.959 F F2(shade)2.96 E F0 2.96(=1w)2.96 G .46
-(ill cause the)-2.96 F .163(shading to be equalized.)144 374.4 R(Using)
-5.163 E F1<ad53>2.663 E F2(0/1)A F0 .163
+(either by synthetic illumi-)5.289 F .459(nation \()144 451.2 R F2<ad47>
+A F1(2)A F0 2.959(\)o)C 2.959(rb)-2.959 G 2.959(yo)-2.959 G -.15(ve)
+-3.109 G .459(rlaying amplitude data \().15 F F2<ad47>A F1(3)A F0 .459
+(option\), then setting)2.959 F F1(shade)2.96 E F0 2.96(=1w)2.96 G .46
+(ill cause the)-2.96 F .163(shading to be equalized.)144 463.2 R(Using)
+5.163 E F2<ad53>2.663 E F1(0/1)A F0 .163
 (will equalize the shading without equalizing the color table.)2.663 F
-F1<ad54>108 391.2 Q F0(If)23.63 E F1<ad54>3.252 E F0 .752(is gi)3.252 F
+F2<ad54>108 480 Q F0(If)23.63 E F2<ad54>3.252 E F0 .752(is gi)3.252 F
 -.15(ve)-.25 G .752(n, it causes a coastline to be dra).15 F .753
 (wn on the map. The def)-.15 F .753(ault is to dra)-.1 F 3.253(wt)-.15 G
 .753(he coastline)-3.253 F .314(and shade all dry land a uniform gray)
-144 403.2 R 2.814(.T)-.65 G 2.814(oe)-3.614 G -.15(xe)-2.964 G .313
-(rcise greater control of the coastline plotting, use the).15 F F1
-(\255MTC)144 415.2 Q F0(,)A F1(\255MTD)4.26 E F0(,)A F1(\255MTG)4.26 E
-F0(,)A F1(\255MTI)4.26 E F0(,)A F1(\255MTN)4.26 E F0(,)A F1(\255MTS)4.26
-E F0 4.26(,a)C(nd)-4.26 E F1(\255MTW)4.26 E F0 1.76
+144 492 R 2.814(.T)-.65 G 2.814(oe)-3.614 G -.15(xe)-2.964 G .313
+(rcise greater control of the coastline plotting, use the).15 F F2
+(\255MTC)144 504 Q F0(,)A F2(\255MTD)4.26 E F0(,)A F2(\255MTG)4.26 E F0
+(,)A F2(\255MTI)4.26 E F0(,)A F2(\255MTN)4.26 E F0(,)A F2(\255MTS)4.26 E
+F0 4.26(,a)C(nd)-4.26 E F2(\255MTW)4.26 E F0 1.76
 (options described in the COM-)4.26 F
-(PLETE DESCRIPTION OF OPTIONS section belo)144 427.2 Q -.65(w.)-.25 G F1
-<ad55>108 444 Q F2(orientation)23.08 E F0 .2(Normally the orientation o\
-f the plot \(portrait or landscape\) is selected automatically so as to\
- maxi-)144 456 R .333(mize the plot scale.)144 468 R(The)5.333 E F1
-<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
+(PLETE DESCRIPTION OF OPTIONS section belo)144 516 Q -.65(w.)-.25 G F2
+<ad55>108 532.8 Q F1(orientation)23.08 E F0 .2(Normally the orientation\
+ of the plot \(portrait or landscape\) is selected automatically so as \
+to maxi-)144 544.8 R .333(mize the plot scale.)144 556.8 R(The)5.333 E
+F2<ad55>2.833 E F0 .333(option allo)2.833 F .333
+(ws the user to set the plot orientation. If)-.25 F F1(orientation)2.833
 E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 480 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 496.8 Q F0(Causes)23.08 E F1(mbm_plot)2.5 E F0
+(portrait plot will be produced; if)144 568.8 Q F1(orientation)2.5 E F0
+2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F2
+<ad56>108 585.6 Q F0(Causes)23.08 E F2(mbm_plot)2.5 E F0
 (to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E F1
-<ad57>108 513.6 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
+(erbose" mode so that it outputs more information than usual.)-.15 E F2
+<ad57>108 602.4 Q F1([color_style)20.3 E F0([)A F1(/palette)A F0([)A F1
 (ncolor)A(s)-.1 E F0(]] | cpt\214le])A
 (This option controls the color scheme used for color \214ll plots.)144
-525.6 Q(If)144 549.6 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
+614.4 Q(If)144 638.4 Q F1(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
 -3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 561.6 Q F0 2.815(=2)2.815 G
+ading of colors. If)-.1 F F1(color_style)144 650.4 Q F0 2.815(=2)2.815 G
 2.815(,t)-2.815 G .315
 (he color scheme will be a set of discrete color interv)-2.815 F .316
-(als. The color palette used is)-.25 F(set using)144 573.6 Q F2(palette)
+(als. The color palette used is)-.25 F(set using)144 662.4 Q F1(palette)
 2.5 E F0 2.5(.F)C -2.15 -.25(iv e)-2.5 H(palettes are a)2.75 E -.25(va)
--.2 G(ilable:).25 E F2(palette)180 585.6 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5
-G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 597.6 Q F0 2.5
-(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)180
-609.6 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F2(palette)180 621.6 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 633.6 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E 4.384(Ac)144 645.6 S 1.883
-(omplete description of the color palettes is gi)-4.384 F -.15(ve)-.25 G
-4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
-F(OPTIONS section belo)144 657.6 Q -.65(w.)-.25 G(The)144 681.6 Q F2
-(ncolor)2.606 E(s)-.1 E F0 .107(parameter sets the number of color v)
-2.606 F .107(alues used in plotting, whether the colors are rep-)-.25 F
-(resented in a continuous color scale or a stepped, discrete color scal\
-e [def)144 693.6 Q(ault is 11].)-.1 E .523(If the option ar)144 717.6 R
-.522(gument is the path to an e)-.18 F(xisting)-.15 E F1(GMT)3.022 E F0
-.522(color palette \(CPT\) \214le, then that CPT \214le)3.022 F
-(and its color scheme will be used for the plot)144 729.6 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
+-.2 G(ilable:).25 E F1(palette)180 674.4 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5
+G(axby colors [def)-26.36 E(ault])-.1 E F1(palette)180 686.4 Q F0 2.5
+(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F1(palette)180
+698.4 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
+(ntensity colors).25 E F1(palette)180 710.4 Q F0 2.5(=4)2.5 G 26.36(:g)
+-2.5 G(rayscale)-26.36 E F1(palette)180 722.4 Q F0 2.5(=5)2.5 G 26.36
+(:u)-2.5 G(niform grayscale)-26.36 E(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(3)198.45 E 0 Cg EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
-(COMPLETE DESCRIPTION OF OPTIONS)72 84 Q/F2 10/Times-Bold at 0 SF<ad41>108
-96 Q/F3 10/Times-Italic at 0 SF(ma)23.08 E(gnitude/azimuth)-.1 E F0(or)2.5
-E F3(ma)2.5 E(gnitude/median)-.1 E F0 .08
-(Sets the parameters which control ho)144 108 R(w)-.25 E F2(mbm_plot)
-2.58 E F0 .08(generates simulated illumination of bath)2.58 F(ymetry)
--.05 E(,)-.65 E .522(which can be either shaded relief bath)144 120 R
-.521(ymetry or bath)-.05 F .521(ymetry draped with amplitude data.)-.05
-F(If)5.521 E F3(mode)3.021 E F0 .18(is set to 2 \(shaded relief bath)144
-132 R .18(ymetry\) using the)-.05 F F2<ad47>2.681 E F0 .181
-(option, then the v)2.681 F(alue)-.25 E F3(ma)2.681 E(gnitude)-.1 E F0
-.181(is an ef)2.681 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 144 S
+(5.0 mbm_plot\(1\))2.5 F 4.384(Ac)144 84 S 1.883
+(omplete description of the color palettes is gi)-4.384 F -.15(ve)-.25 G
+4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
+F(OPTIONS section belo)144 96 Q -.65(w.)-.25 G(The)144 120 Q/F1 10
+/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0 .107
+(parameter sets the number of color v)2.606 F .107
+(alues used in plotting, whether the colors are rep-)-.25 F(resented in\
+ a continuous color scale or a stepped, discrete color scale [def)144
+132 Q(ault is 11].)-.1 E .523(If the option ar)144 156 R .522
+(gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
+(GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
+3.022 F(and its color scheme will be used for the plot)144 168 Q/F3
+10.95/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 196.8 Q F2
+<ad41>108 208.8 Q F1(ma)23.08 E(gnitude/azimuth)-.1 E F0(or)2.5 E F1(ma)
+2.5 E(gnitude/median)-.1 E F0 .08(Sets the parameters which control ho)
+144 220.8 R(w)-.25 E F2(mbm_plot)2.58 E F0 .08
+(generates simulated illumination of bath)2.58 F(ymetry)-.05 E(,)-.65 E
+.522(which can be either shaded relief bath)144 232.8 R .521
+(ymetry or bath)-.05 F .521(ymetry draped with amplitude data.)-.05 F
+(If)5.521 E F1(mode)3.021 E F0 .18(is set to 2 \(shaded relief bath)144
+244.8 R .18(ymetry\) using the)-.05 F F2<ad47>2.681 E F0 .181
+(option, then the v)2.681 F(alue)-.25 E F1(ma)2.681 E(gnitude)-.1 E F0
+.181(is an ef)2.681 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 256.8 S
 1.425(rtical e).15 F 1.424
 (xageration which modulates the intensity of the shading; typical v)-.15
-F 1.424(alues are in the 1-5)-.25 F 2.757(range. The)144 156 R -.25(va)
-2.757 G(lue).25 E F3(azimuth)2.757 E F0 .257
+F 1.424(alues are in the 1-5)-.25 F 2.757(range. The)144 268.8 R -.25
+(va)2.757 G(lue).25 E F1(azimuth)2.757 E F0 .257
 (is the azimuth from which the bath)2.757 F .258(ymetry is illuminated.)
--.05 F(If)5.258 E F3(mode)2.758 E F0 .258(is set)2.758 F .588
-(to 3 \(bath)144 168 R .587(ymetry shaded using amplitudes\) using the)
--.05 F F2<ad47>3.087 E F0 .587(option, then the v)3.087 F(alue)-.25 E F3
-(ma)3.087 E(gnitude)-.1 E F0(modu-)3.087 E .939
-(lates the intensity of the shading; the v)144 180 R(alue)-.25 E F3
-(median)3.439 E F0 .94(sets the amplitude v)3.439 F .94(alue which serv)
--.25 F .94(es as the)-.15 F(zero or neutral le)144 192 Q -.15(ve)-.25 G
-(l.).15 E F2<ad42>108 208.8 Q F3(tic)23.63 E(kinfo)-.2 E F0 .219
-(Sets map boundary tickmark interv)144 220.8 R .219(als. See the)-.25 F
-F2(psbasemap)2.719 E F0 .218(manual page for details. By def)2.719 F
-.218(ault the)-.1 F
+-.05 F(If)5.258 E F1(mode)2.758 E F0 .258(is set)2.758 F .588
+(to 3 \(bath)144 280.8 R .587
+(ymetry shaded using amplitudes\) using the)-.05 F F2<ad47>3.087 E F0
+.587(option, then the v)3.087 F(alue)-.25 E F1(ma)3.087 E(gnitude)-.1 E
+F0(modu-)3.087 E .939(lates the intensity of the shading; the v)144
+292.8 R(alue)-.25 E F1(median)3.439 E F0 .94(sets the amplitude v)3.439
+F .94(alue which serv)-.25 F .94(es as the)-.15 F(zero or neutral le)144
+304.8 Q -.15(ve)-.25 G(l.).15 E F2<ad42>108 321.6 Q F1(tic)23.63 E
+(kinfo)-.2 E F0 .219(Sets map boundary tickmark interv)144 333.6 R .219
+(als. See the)-.25 F F2(psbasemap)2.719 E F0 .218
+(manual page for details. By def)2.719 F .218(ault the)-.1 F
 (program chooses basemap annotations based on the map boundaries.)144
-232.8 Q F2<ad43>108 249.6 Q F3
+345.6 Q F2<ad43>108 362.4 Q F1
 ([cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt])23.08 E F0(Gi)144
-261.6 Q -.15(ve)-.25 G 2.657(nb).15 G 2.657(yi)-2.657 G .157(tself, the)
+374.4 Q -.15(ve)-.25 G 2.657(nb).15 G 2.657(yi)-2.657 G .157(tself, the)
 -2.657 F F2<ad43>2.657 E F0 .157
 (option produces a contour plot of the bath)2.657 F .157
-(ymetry data with a contour inter)-.05 F(-)-.2 E -.25(va)144 273.6 S
+(ymetry data with a contour inter)-.05 F(-)-.2 E -.25(va)144 386.4 S
 3.166(lc).25 G .665
 (hosen according to the data in the \214le or \214les. If the)-3.166 F
 F2<ad47>3.165 E F0 .665(option is used, the def)3.165 F .665
-(ault contours)-.1 F 1.046(will be dra)144 285.6 R 1.047
+(ault contours)-.1 F 1.046(will be dra)144 398.4 R 1.047
 (wn in black; otherwise, the def)-.15 F 1.047(ault contours will be dra)
 -.1 F 1.047(wn in four colors \(black, red,)-.15 F .732
 (green, and blue\) with color changes, annotations, and tickmarks e)144
-297.6 R -.15(ve)-.25 G .731(ry fourth contour interv).15 F 3.231(al. If)
--.25 F(an)144 309.6 Q 3.873(yo)-.15 G 3.873(ft)-3.873 G 1.373
+410.4 R -.15(ve)-.25 G .731(ry fourth contour interv).15 F 3.231(al. If)
+-.25 F(an)144 422.4 Q 3.873(yo)-.15 G 3.873(ft)-3.873 G 1.373
 (he optional parameters are appended, these v)-3.873 F 1.374
 (alues will control the contour interv)-.25 F 1.374(al and)-.25 F 1.128
-(other contour characteristics.)144 321.6 R 1.128
+(other contour characteristics.)144 434.4 R 1.128
 (Contours will be generated at in)6.128 F -.15(ve)-.4 G(rv).15 E 1.127
-(als of)-.25 F F3(cont_int)3.627 E F0 3.627(meters. Color)3.627 F 1.072
-(changes will occur at interv)144 333.6 R 1.072(als of)-.25 F F3
+(als of)-.25 F F1(cont_int)3.627 E F0 3.627(meters. Color)3.627 F 1.072
+(changes will occur at interv)144 446.4 R 1.072(als of)-.25 F F1
 (col_int)3.572 E F0 3.572(meters. Contours)3.572 F 1.073(will ha)3.572 F
 1.373 -.15(ve d)-.2 H -.25(ow).15 G 1.073(nhill f).25 F 1.073
-(acing tickmarks)-.1 F F3(tic_len)144 345.6 Q F0 .297(inches long e)
-2.797 F -.15(ve)-.25 G(ry).15 E F3(tic_int)2.796 E F0 .296
+(acing tickmarks)-.1 F F1(tic_len)144 458.4 Q F0 .297(inches long e)
+2.797 F -.15(ve)-.25 G(ry).15 E F1(tic_int)2.796 E F0 .296
 (meters. Contours will ha)2.796 F .596 -.15(ve a)-.2 H(nnotations).15 E
-F3(lab_hgt)2.796 E F0 .296(inches high e)2.796 F -.15(ve)-.25 G(ry).15 E
-F3(lab_int)144 357.6 Q F0(meters.)2.5 E F2<ad44>108 374.4 Q F3
+F1(lab_hgt)2.796 E F0 .296(inches high e)2.796 F -.15(ve)-.25 G(ry).15 E
+F1(lab_int)144 470.4 Q F0(meters.)2.5 E F2<ad44>108 487.2 Q F1
 ([\215ipcolor/\215ipshade])23.08 E F0 1.13
-(This option \215ips the color and shading con)144 386.4 R -.15(ve)-.4 G
+(This option \215ips the color and shading con)144 499.2 R -.15(ve)-.4 G
 1.131(ntions used by).15 F F2(mbm_plot)3.631 E F0 6.131(.N)C(ormally)
 -6.131 E 3.631(,t)-.65 G 1.131(he color or)-3.631 F 1.33
-(grayscale tables used for color bath)144 398.4 R 1.329
+(grayscale tables used for color bath)144 511.2 R 1.329
 (ymetry maps run from cool colors \(or dark grays\) for lar)-.05 F(ge)
--.18 E .635(depth v)144 410.4 R .635
+-.18 E .635(depth v)144 523.2 R .635
 (alues to hot colors \(or light grays\) for small depth v)-.25 F 3.136
 (alues. In)-.25 F .636(contrast, sidescan and beam)3.136 F .309(amplitu\
 de data is normally plotted using \(light grays \(or hot colors\) for s\
-mall amplitudes and dark)144 422.4 R .278
-(grays \(or cool colors\) for lar)144 434.4 R .278(ge amplitudes.)-.18 F
+mall amplitudes and dark)144 535.2 R .278
+(grays \(or cool colors\) for lar)144 547.2 R .278(ge amplitudes.)-.18 F
 (If)5.278 E F2<ad44>2.778 E F0 .278(is gi)2.778 F -.15(ve)-.25 G 2.778
-(na).15 G .279(lone or with)-2.778 F F3(\215ipcolor)2.779 E F0 2.779(=1)
+(na).15 G .279(lone or with)-2.778 F F1(\215ipcolor)2.779 E F0 2.779(=1)
 2.779 G 2.779(,i)-2.779 G 2.779(ta)-2.779 G .279(pplies to)-2.779 F
-1.006(the color table used for color or gray \214ll plots,)144 446.4 R
+1.006(the color table used for color or gray \214ll plots,)144 559.2 R
 1.006(shaded or unshaded. If the plot is to be shaded,)6.006 F .463
-(either by synthetic illumination \()144 458.4 R F2<ad47>A F3(2)A F0
+(either by synthetic illumination \()144 571.2 R F2<ad47>A F1(2)A F0
 2.964(\)o)C 2.964(rb)-2.964 G 2.964(yo)-2.964 G -.15(ve)-3.114 G .464
-(rlaying amplitude data \().15 F F2<ad47>A F3(3)A F0 .464
-(option\), then setting)2.964 F F3(\215ipshade)144 470.4 Q F0 3.556(=1w)
+(rlaying amplitude data \().15 F F2<ad47>A F1(3)A F0 .464
+(option\), then setting)2.964 F F1(\215ipshade)144 583.2 Q F0 3.556(=1w)
 3.556 G 1.056(ill cause the shading con)-3.556 F -.15(ve)-.4 G 1.055
 (ntion to be re).15 F -.15(ve)-.25 G 1.055
 (rsed \(e.g. high amplitudes o).15 F -.15(ve)-.15 G 1.055(rlaid as).15 F
-.862(light shading\).)144 482.4 R(Using)5.862 E F2<ad44>3.363 E F3(0/1)A
+.862(light shading\).)144 595.2 R(Using)5.862 E F2<ad44>3.363 E F1(0/1)A
 F0 .863(will \215ip the shading con)3.363 F -.15(ve)-.4 G .863(ntion b)
 .15 F .863(ut lea)-.2 F 1.163 -.15(ve t)-.2 H .863(he def).15 F .863
-(ault color con)-.1 F -.15(ve)-.4 G(n-).15 E(tion.)144 494.4 Q F2<ad46>
-108 511.2 Q F3(format)24.19 E F0 1.358
-(Sets the data format for the input data.)144 523.2 R(If)6.358 E F3
+(ault color con)-.1 F -.15(ve)-.4 G(n-).15 E(tion.)144 607.2 Q F2<ad46>
+108 624 Q F1(format)24.19 E F0 1.358
+(Sets the data format for the input data.)144 636 R(If)6.358 E F1
 (format)3.858 E F0 3.858(<0)3.858 G 3.858(,t)-3.858 G 1.358
 (hen the input \214le speci\214ed with the)-3.858 F F2<ad49>3.857 E F0
-1.163(option will actually contain a list of input sw)144 535.2 R 1.164
+1.163(option will actually contain a list of input sw)144 648 R 1.164
 (ath sonar data \214les. This program uses the)-.1 F F2(MBIO)3.664 E F0
-1.292(library and will read or write an)144 547.2 R 3.792(ys)-.15 G -.1
+1.292(library and will read or write an)144 660 R 3.792(ys)-.15 G -.1
 (wa)-3.792 G 1.292(th sonar format supported by).1 F F2(MBIO)3.792 E F0
 3.792(.A)C 1.291(list of the sw)-.001 F(ath)-.1 E .39
-(sonar data formats currently supported by)144 559.2 R F2(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15
-(ve)-.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F2(MBIO)2.891 E
-F0(manual page. Def)144 571.2 Q(ault:)-.1 E F3(format)2.5 E F0 2.5<3dad>
-2.5 G(1.)-2.5 E F2<ad47>108 588 Q F3(mode)22.52 E F0 -.45(Tu)144 600 S
+(sonar data formats currently supported by)144 672 R F2(MBIO)2.891 E F0
+.391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15(ve)
+-.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F2(MBIO)2.891 E F0
+(manual page. Def)144 684 Q(ault:)-.1 E F1(format)2.5 E F0 2.5<3dad>2.5
+G(1.)-2.5 E F2<ad47>108 700.8 Q F1(mode)22.52 E F0 -.45(Tu)144 712.8 S
 (rns on color \214ll sw).45 E(ath plot and sets the style of the plot.)
--.1 E F3(mode)180 612 Q F0 2.5(=1)2.5 G 31.92(:C)-2.5 G
-(olor \214ll of bath)-31.92 E(ymetry data.)-.05 E F3(mode)180 624 Q F0
-2.5(=2)2.5 G 31.92(:C)-2.5 G(olor shaded relief bath)-31.92 E(ymetry)
--.05 E(.)-.65 E F3(mode)180 636 Q F0 2.5(=3)2.5 G 31.92(:B)-2.5 G(ath)
--31.92 E(ymetry shaded using amplitude data.)-.05 E F3(mode)180 648 Q F0
-2.5(=4)2.5 G 31.92(:G)-2.5 G(rayscale \214ll of amplitude data.)-31.92 E
-F3(mode)180 660 Q F0 2.5(=5)2.5 G 31.92(:G)-2.5 G
-(rayscale \214ll of sidescan data.)-31.92 E F2<ad48>108 676.8 Q F0 .162
-(This "help" \215ag cause the program to print out a description of its\
- operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 688.8 Q
-(.)-.65 E F2<ad49>108 705.6 Q F3(\214lename)26.41 E F0 .467
-(Sets the input \214lename. If)144 717.6 R F3(format)2.967 E F0 2.967
-(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .468(ath sonar data contained)-.1 F(in)144
-729.6 Q F3(in\214le)2.943 E F0 .443(is read and processed. If)2.943 F F3
-(format)2.943 E F0 2.943(<0\()2.943 G .442(the def)-2.943 F .442
-(ault\), then)-.1 F F3(in\214le)2.942 E F0 .442
-(is assumed to be an ascii \214le)2.942 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
+-.1 E F1(mode)180 724.8 Q F0 2.5(=1)2.5 G 31.92(:C)-2.5 G
+(olor \214ll of bath)-31.92 E(ymetry data.)-.05 E(MB-System 5.0)72 768 Q
+2.5(9J)140.11 G(anuary 2015)-2.5 E(4)198.45 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F .051(containing a list of the input sw)144 84 R
-.052(ath sonar data \214les to be processed and their formats.)-.1 F
-.052(The program)5.052 F .063
-(will read the data in each one of these \214les.)144 96 R .063(In the)
-5.063 F/F1 10/Times-Italic at 0 SF(in\214le)2.563 E F0 .063
+(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Italic at 0 SF(mode)180 84 Q F0 2.5
+(=2)2.5 G 31.92(:C)-2.5 G(olor shaded relief bath)-31.92 E(ymetry)-.05 E
+(.)-.65 E F1(mode)180 96 Q F0 2.5(=3)2.5 G 31.92(:B)-2.5 G(ath)-31.92 E
+(ymetry shaded using amplitude data.)-.05 E F1(mode)180 108 Q F0 2.5(=4)
+2.5 G 31.92(:G)-2.5 G(rayscale \214ll of amplitude data.)-31.92 E F1
+(mode)180 120 Q F0 2.5(=5)2.5 G 31.92(:G)-2.5 G
+(rayscale \214ll of sidescan data.)-31.92 E/F2 10/Times-Bold at 0 SF<ad48>
+108 136.8 Q F0 .162(This "help" \215ag cause the program to print out a\
+ description of its operation and then e)22.52 F .161(xit immedi-)-.15 F
+(ately)144 148.8 Q(.)-.65 E F2<ad49>108 165.6 Q F1(\214lename)26.41 E F0
+.467(Sets the input \214lename. If)144 177.6 R F1(format)2.967 E F0
+2.967(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
+(option\) then the sw)2.967 F .468(ath sonar data contained)-.1 F(in)144
+189.6 Q F1(in\214le)2.943 E F0 .443(is read and processed. If)2.943 F F1
+(format)2.943 E F0 2.943(<0\()2.943 G .442(the def)-2.943 F .442
+(ault\), then)-.1 F F1(in\214le)2.942 E F0 .442
+(is assumed to be an ascii \214le)2.942 F .051
+(containing a list of the input sw)144 201.6 R .052
+(ath sonar data \214les to be processed and their formats.)-.1 F .052
+(The program)5.052 F .063
+(will read the data in each one of these \214les.)144 213.6 R .063
+(In the)5.063 F F1(in\214le)2.563 E F0 .063
 (\214le, each data \214le should be follo)2.563 F .062(wed by a)-.25 F
-(data format identi\214er)144 108 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 120 Q(data\214le2 24)180 132 Q .568
-(This program uses the)144 144 R/F2 10/Times-Bold at 0 SF(MBIO)3.068 E F0
-.568(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)
--3.068 G .568(th sonar format supported by).1 F F2(MBIO)144 156 Q F0
-3.428(.Al)C .928(ist of the sw)-3.428 F .928
+(data format identi\214er)144 225.6 Q 2.5(,e)-.4 G(.g.:)-2.5 E
+(data\214le1 11)180 237.6 Q(data\214le2 24)180 249.6 Q .568
+(This program uses the)144 261.6 R F2(MBIO)3.068 E F0 .568
+(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
+G .568(th sonar format supported by).1 F F2(MBIO)144 273.6 Q F0 3.428
+(.Al)C .928(ist of the sw)-3.428 F .928
 (ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 168 S(lues is gi).25 E
+.928(and their identi\214er)3.428 F -.25(va)144 285.6 S(lues is gi).25 E
 -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page.)2.5 E F2<ad4a>108 184.8 Q F1(pr)25.3 E(ojection)-.45 E F0
+(manual page.)2.5 E F2<ad4a>108 302.4 Q F1(pr)25.3 E(ojection)-.45 E F0
 ([)A F1(/scale | /width)A F0(])A .367
-(Selects the map projection. By def)144 196.8 R .368
+(Selects the map projection. By def)144 314.4 R .368
 (ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.668(to \214t on the selected page size \(see)144 208.8 R F2<ad50>3.168
+.668(to \214t on the selected page size \(see)144 326.4 R F2<ad50>3.168
 E F0 .668(option\). The user may specify a dif)3.168 F .667
 (ferent projection to be)-.25 F .768(used, in which case the plot scale\
  is still automatically chosen to \214t the page. The user may also)144
-220.8 R .034(specify both the projection and the plot scale. If the pro\
-jection specifying character is upper case, a)144 232.8 R 1.508
-(plot width rather than a plot scale is used.)144 244.8 R 1.508
+338.4 R .034(specify both the projection and the plot scale. If the pro\
+jection specifying character is upper case, a)144 350.4 R 1.508
+(plot width rather than a plot scale is used.)144 362.4 R 1.508
 (The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.509
 (gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 256.8 R
-(plot will not \214t on the def)144 268.8 Q
+inches. If the user speci\214es a plot scale such that the)144 374.4 R
+(plot will not \214t on the def)144 386.4 Q
 (ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E F2(CYLINDRICAL PR)144 292.8 Q
-(OJECTIONS:)-.3 E(\255Jc)144 316.8 Q F1(lon0/lat0/scale)A F0
-(\(Cassini\))2.5 E F2(\255Jm)144 328.8 Q F1(scale)A F0(\(Mercator\))2.5
-E F2<ad4a>144 340.8 Q(oa)-.15 E F1(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F2<ad4a>144 352.8 Q
+(ger page size will be chosen.)-.18 E F2(CYLINDRICAL PR)144 410.4 Q
+(OJECTIONS:)-.3 E(\255Jc)144 434.4 Q F1(lon0/lat0/scale)A F0
+(\(Cassini\))2.5 E F2(\255Jm)144 446.4 Q F1(scale)A F0(\(Mercator\))2.5
+E F2<ad4a>144 458.4 Q(oa)-.15 E F1(lon0/lat0/azimuth/scale)A F0
+(\(Oblique Mercator \255 point and azimuth\))2.5 E F2<ad4a>144 470.4 Q
 (ob)-.15 E F1(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F2<ad4a>144 364.8 Q(oc)-.15 E F1
+2.5 E 2.5(op)-.1 G(oints\))-2.5 E F2<ad4a>144 482.4 Q(oc)-.15 E F1
 (lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F2(\255Jq)144 376.8 Q F1
+(\(Oblique Mercator \255 point and pole\))2.5 E F2(\255Jq)144 494.4 Q F1
 (lon0/scale)A F0
 (\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F2
-(\255Jt)144 388.8 Q F1(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2<ad4a>144 400.8 Q(u)-.15 E F1(zone/scale)A F0
+(\255Jt)144 506.4 Q F1(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
+(erse Mercator\))-.15 E F2<ad4a>144 518.4 Q(u)-.15 E F1(zone/scale)A F0
 (\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2(\255Jy)144 412.8 Q F1(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F2(AZIMUTHAL PR)144 436.8 Q
-(OJECTIONS:)-.3 E<ad4a>144 460.8 Q(a)-.15 E F1(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F2<ad4a>144 472.8 Q(e)-.15 E F1(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F2(\255Jg)144 484.8 Q F1(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F2(\255Js)144 496.8 Q F1(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F2(CONIC PR)144 520.8 Q(OJECTIONS:)-.3
-E(\255Jb)144 544.8 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F2(\255Jl)144 556.8 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F2(MISCELLANEOUS PR)144 580.8 Q(OJECTIONS:)-.3 E(\255Jh)144 604.8 Q F1
-(lon0/scale)A F0(\(Hammer\))2.5 E F2(\255Ji)144 616.8 Q F1(lon0/scale)A
-F0(\(Sinusoidal\))2.5 E F2(\255Jk)144 628.8 Q F1(lon0/scale)A F0(\(Eck)
-2.5 E(ert VI\))-.1 E F2(\255Jn)144 640.8 Q F1(lon0/scale)A F0
-(\(Robinson\))2.5 E F2(\255Jr)144 652.8 Q F1(lon0/scale)A F0(\(W)2.5 E
-(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F2(\255Jw)144 664.8 Q F1
-(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F2(NON-GEOGRAPHICAL PR)144
-688.8 Q(OJECTIONS:)-.3 E(\255Jp)144 712.8 Q F1(scale)A F0
-(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F2
-(\255Jx)144 724.8 Q F1(x-scale)A F0([)A F2(l|p)A F1(pow)A F0(][)A F1
-(/y-scale)A F0([)A F2(l|p)A F1(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
-(og, and po)-2.5 E(wer scaling\))-.25 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(5)204.835 E 0 Cg EP
+(erse Mercator\))-.15 E F2(\255Jy)144 530.4 Q F1(lon0/lats/scale)A F0
+(\(Basic Cylindrical Projection\))2.5 E F2(AZIMUTHAL PR)144 554.4 Q
+(OJECTIONS:)-.3 E<ad4a>144 578.4 Q(a)-.15 E F1(lon0/lat0/scale)A F0
+(\(Lambert\).)2.5 E F2<ad4a>144 590.4 Q(e)-.15 E F1(lon0/lat0/scale)A F0
+(\(Equidistant\).)2.5 E F2(\255Jg)144 602.4 Q F1(lon0/lat0/scale)A F0
+(\(Orthographic\).)2.5 E F2(\255Js)144 614.4 Q F1(lon0/lat0/scale)A F0
+(\(General Stereographic\))2.5 E F2(CONIC PR)144 638.4 Q(OJECTIONS:)-.3
+E(\255Jb)144 662.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
+F2(\255Jl)144 674.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
+E F2(MISCELLANEOUS PR)144 698.4 Q(OJECTIONS:)-.3 E(\255Jh)144 722.4 Q F1
+(lon0/scale)A F0(\(Hammer\))2.5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F(More details can be found in the)144 84 Q/F1 10
-/Times-Bold at 0 SF(psbasemap)2.5 E F0(manpages.)2.5 E F1<ad4c>108 100.8 Q
-/F2 10/Times-Italic at 0 SF(title:scalelabel)23.63 E F0 .157(Sets the titl\
-e and the label for the colorscale \(if used\) of the plot. Note that a\
- colon \(:\) rather than a)144 112.8 R 1.557(slash \(/\) is used to sep\
-arate the labels. Colons cannot be used in the labels themselv)144 124.8
-R 1.557(es. If this)-.15 F 1.367(option is not used, then a def)144
-136.8 R 1.367(ault title and colorscale label are pro)-.1 F 1.367
-(vided. If the title is supplied)-.15 F .742(alone, a def)144 148.8 R
+(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255Ji)144 84 Q/F2 10
+/Times-Italic at 0 SF(lon0/scale)A F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 96
+Q F2(lon0/scale)A F0(\(Eck)2.5 E(ert VI\))-.1 E F1(\255Jn)144 108 Q F2
+(lon0/scale)A F0(\(Robinson\))2.5 E F1(\255Jr)144 120 Q F2(lon0/scale)A
+F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1(\255Jw)144 132 Q F2
+(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144
+156 Q(OJECTIONS:)-.3 E(\255Jp)144 180 Q F2(scale)A F0
+(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
+(\255Jx)144 192 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
+(/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
+(og, and po)-2.5 E(wer scaling\))-.25 E
+(More details can be found in the)144 204 Q F1(psbasemap)2.5 E F0
+(manpages.)2.5 E F1<ad4c>108 220.8 Q F2(title:scalelabel)23.63 E F0 .157
+(Sets the title and the label for the colorscale \(if used\) of the plo\
+t. Note that a colon \(:\) rather than a)144 232.8 R 1.557(slash \(/\) \
+is used to separate the labels. Colons cannot be used in the labels the\
+mselv)144 244.8 R 1.557(es. If this)-.15 F 1.367
+(option is not used, then a def)144 256.8 R 1.367
+(ault title and colorscale label are pro)-.1 F 1.367
+(vided. If the title is supplied)-.15 F .742(alone, a def)144 268.8 R
 .742(ault colorscale label will be pro)-.1 F .742(vided. T)-.15 F 3.242
 (of)-.8 G .742(orce no title use)-3.242 F F1<ad4c>3.241 E F0 3.241("")C
 3.241(;t)-3.241 G 3.241(of)-3.241 G .741(orce no title or)-3.241 F
-(colorscale label use)144 160.8 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
-<ad4d>108 177.6 Q F0 3.055(As)20.86 G .555
+(colorscale label use)144 280.8 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
+<ad4d>108 297.6 Q F0 3.055(As)20.86 G .555
 (eries of "miscellaneous" options are pro)-3.055 F .555
 (vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055 E F1
 <ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1 G
-(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 189.6 R 3.829(,f)-.4
+(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 309.6 R 3.829(,f)-.4
 G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
 (ther parameters associated with that option.)-3.829 F(The)6.328 E F1
 <ad4d>3.828 E F0(options)3.828 E .61(may be strung together separated b\
-y colons, e.g. "-MGQ100:GU", which is equi)144 201.6 R -.25(va)-.25 G
-.61(lent to "-MGQ).25 F(\255MGU".)144 213.6 Q F1(\255MGD)108 230.4 Q F2
-(gmtdef/value)5.86 E F0(Allo)144 242.4 Q .227(ws the user to set the)
+y colons, e.g. "-MGQ100:GU", which is equi)144 321.6 R -.25(va)-.25 G
+.61(lent to "-MGQ).25 F(\255MGU".)144 333.6 Q F1(\255MGD)108 350.4 Q F2
+(gmtdef/value)5.86 E F0(Allo)144 362.4 Q .227(ws the user to set the)
 -.25 F F1(GMT)2.727 E F0(def)2.727 E .227(ault v)-.1 F .227
 (alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 254.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
+(be gi)144 374.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
 (epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
 1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 266.4
+(xample, to set the basemap)-.15 F(annotation font to Courier)144 386.4
 Q 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGF)108 283.2 Q F2(scale_loc)6.97 E F0
-(Sets the location of the color scale. The possible v)144 295.2 Q
-(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 307.2
+(\255MGF)108 403.2 Q F2(scale_loc)6.97 E F0
+(Sets the location of the color scale. The possible v)144 415.2 Q
+(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 427.2
 Q F0 2.5(=b)2.5 G 15.81(:b)-2.5 G(ottom of plot)-15.81 E F2(scale_loc)
-180 319.2 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
-(scale_loc)180 331.2 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
--18.03 E F2(scale_loc)180 343.2 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
-(ight of plot)-17.48 E([Def)144 355.2 Q(ault)-.1 E F2(scale_loc)2.5 E F0
-2.5(=b)2.5 G(])-2.5 E F1(\255MGL)108 372 Q F0([)6.41 E F2(f)A F0(][)A F2
-(x)A F0(])A F2(lon0/lat0/slat/length)A F0([)A F2(m)A F0(])A(Dra)144 384
-Q 1.44(ws a simple map scale centered on)-.15 F F2(lon0/lat0)3.94 E F0
-6.44(.U)C(se)-6.44 E F1(\255Lx)3.94 E F0 1.44
-(to specify position in inch instead.)3.94 F 1.333
-(Scale is calculated at latitude)144 396 R F2(slat)3.833 E F0(,)A F2
-(length)3.833 E F0 1.333(is in km [miles if m is appended].)3.833 F(Use)
-6.333 E F1(\255Lf)3.833 E F0 1.334(to get a)3.834 F("f)144 408 Q(anc)-.1
-E(y" scale [Def)-.15 E(ault is plain].)-.1 E F1(\255MGQ)108 424.8 Q F2
-(dpi)5.3 E F0 .839(Sets the resolution in dots per inch of the raster i\
-mage used for color \214ll maps. Lar)144 436.8 R .838(ger v)-.18 F .838
-(alues of)-.25 F F2(dpi)144 448.8 Q F0(produce lar)2.5 E
-(ger Postscript plot \214les. [Def)-.18 E(ault is 100].)-.1 E F1
-(\255MGT)108 465.6 Q F2(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0
-.487(Causes a te)144 477.6 R .487(xt label to plotted on the map.)-.15 F
-F2(size)5.487 E F0 .487(is te)2.987 F .488(xt size in points,)-.15 F F2
-(angle)2.988 E F0 .488(is measured in de)2.988 F(grees)-.15 E(counter)
-144 489.6 Q .8(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
+180 439.2 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
+(scale_loc)180 451.2 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
+-18.03 E F2(scale_loc)180 463.2 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
+(ight of plot)-17.48 E([Def)144 475.2 Q(ault)-.1 E F2(scale_loc)2.5 E F0
+2.5(=b)2.5 G(])-2.5 E F1(\255MGL)108 492 Q F0([)6.41 E F2(f)A F0(][)A F2
+(x)A F0(])A F2(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2
+(+llabel)A F0(])A(Dra)144 504 Q .16(ws a simple map scale centered on)
+-.15 F F2(lon0/lat0)2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0
+.16(to get a "f)2.66 F(anc)-.1 E .16(y" scale [Def)-.15 F .16
+(ault is plain].)-.1 F(Use)144 516 Q F1(\255Lx)2.961 E F0 .461
+(to specify the position in inches instead of map units.)2.961 F .462
+(The scale is calculated at latitude)5.461 F F2(slat)144 528 Q F0 2.929
+(;i)C 2.929(ft)-2.929 G .429
+(he string "center" is used instead of a numerical v)-2.929 F .428
+(alue for)-.25 F F2(slat)2.928 E F0 2.928(,t)C .428
+(hen the macro will set the)-2.928 F 1.596
+(scaling according to the center of the plot bounds.)144 540 R 1.596
+(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.596
+(is in km by)4.096 F(def)144 552 Q .279(ault, b)-.1 F .278(ut the units\
+ can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet, \
+k = kilome-)-.2 F .911
+(ters, M = statue miles, n = nautical miles, and u = US surv)144 564 R
+1.212 -.15(ey f)-.15 H .912(eet. Append).15 F F2(+l)3.412 E F0 .912
+(to label the scale)3.412 F(with the rele)144 576 Q -.25(va)-.25 G
+(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
+(ferent label string.)-.25 E F1(\255MGQ)108 592.8 Q F2(dpi)5.3 E F0 .839
+(Sets the resolution in dots per inch of the raster image used for colo\
+r \214ll maps. Lar)144 604.8 R .838(ger v)-.18 F .838(alues of)-.25 F F2
+(dpi)144 616.8 Q F0(produce lar)2.5 E(ger Postscript plot \214les. [Def)
+-.18 E(ault is 100].)-.1 E F1(\255MGT)108 633.6 Q F2
+(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .487(Causes a te)144
+645.6 R .487(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0
+.487(is te)2.987 F .488(xt size in points,)-.15 F F2(angle)2.988 E F0
+.488(is measured in de)2.988 F(grees)-.15 E(counter)144 657.6 Q .8
+(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
 (sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
 3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.614(starts with a leading h)144
-501.6 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
+669.6 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
 1.615(is tak)4.115 F 1.615(en to be a te)-.1 F 1.615(xtstring with the)
--.15 F 1.023(desired fontname.)144 513.6 R 1.022(See the)6.023 F F1
+-.15 F 1.023(desired fontname.)144 681.6 R 1.022(See the)6.023 F F1
 (gmtdefaults)3.522 E F0 1.022(man page for names and numbers of a)3.522
-F -.25(va)-.2 G 1.022(ilable fonts \(or).25 F(run)144 525.6 Q F1 .111
+F -.25(va)-.2 G 1.022(ilable fonts \(or).25 F(run)144 693.6 Q F1 .111
 (pstext \255L)2.611 F F0 2.611(\). The)B .111
 (alignment number refers to the part of the te)2.611 F .112
-(xtstring that will be mapped onto)-.15 F .29(the \()144 537.6 R F2(x,y)
+(xtstring that will be mapped onto)-.15 F .29(the \()144 705.6 R F2(x,y)
 A F0 2.79(\)p)C .289(oint: 1 = Lo)-2.79 F .289(wer Left corner)-.25 F
 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789(,3=L)-.4 G
 -.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F(Center)144
-549.6 Q 2.783(,7=M)-.4 G .283
+717.6 Q 2.783(,7=M)-.4 G .283
 (id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
 2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-561.6 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
-G(imes as needed.)-2.5 E F1(\255MGU)108 578.4 Q F0([)5.86 E F2(/dx/dy/)A
-F0(][)A F2(label)A F0(])A(Dra)144 590.4 Q 2.636(wU)-.15 G .136
-(nix System time stamp on plot.)-2.636 F .135
-(User may specify where the lo)5.135 F .135
-(wer left corner of the stamp)-.25 F 1.925(should f)144 602.4 R 1.925
+729.6 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
+G(imes as needed.)-2.5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(6)198.45 E 0 Cg EP
+%%Page: 7 7
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
+(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MGU)108 84 Q F0([)
+5.86 E/F2 10/Times-Italic at 0 SF(/dx/dy/)A F0(][)A F2(label)A F0(])A(Dra)
+144 96 Q 2.636(wU)-.15 G .136(nix System time stamp on plot.)-2.636 F
+.135(User may specify where the lo)5.135 F .135
+(wer left corner of the stamp)-.25 F 1.925(should f)144 108 R 1.925
 (all on the page relati)-.1 F 2.225 -.15(ve t)-.25 H 4.426(ol).15 G -.25
 (ow)-4.426 G 1.926(er left corner of plot in inch [Def).25 F 1.926
-(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 614.4 Q 2.5(,a)-.65 G
+(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 120 Q 2.5(,a)-.65 G
 (ppend a label, or)-2.5 E F1(c)2.5 E F0
-(\(which will plot the command string.\))2.5 E F1(\255MMA)108 631.2 Q F2
-(factor/mode/depth)A F0 1.215(This option determines ho)144 643.2 R
+(\(which will plot the command string.\))2.5 E F1(\255MMA)108 136.8 Q F2
+(factor/mode/depth)A F0 1.215(This option determines ho)144 148.8 R
 3.715(wt)-.25 G 1.214(he along-track dimension of the beam or pix)-3.715
-F 1.214(el footprints is calcu-)-.15 F 1.762(lated. If)144 655.2 R F2
+F 1.214(el footprints is calcu-)-.15 F 1.762(lated. If)144 160.8 R F2
 (mode)4.262 E F0 4.262(=1)4.262 G 4.262(,t)-4.262 G 1.762(hen the fore-\
 aft beam angle width of the sonar is used so that the width)-4.262 F
-.403(increases to)144 667.2 R -.1(wa)-.25 G .403
+.403(increases to)144 172.8 R -.1(wa)-.25 G .403
 (rds the outer parts of the sw).1 F 2.903(ath. The)-.1 F .403
 (fore-aft beam angle width \()2.903 F F1(MB-System)A F0(inter)2.902 E(-)
--.2 E .529(nally stores a v)144 679.2 R .529
+-.2 E .529(nally stores a v)144 184.8 R .529
 (alue for each format/sonar\) is multiplied by the)-.25 F F2(factor)3.03
 E F0 -.25(va)3.03 G .53(lue; a).25 F F2(factor)3.03 E F0 3.03(<1)3.03 G
-.53(.0 can be)-3.03 F .388(useful if the data highly o)144 691.2 R -.15
+.53(.0 can be)-3.03 F .388(useful if the data highly o)144 196.8 R -.15
 (ve)-.15 G .388(rsamples the sea\215oor and a).15 F F2(factor)2.888 E F0
 2.888(>1)2.888 G .388(.0 can \214ll in plots of data which)-2.888 F .064
-(undersample the sea\215oor)144 703.2 R 2.564(.I)-.55 G 2.564(ft)-2.564
+(undersample the sea\215oor)144 208.8 R 2.564(.I)-.55 G 2.564(ft)-2.564
 G .064(he data stream does not include depth v)-2.564 F .065
 (alues \(e.g. one is plotting pure)-.25 F 1.019
-(sidescan data\), then the)144 715.2 R F2(depth)3.518 E F0 -.25(va)3.518
+(sidescan data\), then the)144 220.8 R F2(depth)3.518 E F0 -.25(va)3.518
 G 1.018(lue sets the depth v).25 F 1.018
 (alue in meters used in the footprint calcula-)-.25 F 2.515(tions. If)
-144 727.2 R F2(mode)2.515 E F0 2.515(=2)2.515 G 2.515(,t)-2.515 G .015
+144 232.8 R F2(mode)2.515 E F0 2.515(=2)2.515 G 2.515(,t)-2.515 G .015
 (hen the along-track dimension of the beam or pix)-2.515 F .015
-(el footprints is just the along-)-.15 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(6)204.835 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F .627
-(track distance between pings multiplied by the)144 84 R/F1 10
-/Times-Italic at 0 SF(factor)3.127 E F0 -.25(va)3.127 G 3.127(lue. If).25 F
-.627(mode = 3, then each data point is)3.127 F .424
-(plotted as a point, and the f)144 96 R .425
+(el footprints is just the along-)-.15 F .627
+(track distance between pings multiplied by the)144 244.8 R F2(factor)
+3.127 E F0 -.25(va)3.127 G 3.127(lue. If).25 F .627
+(mode = 3, then each data point is)3.127 F .424
+(plotted as a point, and the f)144 256.8 R .425
 (actor and depth parameters are ignored.)-.1 F(Def)5.425 E(ault:)-.1 E
-F1(factor)2.925 E F0 2.925(=1)2.925 G(.0,)-2.925 E F1(mode)2.925 E F0(=)
-2.925 E(1,)144 108 Q F1(depth)2.5 E F0 2.5(=3)2.5 G(000.0.)-2.5 E/F2 10
-/Times-Bold at 0 SF(\255MMB)108 124.8 Q F1(yr/mo/da/hr/mn/sc)A F0 .614
-(Sets the starting time for data allo)144 136.8 R .614
+F2(factor)2.925 E F0 2.925(=1)2.925 G(.0,)-2.925 E F2(mode)2.925 E F0(=)
+2.925 E(1,)144 268.8 Q F2(depth)2.5 E F0 2.5(=3)2.5 G(000.0.)-2.5 E F1
+(\255MMB)108 285.6 Q F2(yr/mo/da/hr/mn/sc)A F0 .614
+(Sets the starting time for data allo)144 297.6 R .614
 (wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 148.8 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2(\255MMD)108 165.6 Q F1
+(will be ignored.)144 309.6 Q(Def)5 E(ault:)-.1 E F2(yr/mo/da/hr/mn/sc)
+2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F1(\255MMD)108 326.4 Q F2
 (mode/scale[/min/max])A F0 .875
-(Sets scaling of beam amplitude or sidescan pix)144 177.6 R .875(el v)
--.15 F .876(alues which can be applied before plotting. If)-.25 F F1
-(mode)144 189.6 Q F0 2.5(=1o)2.5 G 2.5(r2)-2.5 G 2.5(,t)-2.5 G
-(hen a linear scaling of the form:)-2.5 E(scaled_v)180 201.6 Q
+(Sets scaling of beam amplitude or sidescan pix)144 338.4 R .875(el v)
+-.15 F .876(alues which can be applied before plotting. If)-.25 F F2
+(mode)144 350.4 Q F0 2.5(=1o)2.5 G 2.5(r2)-2.5 G 2.5(,t)-2.5 G
+(hen a linear scaling of the form:)-2.5 E(scaled_v)180 362.4 Q
 (alue = scale * \(v)-.25 E(alue \255 min\) / \(max \255 min\))-.25 E
-(is applied.)144 213.6 Q(If)5 E F1(mode)2.5 E F0 2.5(=3o)2.5 G 2.5(r4)
+(is applied.)144 374.4 Q(If)5 E F2(mode)2.5 E F0 2.5(=3o)2.5 G 2.5(r4)
 -2.5 G 2.5(,t)-2.5 G(hen a log10 scaling of the form:)-2.5 E(scaled_v)
-180 225.6 Q(alue = scale * \(20 * log10\(v)-.25 E
-(alue\) \255 min\) / \(max \255 min\))-.25 E 1.143(is applied.)144 237.6
-R(If)6.143 E F1(mode)3.643 E F0 3.643(=2o)3.643 G 3.643(r4)-3.643 G
+180 386.4 Q(alue = scale * \(20 * log10\(v)-.25 E
+(alue\) \255 min\) / \(max \255 min\))-.25 E 1.143(is applied.)144 398.4
+R(If)6.143 E F2(mode)3.643 E F0 3.643(=2o)3.643 G 3.643(r4)-3.643 G
 3.643(,t)-3.643 G 1.143(hen the v)-3.643 F 1.142(alue \(or 20*log10\(v)
--.25 F 1.142(alue\)\) will be clipped to)-.25 F F1(min)3.642 E F0 1.142
-(if it is)3.642 F .501(smaller than)144 249.6 R F1(min)3.001 E F0(or)
-3.001 E F1(max)3.001 E F0 .502(if it is greater than)3.002 F F1(max)
+-.25 F 1.142(alue\)\) will be clipped to)-.25 F F2(min)3.642 E F0 1.142
+(if it is)3.642 F .501(smaller than)144 410.4 R F2(min)3.001 E F0(or)
+3.001 E F2(max)3.001 E F0 .502(if it is greater than)3.002 F F2(max)
 3.002 E F0 3.002(;t)C .502
-(his clipping happens prior to the multiplication)-3.002 F(by)144 261.6
-Q F1(scale)2.5 E F0 2.5(.D)C(ef)-2.5 E(ault:)-.1 E F1(mode)2.5 E F0 2.5
-(=1)2.5 G(,)-2.5 E F1(scale)2.5 E F0 2.5(=1)2.5 G(.0,)-2.5 E F1(min)2.5
-E F0 2.5(=0)2.5 G(.0,)-2.5 E F1(max)2.5 E F0 2.5(=1)2.5 G(.0.)-2.5 E F2
-(\255MME)108 278.4 Q F1(yr/mo/da/hr/mn/sc)A F0 .287
-(Sets the ending time for data allo)144 290.4 R .287
+(his clipping happens prior to the multiplication)-3.002 F(by)144 422.4
+Q F2(scale)2.5 E F0 2.5(.D)C(ef)-2.5 E(ault:)-.1 E F2(mode)2.5 E F0 2.5
+(=1)2.5 G(,)-2.5 E F2(scale)2.5 E F0 2.5(=1)2.5 G(.0,)-2.5 E F2(min)2.5
+E F0 2.5(=0)2.5 G(.0,)-2.5 E F2(max)2.5 E F0 2.5(=1)2.5 G(.0.)-2.5 E F1
+(\255MME)108 439.2 Q F2(yr/mo/da/hr/mn/sc)A F0 .287
+(Sets the ending time for data allo)144 451.2 R .287
 (wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 302.4 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2(\255MML)108 319.2 Q F1
-(lon\215ip)A F0 .05(If the)144 331.2 R F2<ad52>2.55 E F0 .05
+F(be ignored.)144 463.2 Q(Def)5 E(ault:)-.1 E F2(yr/mo/da/hr/mn/sc)2.5 E
+F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F1(\255MML)108 480 Q F2
+(lon\215ip)A F0 .05(If the)144 492 R F1<ad52>2.55 E F0 .05
 (option is not used to e)2.55 F .05
-(xplicitly set the plot bounds, then the)-.15 F F1(lon\215ip)2.55 E F0
+(xplicitly set the plot bounds, then the)-.15 F F2(lon\215ip)2.55 E F0
 -.25(va)2.55 G .05(lue sets the range of).25 F 1.197(the longitude v)144
-343.2 R 1.197(alues used for calculating the desired bounds.)-.25 F
-3.697(If lon\215ip=\2551)6.197 F 3.697(then the longitude)3.697 F -.25
-(va)144 355.2 S .655(lues will be in the range from \255360 to 0 de).25
-F .656(grees. If lon\215ip=0 then the longitude v)-.15 F .656
-(alues will be)-.25 F 2.772(in the)144 367.2 R 2.772(range from)2.772 F
-.272(\255180 to 180 de)2.772 F .272
+504 R 1.197(alues used for calculating the desired bounds.)-.25 F 3.697
+(If lon\215ip=\2551)6.197 F 3.697(then the longitude)3.697 F -.25(va)144
+516 S .655(lues will be in the range from \255360 to 0 de).25 F .656
+(grees. If lon\215ip=0 then the longitude v)-.15 F .656(alues will be)
+-.25 F 2.772(in the)144 528 R 2.772(range from)2.772 F .272
+(\255180 to 180 de)2.772 F .272
 (grees. If lon\215ip=1 then the longitude v)-.15 F .271
-(alues will be in the range)-.25 F(from 0)144 379.2 Q 2.5(to 360 de)5 F
-5(grees. Def)-.15 F(ault:)-.1 E F2(mbm_plot)2.5 E F0(uses the)2.5 E F1
-(lon\215ip)2.5 E F0 -.25(va)2.5 G(lue set by).25 E F2(mbdefaults)2.5 E
-F0(.)A F2(\255MMN)108 396 Q F1(nplot)A F0 .586(Sets the number of pings\
- to be read in before each contouring episode. See the description of t\
-he)144 408 R F2(\255MMZ)144 420 Q F1(algorithm)A F0 1.126
+(alues will be in the range)-.25 F(from 0)144 540 Q 2.5(to 360 de)5 F 5
+(grees. Def)-.15 F(ault:)-.1 E F1(mbm_plot)2.5 E F0(uses the)2.5 E F2
+(lon\215ip)2.5 E F0 -.25(va)2.5 G(lue set by).25 E F1(mbdefaults)2.5 E
+F0(.)A F1(\255MMN)108 556.8 Q F2(nplot)A F0 .586(Sets the number of pin\
+gs to be read in before each contouring episode. See the description of\
+ the)144 568.8 R F1(\255MMZ)144 580.8 Q F2(algorithm)A F0 1.126
 (option for advice on reasonable v)3.626 F 1.125(alues Def)-.25 F(ault:)
--.1 E F1(nplot)3.625 E F0 3.625(=5)3.625 G 3.625(0u)-3.625 G(nless)
--3.625 E F2(\255MMZ)3.625 E F1(1)A F0(is)3.625 E
-(speci\214ed, in which case the def)144 432 Q(ault is)-.1 E F1(nplot)2.5
-E F0 2.5(=5)2.5 G(.)-2.5 E F2(\255MMP)108 448.8 Q F1(pings)A F0 .498
-(Sets the ping a)144 460.8 R -.15(ve)-.2 G .498(raging of the input sw)
-.15 F .498(ath sonar data. If)-.1 F F1(pings)2.998 E F0 2.999(=1)2.999 G
+-.1 E F2(nplot)3.625 E F0 3.625(=5)3.625 G 3.625(0u)-3.625 G(nless)
+-3.625 E F1(\255MMZ)3.625 E F2(1)A F0(is)3.625 E
+(speci\214ed, in which case the def)144 592.8 Q(ault is)-.1 E F2(nplot)
+2.5 E F0 2.5(=5)2.5 G(.)-2.5 E F1(\255MMP)108 609.6 Q F2(pings)A F0 .498
+(Sets the ping a)144 621.6 R -.15(ve)-.2 G .498(raging of the input sw)
+.15 F .498(ath sonar data. If)-.1 F F2(pings)2.998 E F0 2.999(=1)2.999 G
 2.999(,t)-2.999 G .499(hen no ping a)-2.999 F -.15(ve)-.2 G .499
-(raging is per).15 F(-)-.2 E .212(formed. If)144 472.8 R F1(pings)2.712
+(raging is per).15 F(-)-.2 E .212(formed. If)144 633.6 R F2(pings)2.712
 E F0 2.712(>0)2.712 G 2.712(,t)-2.712 G .212
 (hen that number of input pings will be a)-2.712 F -.15(ve)-.2 G .211
-(raged to produce one output ping.).15 F(If)144 484.8 Q F1(pings)2.871 E
+(raged to produce one output ping.).15 F(If)144 645.6 Q F2(pings)2.871 E
 F0 2.871(=0)2.871 G 2.871(,t)-2.871 G .372(hen the ping a)-2.871 F -.15
 (ve)-.2 G .372
 (raging will automatically be done so that the along-track ping spac-)
-.15 F(ing is equal to the across-track beam spacing.)144 496.8 Q(Def)5 E
-(ault:)-.1 E F1(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)
--.2 G(raging\).).15 E F2(\255MMS)108 513.6 Q F1(speedmin)A F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 525.6 R
+.15 F(ing is equal to the across-track beam spacing.)144 657.6 Q(Def)5 E
+(ault:)-.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)
+-.2 G(raging\).).15 E F1(\255MMS)108 674.4 Q F2(speedmin)A F0 .532
+(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 686.4 R
 .531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be processed. Def)144 537.6 Q(ault:)
--.1 E F1(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F2(\255MMT)108 554.4 Q F1
-(time)144 566.4 Q(gap)-.4 E F0 .478(Sets the maximum time g)144 578.4 R
-.479(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 590.4 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F1(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F2(\255MMZ)108 607.2 Q F1(algorithm)144 619.2 Q F0
-2.487(Sets the contouring algorithm to be used. If)144 631.2 R F1
+(with a smaller ship speed will not be processed. Def)144 698.4 Q(ault:)
+-.1 E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E(MB-System 5.0)72 768 Q 2.5
+(9J)140.11 G(anuary 2015)-2.5 E(7)198.45 E 0 Cg EP
+%%Page: 8 8
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
+(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MMT)108 84 Q/F2 10
+/Times-Italic at 0 SF(time)144 96 Q(gap)-.4 E F0 .478
+(Sets the maximum time g)144 108 R .479
+(ap in minutes between adjacent pings allo)-.05 F .479
+(wed before the data is consid-)-.25 F(ered to ha)144 120 Q .3 -.15
+(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
+(=1)2.5 G(.)-2.5 E F1(\255MMZ)108 136.8 Q F2(algorithm)144 148.8 Q F0
+2.487(Sets the contouring algorithm to be used. If)144 160.8 R F2
 (algorithm)4.986 E F0 2.486(=0, a simple ping to ping contouring)B .885
-(approach is used; this algorithm is f)144 643.2 R .885(ast b)-.1 F .886
+(approach is used; this algorithm is f)144 172.8 R .885(ast b)-.1 F .886
 (ut produces poor looking contours when used with data)-.2 F .377
-(where beams from one ping may lie "behind" beams from pre)144 655.2 R
+(where beams from one ping may lie "behind" beams from pre)144 184.8 R
 .376(vious pings \(this happens for sonars)-.25 F .355(that ping at non\
-null pitch angles or for the "inside" beams when ships mak)144 667.2 R
-2.856(es)-.1 G .356(harp turns\).)-2.856 F(If)5.356 E F1(algo-)2.856 E
-(rithm)144 679.2 Q F0 .473(=1 then a triangular netw)B .472
+null pitch angles or for the "inside" beams when ships mak)144 196.8 R
+2.856(es)-.1 G .356(harp turns\).)-2.856 F(If)5.356 E F2(algo-)2.856 E
+(rithm)144 208.8 Q F0 .473(=1 then a triangular netw)B .472
 (ork is constructed from the a)-.1 F -.25(va)-.2 G .472
 (ilable soundings and this netw).25 F .472(ork is)-.1 F .837
-(in turn contoured; this algorithm is slo)144 691.2 R 3.337(wb)-.25 G
+(in turn contoured; this algorithm is slo)144 220.8 R 3.337(wb)-.25 G
 .838(ut produces good looking contours in most cases. It is)-3.537 F
 .915(important to note that the time required for "triangle" algorithm \
-increases with the square of the)144 703.2 R .804
-(number of beams to be contoured; thus it is sensible to k)144 715.2 R
+increases with the square of the)144 232.8 R .804
+(number of beams to be contoured; thus it is sensible to k)144 244.8 R
 .805(eep the number of pings contoured at a)-.1 F .395
-(time small \(e.g. use)144 727.2 R F2<ad4e>2.895 E F1(5)A F0 2.895
+(time small \(e.g. use)144 256.8 R F1<ad4e>2.895 E F2(5)A F0 2.895
 (\). The)B .395(time required for the "ping to ping" algorithm v)2.895 F
-.395(aries linearly with)-.25 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(7)204.835 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F 1.138(the number of pings contoured; thus lar)
-144 84 R 1.139(ger numbers of pings may be reasonably contoured at a)
--.18 F(time \(e.g. use)144 96 Q/F1 10/Times-Bold at 0 SF<ad4e>2.5 E/F2 10
-/Times-Italic at 0 SF(50)A F0 2.5(\). Def)B(ault:)-.1 E F2(algorithm)2.5 E
-F0 2.5(=0u)2.5 G(nless)-2.5 E F2(format)2.5 E F0 2.5(=4)2.5 G(1.)-2.5 E
-F1(\255MN)108 112.8 Q(A)-.2 E F2([nhgt[/P] | P])6.62 E F0 -.45(Tu)144
-124.8 S .427(rns on \214lename annotation of na).45 F(vig)-.2 E .427
+.395(aries linearly with)-.25 F 1.138
+(the number of pings contoured; thus lar)144 268.8 R 1.139
+(ger numbers of pings may be reasonably contoured at a)-.18 F
+(time \(e.g. use)144 280.8 Q F1<ad4e>2.5 E F2(50)A F0 2.5(\). Def)B
+(ault:)-.1 E F2(algorithm)2.5 E F0 2.5(=0u)2.5 G(nless)-2.5 E F2(format)
+2.5 E F0 2.5(=4)2.5 G(1.)-2.5 E F1(\255MN)108 297.6 Q(A)-.2 E F2
+([nhgt[/P] | P])6.62 E F0 -.45(Tu)144 309.6 S .427
+(rns on \214lename annotation of na).45 F(vig)-.2 E .427
 (ation tracks. If)-.05 F F1(\255MN)2.926 E(A)-.2 E F0 .426(is gi)2.926 F
 -.15(ve)-.25 G 2.926(nw).15 G .426(ithout specifying an)-2.926 F 2.926
 (yc)-.15 G(on-)-2.926 E .68
-(trolling parameters, then the lettering height)144 136.8 R F2(nhgt)
+(trolling parameters, then the lettering height)144 321.6 R F2(nhgt)
 3.181 E F0 .681(is 0.15 and the \214lenames are plotted parallel to)
-3.181 F .795(the na)144 148.8 R(vig)-.2 E .794(ation track from the sta\
+3.181 F .795(the na)144 333.6 R(vig)-.2 E .794(ation track from the sta\
 rt of the track. The lettering height can be speci\214ed using either)
--.05 F F1(\255MN)144 160.8 Q(A)-.2 E F2(nhgt)A F0(or)2.896 E F1(\255MN)
+-.05 F F1(\255MN)144 345.6 Q(A)-.2 E F2(nhgt)A F0(or)2.896 E F1(\255MN)
 2.897 E(A)-.2 E F2(nhgt/P)A F0 5.397(.I)C(f)-5.397 E F1(\255MN)2.897 E
 (A)-.2 E F2(P)A F0(or)2.897 E F1(\255MN)2.897 E(A)-.2 E F2(nhgt/P)A F0
 .397(is speci\214ed, the \214lename will be plot-)2.897 F .401
-(ted perpendicular to the na)144 172.8 R(vig)-.2 E .401(ation track.)
+(ted perpendicular to the na)144 357.6 R(vig)-.2 E .401(ation track.)
 -.05 F .401(Filename annotation can also be speci\214ed using the)5.401
-F F1<ad4e>2.9 E F0 2.5(option. Def)144 184.8 R
-(aults: Filename annotation of)-.1 E(f.)-.25 E F1(\255MNP)108 201.6 Q F2
+F F1<ad4e>2.9 E F0 2.5(option. Def)144 369.6 R
+(aults: Filename annotation of)-.1 E(f.)-.25 E F1(\255MNP)108 386.4 Q F2
 ([pingnumber_tic)7.53 E(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len])
--.2 E F0 -.45(Tu)144 213.6 S 1.421
+-.2 E F0 -.45(Tu)144 398.4 S 1.421
 (rns on ping number \(or shot number\) annotation of na).45 F(vig)-.2 E
 1.421(ation tracks.)-.05 F -.35(Ti)6.421 G 1.421(ck marks are made).35 F
-.288(along the shiptrack at)144 225.6 R F2(pingnumber_tic)2.787 E(k)-.2
+.288(along the shiptrack at)144 410.4 R F2(pingnumber_tic)2.787 E(k)-.2
 E F0(interv)2.787 E .287(als; these are)-.25 F F2(tlen)2.787 E F0 .287
 (inches long. Longer tick marks are)2.787 F 1.744
-(made along the shiptrack at)144 237.6 R F2(pingnumber_annot)4.244 E F0
+(made along the shiptrack at)144 422.4 R F2(pingnumber_annot)4.244 E F0
 (interv)4.245 E 1.745(als; these are 1.5 times)-.25 F F2(tlen)4.245 E F0
-1.745(inches long.)4.245 F(Def)144 249.6 Q .34
+1.745(inches long.)4.245 F(Def)144 434.4 Q .34
 (aults: Pingnumber annotation of)-.1 F .34(f. If the)-.25 F F1(\255MNP)
 2.84 E F0 .34(option is gi)2.84 F -.15(ve)-.25 G 2.84(nw).15 G .34
 (ithout specifying the control-)-2.84 F .766(ling parameters, then)144
-261.6 R F2(pingnumber_tic)3.266 E(k)-.2 E F0 3.266(=5)3.266 G(0,)-3.266
+446.4 R F2(pingnumber_tic)3.266 E(k)-.2 E F0 3.266(=5)3.266 G(0,)-3.266
 E F2(pingnumber_annot)3.266 E F0 3.266(=1)3.266 G .766(00, and)-3.266 F
-F2(pingnumber_tic)3.266 E(k_len)-.2 E F0 2.5(=0)144 273.6 S(.1.)-2.5 E
-F1(\255MTC)108 290.4 Q F2(\214ll)6.97 E F0 2.235
-(Coastline plotting option.)144 302.4 R 2.234(Set the shade \(0-255\), \
+F2(pingnumber_tic)3.266 E(k_len)-.2 E F0 2.5(=0)144 458.4 S(.1.)-2.5 E
+F1(\255MTC)108 475.2 Q F2(\214ll)6.97 E F0 2.235
+(Coastline plotting option.)144 487.2 R 2.234(Set the shade \(0-255\), \
 color \(r/g/b\), or pattern \(p|Pdpi/pattern; see)7.234 F F1(\255MTG)144
-314.4 Q F0 2.5(\)f)C(or lak)-2.5 E 2.5(es [Def)-.1 F
+499.2 Q F0 2.5(\)f)C(or lak)-2.5 E 2.5(es [Def)-.1 F
 (ault is the \214ll chosen for "wet" areas \(-S\)].)-.1 E F1(\255MTD)108
-331.2 Q F2 -.37(re)6.97 G(solution).37 E F0 1.62
-(Coastline plotting option.)144 343.2 R 1.621(Selects the resolution of\
- the coastline data set to use \(\(f\)ull, \(h\)igh,)6.62 F .694
-(\(i\)ntermediate, \(1\)o)144 355.2 R 1.994 -.65(w, a)-.25 H .694
+516 Q F2 -.37(re)6.97 G(solution).37 E F0 1.62
+(Coastline plotting option.)144 528 R 1.621(Selects the resolution of t\
+he coastline data set to use \(\(f\)ull, \(h\)igh,)6.62 F .694
+(\(i\)ntermediate, \(1\)o)144 540 R 1.994 -.65(w, a)-.25 H .694
 (nd \(c\)rude\).).65 F .694(The resolution drops of)5.694 F 3.194(fb)
 -.25 G 3.194(y8)-3.194 G .694(0% between data sets. [Def)-3.194 F(ault)
--.1 E(is l].)144 367.2 Q F1(\255MTG)108 384 Q F2(\214ll)6.41 E F0 .591
-(Coastline plotting option.)144 396 R .591
+-.1 E(is l].)144 552 Q F1(\255MTG)108 568.8 Q F2(\214ll)6.41 E F0 .591
+(Coastline plotting option.)144 580.8 R .591
 (Select painting or clipping of "dry" areas.)5.591 F .592
 (Append a shade, color)5.592 F 3.092(,p)-.4 G(at-)-3.092 E .999
-(tern, or c for clipping.)144 408 R .998
+(tern, or c for clipping.)144 592.8 R .998
 (Specify the shade \(0-255\) or color \(r/g/b\), or)5.999 F F1(\255MTG)
 3.498 E F2(pdpi/pattern)A F0 3.498(,w)C(here)-3.498 E .131(pattern gi)
-144 420 R -.15(ve)-.25 G 2.631(st).15 G .131(he number of the b)-2.631 F
-.132
+144 604.8 R -.15(ve)-.25 G 2.631(st).15 G .131(he number of the b)-2.631
+F .132
 (uilt-in pattern \(1-90\) OR the name of a Sun 1-, 8-, or 24-bit raster)
--.2 F 2.983(\214le. dpi)144 432 R .482
+-.2 F 2.983(\214le. dpi)144 616.8 R .482
 (sets the resolution of the image.)2.983 F(See)5.482 E F1(GMT)2.982 E F0
 .482(Cookbook & T)2.982 F .482(echnical Reference Appendix)-.7 F 2.5(Ef)
-144 444 S(or information on indi)-2.5 E(vidual patterns.)-.25 E F1
-(\255MTI)108 460.8 Q F2(river[/pen])10.3 E F0 1.456
-(Coastline plotting option.)144 472.8 R(Dra)6.457 E 3.957(wr)-.15 G
+144 628.8 S(or information on indi)-2.5 E(vidual patterns.)-.25 E F1
+(\255MTI)108 645.6 Q F2(river[/pen])10.3 E F0 1.456
+(Coastline plotting option.)144 657.6 R(Dra)6.457 E 3.957(wr)-.15 G
 -2.15 -.25(iv e)-3.957 H 3.957(rs. Specify).25 F 1.457(the type of ri)
 3.957 F -.15(ve)-.25 G 1.457(rs and [optionally] append pen).15 F
-(attrib)144 484.8 Q 3.479(utes [Def)-.2 F .978
+(attrib)144 669.6 Q 3.479(utes [Def)-.2 F .978
 (ault pen: width = 1, color = 0/0/0, te)-.1 F .978(xture = solid].)-.15
 F .978(Choose from the list of ri)5.978 F -.15(ve)-.25 G(r).15 E
-(types belo)144 496.8 Q 3.8 -.65(w. R)-.25 H
+(types belo)144 681.6 Q 3.8 -.65(w. R)-.25 H
 (epeat option \255I as often as necessary).65 E(.)-.65 E 2.5(1=P)156.5
-508.8 S(ermanent major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(2=A)156.5
-520.8 S(dditional major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(3=A)156.5
-532.8 S(dditional ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(4=M)156.5 544.8
-S(inor ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(5=I)156.5 556.8 S
-(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 major).15 E 2.5(6=I)156.5
-568.8 S(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 additional).15 E
-2.5(7=I)156.5 580.8 S(ntermittent ri)-2.5 E -.15(ve)-.25 G
-(rs \255 minor).15 E 2.5(8=M)156.5 592.8 S(ajor canals)-2.5 E 2.5(9=M)
-156.5 604.8 S(inor canals)-2.5 E(10 = Irrig)156.5 616.8 Q(ation canals)
--.05 E 2.5(a=A)156.5 628.8 S(ll ri)-2.5 E -.15(ve)-.25 G
-(rs and canals \(1-10\)).15 E 2.5(r=A)156.5 640.8 S(ll permanent ri)-2.5
-E -.15(ve)-.25 G(rs \(1-4\)).15 E 2.5(i=A)156.5 652.8 S
-(ll intermittent ri)-2.5 E -.15(ve)-.25 G(rs \(5-7\)).15 E 2.5(c=A)156.5
-664.8 S(ll canals \(8-10\))-2.5 E F1(\255MTN)108 681.6 Q F2(bor)6.97 E
-(der[/pen])-.37 E F0 .839(Coastline plotting option.)144 693.6 R(Dra)
-5.839 E 3.339(wp)-.15 G .839(olitical boundaries.)-3.339 F .839
-(Specify the type of boundary and [option-)5.839 F .547
-(ally] append pen attrib)144 705.6 R .547(utes [Def)-.2 F .546
-(ault pen:)-.1 F .546(width = 1, color = 0/0/0, te)5.546 F .546
-(xture = solid].)-.15 F .546(Choose from)5.546 F
-(the list of boundaries belo)144 717.6 Q 3.8 -.65(w. R)-.25 H
-(epeat option).65 E F1(\255MTN)2.5 E F0(as often as necessary)2.5 E(.)
--.65 E 2.5(1=N)156.5 729.6 S(ational boundaries)-2.5 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(8)204.835 E 0 Cg EP
+693.6 S(ermanent major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(2=A)156.5
+705.6 S(dditional major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(3=A)156.5
+717.6 S(dditional ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(4=M)156.5 729.6
+S(inor ri)-2.5 E -.15(ve)-.25 G(rs).15 E(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(8)198.45 E 0 Cg EP
 %%Page: 9 9
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F 2.5(2=S)156.5 84 S
-(tate boundaries within the Americas)-2.5 E 2.5(3=M)156.5 96 S
-(arine boundaries)-2.5 E 2.5(a=A)156.5 108 S(ll boundaries \(1-3\))-2.5
-E/F1 10/Times-Bold at 0 SF(\255MTS)108 124.8 Q/F2 10/Times-Italic at 0 SF
-(\214ll)8.63 E F0 .776(Coastline plotting option.)144 136.8 R .777
+(5.0 mbm_plot\(1\))2.5 F 2.5(5=I)156.5 84 S(ntermittent ri)-2.5 E -.15
+(ve)-.25 G(rs \255 major).15 E 2.5(6=I)156.5 96 S(ntermittent ri)-2.5 E
+-.15(ve)-.25 G(rs \255 additional).15 E 2.5(7=I)156.5 108 S
+(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 minor).15 E 2.5(8=M)156.5
+120 S(ajor canals)-2.5 E 2.5(9=M)156.5 132 S(inor canals)-2.5 E
+(10 = Irrig)156.5 144 Q(ation canals)-.05 E 2.5(a=A)156.5 156 S(ll ri)
+-2.5 E -.15(ve)-.25 G(rs and canals \(1-10\)).15 E 2.5(r=A)156.5 168 S
+(ll permanent ri)-2.5 E -.15(ve)-.25 G(rs \(1-4\)).15 E 2.5(i=A)156.5
+180 S(ll intermittent ri)-2.5 E -.15(ve)-.25 G(rs \(5-7\)).15 E 2.5(c=A)
+156.5 192 S(ll canals \(8-10\))-2.5 E/F1 10/Times-Bold at 0 SF(\255MTN)108
+208.8 Q/F2 10/Times-Italic at 0 SF(bor)6.97 E(der[/pen])-.37 E F0 .839
+(Coastline plotting option.)144 220.8 R(Dra)5.839 E 3.339(wp)-.15 G .839
+(olitical boundaries.)-3.339 F .839
+(Specify the type of boundary and [option-)5.839 F .547
+(ally] append pen attrib)144 232.8 R .547(utes [Def)-.2 F .546
+(ault pen:)-.1 F .546(width = 1, color = 0/0/0, te)5.546 F .546
+(xture = solid].)-.15 F .546(Choose from)5.546 F
+(the list of boundaries belo)144 244.8 Q 3.8 -.65(w. R)-.25 H
+(epeat option).65 E F1(\255MTN)2.5 E F0(as often as necessary)2.5 E(.)
+-.65 E 2.5(1=N)156.5 256.8 S(ational boundaries)-2.5 E 2.5(2=S)156.5
+268.8 S(tate boundaries within the Americas)-2.5 E 2.5(3=M)156.5 280.8 S
+(arine boundaries)-2.5 E 2.5(a=A)156.5 292.8 S(ll boundaries \(1-3\))
+-2.5 E F1(\255MTS)108 309.6 Q F2(\214ll)8.63 E F0 .776
+(Coastline plotting option.)144 321.6 R .777
 (Select painting or clipping of "wet" areas.)5.777 F .777
 (Append the shade \(0-255\),)5.777 F(color \(r/g/b\), pattern \(see)144
-148.8 Q F1(\255MTG)2.5 E F0(\), or c for clipping.)A F1(\255MTW)108
-165.6 Q F2(pen)144 177.6 Q F0 1.079(Coastline plotting option.)144 189.6
+333.6 Q F1(\255MTG)2.5 E F0(\), or c for clipping.)A F1(\255MTW)108
+350.4 Q F2(pen)144 362.4 Q F0 1.079(Coastline plotting option.)144 374.4
 R 1.079(Append pen attrib)6.079 F 3.579(utes [Def)-.2 F 3.579
 (aults: width)-.1 F 3.578(=1)3.579 G 3.578(,c)-3.578 G 1.078
-(olor = 0/0/0, te)-3.578 F 1.078(xture =)-.15 F(solid].)144 201.6 Q F1
-(\255MXG)108 218.4 Q F2(\214ll)5.86 E F0 .393
-(Select \214lling of symbols for xy plotting.)144 230.4 R .393
+(olor = 0/0/0, te)-3.578 F 1.078(xture =)-.15 F(solid].)144 386.4 Q F1
+(\255MXG)108 403.2 Q F2(\214ll)5.86 E F0 .393
+(Select \214lling of symbols for xy plotting.)144 415.2 R .393
 (Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.549 -.8(To r)144 242.4 T .949
+(ault is no \214ll].)-.1 F 2.549 -.8(To r)144 427.2 T .949
 (eset no \214ll, use).8 F F2(\214ll)3.449 E F0 3.449(=")3.449 G 3.449
 (N". F)-3.449 F .948(or polygons, you may optionally specify)-.15 F F1
-(\255Gp)3.448 E F2(icon_size/pattern)A F0(,)A(where)144 254.4 Q F2
+(\255Gp)3.448 E F2(icon_size/pattern)A F0(,)A(where)144 439.2 Q F2
 (pattern)3.651 E F0(gi)3.651 E -.15(ve)-.25 G 3.651(st).15 G 1.151(he n\
 umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.651 F F2(icon_size)144 266.4 Q F0 1.129
+.)-3.651 F F2(icon_size)144 451.2 Q F0 1.129
 (sets the unit size in inch.)3.629 F 2.728 -.8(To i)6.128 H -1.85 -.4
 (nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F1
 (\255GP)3.628 E F0 1.128(instead of)3.628 F F1(\255Gp)3.628 E F0(.)A
-(See)144 278.4 Q F1(GMTs)2.5 E F0(Cookbook & T)2.5 E
+(See)144 463.2 Q F1(GMTs)2.5 E F0(Cookbook & T)2.5 E
 (echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F1(\255MXI)108 295.2 Q F2(xy_\214le)9.75 E F0
+(vidual patterns.)-.25 E F1(\255MXI)108 480 Q F2(xy_\214le)9.75 E F0
 .481(Speci\214es a \214le containing \(x,y\) pairs to be plotted as lin\
-es or symbols. The line and symbol char)144 307.2 R(-)-.2 E .533
-(acteristics are set using the last)144 319.2 R F1(\255MXG)3.033 E F0(,)
-A F1(\255MXS)3.033 E F0 3.033(,a)C(nd)-3.033 E F1(\255MXW)3.033 E F0
-.533(options used. All of the)3.033 F F1(\255MX)3.033 E F0(com-)3.033 E
-.142(mands can be gi)144 331.2 R -.15(ve)-.25 G 2.642(nm).15 G .143(ult\
-iple times, so by stringing series of these commands together the user \
-can)-2.642 F(plot dif)144 343.2 Q(ferent \214les using dif)-.25 E
+es or symbols. The line and symbol char)144 492 R(-)-.2 E .533
+(acteristics are set using the last)144 504 R F1(\255MXG)3.033 E F0(,)A
+F1(\255MXS)3.033 E F0 3.033(,a)C(nd)-3.033 E F1(\255MXW)3.033 E F0 .533
+(options used. All of the)3.033 F F1(\255MX)3.033 E F0(com-)3.033 E .142
+(mands can be gi)144 516 R -.15(ve)-.25 G 2.642(nm).15 G .143(ultiple t\
+imes, so by stringing series of these commands together the user can)
+-2.642 F(plot dif)144 528 Q(ferent \214les using dif)-.25 E
 (ferent line or symbol characteristics.)-.25 E([Def)5 E
-(ault is a solid black line].)-.1 E F1(\255MXM)108 360 Q F0 -.8(To)144
-372 S 1.24(ggles e).8 F 1.24(xpectation for xy data \214les ha)-.15 F
+(ault is a solid black line].)-.1 E F1(\255MXM)108 544.8 Q F0 -.8(To)144
+556.8 S 1.24(ggles e).8 F 1.24(xpectation for xy data \214les ha)-.15 F
 1.24(ving multiple se)-.2 F 1.24(gments, in which each se)-.15 F 1.24
-(gment is to be)-.15 F 1.505(plotted separately)144 384 R 4.005(.S)-.65
-G -.15(eg)-4.005 G 1.506
+(gment is to be)-.15 F 1.505(plotted separately)144 568.8 R 4.005(.S)
+-.65 G -.15(eg)-4.005 G 1.506
 (ments are separated by a record whose \214rst character is '>'. By def)
-.15 F(ault,)-.1 E(unse)144 396 Q 1.879(gmented \214les are e)-.15 F
+.15 F(ault,)-.1 E(unse)144 580.8 Q 1.879(gmented \214les are e)-.15 F
 1.878(xpected. Users may gi)-.15 F 2.178 -.15(ve t)-.25 H 1.878
 (his command multiple times, allo).15 F 1.878(wing some)-.25 F
-(input \214les to be handled as se)144 408 Q(gmented and others not.)
--.15 E F1(\255MXS)108 424.8 Q F2(symbol/size)8.08 E F0 .332
-(Selects symbol to be used for plotting the ne)144 436.8 R .332
+(input \214les to be handled as se)144 592.8 Q(gmented and others not.)
+-.15 E F1(\255MXS)108 609.6 Q F2(symbol/size)8.08 E F0 .332
+(Selects symbol to be used for plotting the ne)144 621.6 R .332
 (xt xy data \214le. Setting)-.15 F F2(symbol)2.832 E F0 2.833(=")2.832 G
-.333(N" causes line plot-)-2.833 F 2.5(ting. Choose)144 448.8 R
-(between:)2.5 E F1(\255MXSa)108 465.6 Q F0(st)144 477.6 Q F1(a)A F0 -.55
+.333(N" causes line plot-)-2.833 F 2.5(ting. Choose)144 633.6 R
+(between:)2.5 E F1(\255MXSa)108 650.4 Q F0(st)144 662.4 Q F1(a)A F0 -.55
 (r.)C F2(size)5.55 E F0(is radius of circumscribing circle.)2.5 E F1
-(\255MXSb)108 494.4 Q(b)144 506.4 Q F0 .922(ar e)B .922(xtending from)
+(\255MXSb)108 679.2 Q(b)144 691.2 Q F0 .922(ar e)B .922(xtending from)
 -.15 F F2(base)3.421 E F0 .921(to y)3.421 F(.)-.65 E F2(size)5.921 E F0
 .921(is bar width.)3.421 F .921(By def)5.921 F(ault,)-.1 E F2(base)3.421
 E F0 3.421(=0)3.421 G 5.921(.A)-3.421 G .921(ppend /)-5.921 F F2(base)A
-F0 .921(to change)3.421 F(this v)144 518.4 Q 2.5(alue. Append)-.25 F F1
+F0 .921(to change)3.421 F(this v)144 703.2 Q 2.5(alue. Append)-.25 F F1
 (u)2.5 E F0(if)2.5 E F2(size)2.5 E F0(is in x-units [Def)2.5 E
-(ault is inch].)-.1 E F1(\255MXSc)108 535.2 Q(c)144 547.2 Q F0(ircle.)A
-F2(size)5 E F0(is diameter of circle.)2.5 E F1(\255MXSd)108 564 Q(d)144
-576 Q F0(iamond.)A F2(size)5 E F0(is side of diamond.)2.5 E F1(\255MXSe)
-108 592.8 Q(e)144 604.8 Q F0 5.678(llipse. Direction)B 3.178(\(in de)
-5.678 F 3.178
+(ault is inch].)-.1 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(9)198.45 E 0 Cg EP
+%%Page: 10 10
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
+(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MXSc)108 84 Q(c)144
+96 Q F0(ircle.)A/F2 10/Times-Italic at 0 SF(size)5 E F0
+(is diameter of circle.)2.5 E F1(\255MXSd)108 112.8 Q(d)144 124.8 Q F0
+(iamond.)A F2(size)5 E F0(is side of diamond.)2.5 E F1(\255MXSe)108
+141.6 Q(e)144 153.6 Q F0 5.678(llipse. Direction)B 3.178(\(in de)5.678 F
+3.178
 (grees counterclockwise from horizontal\), major_axis \(in inch\), and)
 -.15 F(minor_axis \(in inch\) must be found in columns 3, 4, and 5.)144
-616.8 Q F1(\255MXSf)108 633.6 Q(f)144 645.6 Q F0 2.529(ault. Gi)B .329
+165.6 Q F1(\255MXSf)108 182.4 Q(f)144 194.4 Q F0 2.529(ault. Gi)B .329
 -.15(ve d)-.25 H .029(istance g).15 F .029
 (ap between ticks and ticklength in inch.)-.05 F .029(If g)5.029 F .029
 (ap is ne)-.05 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 2.529(,i).15 G
 2.528(ti)-2.529 G 2.528(si)-2.528 G .028(nterpreted to)-2.528 F .399
-(mean number of ticks instead.)144 657.6 R(Append)5.399 E F1(l)2.899 E
+(mean number of ticks instead.)144 206.4 R(Append)5.399 E F1(l)2.899 E
 F0(or)2.899 E F1(r)2.899 E F0 .399(to dra)2.899 F 2.899(wt)-.15 G .399
 (ick on the left or right side of line [Def)-2.899 F(ault)-.1 E
-(is centered].)144 669.6 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
+(is centered].)144 218.4 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
 2.5 E F0(dra)2.5 E(ws a triangle instead of line se)-.15 E(gment.)-.15 E
-F1(\255MXSh)108 686.4 Q(h)144 698.4 Q F0 -.15(ex)C 2.5(agon. Gi).15 F .3
--.15(ve s)-.25 H(ide in inch.).15 E F1 2.8(\255MXSi i)108 715.2 R F0
--1.85 -.4(nv e)D(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H
-(ide in inch.).15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(9)204.835 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF 2.8(\255MXSl l)108 84 R
-F0 .406(etter or te)B .406(xt string.)-.15 F(Gi)5.406 E .706 -.15(ve s)
--.25 H .406(ize in inch, and append /).15 F/F2 10/Times-Italic at 0 SF
-(string)A F0 .406(after the size.)2.906 F .405
-(Note that the size is only)5.406 F .919(approximate; no indi)144 96 R
-.919(vidual scaling is done for dif)-.25 F .919(ferent characters.)-.25
-F .92(Remember to escape special)5.919 F(characters lik)144 108 Q 2.5
-(e*)-.1 G(.)-2.5 E F1(\255MXSp)108 124.8 Q(p)144 136.8 Q F0 2.5
-(oint. No)B(size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)
--.15 E F1(\255MXSs)108 153.6 Q(s)144 165.6 Q F0 2.5(quare. Gi)B .3 -.15
-(ve s)-.25 H(ide in inch.).15 E F1(\255MXSt)108 182.4 Q(t)144 194.4 Q F0
-2.5(riangle. Gi)B .3 -.15(ve s)-.25 H(ide in inch.).15 E F1(\255MXSv)108
-211.2 Q(v)144 223.2 Q F0(ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(\
-grees counterclockwise from horizontal\) and length \(in inch\) must be)
--.15 F .036(found in columns 3 and 4.)144 235.2 R F2(size)5.036 E F0
-2.536(,i)C 2.536(fp)-2.536 G .036(resent, will be interpreted as arro)
--2.536 F(wwidth/headlength/headwidth)-.25 E 2.104(\(in inch\) [Def)144
-247.2 R 2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F
-2.104(ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104
-(utes remains in)-.2 F -.25(va)-.4 G 2.103(riant to the).25 F .028
-(length of the arro)144 259.2 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G
--2.25 -.2(av e)-2.529 H .029(the size of the v)2.729 F .029
-(ector scale do)-.15 F .029(wn with decreasing size, append n)-.25 F F2
-(norm)A F0(,)A(where v)144 271.2 Q(ectors shorter than)-.15 E F2(norm)
-2.5 E F0(will ha)2.5 E .3 -.15(ve t)-.2 H(heir attrib).15 E
-(utes scaled by length/)-.2 E F2(norm)A F0(.)A F1(\255MXSV)108 288 Q F0
-.794(Same as)144 300 R F1(\255MXSv)3.294 E F0 3.294(,e)C .794
-(xcept azimuth \(in de)-3.444 F .793(grees east of north\) should be gi)
--.15 F -.15(ve)-.25 G 3.293(ni).15 G .793(nstead of direction.)-3.293 F
-.079(The azimuth will be mapped into an angle based on the chosen map p\
-rojection \()144 312 R F1(\255MXSv)A F0(lea)2.58 E -.15(ve)-.2 G 2.58
-(st).15 G(he)-2.58 E(directions unchanged.\))144 324 Q F1(\255MXSx)108
-340.8 Q F0 2.5(cross. Gi)144 352.8 R .3 -.15(ve l)-.25 H(ength in inch.)
-.15 E F1(\255MXW)108 369.6 Q F2(pen)144 381.6 Q F0 .784(Set pen attrib)
-144 393.6 R .784(utes for xy plotting. See chapter 4.12 in the GMT T)-.2
-F .783(echnical reference for a discus-)-.7 F(sion of GMT pen v)144
-405.6 Q 2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1<ad4e>108 422.4 Q F2([ttic)23.08 E
+F1(\255MXSh)108 235.2 Q(h)144 247.2 Q F0 -.15(ex)C 2.5(agon. Gi).15 F .3
+-.15(ve s)-.25 H(ide in inch.).15 E F1 2.8(\255MXSi i)108 264 R F0 -1.85
+-.4(nv e)D(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H(ide in inch.)
+.15 E F1 2.8(\255MXSl l)108 280.8 R F0 .406(etter or te)B .406
+(xt string.)-.15 F(Gi)5.406 E .706 -.15(ve s)-.25 H .406
+(ize in inch, and append /).15 F F2(string)A F0 .406(after the size.)
+2.906 F .405(Note that the size is only)5.406 F .919
+(approximate; no indi)144 292.8 R .919(vidual scaling is done for dif)
+-.25 F .919(ferent characters.)-.25 F .92(Remember to escape special)
+5.919 F(characters lik)144 304.8 Q 2.5(e*)-.1 G(.)-2.5 E F1(\255MXSp)108
+321.6 Q(p)144 333.6 Q F0 2.5(oint. No)B
+(size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)-.15 E F1
+(\255MXSs)108 350.4 Q(s)144 362.4 Q F0 2.5(quare. Gi)B .3 -.15(ve s)-.25
+H(ide in inch.).15 E F1(\255MXSt)108 379.2 Q(t)144 391.2 Q F0 2.5
+(riangle. Gi)B .3 -.15(ve s)-.25 H(ide in inch.).15 E F1(\255MXSv)108
+408 Q(v)144 420 Q F0(ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(gree\
+s counterclockwise from horizontal\) and length \(in inch\) must be)-.15
+F .036(found in columns 3 and 4.)144 432 R F2(size)5.036 E F0 2.536(,i)C
+2.536(fp)-2.536 G .036(resent, will be interpreted as arro)-2.536 F
+(wwidth/headlength/headwidth)-.25 E 2.104(\(in inch\) [Def)144 444 R
+2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F 2.104
+(ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104(utes remains in)
+-.2 F -.25(va)-.4 G 2.103(riant to the).25 F .028(length of the arro)144
+456 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G -2.25 -.2(av e)-2.529 H
+.029(the size of the v)2.729 F .029(ector scale do)-.15 F .029
+(wn with decreasing size, append n)-.25 F F2(norm)A F0(,)A(where v)144
+468 Q(ectors shorter than)-.15 E F2(norm)2.5 E F0(will ha)2.5 E .3 -.15
+(ve t)-.2 H(heir attrib).15 E(utes scaled by length/)-.2 E F2(norm)A F0
+(.)A F1(\255MXSV)108 484.8 Q F0 .794(Same as)144 496.8 R F1(\255MXSv)
+3.294 E F0 3.294(,e)C .794(xcept azimuth \(in de)-3.444 F .793
+(grees east of north\) should be gi)-.15 F -.15(ve)-.25 G 3.293(ni).15 G
+.793(nstead of direction.)-3.293 F .079(The azimuth will be mapped into\
+ an angle based on the chosen map projection \()144 508.8 R F1(\255MXSv)
+A F0(lea)2.58 E -.15(ve)-.2 G 2.58(st).15 G(he)-2.58 E
+(directions unchanged.\))144 520.8 Q F1(\255MXSx)108 537.6 Q F0 2.5
+(cross. Gi)144 549.6 R .3 -.15(ve l)-.25 H(ength in inch.).15 E F1
+(\255MXW)108 566.4 Q F2(pen)144 578.4 Q F0 .784(Set pen attrib)144 590.4
+R .784(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .783
+(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 602.4 Q
+2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
+(xture = solid].)-.15 E F1<ad4e>108 619.2 Q F2([ttic)23.08 E
 (k/tannot/dannot/tlen[/nhgt/nperp]] | F | FP])-.2 E F0 .341
-(This option causes a na)144 434.4 R(vig)-.2 E .342(ation track plot to\
+(This option causes a na)144 631.2 R(vig)-.2 E .342(ation track plot to\
  be generated, and can also set the start of each sw)-.05 F(ath)-.1 E
-.957(\214le to be annotated with the \214lename. If the)144 446.4 R F1
+.957(\214le to be annotated with the \214lename. If the)144 643.2 R F1
 <ad4e>3.457 E F0 .957(option is gi)3.457 F -.15(ve)-.25 G 3.457(na).15 G
 .957(lone, then the na)-3.457 F(vig)-.2 E .957(ation track)-.05 F .499
-(will be plotted without an)144 458.4 R 2.999(ya)-.15 G 2.999
+(will be plotted without an)144 655.2 R 2.999(ya)-.15 G 2.999
 (nnotation, The)-2.999 F .499(optional parameters allo)2.999 F 2.999(wu)
--.25 G .5(sers to control the details)-2.999 F 1.659(of the na)144 470.4
+-.25 G .5(sers to control the details)-2.999 F 1.659(of the na)144 667.2
 R(vig)-.2 E 1.659(ation track annotation. T)-.05 F 1.658
 (ime marks are made with "X" marks along the shiptrack;)-.35 F .576
-(annotated time marks sho)144 482.4 R 3.076(wt)-.25 G .576
+(annotated time marks sho)144 679.2 R 3.076(wt)-.25 G .576
 (he time in HH:MM format ne)-3.076 F .577
-(xt to the time mark and annotated date)-.15 F .266(marks sho)144 494.4
+(xt to the time mark and annotated date)-.15 F .266(marks sho)144 691.2
 R 2.766(wt)-.25 G .266(he time and julian day in HH:MM/DDD format.)
 -2.766 F .265(The "X" marks are)5.266 F F2(tlen)2.765 E F0 .265
-(inches high)2.765 F .27(for normal time marks and 1.5 times)144 506.4 R
+(inches high)2.765 F .27(for normal time marks and 1.5 times)144 703.2 R
 F2(tlen)2.77 E F0 .27(inches high for annotated time or date marks.)2.77
-F .27(The inter)5.27 F(-)-.2 E -.25(va)144 518.4 S 2.824(lo).25 G 2.824
+F .27(The inter)5.27 F(-)-.2 E -.25(va)144 715.2 S 2.824(lo).25 G 2.824
 (ft)-2.824 G .324
 (ime ticks, annotated time ticks, and annotated date ticks are gi)-2.824
 F -.15(ve)-.25 G 2.823(ni).15 G 2.823(nh)-2.823 G .323(ours by)-2.823 F
-F2(ttic)2.823 E(k)-.2 E F0(,)A F2(tannot)2.823 E F0(,)A(and)144 530.4 Q
-F2(dannot)3.114 E F0 3.114(,r)C(especti)-3.114 E -.15(ve)-.25 G(ly).15 E
-5.614(.I)-.65 G 3.114(ft)-5.614 G(he)-3.114 E F2(nhgt)3.114 E F0 .614
-(parameter is not gi)3.114 F -.15(ve)-.25 G 3.114(nw).15 G .614
-(hen the other parameters are speci-)-3.114 F .651
-(\214ed, then no \214lename annotation will be done. If gi)144 542.4 R
--.15(ve)-.25 G(n,).15 E F2(nhgt)3.151 E F0 .65
-(sets the height in inches of the \214le-)3.15 F .522
-(name annotation and turns that annotation on. If gi)144 554.4 R -.15
-(ve)-.25 G 3.023(na).15 G 3.023(s1)-3.023 G(,)-3.023 E F2(nperp)3.023 E
-F0 .523(causes the \214lename annotation)3.023 F .853
-(to be perpendicular to the shiptrack rather than parallel \(the def)144
-566.4 R .853(ault\). If the)-.1 F F1<ad4e>3.353 E F2(F)A F0 .853(is gi)
-3.353 F -.15(ve)-.25 G .853(n, then a).15 F(na)144 578.4 Q(vig)-.2 E
-.557(ation track will be generated using the def)-.05 F .558
-(ault parameters and also with \214lename annotation)-.1 F 1.869
-(along the shiptrack. If the)144 590.4 R F1<ad4e>4.369 E F2(FP)A F0
-1.869(is gi)4.369 F -.15(ve)-.25 G 1.869(n, then a na).15 F(vig)-.2 E
-1.868(ation track will be generated with the)-.05 F(def)144 602.4 Q
-1.078(ault parameters and also with \214lename annotation perpendicular\
- to the shiptrack.)-.1 F(Def)6.079 E 1.079(aults if)-.1 F
-(annotation is enabled:)144 614.4 Q F2(ttic)2.5 E(k)-.2 E F0 2.5(=0)2.5
-G(.25;)-2.5 E F2(tannot)2.5 E F0 2.5(=1)2.5 G(.0;)-2.5 E F2(dannot)2.5 E
-F0 2.5(=4)2.5 G(.0;)-2.5 E F2(tlen)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F2
-(nhgt)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F2(nperp)2.5 E F0 2.5(=0)2.5 G(.)
--2.5 E F1<ad4f>108 631.2 Q F2 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the\
- root used to construct the \214lename of the output shellscript \()144
-643.2 R F2 -.45(ro)C(ot).45 E F0 .422(.cmd\) and names of \214les)B .21
-(created when the shellscript is run.)144 655.2 R .21(By def)5.21 F .21
-(ault, the name of the input data \214le or list \214le is used as)-.1 F
-(the)144 667.2 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108 684 Q F2
-(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the size of\
- the page the plot will be centered on. If the user does not set the pl\
-ot)144 696 R .125(scale, the plot will be sized as lar)144 708 R .125(g\
-e as will \214t on the designated page. If the user sets the plot scale)
--.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144 720
-R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(10)199.835 E 0
-Cg EP
+F2(ttic)2.823 E(k)-.2 E F0(,)A F2(tannot)2.823 E F0(,)A(and)144 727.2 Q
+F2(dannot)5.042 E F0 5.042(,r)C(especti)-5.042 E -.15(ve)-.25 G(ly).15 E
+7.542(.I)-.65 G 5.042(ft)-7.542 G(he)-5.042 E F2(nhgt)5.042 E F0 2.542
+(parameter is not gi)5.042 F -.15(ve)-.25 G 5.042(nw).15 G 2.542
+(hen the other parameters are)-5.042 F(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(10)193.45 E 0 Cg EP
 %%Page: 11 11
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F(page sizes are:)144 84 Q(American ANSI sizes:)
-169 108 Q 12.5(A8)169 120 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)
--2.5 E(279.4 mm\))5 E 10(B1)169 132 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G
-(79.4 x)-2.5 E(431.8 mm\))5 E 10(C1)169 144 S(7.0 x 22.0 in.)-10 E 2.5
-(\(4)10 G(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 156 S(2.0 x 34.0 in.)
--10 E 2.5(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 168 S
-(4.0 x 44.0 in.)-10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169
-180 S(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5
-(E1 44.0)169 192 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10
-E(Metric ISO A sizes:)169 216 Q 5(A0 841.0)169 228 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 240 R 5(x8)2.5
-G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 252 R 5(x5)2.5 G
-(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 264 R 5(x4)2.5 G
-(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 276 R 5(x2)2.5 G
-(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 288 R
-5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5
-(A6 105.0)169 300 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E
-(5.83 in.\))5 E 7.5(A7 74.0)169 312 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5
-G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 324 R 7.5(x7)2.5 G(4.0 mm)
--7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 336 R 7.5
-(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5
-(A10 26.0)169 348 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E
-(1.46 in.\))5 E(Metric ISO B sizes:)169 372 Q 5(B0 1000.0x)169 384 R
-(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 396 R 2.5(x1)
-2.5 G(000.0 mm)-2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 408 R 5
-(x7)2.5 G(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 420 R 5
-(x5)2.5 G(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 432 R 5
-(x3)2.5 G(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)
-169 444 R 5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5
-E 5(B6 125.0)169 456 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
-(6.93 in.\))5 E 7.5(B7 88.0)169 468 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5
-G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 480 R 7.5(x8)2.5 G(8.0 mm)
--7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 492 R 7.5
-(x6)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5
-(B10 31.0)169 504 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
-(1.73 in.\))5 E(Metric ISO C sizes:)169 528 Q 5(C0 914.4)169 540 R 2.5
-(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 552 R
-5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 564 R 5
-(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 576 R 5
-(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 588 R 5
-(x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
-169 600 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
-E 5(C6 114.3)169 612 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
-(6.40 in.\))5 E 7.5(C7 81.3)169 624 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
-G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 648 Q(ge format sizes:)
--.18 E 2.5(m1 1371.6)169 660 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 672 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 684 R 2.5
-(x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-696 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 708 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 720 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(11)199.835 E 0 Cg EP
+(5.0 mbm_plot\(1\))2.5 F .575
+(speci\214ed, then no \214lename annotation will be done. If gi)144 84 R
+-.15(ve)-.25 G(n,).15 E/F1 10/Times-Italic at 0 SF(nhgt)3.075 E F0 .574
+(sets the height in inches of the)3.075 F .486
+(\214lename annotation and turns that annotation on. If gi)144 96 R -.15
+(ve)-.25 G 2.986(na).15 G 2.986(s1)-2.986 G(,)-2.986 E F1(nperp)2.986 E
+F0 .486(causes the \214lename annota-)2.986 F .199(tion to be perpendic\
+ular to the shiptrack rather than parallel \(the def)144 108 R .199
+(ault\). If the)-.1 F/F2 10/Times-Bold at 0 SF<ad4e>2.699 E F1(F)A F0 .198
+(is gi)2.698 F -.15(ve)-.25 G .198(n, then).15 F 2.522(an)144 120 S -.2
+(av)-2.522 G(ig).2 E .022(ation track will be generated using the def)
+-.05 F .022(ault parameters and also with \214lename annotation)-.1 F
+1.869(along the shiptrack. If the)144 132 R F2<ad4e>4.369 E F1(FP)A F0
+1.869(is gi)4.369 F -.15(ve)-.25 G 1.869(n, then a na).15 F(vig)-.2 E
+1.868(ation track will be generated with the)-.05 F(def)144 144 Q 1.078
+(ault parameters and also with \214lename annotation perpendicular to t\
+he shiptrack.)-.1 F(Def)6.079 E 1.079(aults if)-.1 F
+(annotation is enabled:)144 156 Q F1(ttic)2.5 E(k)-.2 E F0 2.5(=0)2.5 G
+(.25;)-2.5 E F1(tannot)2.5 E F0 2.5(=1)2.5 G(.0;)-2.5 E F1(dannot)2.5 E
+F0 2.5(=4)2.5 G(.0;)-2.5 E F1(tlen)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F1
+(nhgt)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F1(nperp)2.5 E F0 2.5(=0)2.5 G(.)
+-2.5 E F2<ad4f>108 172.8 Q F1 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the\
+ root used to construct the \214lename of the output shellscript \()144
+184.8 R F1 -.45(ro)C(ot).45 E F0 .422(.cmd\) and names of \214les)B .21
+(created when the shellscript is run.)144 196.8 R .21(By def)5.21 F .21
+(ault, the name of the input data \214le or list \214le is used as)-.1 F
+(the)144 208.8 Q F1 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108 225.6 Q F1
+(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the size of\
+ the page the plot will be centered on. If the user does not set the pl\
+ot)144 237.6 R .125(scale, the plot will be sized as lar)144 249.6 R
+.125(ge as will \214t on the designated page. If the user sets the plot\
+ scale)-.18 F .948
+(such that the plot will not \214t on the designated page, a lar)144
+261.6 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
+(page sizes are:)144 273.6 Q(American ANSI sizes:)169 297.6 Q 12.5(A8)
+169 309.6 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
+5 E 10(B1)169 321.6 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
+(431.8 mm\))5 E 10(C1)169 333.6 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
+(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 345.6 S(2.0 x 34.0 in.)-10 E 2.5
+(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 357.6 S(4.0 x 44.0 in.)
+-10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 369.6 S
+(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
+169 381.6 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
+(Metric ISO A sizes:)169 405.6 Q 5(A0 841.0)169 417.6 R 2.5(x1)2.5 G
+(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 429.6 R 5(x8)
+2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 441.6 R 5
+(x5)2.5 G(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 453.6 R
+5(x4)2.5 G(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 465.6 R
+5(x2)2.5 G(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)
+169 477.6 R 5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))
+5 E 5(A6 105.0)169 489.6 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)
+-2.5 E(5.83 in.\))5 E 7.5(A7 74.0)169 501.6 R 5(x1)2.5 G(05.0 mm)-5 E
+2.5(\(2)5 G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 513.6 R 7.5(x7)
+2.5 G(4.0 mm)-7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)
+169 525.6 R 7.5(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E
+(2.05 in.\))5 E 5(A10 26.0)169 537.6 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5
+(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E(Metric ISO B sizes:)169 561.6 Q 5
+(B0 1000.0x)169 573.6 R(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5
+(B1 707.0)169 585.6 R 2.5(x1)2.5 G(000.0 mm)-2.5 E
+(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 597.6 R 5(x7)2.5 G(07.0 mm)-5
+E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 609.6 R 5(x5)2.5 G(00.0 mm)-5
+E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 621.6 R 5(x3)2.5 G(53.0 mm)-5
+E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 633.6 R 5(x2)2.5 G
+(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5(B6 125.0)169
+645.6 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E(6.93 in.\))5 E
+7.5(B7 88.0)169 657.6 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5 G(.46 x)-2.5 E
+(4.92 in.\))5 E 7.5(B8 62.0)169 669.6 R 7.5(x8)2.5 G(8.0 mm)-7.5 E 2.5
+(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 681.6 R 7.5(x6)2.5
+G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5(B10 31.0)169
+693.6 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E(1.73 in.\))5
+E(Metric ISO C sizes:)169 717.6 Q 5(C0 914.4)169 729.6 R 2.5(x1)2.5 G
+(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E(MB-System 5.0)72 768 Q 2.5
+(9J)140.11 G(anuary 2015)-2.5 E(11)193.45 E 0 Cg EP
 %%Page: 12 12
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F(The def)144 84 Q(ault page size is A.)-.1 E/F1
-10/Times-Bold at 0 SF<ad51>108 100.8 Q F0(Normally)22.52 E 2.866(,t)-.65 G
-.367(he output plot generation shellscript includes lines which e)-2.866
-F -.15(xe)-.15 G .367(cute a program to display).15 F 1.072
-(the Postscript image on the screen.)144 112.8 R 1.071
+(5.0 mbm_plot\(1\))2.5 F 5(C1 650.2)169 84 R 5(x9)2.5 G(14.4 mm)-5 E
+(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 96 R 5(x6)2.5 G(50.2 mm)-5 E
+(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 108 R 5(x4)2.5 G(57.2 mm)-5 E
+(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 120 R 5(x3)2.5 G(25.1 mm)-5 E
+2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)169 132 R 5(x2)2.5 G
+(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5 E 5(C6 114.3)169 144
+R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E(6.40 in.\))5 E 7.5
+(C7 81.3)169 156 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5 G(.20 x)-2.5 E
+(4.50 in.\))5 E(MB-System lar)185 180 Q(ge format sizes:)-.18 E 2.5
+(m1 1371.6)169 192 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(54.00 x 72.00 in.\))
+5 E 2.5(m2 1371.6)169 204 R 2.5(x2)2.5 G(133.6 mm)-2.5 E
+(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 216 R 2.5(x2)2.5 G
+(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169 228 R 2.5
+(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5(m5 1524.0)169
+240 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))5 E 2.5
+(m6 1524.0)169 252 R 2.5(x2)2.5 G(438.4 mm)-2.5 E(\(60.00 x 96.00 in.\))
+5 E(The def)144 276 Q(ault page size is A.)-.1 E/F1 10/Times-Bold at 0 SF
+<ad51>108 292.8 Q F0(Normally)22.52 E 2.866(,t)-.65 G .367
+(he output plot generation shellscript includes lines which e)-2.866 F
+-.15(xe)-.15 G .367(cute a program to display).15 F 1.072
+(the Postscript image on the screen.)144 304.8 R 1.071
 (This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 124.8 S .147
+(exe)144 316.8 S .147
 (cuting the shellscript produces a Postscript plot b).15 F .148
-(ut does not attempt to display it on the screen.)-.2 F .327
-(The program to be used to display the Postscript is set using)144 136.8
-R F1(mbdefaults)2.826 E F0 2.826(;t)C .326(he def)-2.826 F .326(ault v)
--.1 F .326(alue can be)-.25 F -.15(ove)144 148.8 S
-(rridden by setting the en).15 E(vironment v)-.4 E
-(ariable $MB_PS_VIEWER.)-.25 E F1<ad52>108 165.6 Q/F2 10/Times-Italic at 0
-SF(west/east/south/north)23.08 E F0 .779
-(Sets the longitude and latitude bounds within which sw)144 177.6 R .78
+(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
+328.8 Q -.15(ve)-.25 G(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H
+.392(king the plot generation shellscript with a).4 F F1(-N)2.891 E F0
+.391(command line ar)2.891 F .391(gument also sup-)-.18 F .227(presses \
+the screen display of the plot. The program to be used to display the P\
+ostscript is set using)144 340.8 R F1(mbdefaults)144 352.8 Q F0 7.891
+(;t)C 5.391(he def)-7.891 F 5.391(ault v)-.1 F 5.391(alue can be o)-.25
+F -.15(ve)-.15 G 5.391(rridden by setting the en).15 F 5.39(vironment v)
+-.4 F(ariable)-.25 E($MB_PS_VIEWER.)144 364.8 Q F1<ad52>108 381.6 Q/F2
+10/Times-Italic at 0 SF(west/east/south/north)23.08 E F0 .779
+(Sets the longitude and latitude bounds within which sw)144 393.6 R .78
 (ath sonar data will be read. Normally the)-.1 F
 (bounds are automatically chosen to include all of the input data.)144
-189.6 Q F1<ad53>108 206.4 Q F2([color/shade])24.74 E F0 1.073
-(This option enables ef)144 218.4 R(fecti)-.25 E 1.373 -.15(ve h)-.25 H
+405.6 Q F1<ad53>108 422.4 Q F2([color/shade])24.74 E F0 1.073
+(This option enables ef)144 434.4 R(fecti)-.25 E 1.373 -.15(ve h)-.25 H
 1.072(istogram equalization of the color and/or shading of thedata. The)
-.15 F 1.016(equalization is not achie)144 230.4 R -.15(ve)-.25 G 3.516
+.15 F 1.016(equalization is not achie)144 446.4 R -.15(ve)-.25 G 3.516
 (db).15 G 3.516(yc)-3.516 G 1.017(hanging the data v)-3.516 F 1.017
 (alues, b)-.25 F 1.017(ut rather by constructing the color or)-.2 F
 1.325(shading tables so that the boundaries in the tables encompass equ\
-al fractions of the datapoints.)144 242.4 R 1.11(This serv)144 254.4 R
+al fractions of the datapoints.)144 458.4 R 1.11(This serv)144 470.4 R
 1.11(es to focus color or shading contrasts in v)-.15 F 1.111
 (alue ranges corresponding to the b)-.25 F 1.111(ulk of the)-.2 F .71
-(data v)144 266.4 R .71(alues, and is particularly useful for enhancing\
+(data v)144 482.4 R .71(alues, and is particularly useful for enhancing\
  the contrast of sidescan and beam amplitude)-.25 F 3.587(plots. If)144
-278.4 R F1<ad53>3.587 E F0 1.087(is gi)3.587 F -.15(ve)-.25 G 3.587(na)
+494.4 R F1<ad53>3.587 E F0 1.087(is gi)3.587 F -.15(ve)-.25 G 3.587(na)
 .15 G 1.087(lone or with)-3.587 F F2(color)3.587 E F0 3.587(=1)3.587 G
 3.587(,i)-3.587 G 3.587(te)-3.587 G 1.088
 (nables equalization of the color table used for)-3.587 F .289
-(color or gray \214ll plots,)144 290.4 R .289
+(color or gray \214ll plots,)144 506.4 R .289
 (shaded or unshaded. If the plot is to be shaded,)5.289 F .288
-(either by synthetic illumi-)5.289 F .459(nation \()144 302.4 R F1<ad47>
+(either by synthetic illumi-)5.289 F .459(nation \()144 518.4 R F1<ad47>
 A F2(2)A F0 2.959(\)o)C 2.959(rb)-2.959 G 2.959(yo)-2.959 G -.15(ve)
 -3.109 G .459(rlaying amplitude data \().15 F F1<ad47>A F2(3)A F0 .459
 (option\), then setting)2.959 F F2(shade)2.96 E F0 2.96(=1w)2.96 G .46
-(ill cause the)-2.96 F .163(shading to be equalized.)144 314.4 R(Using)
+(ill cause the)-2.96 F .163(shading to be equalized.)144 530.4 R(Using)
 5.163 E F1<ad53>2.663 E F2(0/1)A F0 .163
 (will equalize the shading without equalizing the color table.)2.663 F
-F1<ad54>108 331.2 Q F0(If)23.63 E F1<ad54>3.252 E F0 .752(is gi)3.252 F
+F1<ad54>108 547.2 Q F0(If)23.63 E F1<ad54>3.252 E F0 .752(is gi)3.252 F
 -.15(ve)-.25 G .752(n, it causes a coastline to be dra).15 F .753
 (wn on the map. The def)-.15 F .753(ault is to dra)-.1 F 3.253(wt)-.15 G
 .753(he coastline)-3.253 F .314(and shade all dry land a uniform gray)
-144 343.2 R 2.814(.T)-.65 G 2.814(oe)-3.614 G -.15(xe)-2.964 G .313
+144 559.2 R 2.814(.T)-.65 G 2.814(oe)-3.614 G -.15(xe)-2.964 G .313
 (rcise greater control of the coastline plotting, use the).15 F F1
-(\255MTC)144 355.2 Q F0(,)A F1(\255MTD)2.5 E F0(,)A F1(\255MTG)2.5 E F0
+(\255MTC)144 571.2 Q F0(,)A F1(\255MTD)2.5 E F0(,)A F1(\255MTG)2.5 E F0
 (,)A F1(\255MTI)2.5 E F0(,)A F1(\255MTN)2.5 E F0(,)A F1(\255MTS)2.5 E F0
 2.5(,a)C(nd)-2.5 E F1(\255MTW)2.5 E F0(options described in the)2.5 E F1
-<ad55>108 372 Q F2(orientation)23.08 E F0 .2(Normally the orientation o\
+<ad55>108 588 Q F2(orientation)23.08 E F0 .2(Normally the orientation o\
 f the plot \(portrait or landscape\) is selected automatically so as to\
- maxi-)144 384 R .334(mize the plot scale.)144 396 R(The)5.333 E F1
+ maxi-)144 600 R .334(mize the plot scale.)144 612 R(The)5.333 E F1
 <ad55>2.833 E F0 .333(option allo)2.833 F .333
 (ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
 E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 408 Q F2(orientation)2.5 E F0
+(portrait plot will be produced; if)144 624 Q F2(orientation)2.5 E F0
 2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 424.8 Q F0(Causes)23.08 E F1(mbm_plot)2.5 E F0
+<ad56>108 640.8 Q F0(Causes)23.08 E F1(mbm_plot)2.5 E F0
 (to operate in "v)2.5 E
 (erbose" mode so that it outputs more information than usual.)-.15 E F1
-<ad57>108 441.6 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
+<ad57>108 657.6 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
 (ncolor)A(s)-.1 E F0(]] | cpt\214le])A
 (This option controls the color scheme used for color \214ll plots.)144
-453.6 Q(If)144 477.6 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
+669.6 Q(If)144 693.6 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
 -3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 489.6 Q F0 2.816(=2)2.816 G
+ading of colors. If)-.1 F F2(color_style)144 705.6 Q F0 2.816(=2)2.816 G
 2.816(,t)-2.816 G .316
 (he color scheme will be a set of discrete color interv)-2.816 F .315
-(als. The color palette used is)-.25 F(set using)144 501.6 Q F2(palette)
+(als. The color palette used is)-.25 F(set using)144 717.6 Q F2(palette)
 2.5 E F0 2.5(.S)C -2.15 -.25(ev e)-2.5 H 2.5(np).25 G(alettes are a)-2.5
-E -.25(va)-.2 G(ilable:).25 E F2(palette)180 513.6 Q F0 2.5(=1)2.5 G
-26.36(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180
-525.6 Q F0 2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2
-(palette)180 537.6 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36
-H(ntensity colors).25 E F2(palette)180 549.6 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 561.6 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E F2(palette)180 573.6 Q F0 2.5(=6)
-2.5 G 26.36(:u)-2.5 G(niform black)-26.36 E F2(palette)180 585.6 Q F0
-2.5(=7)2.5 G 26.36(:u)-2.5 G(niform white)-26.36 E
-(The RGB de\214nitions of the color palettes are:)144 609.6 Q
-(color palette 1 \255 Haxby Color T)144 633.6 Q(able)-.8 E 5(red: 255)
-149 645.6 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
-(green: 255 186 161 189 236 255 236 235 190 127)149 657.6 Q(57)5 E 2.5
-(blue: 255)149 669.6 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)
-2.5 E(color palette 2 \255 High Intensity Colors)144 693.6 Q 5(red: 255)
-149 705.6 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5
-(green: 0)149 717.6 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5
-(blue: 0)149 729.6 R 7.5(00000)7.5 G(255 255 255 255 255)-5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(12)199.835 E 0
-Cg EP
+E -.25(va)-.2 G(ilable:).25 E F2(palette)180 729.6 Q F0 2.5(=1)2.5 G
+26.36(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E(MB-System 5.0)72
+768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(12)193.45 E 0 Cg EP
 %%Page: 13 13
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F(color palette 3 \255 Lo)144 84 Q 2.5(wI)-.25 G
-(ntensity Colors)-2.5 E 5(red: 200)149 96 R(194 179 141)2.5 E 5
-(90 0 0 0 0)5 F(90 141)5 E 5(green: 0)149 108 R 2.5(49 90)5 F
-(141 179 200 141)2.5 E 5(90 0 0 0)5 F 7.5(blue: 0)149 120 R 7.5(00000)
-7.5 G(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 144 Q
-5(red: 255)149 156 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)
-7.5 E(green: 255 230 204 179 153 128 102)149 168 Q 2.5(77 51 26)5 F(0)
-7.5 E 2.5(blue: 255)149 180 R(230 204 179 153 128 102)2.5 E 2.5
-(77 51 26)5 F(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 204 Q 5
-(red: 128)149 216 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(green: 128 128 128 128 128 128 128 128 128 128 128)149 228 Q 2.5
-(blue: 128)149 240 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(color palette 6 \255 Uniform Black)144 264 Q 10(red: 0)149 276 R 7.5
-(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 288 R 7.5(blue: 0)
-149 300 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
-324 Q 5(red: 255)149 336 R(255 255 255 255 255 255 255 255 255 255)2.5 E
-(green: 255 255 255 255 255 255 255 255 255 255 255)149 348 Q 2.5
-(blue: 255)149 360 R(255 255 255 255 255 255 255 255 255 255)2.5 E .365
-(The Haxby colors ha)144 384 R .665 -.15(ve b)-.2 H .366
+(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Italic at 0 SF(palette)180 84 Q F0 2.5
+(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F1(palette)180
+96 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
+(ntensity colors).25 E F1(palette)180 108 Q F0 2.5(=4)2.5 G 26.36(:g)
+-2.5 G(rayscale)-26.36 E F1(palette)180 120 Q F0 2.5(=5)2.5 G 26.36(:u)
+-2.5 G(niform grayscale)-26.36 E F1(palette)180 132 Q F0 2.5(=6)2.5 G
+26.36(:u)-2.5 G(niform black)-26.36 E F1(palette)180 144 Q F0 2.5(=7)2.5
+G 26.36(:u)-2.5 G(niform white)-26.36 E
+(The RGB de\214nitions of the color palettes are:)144 168 Q
+(color palette 1 \255 Haxby Color T)144 192 Q(able)-.8 E 5(red: 255)149
+204 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
+(green: 255 186 161 189 236 255 236 235 190 127)149 216 Q(57)5 E 2.5
+(blue: 255)149 228 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)2.5
+E(color palette 2 \255 High Intensity Colors)144 252 Q 5(red: 255)149
+264 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5(green: 0)149
+276 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5(blue: 0)149 288 R
+7.5(00000)7.5 G(255 255 255 255 255)-5 E(color palette 3 \255 Lo)144 312
+Q 2.5(wI)-.25 G(ntensity Colors)-2.5 E 5(red: 200)149 324 R(194 179 141)
+2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5(green: 0)149 336 R 2.5(49 90)5 F
+(141 179 200 141)2.5 E 5(90 0 0 0)5 F 7.5(blue: 0)149 348 R 7.5(00000)
+7.5 G(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 372 Q
+5(red: 255)149 384 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)
+7.5 E(green: 255 230 204 179 153 128 102)149 396 Q 2.5(77 51 26)5 F(0)
+7.5 E 2.5(blue: 255)149 408 R(230 204 179 153 128 102)2.5 E 2.5
+(77 51 26)5 F(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 432 Q 5
+(red: 128)149 444 R(128 128 128 128 128 128 128 128 128 128)2.5 E
+(green: 128 128 128 128 128 128 128 128 128 128 128)149 456 Q 2.5
+(blue: 128)149 468 R(128 128 128 128 128 128 128 128 128 128)2.5 E
+(color palette 6 \255 Uniform Black)144 492 Q 10(red: 0)149 504 R 7.5
+(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 516 R 7.5(blue: 0)
+149 528 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
+552 Q 5(red: 255)149 564 R(255 255 255 255 255 255 255 255 255 255)2.5 E
+(green: 255 255 255 255 255 255 255 255 255 255 255)149 576 Q 2.5
+(blue: 255)149 588 R(255 255 255 255 255 255 255 255 255 255)2.5 E .365
+(The Haxby colors ha)144 612 R .665 -.15(ve b)-.2 H .366
 (een adapted from a palette de).15 F -.15(ve)-.25 G .366(loped by Dr).15
 F 2.866(.W)-.55 G .366(illiam Haxby of the Lam-)-3.266 F .32
-(ont-Doherty Earth Observ)144 396 R .319
+(ont-Doherty Earth Observ)144 624 R .319
 (atory; this palette is pleasing to the e)-.25 F .319
 (ye and well suited for shading. The)-.15 F .309(high intensity colors \
 describe linear paths through RGB space from red to blue to green to pu\
-rple;)144 408 R .438(because the colors are high intensity the)144 420 R
+rple;)144 636 R .438(because the colors are high intensity the)144 648 R
 2.938(ya)-.15 G .437(re not well suited to shading.)-2.938 F .437
 (The lo)5.437 F 2.937(wi)-.25 G .437(ntensity colors)-2.937 F .517
-(are similar to the high intensity)144 432 R 3.017(,b)-.65 G .517
+(are similar to the high intensity)144 660 R 3.017(,b)-.65 G .517
 (ut muted and thus well suited to shading.)-3.217 F .517
 (The grayscale palette)5.517 F .499(runs linearly from white to black a\
-nd is commonly used for plots of sidescan and amplitude data.)144 444 R
+nd is commonly used for plots of sidescan and amplitude data.)144 672 R
 (The uniform grayscale is useful for non-color shaded relief plots.)144
-456 Q(The)144 480 Q/F1 10/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0
-.107(parameter sets the number of color v)2.606 F .107
+684 Q(The)144 708 Q F1(ncolor)2.606 E(s)-.1 E F0 .107
+(parameter sets the number of color v)2.606 F .107
 (alues used in plotting, whether the colors are rep-)-.25 F(resented in\
  a continuous color scale or a stepped, discrete color scale [def)144
-492 Q(ault is 11].)-.1 E .523(If the option ar)144 516 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
+720 Q(ault is 11].)-.1 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(13)193.45 E 0 Cg EP
+%%Page: 14 14
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
+(5.0 mbm_plot\(1\))2.5 F .523(If the option ar)144 84 R .522
+(gument is the path to an e)-.18 F(xisting)-.15 E/F1 10/Times-Bold at 0 SF
 (GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 528 Q F2
-<ad58>108 544.8 Q F0(Normally)23.08 E(,)-.65 E F2(mbm_plot)3.263 E F0
-.764(creates an e)3.263 F -.15(xe)-.15 G .764
+3.022 F(and its color scheme will be used for the plot)144 96 Q F1<ad58>
+108 112.8 Q F0(Normally)23.08 E(,)-.65 E F1(mbm_plot)3.263 E F0 .764
+(creates an e)3.263 F -.15(xe)-.15 G .764
 (cutable shellscript and then e).15 F 3.264(xits. This)-.15 F .764
-(option will cause the)3.264 F(shellscript to be e)144 556.8 Q -.15(xe)
--.15 G(cuted in the background before).15 E F2(mbm_plot)2.5 E F0 -.15
-(ex)2.5 G(its.).15 E F2<ad59>108 573.6 Q F0(Normally)23.08 E(,)-.65 E F2
+(option will cause the)3.264 F(shellscript to be e)144 124.8 Q -.15(xe)
+-.15 G(cuted in the background before).15 E F1(mbm_plot)2.5 E F0 -.15
+(ex)2.5 G(its.).15 E F1<ad59>108 141.6 Q F0(Normally)23.08 E(,)-.65 E F1
 (mbm_plot)3.709 E F0 1.208(generates nicely rounded numbers for the bou\
 ndaries of the color palette.)3.709 F .894
-(Often, the resulting color bounds e)144 585.6 R .895
+(Often, the resulting color bounds e)144 153.6 R .895
 (xtend well outside the range of the gridded data.)-.15 F .895
 (This option)5.895 F .478
-(causes the color boundaries to be uniformly distrib)144 597.6 R .477
+(causes the color boundaries to be uniformly distrib)144 165.6 R .477
 (uted between the minimum and maximum v)-.2 F(al-)-.25 E
-(ues of the grid.)144 609.6 Q F2<ad5a>108 626.4 Q F1(min/max)23.63 E F0
-.829(This option o)144 638.4 R -.15(ve)-.15 G .829
+(ues of the grid.)144 177.6 Q F1<ad5a>108 194.4 Q/F2 10/Times-Italic at 0
+SF(min/max)23.63 E F0 .829(This option o)144 206.4 R -.15(ve)-.15 G .829
 (rrides the minimum and maximum v).15 F .829(alues of bath)-.25 F .829
 (ymetry data, af)-.05 F .83(fecting the color)-.25 F
-(palette and the contour interv)144 650.4 Q
+(palette and the contour interv)144 218.4 Q
 (al if those parameters are not speci\214ed by the user)-.25 E(.)-.55 E
-/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 679.2 Q F0 .211(Suppose we ha)108
-691.2 R .511 -.15(ve o)-.2 H .211(btained a sw).15 F .211
+/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 247.2 Q F0 .211(Suppose we ha)108
+259.2 R .511 -.15(ve o)-.2 H .211(btained a sw).15 F .211
 (ath sonar data \214le called sb2112_e)-.1 F .21
-(xample.mb41 collected using a SeaBeam)-.15 F 1.33(2112 sonar)108 703.2
+(xample.mb41 collected using a SeaBeam)-.15 F 1.33(2112 sonar)108 271.2
 R 6.33(.T)-.55 G 1.33(his \214le contains bath)-6.33 F(ymetry)-.05 E
 3.831(,b)-.65 G 1.331
 (eam amplitude, and sidescan data. In order to obtain initial)-3.831 F
-(vie)108 715.2 Q .7(ws of the data in the \214le, we use)-.25 F F2
+(vie)108 283.2 Q .7(ws of the data in the \214le, we use)-.25 F F1
 (mbm_plot)3.199 E F0 .699
 (to generate shellscripts which in turn generate plots when)3.199 F -.15
-(exe)108 727.2 S 4.008(cuted. The).15 F(follo)4.008 E 1.508(wing \214v)
+(exe)108 295.2 S 4.008(cuted. The).15 F(follo)4.008 E 1.508(wing \214v)
 -.25 F 4.008(ec)-.15 G 1.508
 (ommands generate plotting shellscripts for color \214ll bath)-4.008 F
-1.509(ymetry o)-.05 F -.15(ve)-.15 G(rlaid).15 E(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(13)199.835 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F 1.579(with contours, color shaded relief bath)
-108 84 R(ymetry)-.05 E 4.078(,c)-.65 G 1.578(olor \214ll bath)-4.078 F
-1.578(ymetry o)-.05 F -.15(ve)-.15 G 1.578
-(rlaid with amplitudes, grayscale).15 F
-(amplitudes, and grayscale sidescan, respecti)108 96 Q -.15(ve)-.25 G
-(ly:).15 E(mbm_plot \255F41 \255I sb2112_e)144 120 Q
-(xample.mb41 \255G1 \255C)-.15 E(\\)10 E(-N \255V \255Obathcont)180 132
-Q(mbm_plot \255F41 \255I sb2112_e)144 144 Q(xample.mb41 \255G2)-.15 E
-(\\)17.5 E(-N \255V \255Obathshade)180 156 Q
-(mbm_plot \255F41 \255I sb2112_e)144 168 Q
-(xample.mb41 \255G3 \255S0/1 \\)-.15 E(-N \255V \255Obathamp)180 180 Q
-(mbm_plot \255F41 \255I sb2112_e)144 192 Q(xample.mb41 \255G4 \255S)-.15
-E(\\)10 E(-N \255V \255Oamp)180 204 Q(mbm_plot \255F41 \255I sb2112_e)
-144 216 Q(xample.mb41 \255G5 \255S)-.15 E(\\)10 E(-N \255V \255Oss)180
-228 Q .632(When the follo)108 252 R .632(wing shellscripts are e)-.25 F
--.15(xe)-.15 G .633(cuted, each will generate a postscript plot \214le \
-and then display the).15 F(plot on the screen:)108 264 Q(bathcont.cmd)
-144 288 Q(bathshade.cmd)144 300 Q(bathamp.cmd)144 312 Q(amp.cmd)144 324
-Q(ss.cmd)144 336 Q .379(Note that we use the)108 360 R/F1 10
-/Times-Bold at 0 SF<ad53>2.879 E F0 .378(option to apply histogram equaliz\
-ation to the amplitude and sidescan data, b)2.879 F .378(ut not)-.2 F
-.628(the bath)108 372 R .629(ymetry data. Also note that by specifying)
--.05 F F1<ad4e>3.129 E F0 .629(we obtain a track plot of the ship')3.129
-F 3.129(sn)-.55 G -.2(av)-3.129 G(ig).2 E .629(ation o)-.05 F -.15(ve)
--.15 G -.2(r-).15 G(laid on the color or grayscale \214le plots.)108 384
-Q(No)108 408 Q 2.959(ws)-.25 G .459(uppose we ha)-2.959 F .759 -.15
-(ve a s)-.2 H .459
+1.509(ymetry o)-.05 F -.15(ve)-.15 G(rlaid).15 E 1.579
+(with contours, color shaded relief bath)108 307.2 R(ymetry)-.05 E 4.078
+(,c)-.65 G 1.578(olor \214ll bath)-4.078 F 1.578(ymetry o)-.05 F -.15
+(ve)-.15 G 1.578(rlaid with amplitudes, grayscale).15 F
+(amplitudes, and grayscale sidescan, respecti)108 319.2 Q -.15(ve)-.25 G
+(ly:).15 E(mbm_plot \255F41 \255I sb2112_e)144 343.2 Q
+(xample.mb41 \255G1 \255C)-.15 E(\\)10 E(-N \255V \255Obathcont)180
+355.2 Q(mbm_plot \255F41 \255I sb2112_e)144 367.2 Q(xample.mb41 \255G2)
+-.15 E(\\)17.5 E(-N \255V \255Obathshade)180 379.2 Q
+(mbm_plot \255F41 \255I sb2112_e)144 391.2 Q
+(xample.mb41 \255G3 \255S0/1 \\)-.15 E(-N \255V \255Obathamp)180 403.2 Q
+(mbm_plot \255F41 \255I sb2112_e)144 415.2 Q(xample.mb41 \255G4 \255S)
+-.15 E(\\)10 E(-N \255V \255Oamp)180 427.2 Q
+(mbm_plot \255F41 \255I sb2112_e)144 439.2 Q(xample.mb41 \255G5 \255S)
+-.15 E(\\)10 E(-N \255V \255Oss)180 451.2 Q .632(When the follo)108
+475.2 R .632(wing shellscripts are e)-.25 F -.15(xe)-.15 G .633(cuted, \
+each will generate a postscript plot \214le and then display the).15 F
+(plot on the screen:)108 487.2 Q(bathcont.cmd)144 511.2 Q(bathshade.cmd)
+144 523.2 Q(bathamp.cmd)144 535.2 Q(amp.cmd)144 547.2 Q(ss.cmd)144 559.2
+Q .379(Note that we use the)108 583.2 R F1<ad53>2.879 E F0 .378(option \
+to apply histogram equalization to the amplitude and sidescan data, b)
+2.879 F .378(ut not)-.2 F .628(the bath)108 595.2 R .629
+(ymetry data. Also note that by specifying)-.05 F F1<ad4e>3.129 E F0
+.629(we obtain a track plot of the ship')3.129 F 3.129(sn)-.55 G -.2(av)
+-3.129 G(ig).2 E .629(ation o)-.05 F -.15(ve)-.15 G -.2(r-).15 G
+(laid on the color or grayscale \214le plots.)108 607.2 Q(No)108 631.2 Q
+2.959(ws)-.25 G .459(uppose we ha)-2.959 F .759 -.15(ve a s)-.2 H .459
 (et of SeaBeam 2112 data \214les comprising a short surv).15 F .759 -.15
 (ey a)-.15 H .459(nd that we w).15 F .459(ant a plot)-.1 F .156
-(of all the data together)108 420 R 5.156(.W)-.55 G 2.656(ec)-5.956 G
+(of all the data together)108 643.2 R 5.156(.W)-.55 G 2.656(ec)-5.956 G
 .156(reate an ASCII te)-2.656 F .156
 (xt \214le which has a list of the \214lenames, each follo)-.15 F .157
-(wed by the)-.25 F(appropriate)108 432 Q F1(MBIO)2.5 E F0
-(format id number)2.5 E 2.5(,e)-.4 G(.g.:)-2.5 E(sb2112_e)144 456 Q
-(xample_1.mb41 41)-.15 E(sb2112_e)144 468 Q(xample_2.mb41 41)-.15 E
-(sb2112_e)144 480 Q(xample_3.mb41 41)-.15 E .202
-(If the name of the data \214le list is "datalist", then using ")108 504
-R F1<ad46>A/F2 10/Times-Italic at 0 SF(-1)A F1<ad49>2.702 E F2(datalist)A
-F0 2.702("w)C .202(ill cause the macro to operate on)-2.702 F .923
-(all of the \214les together)108 516 R 5.923(.W)-.55 G 3.423(ed)-6.723 G
-.923(esire a plot including color \214ll bath)-3.423 F .923(ymetry o)
--.05 F -.15(ve)-.15 G .923(rlaid with 25 meter contours).15 F .103
-(and the ship')108 528 R 2.603(sn)-.55 G -.2(av)-2.603 G(ig).2 E 2.603
+(wed by the)-.25 F(appropriate)108 655.2 Q F1(MBIO)2.5 E F0
+(format id number)2.5 E 2.5(,e)-.4 G(.g.:)-2.5 E(sb2112_e)144 679.2 Q
+(xample_1.mb41 41)-.15 E(sb2112_e)144 691.2 Q(xample_2.mb41 41)-.15 E
+(sb2112_e)144 703.2 Q(xample_3.mb41 41)-.15 E .202
+(If the name of the data \214le list is "datalist", then using ")108
+727.2 R F1<ad46>A F2(-1)A F1<ad49>2.702 E F2(datalist)A F0 2.702("w)C
+.202(ill cause the macro to operate on)-2.702 F(MB-System 5.0)72 768 Q
+2.5(9J)140.11 G(anuary 2015)-2.5 E(14)193.45 E 0 Cg EP
+%%Page: 15 15
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
+(5.0 mbm_plot\(1\))2.5 F .923(all of the \214les together)108 84 R 5.923
+(.W)-.55 G 3.423(ed)-6.723 G .923
+(esire a plot including color \214ll bath)-3.423 F .923(ymetry o)-.05 F
+-.15(ve)-.15 G .923(rlaid with 25 meter contours).15 F .103
+(and the ship')108 96 R 2.603(sn)-.55 G -.2(av)-2.603 G(ig).2 E 2.603
 (ation. F)-.05 F .103(or this plot, we w)-.15 F .103(ant a v)-.1 F .103
 (ery bright colortable and we w)-.15 F .103(ould lik)-.1 F 2.603(et)-.1
 G .103(he colors to be)-2.603 F .265
-(discretely stepped rather than continuous; thus we use)108 540 R F1
-<ad57>2.765 E F2(2/2)A F0 2.765(.W)C 2.765(ea)-3.565 G .265
-(lso choose to use the)-2.765 F F1<ad58>2.766 E F0 .266(option, which)
-2.766 F(causes)108 552 Q F1(mbm_plot)3.93 E F0 1.43(to e)3.93 F -.15(xe)
--.15 G 1.43(cute the shellscript it creates in the background before e)
-.15 F 1.43(xiting. The)-.15 F F1(mbm_plot)3.93 E F0(command is:)108 564
-Q(mbm_plot \255F-1 \255Idatalist \255G1 \255C25 \255N \\)144 588 Q
-(-X \255V \255Obathtest)216 600 Q(As an e)108 624 Q
+(discretely stepped rather than continuous; thus we use)108 108 R/F1 10
+/Times-Bold at 0 SF<ad57>2.765 E/F2 10/Times-Italic at 0 SF(2/2)A F0 2.765(.W)
+C 2.765(ea)-3.565 G .265(lso choose to use the)-2.765 F F1<ad58>2.766 E
+F0 .266(option, which)2.766 F(causes)108 120 Q F1(mbm_plot)3.93 E F0
+1.43(to e)3.93 F -.15(xe)-.15 G 1.43
+(cute the shellscript it creates in the background before e).15 F 1.43
+(xiting. The)-.15 F F1(mbm_plot)3.93 E F0(command is:)108 132 Q
+(mbm_plot \255F-1 \255Idatalist \255G1 \255C25 \255N \\)144 156 Q
+(-X \255V \255Obathtest)216 168 Q(As an e)108 192 Q
 (xample, the contents of the plotting shellscript "bathtest.cmd" are:)
--.15 E(#)110.5 648 Q 2.5(#S)110.5 660 S
+-.15 E(#)110.5 216 Q 2.5(#S)110.5 228 S
 (hellscript to create Postscript plot of sw)-2.5 E(ath sonar data)-.1 E
-2.5(#C)110.5 672 S(reated by macro mbm_plot)-2.5 E(#)110.5 684 Q 2.5(#T)
-110.5 696 S(his shellscript created by follo)-2.5 E(wing command line:)
--.25 E 2.5(#m)110.5 708 S
+2.5(#C)110.5 240 S(reated by macro mbm_plot)-2.5 E(#)110.5 252 Q 2.5(#T)
+110.5 264 S(his shellscript created by follo)-2.5 E(wing command line:)
+-.25 E 2.5(#m)110.5 276 S
 (bm_plot \255F-1 \255Idatalist \255G1 \255C25 \255N \255V \255Obathtest)
--2.5 E(#)110.5 720 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(14)199.835 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F 2.5(#S)110.5 84 S -2.25 -.2(av e)-2.5 H -.15
-(ex)2.7 G(isting GMT def).15 E(aults)-.1 E(echo Sa)110.5 96 Q
-(ving GMT def)-.2 E(aults...)-.1 E(gmtdef)110.5 108 Q
-(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 120 Q 2.5(#S)110.5 132
-S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1 E(echo Setting ne)
-110.5 144 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E(gmtset ANO)110.5
-156 Q(T_FONT Helv)-.4 E(etica)-.15 E(gmtset LABEL_FONT Helv)110.5 168 Q
-(etica)-.15 E(gmtset HEADER_FONT Helv)110.5 180 Q(etica)-.15 E
-(gmtset ANO)110.5 192 Q(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)
-110.5 204 Q(gmtset HEADER_FONT_SIZE 10)110.5 216 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 228 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 240 Q(gmtset P)110.5 252
+-2.5 E(#)110.5 288 Q 2.5(#S)110.5 300 S -2.25 -.2(av e)-2.5 H -.15(ex)
+2.7 G(isting GMT def).15 E(aults)-.1 E(echo Sa)110.5 312 Q(ving GMT def)
+-.2 E(aults...)-.1 E(gmtdef)110.5 324 Q(aults \255L > gmtdef)-.1 E
+(aults$$)-.1 E(#)110.5 336 Q 2.5(#S)110.5 348 S(et ne)-2.5 E 2.5(wG)-.25
+G(MT def)-2.5 E(aults)-.1 E(echo Setting ne)110.5 360 Q 2.5(wG)-.25 G
+(MT def)-2.5 E(aults...)-.1 E(gmtset ANO)110.5 372 Q(T_FONT Helv)-.4 E
+(etica)-.15 E(gmtset LABEL_FONT Helv)110.5 384 Q(etica)-.15 E
+(gmtset HEADER_FONT Helv)110.5 396 Q(etica)-.15 E(gmtset ANO)110.5 408 Q
+(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 420 Q
+(gmtset HEADER_FONT_SIZE 10)110.5 432 Q
+(gmtset FRAME_WIDTH 0.074999999999999997)110.5 444 Q
+(gmtset TICK_LENGTH 0.074999999999999997)110.5 456 Q(gmtset P)110.5 468
 Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 264 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 276 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
-110.5 288 Q(AN 255/255/255)-.35 E(#)110.5 300 Q 2.5(#M)110.5 312 S(ak)
+(gmtset COLOR_B)110.5 480 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
+(gmtset COLOR_FOREGR)110.5 492 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
+110.5 504 Q(AN 255/255/255)-.35 E(#)110.5 516 Q 2.5(#M)110.5 528 S(ak)
 -2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 324 Q 5(echo 2975)110.5
-336 R(255 255 255)2.5 E(3150 255 186 133 > bathtest.cpt)7.5 E 5
-(echo 3150)110.5 348 R(255 186 133)2.5 E(3325 255 161)7.5 E
-(68 >> bathtest.cpt)5 E 5(echo 3325)110.5 360 R(255 161)2.5 E 5(68 3500)
-5 F(255 189)2.5 E(87 >> bathtest.cpt)5 E 5(echo 3500)110.5 372 R
+(echo Making color palette table \214le...)110.5 540 Q 5(echo 2975)110.5
+552 R(255 255 255)2.5 E(3150 255 186 133 > bathtest.cpt)7.5 E 5
+(echo 3150)110.5 564 R(255 186 133)2.5 E(3325 255 161)7.5 E
+(68 >> bathtest.cpt)5 E 5(echo 3325)110.5 576 R(255 161)2.5 E 5(68 3500)
+5 F(255 189)2.5 E(87 >> bathtest.cpt)5 E 5(echo 3500)110.5 588 R
 (255 189)2.5 E 5(87 3675)5 F(240 236 121 >> bathtest.cpt)2.5 E 5
-(echo 3675)110.5 384 R(240 236 121)2.5 E
-(3850 205 255 162 >> bathtest.cpt)7.5 E 5(echo 3850)110.5 396 R
+(echo 3675)110.5 600 R(240 236 121)2.5 E
+(3850 205 255 162 >> bathtest.cpt)7.5 E 5(echo 3850)110.5 612 R
 (205 255 162)2.5 E(4025 138 236 174 >> bathtest.cpt)7.5 E 5(echo 4025)
-110.5 408 R(138 236 174)2.5 E(4200 106 235 255 >> bathtest.cpt)7.5 E 5
-(echo 4200)110.5 420 R(106 235 255)2.5 E 2.5(4375 50)7.5 F
-(190 255 >> bathtest.cpt)2.5 E 5(echo 4375)110.5 432 R(50 190 255)5 E
-2.5(4550 40)7.5 F(127 251 >> bathtest.cpt)2.5 E 5(echo 4550)110.5 444 R
+110.5 624 R(138 236 174)2.5 E(4200 106 235 255 >> bathtest.cpt)7.5 E 5
+(echo 4200)110.5 636 R(106 235 255)2.5 E 2.5(4375 50)7.5 F
+(190 255 >> bathtest.cpt)2.5 E 5(echo 4375)110.5 648 R(50 190 255)5 E
+2.5(4550 40)7.5 F(127 251 >> bathtest.cpt)2.5 E 5(echo 4550)110.5 660 R
 (40 127 251)5 E 2.5(4725 37 57)7.5 F(175 >> bathtest.cpt)2.5 E(#)110.5
-456 Q 2.5(#R)110.5 468 S(un mbsw)-2.5 E(ath)-.1 E(echo Running mbsw)
-110.5 480 Q(ath...)-.1 E(mbsw)110.5 492 Q(ath \255f-1 \255Idatalist \\)
--.1 E(-Jm22.198543775528325 \\)144 504 Q
-(-R114.210795/114.430905/-31.91322/-31.62458 \\)144 516 Q
-(-Cbathtest.cpt \\)144 528 Q(-p1 \255A1 \255Z1 \\)144 540 Q(-p1 \\)144
-552 Q(-P \255X1.8069392647842304 \255Y2 \255K \255V > bathtest.ps)144
-564 Q(#)110.5 576 Q 2.5(#R)110.5 588 S(un mbcontour)-2.5 E
-(echo Running mbcontour)110.5 600 Q(...)-.55 E
-(mbcontour \255f-1 \255Idatalist \\)110.5 612 Q
-(-Jm22.198543775528325 \\)144 624 Q
-(-R114.210795/114.430905/-31.91322/-31.62458 \\)144 636 Q
-(-A50/100000/100000/100000/0.01/0.1 \\)144 648 Q(-D0.25/1/4/0.15 \\)144
-660 Q(-p1 \\)144 672 Q(-P \255K \255O \255V >> bathtest.ps)144 684 Q(#)
-110.5 696 Q 2.5(#M)110.5 708 S(ak)-2.5 E 2.5(ec)-.1 G(olor scale)-2.5 E
-(echo Running psscale...)110.5 720 Q(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(15)199.835 E 0 Cg EP
+672 Q 2.5(#R)110.5 684 S(un mbsw)-2.5 E(ath)-.1 E(echo Running mbsw)
+110.5 696 Q(ath...)-.1 E(mbsw)110.5 708 Q(ath \255f-1 \255Idatalist \\)
+-.1 E(-Jm22.198543775528325 \\)144 720 Q(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(15)193.45 E 0 Cg EP
 %%Page: 16 16
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F(psscale \255Cbathtest.cpt \\)110.5 84 Q
-(-D2.4431/-0.5000/4.8861/0.1500h \\)144 96 Q(-B":.Depth \(meters\):" \\)
-144 108 Q(-P \255K \255O \255V >> bathtest.ps)144 120 Q(#)110.5 132 Q
-2.5(#M)110.5 144 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
-(echo Running psbasemap...)110.5 156 Q
-(psbasemap \255Jm22.198543775528325 \\)110.5 168 Q
-(-R114.210795/114.430905/-31.91322/-31.62458 \\)144 180 Q
-(-B5m/5m:."Data List File datalist": \\)144 192 Q
-(-P \255O \255V >> bathtest.ps)144 204 Q(#)110.5 216 Q 2.5(#D)110.5 228
+(5.0 mbm_plot\(1\))2.5 F(-R114.210795/114.430905/-31.91322/-31.62458 \\)
+144 84 Q(-Cbathtest.cpt \\)144 96 Q(-p1 \255A1 \255Z1 \\)144 108 Q
+(-p1 \\)144 120 Q
+(-P \255X1.8069392647842304 \255Y2 \255K \255V > bathtest.ps)144 132 Q
+(#)110.5 144 Q 2.5(#R)110.5 156 S(un mbcontour)-2.5 E
+(echo Running mbcontour)110.5 168 Q(...)-.55 E
+(mbcontour \255f-1 \255Idatalist \\)110.5 180 Q
+(-Jm22.198543775528325 \\)144 192 Q
+(-R114.210795/114.430905/-31.91322/-31.62458 \\)144 204 Q
+(-A50/100000/100000/100000/0.01/0.1 \\)144 216 Q(-D0.25/1/4/0.15 \\)144
+228 Q(-p1 \\)144 240 Q(-P \255K \255O \255V >> bathtest.ps)144 252 Q(#)
+110.5 264 Q 2.5(#M)110.5 276 S(ak)-2.5 E 2.5(ec)-.1 G(olor scale)-2.5 E
+(echo Running psscale...)110.5 288 Q(psscale \255Cbathtest.cpt \\)110.5
+300 Q(-D2.4431/-0.5000/4.8861/0.1500h \\)144 312 Q
+(-B":.Depth \(meters\):" \\)144 324 Q
+(-P \255K \255O \255V >> bathtest.ps)144 336 Q(#)110.5 348 Q 2.5(#M)
+110.5 360 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
+(echo Running psbasemap...)110.5 372 Q
+(psbasemap \255Jm22.198543775528325 \\)110.5 384 Q
+(-R114.210795/114.430905/-31.91322/-31.62458 \\)144 396 Q
+(-B5m/5m:."Data List File datalist": \\)144 408 Q
+(-P \255O \255V >> bathtest.ps)144 420 Q(#)110.5 432 Q 2.5(#D)110.5 444
 S(elete surplus \214les)-2.5 E(echo Deleting surplus \214les...)110.5
-240 Q(rm \255f bathtest.cpt)110.5 252 Q(#)110.5 264 Q 2.5(#R)110.5 276 S
+456 Q(rm \255f bathtest.cpt)110.5 468 Q(#)110.5 480 Q 2.5(#R)110.5 492 S
 (eset GMT def)-2.5 E(ault fonts)-.1 E(echo Resetting GMT fonts...)110.5
-288 Q(mv gmtdef)110.5 300 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5
-312 Q 2.5(#R)110.5 324 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)
-110.5 336 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5
-348 Q 2.5<77ad>-.25 G(ps a \255maxp 4m bathtest.ps &)-2.5 E(#)110.5 360
-Q 2.5(#A)110.5 372 S(ll done!)-2.5 E(echo All done!)110.5 384 Q/F1 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 412.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108
-424.8 Q F0(\(1\),)A F2(mbcontour)2.746 E F0(\(1\),)A F2(mbswath)2.746 E
+504 Q(mv gmtdef)110.5 516 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5
+528 Q 2.5(#R)110.5 540 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)
+110.5 552 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5
+564 Q 2.5<77ad>-.25 G(ps a \255maxp 4m bathtest.ps &)-2.5 E(#)110.5 576
+Q 2.5(#A)110.5 588 S(ll done!)-2.5 E(echo All done!)110.5 600 Q/F1 10.95
+/Times-Bold at 0 SF(SEE ALSO)72 628.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108
+640.8 Q F0(\(1\),)A F2(mbcontour)2.746 E F0(\(1\),)A F2(mbswath)2.746 E
 F0(\(1\),)A F2(mbdefaults)2.747 E F0(\(1\),)A F2(mbm_grdplot)2.747 E F0
 (\(1\),)A F2(mbm_grd3dplot)2.747 E F0(\(1\),)A F2(mb\214l-)2.747 E(ter)
-108 436.8 Q F0(\(1\))A F1 -.11(BU)72 465.6 S(GS).11 E F0
-(By making this macro more useful, we ha)108 477.6 Q .3 -.15(ve a)-.2 H
-(lso made it more comple).15 E(x.)-.15 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(16)199.835 E 0 Cg EP
+108 652.8 Q F0(\(1\))A F1 -.11(BU)72 681.6 S(GS).11 E F0
+(By making this macro more useful, we ha)108 693.6 Q .3 -.15(ve a)-.2 H
+(lso made it more comple).15 E(x.)-.15 E(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(16)193.45 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbm_route2mission.ps b/src/ps/mbm_route2mission.ps
index e4baf78..e6c4771 100644
--- a/src/ps/mbm_route2mission.ps
+++ b/src/ps/mbm_route2mission.ps
@@ -1,11 +1,11 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
 %%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 6
+%%Pages: 7
 %%PageOrder: Ascend
 %%DocumentMedia: Default 612 792 0 () ()
 %%Orientation: Portrait
@@ -246,16 +246,16 @@ F3(behavior)A F2<ad43>108 189.6 Q F3(missiontime)A F2<ad44>8.442 E F3
 -.15 E F2<ad4d>4.042 E F3([sensorlist])A F2<ad4e>4.042 E F0([)A F3(spir)
 A(aldescentaltitude)-.15 E F0(])A F2<ad4f>4.042 E F3(mission\214le)A F2
 <ad50>4.042 E F3 1.541([startlon/startlat | startdis-)B(tance])108 213.6
-Q F2<ad52>8.917 E F3(tr)A(ansmitpower/r)-.15 E(eceive)-.37 E(gain[/r)-.4
+Q F2<ad52>9.475 E F3(tr)A(ansmitpower/r)-.15 E(eceive)-.37 E(gain[/r)-.4
 E(ang)-.15 E(eminfr)-.1 E(action[/pulse)-.15 E(width]])-.15 E F2<ad53>
-8.917 E F3(speed)A F2<ad54>8.918 E F3(starttime)A F2<ad57>8.918 E F3
-(way-)A(pointspacing)108 225.6 Q F2<ad5620ad48>2.5 E F0(])A F1
-(DESCRIPTION)72 254.4 Q F2(mbm_r)108 266.4 Q(oute2mission)-.18 E F0 2.5
-<ad4d>2.5 G(acro to con)-2.5 E -.15(ve)-.4 G(rt an).15 E F2(mbgrdviz)2.5
-E F0(route \214le into an MB)2.5 E(ARI A)-.35 E(UV mission script.)-.55
-E(MB)108 290.4 Q .075(ARI Autonomous Underw)-.35 F .075(ater V)-.1 F
-.075(ehicles, or A)-1.11 F .075
-(UVs, are controlled using a layered beha)-.55 F .075
+9.475 E F3(speed)A F2<ad54>9.475 E F3(starttime)A F2<ad55>9.475 E F3
+(max-)A(climbr)108 225.6 Q(ate)-.15 E F2<ad57>2.5 E F3(waypointspacing)A
+F2<ad5620ad48>2.5 E F0(])A F1(DESCRIPTION)72 254.4 Q F2(mbm_r)108 266.4
+Q(oute2mission)-.18 E F0 2.5<ad4d>2.5 G(acro to con)-2.5 E -.15(ve)-.4 G
+(rt an).15 E F2(mbgrdviz)2.5 E F0(route \214le into an MB)2.5 E(ARI A)
+-.35 E(UV mission script.)-.55 E(MB)108 290.4 Q .075
+(ARI Autonomous Underw)-.35 F .075(ater V)-.1 F .075(ehicles, or A)-1.11
+F .075(UVs, are controlled using a layered beha)-.55 F .075
 (vior system that is)-.2 F .085
 (speci\214ed using a mission script. This macro generates an MB)108
 302.4 R .085(ARI A)-.35 F .086(UV mission script from an)-.55 F F2
@@ -340,8 +340,8 @@ en \215y le)-.15 F -.15(ve)-.25 G 3.548(lu).15 G 1.048(ntil the)-3.548 F
 3.051 E F0 .551(meters. In that circumstance, the)3.051 F -.15(ve)108
 722.4 S .013(hicle \215ies in an altitude-follo).15 F .013
 (wing mode. Thus, for consistent bottom-follo)-.25 F .013
-(wing, a common approach is to)-.25 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
+(wing, a common approach is to)-.25 F(MB-System 5.0)72 768 Q
+(22 February 2015)135.11 E(1)193.45 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
@@ -454,8 +454,7 @@ ond to the minimum altitude.)-2.902 F .402(The user)5.402 F 2.359
 (ehicle is commanded to \215y a depth pro\214le that is)-.15 F 2.5(al)
 144 710.4 S(inear ramp between the tw)-2.5 E 2.5(od)-.1 G(epths. Def)
 -2.5 E(ault:)-.1 E F1(behavior)2.5 E F0 2.5(=1)2.5 G(;)-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
+(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(2)193.45 E 0 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
@@ -560,8 +559,8 @@ F1<ad4e>108 691.2 Q F2(spir)23.08 E(aldescentaltitude)-.15 E F0 .125
 (aldescen-)-.15 E(taltitude)144 715.2 Q F0 .737(if speci\214ed here. Ot\
 herwise, the descent is terminated at the altitude)3.237 F F2(altdesir)
 3.236 E(ed)-.37 E F0 .736(from the)3.236 F F1<ad41>144 727.2 Q F0
-(option.)2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(3)204.835 E 0 Cg EP
+(option.)2.5 E(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(3)193.45
+E 0 Cg EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
@@ -610,197 +609,212 @@ F0 .16(This sets the e)144 319.2 R .16(xpected time required for the A)
 -.1 F .459 -.15(ey m)-.15 H(ission.).15 E 1.421(If neither the)144 331.2
 R F1<ad50>3.921 E F0(or)3.921 E F1<ad54>3.921 E F0 1.421
 (options are speci\214ed, a distance of 500 meters to the \214rst w)
-3.921 F 1.422(aypoint is)-.1 F(assumed.)144 343.2 Q F1<ad57>108 360 Q F2
-(waypointspacing)20.3 E F0(Sets the spacing in meters of the w)144 372 Q
-(aypoints output to the mission script.)-.1 E F1<ad56>108 388.8 Q F0
+3.921 F 1.422(aypoint is)-.1 F(assumed.)144 343.2 Q F1<ad55>108 360 Q F2
+(maxclimbr)23.08 E(ate)-.15 E F0 .837
+(This sets the maximum climb rate in de)144 372 R .837(grees allo)-.15 F
+.836(wed to be planned for the A)-.25 F .836(UV mission. If the)-.55 F
+(topograph)144 384 Q 3.698(yh)-.05 G 1.198(as a greater slope, the A)
+-3.698 F 1.198(UV will be brought up earlier so the planned climb angle)
+-.55 F(ne)144 396 Q -.15(ve)-.25 G 2.5(re).15 G(xceed)-2.65 E F2
+(maxclimbr)2.5 E(ate)-.15 E F0 5(.D)C(ef)-5 E(ault:)-.1 E F2(maxclimbr)
+2.5 E(ate)-.15 E F0 2.5(=2)2.5 G 2.5(5d)-2.5 G -.15(eg)-2.5 G(rees.).15
+E F1<ad57>108 412.8 Q F2(waypointspacing)20.3 E F0
+(Sets the spacing in meters of the w)144 424.8 Q
+(aypoints output to the mission script.)-.1 E F1<ad56>108 441.6 Q F0
 (The)23.08 E F1<ad56>2.5 E F0(option causes)2.5 E F1(mbm_r)2.5 E
 (oute2mission)-.18 E F0(to print out status messages.)2.5 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 417.6 Q F0 1.345
-(Suppose you are going to run the MB)108 429.6 R 1.345(ARI Mapping A)
+/Times-Bold at 0 SF(EXAMPLES)72 470.4 Q F0 1.345
+(Suppose you are going to run the MB)108 482.4 R 1.345(ARI Mapping A)
 -.35 F 1.344(UV on the Coaxial Se)-.55 F 1.344
-(gment of the Juan de Fuca)-.15 F 1.532(Ridge. Y)108 441.6 R 1.532
+(gment of the Juan de Fuca)-.15 F 1.532(Ridge. Y)108 494.4 R 1.532
 (ou ha)-1.1 F 1.832 -.15(ve c)-.2 H 1.532
 (reated a route \214le called Coaxial2009_1v3.rte using).15 F F1
 (mbgrdviz)4.032 E F0 4.032(.I)C 4.032(no)-4.032 G 1.532
-(rder to create an)-4.032 F(MB)108 453.6 Q .108(ARI A)-.35 F .108
+(rder to create an)-4.032 F(MB)108 506.4 Q .108(ARI A)-.35 F .108
 (UV mission script for mission be)-.55 F .107
 (ginning with a spiral descent to an altitude of 50 m, follo)-.15 F .107
-(wed by)-.25 F 2.5(as)108 465.6 S(urv)-2.5 E .3 -.15(ey r)-.15 H
+(wed by)-.25 F 2.5(as)108 518.4 S(urv)-2.5 E .3 -.15(ey r)-.15 H
 (un at a 75 m altitude, the follo).15 E(wing will suf)-.25 E(\214ce:)
--.25 E 4.09(mbm_route2mission \255I Coaxial2009_1v3.rte)144 477.6 R 4.09
+-.25 E 4.09(mbm_route2mission \255I Coaxial2009_1v3.rte)144 530.4 R 4.09
 (-A75/30/75 \255B1)75.73 F(-G0)46.17 E(\255MSL \255N50 \255R220/83/0.3)
-108 489.6 Q(-O Coaxial2009_1v3.cfg)70.57 E(-S1.5 \255L30 \255W100 \255V)
-44.57 E(The resulting mission script has the follo)108 501.6 Q
-(wing header:)-.25 E 2.5(#T)120.5 525.6 S(his MB)-2.5 E(ARI Mapping A)
--.35 E(UV mission \214le has been generated)-.55 E 2.5(#b)120.5 537.6 S
+108 542.4 Q(-O Coaxial2009_1v3.cfg)70.57 E(-S1.5 \255L30 \255W100 \255V)
+44.57 E(The resulting mission script has the follo)108 554.4 Q
+(wing header:)-.25 E 2.5(#T)120.5 578.4 S(his MB)-2.5 E(ARI Mapping A)
+-.35 E(UV mission \214le has been generated)-.55 E 2.5(#b)120.5 590.4 S
 2.5(yt)-2.5 G(he MB-System program mbm_route2mission run by)-2.5 E 2.5
-(#u)120.5 549.6 S
+(#u)120.5 602.4 S
 (ser <caress> on cpu <shepard> at <Thu Jul 30 11:36:47 PDT 2009>)-2.5 E
-(#)120.5 561.6 Q 2.5(#M)120.5 573.6 S(ission Summary:)-2.5 E 12.5(#R)
-120.5 585.6 S(oute File:)-12.5 E(Coaxial2009_1v3.rte)37.5 E 12.5(#M)
-120.5 597.6 S(ission File:)-12.5 E(Coaxial2009_1v3.cfg)32.5 E 12.5(#D)
-120.5 609.6 S 40(istance: 79501.503455)-12.5 F(\(m\))2.5 E 12.5(#E)120.5
-621.6 S(stimated T)-12.5 E 25(ime: 57203)-.35 F 2.5(\(s\) 15.890)2.5 F
-(\(hr\))2.5 E 12.5(#A)120.5 633.6 S(bort T)-12.5 E 35(ime: 60067)-.35 F
-(\(s\))2.5 E 12.5(#M)120.5 645.6 S(ax battery life:)-12.5 E(64800 \(s\))
-22.5 E 12.5(#S)120.5 657.6 S(afety mar)-12.5 E 27.5(gin: 1800)-.18 F
-(\(s\))2.5 E 12.5(#A)120.5 669.6 S(scend time:)-12.5 E(2932 \(s\))35 E
-12.5(#W)120.5 681.6 S(ay Points:)-13.3 E(44)37.5 E 12.5(#R)120.5 693.6 S
-(oute Points:)-12.5 E(550)32.5 E 12.5(#S)120.5 705.6 S(urv)-12.5 E .3
--.15(ey b)-.15 H(eha).15 E 22.5(vior: W)-.2 F(aypointDepth)-.8 E 12.5
-(#D)120.5 717.6 S(escent style:)-12.5 E(Spiral descent)30 E 12.5(#M)
-120.5 729.6 S(apping sonar control enabled:)-12.5 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
+(#)120.5 614.4 Q 2.5(#M)120.5 626.4 S(ission Summary:)-2.5 E 12.5(#R)
+120.5 638.4 S(oute File:)-12.5 E(Coaxial2009_1v3.rte)37.5 E 12.5(#M)
+120.5 650.4 S(ission File:)-12.5 E(Coaxial2009_1v3.cfg)32.5 E 12.5(#D)
+120.5 662.4 S 40(istance: 79501.503455)-12.5 F(\(m\))2.5 E 12.5(#E)120.5
+674.4 S(stimated T)-12.5 E 25(ime: 57203)-.35 F 2.5(\(s\) 15.890)2.5 F
+(\(hr\))2.5 E 12.5(#A)120.5 686.4 S(bort T)-12.5 E 35(ime: 60067)-.35 F
+(\(s\))2.5 E 12.5(#M)120.5 698.4 S(ax battery life:)-12.5 E(64800 \(s\))
+22.5 E 12.5(#S)120.5 710.4 S(afety mar)-12.5 E 27.5(gin: 1800)-.18 F
+(\(s\))2.5 E 12.5(#A)120.5 722.4 S(scend time:)-12.5 E(2932 \(s\))35 E
+(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(4)193.45 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F 77.5(#M)120.5 84 S
-(ultibeam enabled)-77.5 E 82.5(#M)120.5 96 S(ultibeam recei)-82.5 E .3
--.15(ve g)-.25 H 25(ain: 83).1 F 82.5(#M)120.5 108 S
-(ultibeam transmit g)-82.5 E 22.5(ain: 220)-.05 F 82.5(#M)120.5 120 S
-(ultibeam minimum range fraction: 0.3)-82.5 E 77.5(#S)120.5 132 S
-(ubbottom enabled)-77.5 E 77.5(#L)120.5 144 S .5 -.25(ow s)-77.5 H
-(idescan enabled).25 E 77.5(#H)120.5 156 S(igh sidescan disabled)-77.5 E
-(#)120.5 168 Q 2.5(#M)120.5 180 S(ission P)-2.5 E(arameters:)-.15 E 12.5
-(#V)120.5 192 S(ehicle Speed:)-13.61 E
-(1.500000 \(m/s\) 2.915769 \(knots\))30 E 12.5(#D)120.5 204 S(esired V)
--12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#M)120.5 216 S(inimum V)
--12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#A)120.5 228 S(bort V)
--12.5 E(ehicle Altitude:)-1.11 E(30 \(m\))7.5 E 12.5(#M)120.5 240 S
+105.94(5.0 mbm_route2mission\(1\))2.5 F 12.5(#W)120.5 84 S(ay Points:)
+-13.3 E(44)37.5 E 12.5(#R)120.5 96 S(oute Points:)-12.5 E(550)32.5 E
+12.5(#S)120.5 108 S(urv)-12.5 E .3 -.15(ey b)-.15 H(eha).15 E 22.5
+(vior: W)-.2 F(aypointDepth)-.8 E 12.5(#D)120.5 120 S(escent style:)
+-12.5 E(Spiral descent)30 E 12.5(#M)120.5 132 S
+(apping sonar control enabled:)-12.5 E 77.5(#M)120.5 144 S
+(ultibeam enabled)-77.5 E 82.5(#M)120.5 156 S(ultibeam recei)-82.5 E .3
+-.15(ve g)-.25 H 25(ain: 83).1 F 82.5(#M)120.5 168 S
+(ultibeam transmit g)-82.5 E 22.5(ain: 220)-.05 F 82.5(#M)120.5 180 S
+(ultibeam minimum range fraction: 0.3)-82.5 E 77.5(#S)120.5 192 S
+(ubbottom enabled)-77.5 E 77.5(#L)120.5 204 S .5 -.25(ow s)-77.5 H
+(idescan enabled).25 E 77.5(#H)120.5 216 S(igh sidescan disabled)-77.5 E
+(#)120.5 228 Q 2.5(#M)120.5 240 S(ission P)-2.5 E(arameters:)-.15 E 12.5
+(#V)120.5 252 S(ehicle Speed:)-13.61 E
+(1.500000 \(m/s\) 2.915769 \(knots\))30 E 12.5(#D)120.5 264 S(esired V)
+-12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#M)120.5 276 S(inimum V)
+-12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#A)120.5 288 S(bort V)
+-12.5 E(ehicle Altitude:)-1.11 E(30 \(m\))7.5 E 12.5(#M)120.5 300 S
 (aximum V)-12.5 E(ehicle Depth:)-1.11 E(2525.307922 \(m\))10 E 12.5(#A)
-120.5 252 S(bort V)-12.5 E(ehicle Depth:)-1.11 E(2562.807922 \(m\))15 E
-12.5(#D)120.5 264 S(escent V)-12.5 E(ehicle Depth:)-1.11 E 2.5(3\()10 G
-(m\))-2.5 E 12.5(#S)120.5 276 S(piral descent depth:)-12.5 E
-(2324.917643 m)12.5 E 12.5(#S)120.5 288 S(piral descent altitude:)-12.5
-E(50 m)5 E 12.5(#F)120.5 300 S(orw)-12.65 E(ard Looking Distance:)-.1 E
-(\(m\))5 E 12.5(#W)120.5 312 S(aypoint Spacing:)-13.3 E(100 \(m\))22.5 E
-12.5(#G)120.5 324 S(PS Duration:)-12.5 E(600 \(s\))32.5 E 12.5(#D)120.5
-336 S(escend Rate:)-12.5 E(0.417 \(m/s\))32.5 E 12.5(#A)120.5 348 S
-(scend Rate:)-12.5 E 2.5(1\()35 G(m/s\))-2.5 E 12.5(#I)120.5 360 S
-(nitial descend Duration: 300 \(s\))-12.5 E 12.5(#S)120.5 372 S
-(etpoint Duration:)-12.5 E(30 \(s\))20 E(#)120.5 384 Q 2.5(#T)120.5 396
+120.5 312 S(bort V)-12.5 E(ehicle Depth:)-1.11 E(2562.807922 \(m\))15 E
+12.5(#D)120.5 324 S(escent V)-12.5 E(ehicle Depth:)-1.11 E 2.5(3\()10 G
+(m\))-2.5 E 12.5(#S)120.5 336 S(piral descent depth:)-12.5 E
+(2324.917643 m)12.5 E 12.5(#S)120.5 348 S(piral descent altitude:)-12.5
+E(50 m)5 E 12.5(#F)120.5 360 S(orw)-12.65 E(ard Looking Distance:)-.1 E
+(\(m\))5 E 12.5(#W)120.5 372 S(aypoint Spacing:)-13.3 E(100 \(m\))22.5 E
+12.5(#G)120.5 384 S(PS Duration:)-12.5 E(600 \(s\))32.5 E 12.5(#D)120.5
+396 S(escend Rate:)-12.5 E(0.417 \(m/s\))32.5 E 12.5(#A)120.5 408 S
+(scend Rate:)-12.5 E 2.5(1\()35 G(m/s\))-2.5 E 12.5(#I)120.5 420 S
+(nitial descend Duration: 300 \(s\))-12.5 E 12.5(#S)120.5 432 S
+(etpoint Duration:)-12.5 E(30 \(s\))20 E(#)120.5 444 Q 2.5(#T)120.5 456
 S(he primary w)-2.5 E(aypoints from the route \214le are:)-.1 E 7.5(#<)
-120.5 408 S(number> <longitude \(de)-7.5 E(g\)> <latitude \(de)-.15 E
+120.5 468 S(number> <longitude \(de)-7.5 E(g\)> <latitude \(de)-.15 E
 (g\)> <topograph)-.15 E 2.5(y\()-.05 G(m\)> <distance \(m\)> <type>)-2.5
-E 7.5(#0)120.5 420 S
+E 7.5(#0)120.5 480 S
 (\255129.588618 46.504590 \2552384.917643 0.000000 3)-5 E 7.5(#1)120.5
-432 S(\255129.583151 46.507559 \2552412.977865 533.709482 3)-5 E 7.5(#2)
-120.5 444 S(\255129.569223 46.503420 \2552548.389974 1697.143568 1)-5 E
-7.5(#3)120.5 456 S
+492 S(\255129.583151 46.507559 \2552412.977865 533.709482 3)-5 E 7.5(#2)
+120.5 504 S(\255129.569223 46.503420 \2552548.389974 1697.143568 1)-5 E
+7.5(#3)120.5 516 S
 (\255129.566359 46.501080 \2552494.963053 2037.557099 3)-5 E 7.5(#4)
-120.5 468 S(\255129.548611 46.529852 \2552539.510864 5512.537193 4)-5 E
-7.5(#5)120.5 480 S
+120.5 528 S(\255129.548611 46.529852 \2552539.510864 5512.537193 4)-5 E
+7.5(#5)120.5 540 S
 (\255129.551250 46.530628 \2552562.807922 5732.537193 3)-5 E 7.5(#6)
-120.5 492 S(\255129.568962 46.501924 \2552531.034424 9199.497998 4)-5 E
-7.5(#7)120.5 504 S
+120.5 552 S(\255129.568962 46.501924 \2552531.034424 9199.497998 4)-5 E
+7.5(#7)120.5 564 S
 (\255129.571600 46.502699 \2552519.138489 9419.497998 3)-5 E 7.5(#8)
-120.5 516 S(\255129.553889 46.531404 \2552547.114624 12886.458803 4)-5 E
-7.5(#9)120.5 528 S
+120.5 576 S(\255129.553889 46.531404 \2552547.114624 12886.458803 4)-5 E
+7.5(#9)120.5 588 S
 (\255129.556529 46.532180 \2552514.533569 13106.458803 3)-5 E 7.5(#1)
-120.5 540 S 2.5<30ad>-7.5 G
+120.5 600 S 2.5<30ad>-7.5 G
 (129.574238 46.503475 \2552470.815735 16573.419607 4)-2.5 E 7.5(#1)120.5
-552 S 2.5<31ad>-7.5 G
+612 S 2.5<31ad>-7.5 G
 (129.576876 46.504250 \2552444.596313 16793.419607 3)-2.5 E 7.5(#1)120.5
-564 S 2.5<32ad>-7.5 G
+624 S 2.5<32ad>-7.5 G
 (129.559168 46.532956 \2552521.781921 20260.380412 4)-2.5 E 7.5(#1)120.5
-576 S 2.5<33ad>-7.5 G
+636 S 2.5<33ad>-7.5 G
 (129.561807 46.533732 \2552537.382141 20480.380412 3)-2.5 E 7.5(#1)120.5
-588 S 2.5<34ad>-7.5 G
+648 S 2.5<34ad>-7.5 G
 (129.579514 46.505026 \2552429.459961 23947.341216 4)-2.5 E 7.5(#1)120.5
-600 S 2.5<35ad>-7.5 G
+660 S 2.5<35ad>-7.5 G
 (129.582152 46.505801 \2552412.764343 24167.341217 3)-2.5 E 7.5(#1)120.5
-612 S 2.5<36ad>-7.5 G
+672 S 2.5<36ad>-7.5 G
 (129.564447 46.534508 \2552545.397705 27634.302021 4)-2.5 E 7.5(#1)120.5
-624 S 2.5<37ad>-7.5 G
+684 S 2.5<37ad>-7.5 G
 (129.567086 46.535284 \2552534.068665 27854.302021 3)-2.5 E 7.5(#1)120.5
-636 S 2.5<38ad>-7.5 G
+696 S 2.5<38ad>-7.5 G
 (129.584791 46.506576 \2552398.283020 31321.262826 4)-2.5 E 7.5(#1)120.5
-648 S 2.5<39ad>-7.5 G
+708 S 2.5<39ad>-7.5 G
 (129.587429 46.507352 \2552390.671509 31541.262826 3)-2.5 E 7.5(#2)120.5
-660 S 2.5<30ad>-7.5 G
-(129.569726 46.536059 \2552489.889282 35008.223630 4)-2.5 E 7.5(#2)120.5
-672 S 2.5<31ad>-7.5 G
-(129.572365 46.536835 \2552465.280823 35228.223630 3)-2.5 E 7.5(#2)120.5
-684 S 2.5<32ad>-7.5 G
-(129.590068 46.508127 \2552389.067017 38695.184435 4)-2.5 E 7.5(#2)120.5
-696 S 2.5<33ad>-7.5 G
-(129.592706 46.508902 \2552409.290771 38915.184435 3)-2.5 E 7.5(#2)120.5
-708 S 2.5<34ad>-7.5 G
-(129.575005 46.537610 \2552466.533142 42382.145240 4)-2.5 E 7.5(#2)120.5
-720 S 2.5<35ad>-7.5 G
-(129.577645 46.538386 \2552491.371094 42602.145240 3)-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0
-Cg EP
+720 S 2.5<30ad>-7.5 G
+(129.569726 46.536059 \2552489.889282 35008.223630 4)-2.5 E
+(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(5)193.45 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F 7.5(#2)120.5 84 S 2.5<36ad>-7.5
-G(129.595345 46.509677 \2552397.609253 46069.106044 4)-2.5 E 7.5(#2)
-120.5 96 S 2.5<37ad>-7.5 G
+105.94(5.0 mbm_route2mission\(1\))2.5 F 7.5(#2)120.5 84 S 2.5<31ad>-7.5
+G(129.572365 46.536835 \2552465.280823 35228.223630 3)-2.5 E 7.5(#2)
+120.5 96 S 2.5<32ad>-7.5 G
+(129.590068 46.508127 \2552389.067017 38695.184435 4)-2.5 E 7.5(#2)120.5
+108 S 2.5<33ad>-7.5 G
+(129.592706 46.508902 \2552409.290771 38915.184435 3)-2.5 E 7.5(#2)120.5
+120 S 2.5<34ad>-7.5 G
+(129.575005 46.537610 \2552466.533142 42382.145240 4)-2.5 E 7.5(#2)120.5
+132 S 2.5<35ad>-7.5 G
+(129.577645 46.538386 \2552491.371094 42602.145240 3)-2.5 E 7.5(#2)120.5
+144 S 2.5<36ad>-7.5 G
+(129.595345 46.509677 \2552397.609253 46069.106044 4)-2.5 E 7.5(#2)120.5
+156 S 2.5<37ad>-7.5 G
 (129.597984 46.510452 \2552413.315918 46289.106044 3)-2.5 E 7.5(#2)120.5
-108 S 2.5<38ad>-7.5 G
+168 S 2.5<38ad>-7.5 G
 (129.580285 46.539161 \2552499.048889 49756.066849 4)-2.5 E 7.5(#2)120.5
-120 S 2.5<39ad>-7.5 G
+180 S 2.5<39ad>-7.5 G
 (129.582925 46.539937 \2552523.030640 49976.066849 3)-2.5 E 7.5(#3)120.5
-132 S 2.5<30ad>-7.5 G
+192 S 2.5<30ad>-7.5 G
 (129.600622 46.511227 \2552443.481018 53443.027653 4)-2.5 E 7.5(#3)120.5
-144 S 2.5<31ad>-7.5 G
+204 S 2.5<31ad>-7.5 G
 (129.603261 46.512002 \2552419.008240 53663.027653 3)-2.5 E 7.5(#3)120.5
-156 S 2.5<32ad>-7.5 G
+216 S 2.5<32ad>-7.5 G
 (129.585565 46.540712 \2552518.522400 57129.988458 4)-2.5 E 7.5(#3)120.5
-168 S 2.5<33ad>-7.5 G
+228 S 2.5<33ad>-7.5 G
 (129.588205 46.541487 \2552498.521301 57349.988458 3)-2.5 E 7.5(#3)120.5
-180 S 2.5<34ad>-7.5 G
+240 S 2.5<34ad>-7.5 G
 (129.605900 46.512777 \2552450.386536 60816.949263 4)-2.5 E 7.5(#3)120.5
-192 S 2.5<35ad>-7.5 G
+252 S 2.5<35ad>-7.5 G
 (129.608539 46.513552 \2552473.623230 61036.949263 3)-2.5 E 7.5(#3)120.5
-204 S 2.5<36ad>-7.5 G
+264 S 2.5<36ad>-7.5 G
 (129.590845 46.542262 \2552487.422180 64503.910067 4)-2.5 E 7.5(#3)120.5
-216 S 2.5<37ad>-7.5 G
+276 S 2.5<37ad>-7.5 G
 (129.593485 46.543038 \2552491.040466 64723.910067 3)-2.5 E 7.5(#3)120.5
-228 S 2.5<38ad>-7.5 G
+288 S 2.5<38ad>-7.5 G
 (129.611178 46.514327 \2552472.610657 68190.870872 3)-2.5 E 7.5(#3)120.5
-240 S 2.5<39ad>-7.5 G
+300 S 2.5<39ad>-7.5 G
 (129.606711 46.517999 \2552485.114583 68723.704236 3)-2.5 E 7.5(#4)120.5
-252 S 2.5<30ad>-7.5 G
+312 S 2.5<30ad>-7.5 G
 (129.557338 46.509809 \2552488.398743 72619.152031 3)-2.5 E 7.5(#4)120.5
-264 S 2.5<31ad>-7.5 G
+324 S 2.5<31ad>-7.5 G
 (129.550415 46.521262 \2552545.285828 73998.189601 3)-2.5 E 7.5(#4)120.5
-276 S 2.5<32ad>-7.5 G
+336 S 2.5<32ad>-7.5 G
 (129.600724 46.536447 \2552470.920736 78209.372536 3)-2.5 E 7.5(#4)120.5
-288 S 2.5<33ad>-7.5 G
-(129.606972 46.525648 \2552443.988281 79501.503455 4)-2.5 E(#)120.5 300
-Q 2.5(#At)120.5 312 S(otal of 550 mission points ha)-2.5 E .3 -.15(ve b)
--.2 H(een de\214ned.).15 E(#)120.5 324 Q 2.5(#D)120.5 336 S
-(e\214ne Mission parameters:)-2.5 E(#de\214ne MISSION_SPEED)120.5 348 Q
-(1.500000)15 E(#de\214ne MISSION_DIST)120.5 360 Q 5(ANCE 79501.503455)
--.93 F(#de\214ne MISSION_TIME)120.5 372 Q(57203)17.5 E
-(#de\214ne MISSION_TIMEOUT)120.5 384 Q(60067)10 E(#de\214ne DEPTH_MAX)
-120.5 396 Q(2525.307922)25 E(#de\214ne DEPTH_ABOR)120.5 408 Q 20(T2)-.6
-G(562.807922)-20 E(#de\214ne AL)120.5 420 Q 5(TITUDE_DESIRED 75.000000)
--.92 F(#de\214ne AL)120.5 432 Q 15(TITUDE_MIN 75.000000)-.92 F
-(#de\214ne AL)120.5 444 Q(TITUDE_ABOR)-.92 E 12.5(T3)-.6 G(0.000000)
--12.5 E(#de\214ne GPS_DURA)120.5 456 Q 15(TION 600)-1.11 F
-(#de\214ne DESCENT_DEPTH)120.5 468 Q(3.000000)15 E
-(#de\214ne SPIRAL_DESCENT_DEPTH)120.5 480 Q(2324.917643)15 E
-(#de\214ne SPIRAL_DESCENT_AL)120.5 492 Q 5(TITUDE 50.000000)-.92 F
-(#de\214ne DESCEND_DURA)120.5 504 Q 5(TION 300)-1.11 F
-(#de\214ne SETPOINT_DURA)120.5 516 Q 2.5(TION 30)-1.11 F
-(#de\214ne GPSMINHITS)120.5 528 Q(10)22.5 E(#de\214ne ASCENDR)120.5 540
-Q 15(UDDER 3.000000)-.4 F(#de\214ne ASCENDPITCH)120.5 552 Q(45.000000)20
-E(#de\214ne ASCENDENDDEPTH)120.5 564 Q(2.000000)12.5 E
-(#de\214ne DESCENDR)120.5 576 Q 12.5(UDDER 3.000000)-.4 F
-(#de\214ne DESCENDPITCH)120.5 588 Q(\25530.000000)17.5 E
-(#de\214ne MAXCR)120.5 600 Q(OSSTRA)-.4 E(CKERR)-.4 E(OR 30)-.4 E
-(#de\214ne RESON_DURA)120.5 612 Q 10(TION 6)-1.11 F(#q)120.5 624 Q/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 652.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 664.8 Q F0(\(1\),)A F2(mbgrdviz)2.5 E F0(\(1\))A F1 -.11
-(BU)72 693.6 S(GS).11 E F0(Perhaps.)108 705.6 Q(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(6)204.835 E 0 Cg EP
+348 S 2.5<33ad>-7.5 G
+(129.606972 46.525648 \2552443.988281 79501.503455 4)-2.5 E(#)120.5 360
+Q 2.5(#At)120.5 372 S(otal of 550 mission points ha)-2.5 E .3 -.15(ve b)
+-.2 H(een de\214ned.).15 E(#)120.5 384 Q 2.5(#D)120.5 396 S
+(e\214ne Mission parameters:)-2.5 E(#de\214ne MISSION_SPEED)120.5 408 Q
+(1.500000)15 E(#de\214ne MISSION_DIST)120.5 420 Q 5(ANCE 79501.503455)
+-.93 F(#de\214ne MISSION_TIME)120.5 432 Q(57203)17.5 E
+(#de\214ne MISSION_TIMEOUT)120.5 444 Q(60067)10 E(#de\214ne DEPTH_MAX)
+120.5 456 Q(2525.307922)25 E(#de\214ne DEPTH_ABOR)120.5 468 Q 20(T2)-.6
+G(562.807922)-20 E(#de\214ne AL)120.5 480 Q 5(TITUDE_DESIRED 75.000000)
+-.92 F(#de\214ne AL)120.5 492 Q 15(TITUDE_MIN 75.000000)-.92 F
+(#de\214ne AL)120.5 504 Q(TITUDE_ABOR)-.92 E 12.5(T3)-.6 G(0.000000)
+-12.5 E(#de\214ne GPS_DURA)120.5 516 Q 15(TION 600)-1.11 F
+(#de\214ne DESCENT_DEPTH)120.5 528 Q(3.000000)15 E
+(#de\214ne SPIRAL_DESCENT_DEPTH)120.5 540 Q(2324.917643)15 E
+(#de\214ne SPIRAL_DESCENT_AL)120.5 552 Q 5(TITUDE 50.000000)-.92 F
+(#de\214ne DESCEND_DURA)120.5 564 Q 5(TION 300)-1.11 F
+(#de\214ne SETPOINT_DURA)120.5 576 Q 2.5(TION 30)-1.11 F
+(#de\214ne GPSMINHITS)120.5 588 Q(10)22.5 E(#de\214ne ASCENDR)120.5 600
+Q 15(UDDER 3.000000)-.4 F(#de\214ne ASCENDPITCH)120.5 612 Q(45.000000)20
+E(#de\214ne ASCENDENDDEPTH)120.5 624 Q(2.000000)12.5 E
+(#de\214ne DESCENDR)120.5 636 Q 12.5(UDDER 3.000000)-.4 F
+(#de\214ne DESCENDPITCH)120.5 648 Q(\25530.000000)17.5 E
+(#de\214ne MAXCR)120.5 660 Q(OSSTRA)-.4 E(CKERR)-.4 E(OR 30)-.4 E
+(#de\214ne RESON_DURA)120.5 672 Q 10(TION 6)-1.11 F(#q)120.5 684 Q
+(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(6)193.45 E 0 Cg EP
+%%Page: 7 7
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
+105.94(5.0 mbm_route2mission\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
+(SEE ALSO)72 84 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2
+(mbgrdviz)2.5 E F0(\(1\))A F1 -.11(BU)72 124.8 S(GS).11 E F0(Perhaps.)
+108 136.8 Q(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(7)193.45 E
+0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbm_stat.ps b/src/ps/mbm_stat.ps
index 94f1556..6e7bbbb 100644
--- a/src/ps/mbm_stat.ps
+++ b/src/ps/mbm_stat.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_utm.ps b/src/ps/mbm_utm.ps
index 6040ee1..8a463b1 100644
--- a/src/ps/mbm_utm.ps
+++ b/src/ps/mbm_utm.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_vrefcheck.ps b/src/ps/mbm_vrefcheck.ps
index 7f82418..2ed7895 100644
--- a/src/ps/mbm_vrefcheck.ps
+++ b/src/ps/mbm_vrefcheck.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_xbt.ps b/src/ps/mbm_xbt.ps
index 68b274f..824ab00 100644
--- a/src/ps/mbm_xbt.ps
+++ b/src/ps/mbm_xbt.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbm_xyplot.ps b/src/ps/mbm_xyplot.ps
index bcdf91c..fdc3b8e 100644
--- a/src/ps/mbm_xyplot.ps
+++ b/src/ps/mbm_xyplot.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -245,8 +245,8 @@ F3([\214lepar)A(s:]\214le)-.1 E F2<ad47>2.641 E F3(\214ll)A F2 .141
 -.2 E F2<ad4a>2.5 E F3(pr)A(ojection[/scale | width])-.45 E F2<ad4c>2.5
 E F3(title[:xlabel:ylabel])A F2<ad4d>2.5 E F3(misc)A F2<ad5120ad52>2.5 E
 F3(w/e/s/n)A F2<ad5820ad5a>2.5 E F3(])A(Miscellaneous Options:)108 249.6
-Q([)108 261.6 Q F2(\255MGD)A F3(gmtdef/value)A F2(\255MGL)30.595 E F3
-([f][x]lon0/lat0/slat/length[m])A F2(\255MGT)30.595 E F3
+Q([)108 261.6 Q F2(\255MGD)A F3(gmtdef/value)A F2(\255MGL)5.825 E F3
+([f][x]lon0/lat0/slat/length[units][+llabel])A F2(\255MGT)5.825 E F3
 (x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)108 273.6 Q F3
 (/dx/dy/)A F2(][)A F3(label)A F2 2.5(]])C F1(DESCRIPTION)72 302.4 Q F2
 (mbm_xyplot)108 314.4 Q F0 .045
@@ -305,679 +305,718 @@ Q(ault, b)-.1 E(ut can optionally be retained for deb)-.2 E
 1.218(guments are)-.18 F(pro)108 590.4 Q .024(vided. T)-.15 F .024
 (ruly ambitious users may edit the plot shellscript to tak)-.35 F 2.525
 (ea)-.1 G(dv)-2.525 E .025(antage of GMT capabilities not sup-)-.25 F
-(ported by this macro.)108 602.4 Q F1 -.548(AU)72 631.2 S(THORSHIP).548
-E F0(Da)108 643.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)
--2.5 E(g\))-.18 E(Montere)113 655.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 667.2 Q
-(Lamont-Doherty Earth Observ)113 679.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 691.2 Q
-(Lamont-Doherty Earth Observ)113 703.2 Q(atory)-.25 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
+(ported by this macro.)108 602.4 Q .084(By def)108 626.4 R .083
+(ault the output plot generation shellscript includes lines which e)-.1
+F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
+ript image on the screen. The program to be used to display the Postscr\
+ipt is set using)108 638.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
+-3.308 E(def)108 650.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
+-.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
+F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
+(king the plot).2 F(generation shellscript with a)108 662.4 Q F2(-N)2.5
+E F0(command line ar)2.5 E
+(gument suppresses the screen display of the plot.)-.18 E .305
+(The plot scripts generated by this macro will w)108 686.4 R .305
+(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
+.305(nd are not compatible)-2.805 F(with earlier v)108 698.4 Q
+(ersions of GMT)-.15 E(.)-.74 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
+(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
-(SIMPLE DESCRIPTION OF B)72 84 Q(ASIC OPTIONS)-.329 E/F2 10/Times-Bold at 0
-SF<ad47>108 96 Q/F3 10/Times-Italic at 0 SF(\214ll)22.52 E F0 .393
-(Select \214lling of symbols for xy plotting.)144 108 R .393
+(5.0 mbm_xyplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.548(AU)72 84 S
+(THORSHIP).548 E F0(Da)108 96 Q(vid W)-.2 E 2.5(.C)-.92 G
+(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 108 Q 2.5(yB)-.15
+G(ay Aquarium Research Institute)-2.5 E
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 120 Q
+(Lamont-Doherty Earth Observ)113 132 Q(atory)-.25 E
+(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 144 Q
+(Lamont-Doherty Earth Observ)113 156 Q(atory)-.25 E F1
+(SIMPLE DESCRIPTION OF B)72 184.8 Q(ASIC OPTIONS)-.329 E/F2 10
+/Times-Bold at 0 SF<ad47>108 196.8 Q/F3 10/Times-Italic at 0 SF(\214ll)22.52 E
+F0 .393(Select \214lling of symbols for xy plotting.)144 208.8 R .393
 (Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 120 T .948
+(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 220.8 T .948
 (eset no \214ll, use).8 F F3(\214ll)3.448 E F0 3.449(=")3.448 G 3.449
 (N". F)-3.449 F .949(or polygons, you may optionally specify)-.15 F F2
-(\255Gp)3.449 E F3(icon_size/pattern)A F0(,)A(where)144 132 Q F3
+(\255Gp)3.449 E F3(icon_size/pattern)A F0(,)A(where)144 232.8 Q F3
 (pattern)3.652 E F0(gi)3.652 E -.15(ve)-.25 G 3.652(st).15 G 1.151(he n\
 umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.652 F F3(icon_size)144 144 Q F0 1.128(sets the unit size in inch.)
-3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4(nv e).8 H 1.128
-(rt black and white pix).4 F 1.128(els, use)-.15 F F2(\255GP)3.629 E F0
-1.129(instead of)3.629 F F2(\255Gp)3.629 E F0(.)A(See)144 156 Q F2(GMTs)
-2.5 E F0(Cookbook & T)2.5 E
+.)-3.652 F F3(icon_size)144 244.8 Q F0 1.128
+(sets the unit size in inch.)3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4
+(nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F2
+(\255GP)3.629 E F0 1.129(instead of)3.629 F F2(\255Gp)3.629 E F0(.)A
+(See)144 256.8 Q F2(GMTs)2.5 E F0(Cookbook & T)2.5 E
 (echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F2<ad48>108 172.8 Q F0 .162(This "help" \215ag\
+(vidual patterns.)-.25 E F2<ad48>108 273.6 Q F0 .162(This "help" \215ag\
  cause the program to print out a description of its operation and then\
- e)22.52 F .161(xit immedi-)-.15 F(ately)144 184.8 Q(.)-.65 E F2<ad49>
-108 201.6 Q F3([\214lepar)26.41 E(s:]xy_\214le)-.1 E F0 .866(Speci\214e\
+ e)22.52 F .161(xit immedi-)-.15 F(ately)144 285.6 Q(.)-.65 E F2<ad49>
+108 302.4 Q F3([\214lepar)26.41 E(s:]xy_\214le)-.1 E F0 .866(Speci\214e\
 s a \214le containing \(x,y\) pairs to be plotted as lines or symbols. \
-Optional parameters pre-)144 213.6 R .598
-(ceed the \214le name and consist of a list of \215ag-ar)144 225.6 R
+Optional parameters pre-)144 314.4 R .598
+(ceed the \214le name and consist of a list of \215ag-ar)144 326.4 R
 .598(gument pairs, strung together with colons. These)-.18 F(ar)144
-237.6 Q .402(guments may include the column delimiter)-.18 F 2.902(,w)
+338.4 Q .402(guments may include the column delimiter)-.18 F 2.902(,w)
 -.4 G .403(hich columns to plot, line and symbol characteris-)-2.902 F
-.057(tics and a \215ag to specify when multiple data se)144 249.6 R .056
+.057(tics and a \215ag to specify when multiple data se)144 350.4 R .056
 (gments are embedded in a single \214le. The looks lik)-.15 F(e)-.1 E
-(the follo)144 261.6 Q(wing.:)-.25 E F2(\255ID)146.5 285.6 Q F3
+(the follo)144 362.4 Q(wing.:)-.25 E F2(\255ID)146.5 386.4 Q F3
 (delimiter)A F0(:)A F2(C)A F3(columnse)A(xpr)-.2 E(ession)-.37 E F0(:)A
 F2(G)A F3(color)A F0(:)A F2(S)A F3(symbol)A F0(:)A F2(W)A F3(weight)A F0
-(:)A F2(M)A F0(:)A F2(xy\214le)A F0(Def)144 309.6 Q 1.111(ault paramete\
+(:)A F2(M)A F0(:)A F2(xy\214le)A F0(Def)144 410.4 Q 1.111(ault paramete\
 rs are whitespace [ D\(\\s+\) ], column 1 vs column 2 [ Cc[1]_c[2] ], b\
 lack lines)-.1 F
-(without symbols [ SN ], [ GN ], [ W1 ], and no multiple se)144 321.6 Q
+(without symbols [ SN ], [ GN ], [ W1 ], and no multiple se)144 422.4 Q
 (gments \(omitted M \215ag\).)-.15 E
-(Please see the "Complete Description of Options" belo)144 345.6 Q 2.5
-(wf)-.25 G(or details.)-2.5 E F2<ad4f>108 362.4 Q F3 -.45(ro)22.52 G(ot)
+(Please see the "Complete Description of Options" belo)144 446.4 Q 2.5
+(wf)-.25 G(or details.)-2.5 E F2<ad4f>108 463.2 Q F3 -.45(ro)22.52 G(ot)
 .45 E F0 .423(Sets the root used to construct the \214lename of the out\
-put shellscript \()144 374.4 R F3 -.45(ro)C(ot).45 E F0 .422
+put shellscript \()144 475.2 R F3 -.45(ro)C(ot).45 E F0 .422
 (.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 386.4 R .157
+(created when the shellscript is run.)144 487.2 R .157
 (Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 398.4 Q F3 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108
-415.2 Q F3(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
-he size of the page the plot will be centered on. If the user does not \
-set the plot)144 427.2 R .125(scale, the plot will be sized as lar)144
-439.2 R .125(ge as will \214t on the designated page. If the user sets \
-the plot scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-451.2 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-1.342(page sizes include ANSI A, B, C, D, E, F)144 463.2 R 3.842(,a)-.8
-G 1.343(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 475.2 R 3.81(wf)-.25 G
+5.157 F(as the)144 499.2 Q F3 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108
+516 Q F3(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the\
+ size of the page the plot will be centered on. If the user does not se\
+t the plot)144 528 R .125(scale, the plot will be sized as lar)144 540 R
+.125(ge as will \214t on the designated page. If the user sets the plot\
+ scale)-.18 F .948
+(such that the plot will not \214t on the designated page, a lar)144 552
+R .948(ger page will be used.)-.18 F .947(The supported)5.947 F 1.342
+(page sizes include ANSI A, B, C, D, E, F)144 564 R 3.842(,a)-.8 G 1.343
+(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
+(COMPLETE DESCRIPTION OF OPTIONS section belo)144 576 R 3.81(wf)-.25 G
 1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-487.2 Q(ault page size is A.)-.1 E F2<ad53>108 504 Q F3(symbol/size)
-24.74 E F0 .332(Selects symbol to be used for plotting the ne)144 516 R
-.332(xt xy data \214le. Setting)-.15 F F3(symbol)2.832 E F0 2.833(=")
-2.832 G .333(N" causes line plot-)-2.833 F 3.775(ting. The)144 528 R
+588 Q(ault page size is A.)-.1 E F2<ad53>108 604.8 Q F3(symbol/size)
+24.74 E F0 .332(Selects symbol to be used for plotting the ne)144 616.8
+R .332(xt xy data \214le. Setting)-.15 F F3(symbol)2.832 E F0 2.833(=")
+2.832 G .333(N" causes line plot-)-2.833 F 3.775(ting. The)144 628.8 R
 1.275(list of a)3.775 F -.25(va)-.2 G 1.275(ilable symbols is gi).25 F
 -.15(ve)-.25 G 3.775(ni).15 G 3.774(nt)-3.775 G 1.274
-(he COMPLETE DESCRIPTION OF OPTIONS)-3.774 F(section belo)144 540 Q -.65
-(w.)-.25 G F2<ad55>108 556.8 Q F3(orientation)23.08 E F0 .2(Normally th\
-e orientation of the plot \(portrait or landscape\) is selected automat\
-ically so as to maxi-)144 568.8 R .334(mize the plot scale.)144 580.8 R
-(The)5.333 E F2<ad55>2.833 E F0 .333(option allo)2.833 F .333
+(he COMPLETE DESCRIPTION OF OPTIONS)-3.774 F(section belo)144 640.8 Q
+-.65(w.)-.25 G F2<ad55>108 657.6 Q F3(orientation)23.08 E F0 .2(Normall\
+y the orientation of the plot \(portrait or landscape\) is selected aut\
+omatically so as to maxi-)144 669.6 R .334(mize the plot scale.)144
+681.6 R(The)5.333 E F2<ad55>2.833 E F0 .333(option allo)2.833 F .333
 (ws the user to set the plot orientation. If)-.25 F F3(orientation)2.833
 E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 592.8 Q F3(orientation)2.5 E F0
+(portrait plot will be produced; if)144 693.6 Q F3(orientation)2.5 E F0
 2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F2
-<ad56>108 609.6 Q F0(Causes)23.08 E F2(mbm_grdplot)4.505 E F0 2.005
+<ad56>108 710.4 Q F0(Causes)23.08 E F2(mbm_grdplot)4.505 E F0 2.005
 (to operate in "v)4.505 F 2.006
 (erbose" mode so that it outputs more information than)-.15 F(usual.)144
-621.6 Q F2<ad57>108 638.4 Q F3(pen)20.3 E F0 .784(Set pen attrib)144
-650.4 R .784(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F
-.783(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 662.4
-Q 2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1(COMPLETE DESCRIPTION OF OPTIONS)72 691.2 Q F2
-<ad42>108 703.2 Q F3(tic)23.63 E(kinfo)-.2 E F0 .218
-(Sets map boundary tickmark interv)144 715.2 R .218(als. See the)-.25 F
-F2(psbasemap)2.719 E F0 .219(manual page for details. By def)2.719 F
-.219(ault the)-.1 F
-(program chooses basemap annotations based on the map boundaries.)144
-727.2 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
+722.4 Q(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)
+198.45 E 0 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad47>108 84 Q/F2 10
-/Times-Italic at 0 SF(\214ll)22.52 E F0 .393
-(Select \214lling of symbols for xy plotting.)144 96 R .393
+(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad57>108 84 Q/F2 10
+/Times-Italic at 0 SF(pen)20.3 E F0 .784(Set pen attrib)144 96 R .784
+(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .783
+(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 108 Q 2.5
+(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
+(xture = solid].)-.15 E/F3 10.95/Times-Bold at 0 SF
+(COMPLETE DESCRIPTION OF OPTIONS)72 136.8 Q F1<ad42>108 148.8 Q F2(tic)
+23.63 E(kinfo)-.2 E F0 .218(Sets map boundary tickmark interv)144 160.8
+R .218(als. See the)-.25 F F1(psbasemap)2.719 E F0 .219
+(manual page for details. By def)2.719 F .219(ault the)-.1 F
+(program chooses basemap annotations based on the map boundaries.)144
+172.8 Q F1<ad47>108 189.6 Q F2(\214ll)22.52 E F0 .393
+(Select \214lling of symbols for xy plotting.)144 201.6 R .393
 (Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 108 T .948
+(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 213.6 T .948
 (eset no \214ll, use).8 F F2(\214ll)3.448 E F0 3.449(=")3.448 G 3.449
 (N". F)-3.449 F .949(or polygons, you may optionally specify)-.15 F F1
-(\255Gp)3.449 E F2(icon_size/pattern)A F0(,)A(where)144 120 Q F2
+(\255Gp)3.449 E F2(icon_size/pattern)A F0(,)A(where)144 225.6 Q F2
 (pattern)3.652 E F0(gi)3.652 E -.15(ve)-.25 G 3.652(st).15 G 1.151(he n\
 umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.652 F F2(icon_size)144 132 Q F0 1.128(sets the unit size in inch.)
-3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4(nv e).8 H 1.128
-(rt black and white pix).4 F 1.128(els, use)-.15 F F1(\255GP)3.629 E F0
-1.129(instead of)3.629 F F1(\255Gp)3.629 E F0(.)A(See)144 144 Q F1(GMTs)
-2.5 E F0(Cookbook & T)2.5 E
+.)-3.652 F F2(icon_size)144 237.6 Q F0 1.128
+(sets the unit size in inch.)3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4
+(nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F1
+(\255GP)3.629 E F0 1.129(instead of)3.629 F F1(\255Gp)3.629 E F0(.)A
+(See)144 249.6 Q F1(GMTs)2.5 E F0(Cookbook & T)2.5 E
 (echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F1<ad48>108 160.8 Q F0 .162(This "help" \215ag\
+(vidual patterns.)-.25 E F1<ad48>108 266.4 Q F0 .162(This "help" \215ag\
  cause the program to print out a description of its operation and then\
- e)22.52 F .161(xit immedi-)-.15 F(ately)144 172.8 Q(.)-.65 E F1<ad49>
-108 189.6 Q F2([\214lepar)26.41 E(s:]xy_\214le)-.1 E F0 .089(Speci\214e\
+ e)22.52 F .161(xit immedi-)-.15 F(ately)144 278.4 Q(.)-.65 E F1<ad49>
+108 295.2 Q F2([\214lepar)26.41 E(s:]xy_\214le)-.1 E F0 .089(Speci\214e\
 s the \214les containing the data to be plotted, and for each \214le, a\
- list of \214le parameters which)144 213.6 R .166
-(are comprised of the rules used by)144 225.6 R F1(mbm_xyplot)2.666 E F0
+ list of \214le parameters which)144 319.2 R .166
+(are comprised of the rules used by)144 331.2 R F1(mbm_xyplot)2.666 E F0
 .165(to parse and manipulate the x and y v)2.666 F .165(alues on the)
--.25 F<8d79>144 237.6 Q 2.5(,a)-.65 G 2.5(sw)-2.5 G
+-.25 F<8d79>144 343.2 Q 2.5(,a)-.65 G 2.5(sw)-2.5 G
 (ell as the line and symbol characters used for plotting the results.)
 -2.5 E 2.192
 (The \214le parameters are an optional list of \215ags and their ar)144
-261.6 R 2.193(guments concatinated and strung)-.18 F 1.679
-(together with colons. A full speci\214cation has the follo)144 273.6 R
+367.2 R 2.193(guments concatinated and strung)-.18 F 1.679
+(together with colons. A full speci\214cation has the follo)144 379.2 R
 1.678(wing general syntax although indi)-.25 F(vidual)-.25 E .336
-(\215ags and their ar)144 285.6 R .336(guments need not appear in an)
+(\215ags and their ar)144 391.2 R .336(guments need not appear in an)
 -.18 F 2.836(yp)-.15 G .336(articular order as long as ar)-2.836 F .337
 (gument follo)-.18 F .337(ws cor)-.25 F(-)-.2 E(responding \215ag.:)144
-297.6 Q F1(\255ID)146.5 333.6 Q F2(delimiter)A F0(:)A F1(C)A F2
+403.2 Q F1(\255ID)146.5 439.2 Q F2(delimiter)A F0(:)A F1(C)A F2
 (columnse)A(xpr)-.2 E(ession)-.37 E F0(:)A F1(G)A F2(color)A F0(:)A F1
 (S)A F2(symbol)A F0(:)A F1(W)A F2(weight)A F0(:)A F1(M)A F0(:)A F1
-(xy\214le)A F0(The delimiter may be an)144 357.6 Q 2.5(yc)-.15 G
+(xy\214le)A F0(The delimiter may be an)144 463.2 Q 2.5(yc)-.15 G
 (haracter string. The def)-2.5 E(ault delimiter is whitespace.)-.1 E
-.107(By def)144 381.6 R(ault,)-.1 E F1(mbm_xyplot)2.607 E F0 .107
+.107(By def)144 487.2 R(ault,)-.1 E F1(mbm_xyplot)2.607 E F0 .107
 (uses the \214rst column as the x v)2.607 F .106
 (alue and the second column as the y v)-.25 F(alue)-.25 E .261
-(for the plot. Ho)144 393.6 R(we)-.25 E -.15(ve)-.25 G 1.061 -.4(r, t)
+(for the plot. Ho)144 499.2 R(we)-.25 E -.15(ve)-.25 G 1.061 -.4(r, t)
 .15 H(he).4 E F1(C)2.762 E F0 .262(\215ag and column e)2.762 F .262
 (xpression allo)-.15 F .262(ws the user to chose other columns to)-.25 F
-(plot. The general syntax is)144 405.6 Q F1(C)144 429.6 Q F2
+(plot. The general syntax is)144 511.2 Q F1(C)144 535.2 Q F2
 (c[xcol]_c[ycol])2.5 E F0 .529
 (where 'xcol' and 'ycol' designate the x and y columns respecti)144
-453.6 R -.15(ve)-.25 G(ly).15 E 3.029(.C)-.65 G .529
+559.2 R -.15(ve)-.25 G(ly).15 E 3.029(.C)-.65 G .529
 (olumns are numbered start-)-3.029 F .777(ing at '1' one the left most \
-column in the \214le. In addition, either c[] e)144 465.6 R .778
+column in the \214le. In addition, either c[] e)144 571.2 R .778
 (xpression may be replaced)-.15 F
-(with a single '#' symbol to plot the other v)144 477.6 Q
+(with a single '#' symbol to plot the other v)144 583.2 Q
 (ariable vs. line number)-.25 E 2.5(.F)-.55 G(or e)-2.65 E(xample,)-.15
-E F1(C)144 501.6 Q F2(#_c[ycol])2.5 E F0(will plot the v)144 525.6 Q
+E F1(C)144 607.2 Q F2(#_c[ycol])2.5 E F0(will plot the v)144 631.2 Q
 (alues in column 'ycol' vs their line number in the \214le.)-.25 E .057
-(Other v)144 549.6 R .057(alid Perl e)-.25 F .056
+(Other v)144 655.2 R .057(alid Perl e)-.25 F .056
 (xpressions may be substituted for either column e)-.15 F .056
 (xpression as well. F)-.15 F .056(or e)-.15 F(xample,)-.15 E .214(to pl\
 ot in kilometers, a \214le whose columns contain x and y coordinates in\
- meters, one w)144 561.6 R .215(ould spec-)-.1 F(ify)144 573.6 Q F1(C)
-144 597.6 Q F2(c[0]/1000_c[1]/1000)2.5 E F0 .276
-(The line and symbol characteristics are set using the)144 621.6 R F1(G)
-2.775 E F0(,)A F1(S)2.775 E F0 2.775(,a)C(nd)-2.775 E F1(W)2.775 E F0
-2.775(options. F)2.775 F .275(or e)-.15 F .275(xample, the com-)-.15 F
-(mand)144 633.6 Q F1(\255IG)2.75 E F2(255/0/0:)A F1(S)A F2(a/0.1:xy)A
-(.dat)-.55 E F0 .25(will plot the \(x,y\) data pairs in the \214le xy)
-2.75 F .25(.dat as 0.1 inch diameter)-.65 F(red stars.)144 645.6 Q([Def)
+ meters, one w)144 667.2 R .215(ould spec-)-.1 F(ify)144 679.2 Q F1(C)
+144 703.2 Q F2(c[0]/1000_c[1]/1000)2.5 E F0 1.733
+(The line and symbol characteristics are set using the)144 727.2 R F1(G)
+4.233 E F0(,)A F1(S)4.233 E F0 4.233(,a)C(nd)-4.233 E F1(W)4.233 E F0
+4.233(options. F)4.233 F 1.733(or e)-.15 F 1.733(xample, the)-.15 F
+(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
+Cg EP
+%%Page: 4 4
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
+(5.0 mbm_xyplot\(1\))2.5 F(command)144 84 Q/F1 10/Times-Bold at 0 SF
+(\255IG)4.215 E/F2 10/Times-Italic at 0 SF(255/0/0:)A F1(S)A F2(a/0.1:xy)A
+(.dat)-.55 E F0 1.716(will plot the \(x,y\) data pairs in the \214le xy)
+4.215 F 1.716(.dat as 0.1 inch)-.65 F(diameter red stars.)144 96 Q([Def)
 5 E
 (ault is a solid black line]. See the psxy man page for more details.)
 -.1 E .662(When multiple data \214les are speci\214ed \(with multiple)
-144 669.6 R F1<ad49>3.162 E F0 .662(statements, the last)3.162 F F1(G)
+144 120 R F1<ad49>3.162 E F0 .662(statements, the last)3.162 F F1(G)
 3.162 E F0(,)A F1(S)3.162 E F0 3.162(,a)C(nd)-3.162 E F1(W)3.161 E F0
 (options)3.161 E .024
-(speci\214ed are for subsequent \214les. In order to plot dif)144 681.6
-R .024(ferent \214les using dif)-.25 F .024(ferent line or symbol char)
--.25 F(-)-.2 E(acteristics, ne)144 693.6 Q 2.5(ws)-.25 G
+(speci\214ed are for subsequent \214les. In order to plot dif)144 132 R
+.024(ferent \214les using dif)-.25 F .024(ferent line or symbol char)
+-.25 F(-)-.2 E(acteristics, ne)144 144 Q 2.5(ws)-.25 G
 (ets of commands can be speci\214ed for each \214le.)-2.5 E(Finally)144
-717.6 Q 3.377(,n)-.65 G .876(ote that there are tw)-3.377 F 3.376(ow)-.1
-G .876(ays in which one may plot multiple data sets on the same plot.)
--3.476 F .82(One may specify multiple sets of \214le ar)144 729.6 R .821
+168 Q 3.377(,n)-.65 G .876(ote that there are tw)-3.377 F 3.376(ow)-.1 G
+.876(ays in which one may plot multiple data sets on the same plot.)
+-3.476 F .82(One may specify multiple sets of \214le ar)144 180 R .821
 (guments [i.e.)-.18 F F1<ad49>3.321 E F2([\214lepar)A(s:]xy_\214le)-.1 E
-F0 .821(], one for each \214le to be)B(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F .993(plotted. This allo)144 84 R .993
-(ws the most \215e)-.25 F(xibility)-.15 E 3.493(,i)-.65 G .993
+F0 .821(], one for each \214le to be)B .993(plotted. This allo)144 192 R
+.993(ws the most \215e)-.25 F(xibility)-.15 E 3.493(,i)-.65 G .993
 (ncluding dif)-3.493 F .992
 (ferent one-the-\215y manipulations and colors)-.25 F
-(for each xy series.)144 96 Q .658(An alternati)144 120 R .958 -.15
+(for each xy series.)144 204 Q .658(An alternati)144 228 R .958 -.15
 (ve i)-.25 H 3.158(st).15 G 3.159(ou)-3.158 G .659
-(tilize the "multiple se)-3.159 F .659(gments" feature of)-.15 F/F1 10
-/Times-Bold at 0 SF(psxy)3.159 E F0 3.159(.S)C .659(pecify the)-3.159 F F1
-(M)3.159 E F0 .659(\215ag in the \214le)3.159 F(ar)144 132 Q .293
-(gument list to in)-.18 F -.2(vo)-.4 G .493 -.1(ke t).2 H .293(his feat\
-ure. A single \214le may then contain all the data, one series after th\
-e).1 F(ne)144 144 Q 1.225(xt, with lines containing a single ">" and no\
-thing more to delineate breaks in data se)-.15 F(gments.)-.15 E .939
-(This is the def)144 156 R .939(ault break character for psxy)-.1 F
-3.439(,a)-.65 G .938(nd currently the only break character supported by)
--3.439 F 1.607(mbm_xyplot. F)144 168 R 1.607(or e)-.15 F(xample)-.15 E
-F1(\255IM)4.107 E F0(:xy)A 1.607(.dat w)-.65 F 1.608
+(tilize the "multiple se)-3.159 F .659(gments" feature of)-.15 F F1
+(psxy)3.159 E F0 3.159(.S)C .659(pecify the)-3.159 F F1(M)3.159 E F0
+.659(\215ag in the \214le)3.159 F(ar)144 240 Q .293(gument list to in)
+-.18 F -.2(vo)-.4 G .493 -.1(ke t).2 H .293(his feature. A single \214l\
+e may then contain all the data, one series after the).1 F(ne)144 252 Q
+1.225(xt, with lines containing a single ">" and nothing more to deline\
+ate breaks in data se)-.15 F(gments.)-.15 E .939(This is the def)144 264
+R .939(ault break character for psxy)-.1 F 3.439(,a)-.65 G .938
+(nd currently the only break character supported by)-3.439 F 1.607
+(mbm_xyplot. F)144 276 R 1.607(or e)-.15 F(xample)-.15 E F1(\255IM)4.107
+E F0(:xy)A 1.607(.dat w)-.65 F 1.608
 (ould plot multiple data series in the \214le xy)-.1 F 1.608(.dat whose)
--.65 F(se)144 180 Q(gements were separated as in the follo)-.15 E
-(wing snippet:)-.25 E 5(1.2 3)144 204 R 5(1.3 5)144 216 R(>)144 228 Q
-12.5(0.)144 240 S(1)-12.5 E 5(0.1 .4)144 252 R F1<ad4a>108 280.8 Q/F2 10
-/Times-Italic at 0 SF(pr)25.3 E(ojection)-.45 E F0([)A F2(/scale | /width)A
-F0(])A .368(Selects the map projection. By def)144 292.8 R .367
+-.65 F(se)144 288 Q(gements were separated as in the follo)-.15 E
+(wing snippet:)-.25 E 5(1.2 3)144 312 R 5(1.3 5)144 324 R(>)144 336 Q
+12.5(0.)144 348 S(1)-12.5 E 5(0.1 .4)144 360 R F1<ad4a>108 388.8 Q F2
+(pr)25.3 E(ojection)-.45 E F0([)A F2(/scale | /width)A F0(])A .368
+(Selects the map projection. By def)144 400.8 R .367
 (ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.667(to \214t on the selected page size \(see)144 304.8 R F1<ad50>3.168
+.667(to \214t on the selected page size \(see)144 412.8 R F1<ad50>3.168
 E F0 .668(option\). The user may specify a dif)3.168 F .668
 (ferent projection to be)-.25 F .768(used, in which case the plot scale\
  is still automatically chosen to \214t the page. The user may also)144
-316.8 R .034(specify both the projection and the plot scale. If the pro\
-jection specifying character is upper case, a)144 328.8 R 1.509
-(plot width rather than a plot scale is used.)144 340.8 R 1.508
+424.8 R .034(specify both the projection and the plot scale. If the pro\
+jection specifying character is upper case, a)144 436.8 R 1.509
+(plot width rather than a plot scale is used.)144 448.8 R 1.508
 (The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.508
 (gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 352.8 R
-(plot will not \214t on the def)144 364.8 Q
+inches. If the user speci\214es a plot scale such that the)144 460.8 R
+(plot will not \214t on the def)144 472.8 Q
 (ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E F1(CYLINDRICAL PR)144 388.8 Q
-(OJECTIONS:)-.3 E(\255Jc)144 412.8 Q F2(lon0/lat0/scale)A F0
-(\(Cassini\))2.5 E F1(\255Jm)144 424.8 Q F2(scale)A F0(\(Mercator\))2.5
-E F1<ad4a>144 436.8 Q(oa)-.15 E F2(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 448.8 Q
+(ger page size will be chosen.)-.18 E F1(CYLINDRICAL PR)144 496.8 Q
+(OJECTIONS:)-.3 E(\255Jc)144 520.8 Q F2(lon0/lat0/scale)A F0
+(\(Cassini\))2.5 E F1(\255Jm)144 532.8 Q F2(scale)A F0(\(Mercator\))2.5
+E F1<ad4a>144 544.8 Q(oa)-.15 E F2(lon0/lat0/azimuth/scale)A F0
+(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 556.8 Q
 (ob)-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 460.8 Q(oc)-.15 E F2
+2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 568.8 Q(oc)-.15 E F2
 (lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 472.8 Q F2
+(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 580.8 Q F2
 (lon0/scale)A F0
 (\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 484.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 496.8 Q(u)-.15 E F2(zone/scale)A F0
+(\255Jt)144 592.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
+(erse Mercator\))-.15 E F1<ad4a>144 604.8 Q(u)-.15 E F2(zone/scale)A F0
 (\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 508.8 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 532.8 Q
-(OJECTIONS:)-.3 E<ad4a>144 556.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F1<ad4a>144 568.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F1(\255Jg)144 580.8 Q F2(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F1(\255Js)144 592.8 Q F2(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F1(CONIC PR)144 616.8 Q(OJECTIONS:)-.3
-E(\255Jb)144 640.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F1(\255Jl)144 652.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F1(MISCELLANEOUS PR)144 676.8 Q(OJECTIONS:)-.3 E(\255Jh)144 700.8 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 712.8 Q F2(lon0/scale)A
-F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 724.8 Q F2(lon0/scale)A F0(\(Eck)
-2.5 E(ert VI\))-.1 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(4)204.835 E 0 Cg EP
+(erse Mercator\))-.15 E F1(\255Jy)144 616.8 Q F2(lon0/lats/scale)A F0
+(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 640.8 Q
+(OJECTIONS:)-.3 E<ad4a>144 664.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
+(\(Lambert\).)2.5 E F1<ad4a>144 676.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
+(\(Equidistant\).)2.5 E F1(\255Jg)144 688.8 Q F2(lon0/lat0/scale)A F0
+(\(Orthographic\).)2.5 E F1(\255Js)144 700.8 Q F2(lon0/lat0/scale)A F0
+(\(General Stereographic\))2.5 E F1(CONIC PR)144 724.8 Q(OJECTIONS:)-.3
+E F0(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(4)198.45
+E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255Jn)144 84 Q/F2 10
-/Times-Italic at 0 SF(lon0/scale)A F0(\(Robinson\))2.5 E F1(\255Jr)144 96 Q
-F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1
-(\255Jw)144 108 Q F2(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1
-(NON-GEOGRAPHICAL PR)144 132 Q(OJECTIONS:)-.3 E(\255Jp)144 156 Q F2
-(scale)A F0(\(Linear projection for polar \(theta,r\) coordinates\))2.5
-E F1(\255Jx)144 168 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
+(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255Jb)144 84 Q/F2 10
+/Times-Italic at 0 SF(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E F1
+(\255Jl)144 96 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5 E F1
+(MISCELLANEOUS PR)144 120 Q(OJECTIONS:)-.3 E(\255Jh)144 144 Q F2
+(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 156 Q F2(lon0/scale)A F0
+(\(Sinusoidal\))2.5 E F1(\255Jk)144 168 Q F2(lon0/scale)A F0(\(Eck)2.5 E
+(ert VI\))-.1 E F1(\255Jn)144 180 Q F2(lon0/scale)A F0(\(Robinson\))2.5
+E F1(\255Jr)144 192 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E
+(ripel\))-.35 E F1(\255Jw)144 204 Q F2(lon0/scale)A F0(\(Moll)2.5 E
+(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144 228 Q(OJECTIONS:)-.3 E(\255Jp)
+144 252 Q F2(scale)A F0
+(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
+(\255Jx)144 264 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
 (/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
 (og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 180 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4c>108 196.8 Q F2(title[:xlabel[:ylabel]])23.63 E
-F0 .174(Sets the title and the labels for the x and y ax)144 208.8 R
+(More details can be found in the)144 276 Q F1(psbasemap)2.5 E F0
+(manpages.)2.5 E F1<ad4c>108 292.8 Q F2(title[:xlabel[:ylabel]])23.63 E
+F0 .174(Sets the title and the labels for the x and y ax)144 304.8 R
 .173(es of the plot. Note that a colon \(:\) rather than a slash)-.15 F
 .652(\(/\) is used to separate the labels. Colons cannot be used in the\
- labels themselv)144 220.8 R .653(es. If this option is)-.15 F .157
-(not used, then a def)144 232.8 R .157
+ labels themselv)144 316.8 R .653(es. If this option is)-.15 F .157
+(not used, then a def)144 328.8 R .157
 (ault title and colorscale label are pro)-.1 F .157
 (vided. If the title is supplied alone, no x or)-.15 F
-(y-axis labels will be pro)144 244.8 Q(vided.)-.15 E F1<ad4d>108 261.6 Q
+(y-axis labels will be pro)144 340.8 Q(vided.)-.15 E F1<ad4d>108 357.6 Q
 F0 3.055(As)20.86 G .555(eries of "miscellaneous" options are pro)-3.055
 F .555(vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055
 E F1<ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1
-G(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 273.6 R 3.829(,f)-.4
+G(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 369.6 R 3.829(,f)-.4
 G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
 (ther parameters associated with that option.)-3.829 F(The)6.328 E F1
 <ad4d>3.828 E F0(options)3.828 E .636(may be strung together separated \
-by colons, e.g. "-MGQ100:GU:CA200/10", which is equi)144 285.6 R -.25
-(va)-.25 G(lent).25 E(to "-MGQ \255MGU \255MCA200/10".)144 297.6 Q F1
-(\255MGD)108 314.4 Q F2(gmtdef/value)5.86 E F0(Allo)144 326.4 Q .227
+by colons, e.g. "-MGQ100:GU:CA200/10", which is equi)144 381.6 R -.25
+(va)-.25 G(lent).25 E(to "-MGQ \255MGU \255MCA200/10".)144 393.6 Q F1
+(\255MGD)108 410.4 Q F2(gmtdef/value)5.86 E F0(Allo)144 422.4 Q .227
 (ws the user to set the)-.25 F F1(GMT)2.727 E F0(def)2.727 E .227
 (ault v)-.1 F .227
 (alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 338.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
+(be gi)144 434.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
 (epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
 1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 350.4
+(xample, to set the basemap)-.15 F(annotation font to Courier)144 446.4
 Q 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGT)108 367.2 Q F2(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0
-.488(Causes a te)144 379.2 R .488(xt label to plotted on the map.)-.15 F
-F2(size)5.487 E F0 .487(is te)2.987 F .487(xt size in points,)-.15 F F2
-(angle)2.987 E F0 .487(is measured in de)2.987 F(grees)-.15 E(counter)
-144 391.2 Q .8(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
+(\255MGL)108 463.2 Q F0([)6.41 E F2(f)A F0(][)A F2(x)A F0(])A F2
+(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2(+llabel)A F0(])A
+(Dra)144 475.2 Q .16(ws a simple map scale centered on)-.15 F F2
+(lon0/lat0)2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0 .16
+(to get a "f)2.66 F(anc)-.1 E .16(y" scale [Def)-.15 F .16
+(ault is plain].)-.1 F(Use)144 487.2 Q F1(\255Lx)2.961 E F0 .461
+(to specify the position in inches instead of map units.)2.961 F .462
+(The scale is calculated at latitude)5.461 F F2(slat)144 499.2 Q F0
+2.929(;i)C 2.929(ft)-2.929 G .429
+(he string "center" is used instead of a numerical v)-2.929 F .428
+(alue for)-.25 F F2(slat)2.928 E F0 2.928(,t)C .428
+(hen the macro will set the)-2.928 F 1.596
+(scaling according to the center of the plot bounds.)144 511.2 R 1.596
+(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.596
+(is in km by)4.096 F(def)144 523.2 Q .279(ault, b)-.1 F .278(ut the uni\
+ts can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet\
+, k = kilome-)-.2 F .911
+(ters, M = statue miles, n = nautical miles, and u = US surv)144 535.2 R
+1.212 -.15(ey f)-.15 H .912(eet. Append).15 F F2(+l)3.412 E F0 .912
+(to label the scale)3.412 F(with the rele)144 547.2 Q -.25(va)-.25 G
+(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
+(ferent label string.)-.25 E F1(\255MGT)108 564 Q F2
+(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .488(Causes a te)144 576
+R .488(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0 .487
+(is te)2.987 F .487(xt size in points,)-.15 F F2(angle)2.987 E F0 .487
+(is measured in de)2.987 F(grees)-.15 E(counter)144 588 Q .8
+(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
 (sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
-3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.615(starts with a leading h)144
-403.2 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
-1.615(is tak)4.115 F 1.614(en to be a te)-.1 F 1.614(xtstring with the)
--.15 F 1.022(desired fontname.)144 415.2 R 1.022(See the)6.022 F F1
-(gmtdefaults)3.522 E F0 1.022(man page for names and numbers of a)3.522
-F -.25(va)-.2 G 1.023(ilable fonts \(or).25 F(run)144 427.2 Q F1 .112
-(pstext \255L)2.612 F F0 2.612(\). The)B .111
-(alignment number refers to the part of the te)2.611 F .111
-(xtstring that will be mapped onto)-.15 F .289(the \()144 439.2 R F2
-(x,y)A F0 2.789(\)p)C .289(oint: 1 = Lo)-2.789 F .289(wer Left corner)
--.25 F 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789
-(,3=L)-.4 G -.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F
-(Center)144 451.2 Q 2.783(,7=M)-.4 G .283
-(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
+3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.615(starts with a leading h)144 600
+R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0 1.615
+(is tak)4.115 F 1.614(en to be a te)-.1 F 1.614(xtstring with the)-.15 F
+1.022(desired fontname.)144 612 R 1.022(See the)6.022 F F1(gmtdefaults)
+3.522 E F0 1.022(man page for names and numbers of a)3.522 F -.25(va)-.2
+G 1.023(ilable fonts \(or).25 F(run)144 624 Q F1 .112(pstext \255L)2.612
+F F0 2.612(\). The)B .111(alignment number refers to the part of the te)
+2.611 F .111(xtstring that will be mapped onto)-.15 F .289(the \()144
+636 R F2(x,y)A F0 2.789(\)p)C .289(oint: 1 = Lo)-2.789 F .289
+(wer Left corner)-.25 F 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289
+(er Center).25 F 2.789(,3=L)-.4 G -.25(ow)-2.789 G .289
+(er Right, 5 = Mid Left, 6 = Mid).25 F(Center)144 648 Q 2.783(,7=M)-.4 G
+.283(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
 2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-463.2 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
-G(imes as needed.)-2.5 E F1(\255MGU)108 480 Q F0([)5.86 E F2(/dx/dy/)A
-F0(][)A F2(label)A F0(])A(Dra)144 492 Q 2.635(wU)-.15 G .135
+660 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15 G
+(imes as needed.)-2.5 E F1(\255MGU)108 676.8 Q F0([)5.86 E F2(/dx/dy/)A
+F0(][)A F2(label)A F0(])A(Dra)144 688.8 Q 2.635(wU)-.15 G .135
 (nix System time stamp on plot.)-2.635 F .135
 (User may specify where the lo)5.135 F .136
-(wer left corner of the stamp)-.25 F 1.926(should f)144 504 R 1.926
+(wer left corner of the stamp)-.25 F 1.926(should f)144 700.8 R 1.926
 (all on the page relati)-.1 F 2.226 -.15(ve t)-.25 H 4.426(ol).15 G -.25
 (ow)-4.426 G 1.925(er left corner of plot in inch [Def).25 F 1.925
-(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 516 Q 2.5(,a)-.65 G
+(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 712.8 Q 2.5(,a)-.65 G
 (ppend a label, or)-2.5 E F1(c)2.5 E F0
-(\(which will plot the command string.\))2.5 E F1<ad4f>108 532.8 Q F2
--.45(ro)22.52 G(ot).45 E F0 .422(Sets the root used to construct the \
-\214lename of the output shellscript \()144 544.8 R F2 -.45(ro)C(ot).45
-E F0 .423(.cmd\) and names of \214les)B .157
-(created when the shellscript is run.)144 556.8 R .157
+(\(which will plot the command string.\))2.5 E(MB-System 5.0)72 768 Q
+2.5(9J)140.11 G(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
+%%Page: 6 6
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
+(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4f>108 84 Q/F2 10
+/Times-Italic at 0 SF -.45(ro)22.52 G(ot).45 E F0 .422(Sets the root used \
+to construct the \214lename of the output shellscript \()144 96 R F2
+-.45(ro)C(ot).45 E F0 .423(.cmd\) and names of \214les)B .157
+(created when the shellscript is run.)144 108 R .157
 (Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 568.8 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-585.6 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
+5.157 F(as the)144 120 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
+136.8 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
 he size of the page the plot will be centered on. If the user does not \
-set the plot)144 597.6 R .126(scale, the plot will be sized as lar)144
-609.6 R .125(ge as will \214t on the designated page. If the user sets \
+set the plot)144 148.8 R .126(scale, the plot will be sized as lar)144
+160.8 R .125(ge as will \214t on the designated page. If the user sets \
 the plot scale)-.18 F .948
 (such that the plot will not \214t on the designated page, a lar)144
-621.6 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
-(page sizes are:)144 633.6 Q(American ANSI sizes:)169 657.6 Q 12.5(A8)
-169 669.6 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
-5 E 10(B1)169 681.6 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 693.6 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 705.6 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 717.6 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 729.6 S
-(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0
-Cg EP
-%%Page: 6 6
+172.8 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
+(page sizes are:)144 184.8 Q(American ANSI sizes:)169 208.8 Q 12.5(A8)
+169 220.8 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
+5 E 10(B1)169 232.8 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
+(431.8 mm\))5 E 10(C1)169 244.8 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
+(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 256.8 S(2.0 x 34.0 in.)-10 E 2.5
+(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 268.8 S(4.0 x 44.0 in.)
+-10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 280.8 S
+(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
+169 292.8 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
+(Metric ISO A sizes:)169 316.8 Q 5(A0 841.0)169 328.8 R 2.5(x1)2.5 G
+(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 340.8 R 5(x8)
+2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 352.8 R 5
+(x5)2.5 G(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 364.8 R
+5(x4)2.5 G(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 376.8 R
+5(x2)2.5 G(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)
+169 388.8 R 5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))
+5 E 5(A6 105.0)169 400.8 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)
+-2.5 E(5.83 in.\))5 E 7.5(A7 74.0)169 412.8 R 5(x1)2.5 G(05.0 mm)-5 E
+2.5(\(2)5 G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 424.8 R 7.5(x7)
+2.5 G(4.0 mm)-7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)
+169 436.8 R 7.5(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E
+(2.05 in.\))5 E 5(A10 26.0)169 448.8 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5
+(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E(Metric ISO B sizes:)169 472.8 Q 5
+(B0 1000.0x)169 484.8 R(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5
+(B1 707.0)169 496.8 R 2.5(x1)2.5 G(000.0 mm)-2.5 E
+(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 508.8 R 5(x7)2.5 G(07.0 mm)-5
+E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 520.8 R 5(x5)2.5 G(00.0 mm)-5
+E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 532.8 R 5(x3)2.5 G(53.0 mm)-5
+E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 544.8 R 5(x2)2.5 G
+(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5(B6 125.0)169
+556.8 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E(6.93 in.\))5 E
+7.5(B7 88.0)169 568.8 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5 G(.46 x)-2.5 E
+(4.92 in.\))5 E 7.5(B8 62.0)169 580.8 R 7.5(x8)2.5 G(8.0 mm)-7.5 E 2.5
+(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 592.8 R 7.5(x6)2.5
+G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5(B10 31.0)169
+604.8 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E(1.73 in.\))5
+E(Metric ISO C sizes:)169 628.8 Q 5(C0 914.4)169 640.8 R 2.5(x1)2.5 G
+(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 652.8 R 5(x9)
+2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 664.8 R 5
+(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 676.8 R
+5(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 688.8 R
+5(x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
+169 700.8 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))
+5 E 5(C6 114.3)169 712.8 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)
+-2.5 E(6.40 in.\))5 E 7.5(C7 81.3)169 724.8 R 5(x1)2.5 G(14.3 mm)-5 E
+2.5(\(3)5 G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(6)198.45 E 0 Cg EP
+%%Page: 7 7
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F 5(E1 44.0)169 84 R 2.5(x6)2.5 G(8.0 in.)-2.5
-E(\(1117.6 x 1727.2 mm\))10 E(Metric ISO A sizes:)169 108 Q 5(A0 841.0)
-169 120 R 2.5(x1)2.5 G(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5
-(A1 594.0)169 132 R 5(x8)2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5
-(A2 420.0)169 144 R 5(x5)2.5 G(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5
-(A3 297.0)169 156 R 5(x4)2.5 G(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5
-(A4 210.0)169 168 R 5(x2)2.5 G(97.0 mm)-5 E 2.5(\(8)5 G
-(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 180 R 5(x2)2.5 G(10.0 mm)-5 E
-2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5(A6 105.0)169 192 R 5(x1)2.5 G
-(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E(5.83 in.\))5 E 7.5(A7 74.0)169
-204 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5 G(.91 x)-2.5 E(4.13 in.\))5 E
-7.5(A8 52.0)169 216 R 7.5(x7)2.5 G(4.0 mm)-7.5 E 2.5(\(2)5 G(.05 x)-2.5
-E(2.91 in.\))5 E 7.5(A9 37.0)169 228 R 7.5(x5)2.5 G(2.0 mm)-7.5 E 2.5
-(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5(A10 26.0)169 240 R 7.5(x3)2.5 G
-(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E
-(Metric ISO B sizes:)169 264 Q 5(B0 1000.0x)169 276 R(1414.0 mm)2.5 E
-(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 288 R 2.5(x1)2.5 G(000.0 mm)
--2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 300 R 5(x7)2.5 G
-(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 312 R 5(x5)2.5 G
-(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 324 R 5(x3)2.5 G
-(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 336 R
-5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5
-(B6 125.0)169 348 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
-(6.93 in.\))5 E 7.5(B7 88.0)169 360 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5
-G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 372 R 7.5(x8)2.5 G(8.0 mm)
--7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 384 R 7.5
-(x6)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5
-(B10 31.0)169 396 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
-(1.73 in.\))5 E(Metric ISO C sizes:)169 420 Q 5(C0 914.4)169 432 R 2.5
-(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 444 R
-5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 456 R 5
-(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 468 R 5
-(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 480 R 5
-(x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
-169 492 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
-E 5(C6 114.3)169 504 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
-(6.40 in.\))5 E 7.5(C7 81.3)169 516 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
-G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 540 Q(ge format sizes:)
--.18 E 2.5(m1 1371.6)169 552 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 564 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 576 R 2.5
+(5.0 mbm_xyplot\(1\))2.5 F(MB-System lar)185 84 Q(ge format sizes:)-.18
+E 2.5(m1 1371.6)169 96 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
+(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 108 R 2.5(x2)2.5 G
+(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 120 R 2.5
 (x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-588 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 600 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 612 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(The def)144 636 Q(ault page size is A.)-.1 E
-/F1 10/Times-Bold at 0 SF<ad51>108 652.8 Q F0(Normally)22.52 E 2.867(,t)
+132 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
+(m5 1524.0)169 144 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
+5 E 2.5(m6 1524.0)169 156 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
+(\(60.00 x 96.00 in.\))5 E(The def)144 180 Q(ault page size is A.)-.1 E
+/F1 10/Times-Bold at 0 SF<ad51>108 196.8 Q F0(Normally)22.52 E 2.867(,t)
 -.65 G .367
 (he output plot generation shellscript includes lines which e)-2.867 F
 -.15(xe)-.15 G .367(cute a program to display).15 F 1.071
-(the Postscript image on the screen.)144 664.8 R 1.071
+(the Postscript image on the screen.)144 208.8 R 1.071
 (This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 676.8 S .148
+(exe)144 220.8 S .148
 (cuting the shellscript produces a Postscript plot b).15 F .147
-(ut does not attempt to display it on the screen.)-.2 F .326
-(The program to be used to display the Postscript is set using)144 688.8
-R F1(mbdefaults)2.827 E F0 2.827(;t)C .327(he def)-2.827 F .327(ault v)
--.1 F .327(alue can be)-.25 F -.15(ove)144 700.8 S
-(rridden by setting the en).15 E(vironment v)-.4 E
-(ariable $MB_PS_VIEWER.)-.25 E F1<ad52>108 717.6 Q/F2 10/Times-Italic at 0
-SF(west/east/south/north)23.08 E .736(west, east, south,)144 729.6 R F0
+(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
+232.8 Q -.15(ve)-.25 G(ly).15 E 2.891(,i)-.65 G -1.9 -.4(nv o)-2.891 H
+.391(king the plot generation shellscript with a).4 F F1(-N)2.892 E F0
+.392(command line ar)2.892 F .392(gument also sup-)-.18 F .089
+(presses the screen display of the plot.)144 244.8 R .088
+(The program to be used to display the Postscript is set using)5.088 F
+F1(mbdefaults)144 256.8 Q F0 7.89(;t)C 5.391(he def)-7.89 F 5.391
+(ault v)-.1 F 5.391(alue can be o)-.25 F -.15(ve)-.15 G 5.391
+(rridden by setting the en).15 F 5.391(vironment v)-.4 F(ariable)-.25 E
+($MB_PS_VIEWER.)144 268.8 Q F1<ad52>108 285.6 Q/F2 10/Times-Italic at 0 SF
+(west/east/south/north)23.08 E .736(west, east, south,)144 297.6 R F0
 (and)3.236 E F2(north)3.236 E F0 .736(specify the Re)3.236 F .736
 (gion of interest.)-.15 F 2.336 -.8(To s)5.736 H .736
-(pecify boundaries in de).8 F .736(grees and)-.15 F(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)204.835 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F 1.161
-(minutes [and seconds], use the dd:mm[:ss] format.)144 84 R(Append)6.161
-E/F1 10/Times-Bold at 0 SF(r)3.661 E F0 1.161(if lo)3.661 F 1.162
-(wer left and upper right map)-.25 F .209(coordinates are gi)144 96 R
+(pecify boundaries in de).8 F .736(grees and)-.15 F 1.161
+(minutes [and seconds], use the dd:mm[:ss] format.)144 309.6 R(Append)
+6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.162
+(wer left and upper right map)-.25 F .209(coordinates are gi)144 321.6 R
 -.15(ve)-.25 G 2.709(ni).15 G .209(nstead of wesn.)-2.709 F -1.1(Yo)
-5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E/F2 10
-/Times-Italic at 0 SF(w/e/s/n)2.708 E F0(re)2.708 E .208(gion to ha)-.15 F
-.508 -.15(ve m)-.2 H .208(ore room).15 F .199
-(between the image and the ax)144 108 R 2.699(es. A)-.15 F .199
-(smaller re)2.699 F .199
+5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E F2
+(w/e/s/n)2.708 E F0(re)2.708 E .208(gion to ha)-.15 F .508 -.15(ve m)-.2
+H .208(ore room).15 F .199(between the image and the ax)144 333.6 R
+2.699(es. A)-.15 F .199(smaller re)2.699 F .199
 (gion than speci\214ed in the grd\214le will result in a sub-)-.15 F
-(set of the grid [Def)144 120 Q(ault is re)-.1 E(gion gi)-.15 E -.15(ve)
--.25 G 2.5(nb).15 G 2.5(yt)-2.5 G(he grd\214le].)-2.5 E F1<ad53>108
-136.8 Q F2(symbol/size)24.74 E F0 .333
-(Selects symbol to be used for plotting the ne)144 148.8 R .332
+(set of the grid [Def)144 345.6 Q(ault is re)-.1 E(gion gi)-.15 E -.15
+(ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G(he grd\214le].)-2.5 E F1<ad53>108
+362.4 Q F2(symbol/size)24.74 E F0 .333
+(Selects symbol to be used for plotting the ne)144 374.4 R .332
 (xt xy data \214le. Setting)-.15 F F2(symbol)2.832 E F0 2.832(=")2.832 G
-.332(N" causes line plot-)-2.832 F 2.5(ting. Choose)144 160.8 R
-(between:)2.5 E F1(\255Sa)108 177.6 Q F0(st)19.74 E F1(a)A F0 -.55(r.)C
+.332(N" causes line plot-)-2.832 F 2.5(ting. Choose)144 386.4 R
+(between:)2.5 E F1(\255Sa)108 403.2 Q F0(st)19.74 E F1(a)A F0 -.55(r.)C
 F2(size)5.55 E F0(is radius of circumscribing circle.)2.5 E F1 16.68
-(\255Sb b)108 194.4 R F0 .921(ar e)B .921(xtending from)-.15 F F2(base)
+(\255Sb b)108 420 R F0 .921(ar e)B .921(xtending from)-.15 F F2(base)
 3.421 E F0 .921(to y)3.421 F(.)-.65 E F2(size)5.921 E F0 .921
 (is bar width.)3.421 F .921(By def)5.921 F(ault,)-.1 E F2(base)3.421 E
 F0 3.421(=0)3.421 G 5.921(.A)-3.421 G .921(ppend /)-5.921 F F2(base)A F0
-.922(to change)3.422 F(this v)144 206.4 Q 2.5(alue. Append)-.25 F F1(u)
-2.5 E F0(if)2.5 E F2(size)2.5 E F0(is in x-units [Def)2.5 E
-(ault is inch].)-.1 E F1 17.8(\255Sc c)108 223.2 R F0(ircle.)A F2(size)5
-E F0(is diameter of circle.)2.5 E F1 16.68(\255Sd d)108 240 R F0
-(iamond.)A F2(size)5 E F0(is side of diamond.)2.5 E F1 17.8(\255Se e)108
-256.8 R F0 5.678(llipse. Direction)B 3.178(\(in de)5.678 F 3.178
+.922(to change)3.422 F(this v)144 432 Q 2.5(alue. Append)-.25 F F1(u)2.5
+E F0(if)2.5 E F2(size)2.5 E F0(is in x-units [Def)2.5 E(ault is inch].)
+-.1 E F1 17.8(\255Sc c)108 448.8 R F0(ircle.)A F2(size)5 E F0
+(is diameter of circle.)2.5 E F1 16.68(\255Sd d)108 465.6 R F0(iamond.)A
+F2(size)5 E F0(is side of diamond.)2.5 E F1 17.8(\255Se e)108 482.4 R F0
+5.678(llipse. Direction)B 3.178(\(in de)5.678 F 3.178
 (grees counterclockwise from horizontal\), major_axis \(in inch\), and)
 -.15 F(minor_axis \(in inch\) must be found in columns 3, 4, and 5.)144
-268.8 Q F1 18.91(\255Sf f)108 285.6 R F0 2.528(ault. Gi)B .328 -.15
+494.4 Q F1 18.91(\255Sf f)108 511.2 R F0 2.528(ault. Gi)B .328 -.15
 (ve d)-.25 H .028(istance g).15 F .029
 (ap between ticks and ticklength in inch.)-.05 F .029(If g)5.029 F .029
 (ap is ne)-.05 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 2.529(,i).15 G
 2.529(ti)-2.529 G 2.529(si)-2.529 G .029(nterpreted to)-2.529 F .399
-(mean number of ticks instead.)144 297.6 R(Append)5.399 E F1(l)2.899 E
+(mean number of ticks instead.)144 523.2 R(Append)5.399 E F1(l)2.899 E
 F0(or)2.899 E F1(r)2.899 E F0 .399(to dra)2.899 F 2.899(wt)-.15 G .399
 (ick on the left or right side of line [Def)-2.899 F(ault)-.1 E
-(is centered].)144 309.6 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
+(is centered].)144 535.2 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
 2.5 E F0(dra)2.5 E(ws a triangle instead of line se)-.15 E(gment.)-.15 E
-F1 16.68(\255Sh h)108 326.4 R F0 -.15(ex)C 2.5(agon. Gi).15 F .3 -.15
-(ve s)-.25 H(ide in inch.).15 E F1 19.46(\255Si i)108 343.2 R F0 -1.85
+F1 16.68(\255Sh h)108 552 R F0 -.15(ex)C 2.5(agon. Gi).15 F .3 -.15
+(ve s)-.25 H(ide in inch.).15 E F1 19.46(\255Si i)108 568.8 R F0 -1.85
 -.4(nv e)D(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H(ide in inch.)
-.15 E F1 19.46(\255Sl l)108 360 R F0 .405(etter or te)B .405(xt string.)
--.15 F(Gi)5.405 E .706 -.15(ve s)-.25 H .406(ize in inch, and append /)
-.15 F F2(string)A F0 .406(after the size.)2.906 F .406
-(Note that the size is only)5.406 F .92(approximate; no indi)144 372 R
-.919(vidual scaling is done for dif)-.25 F .919(ferent characters.)-.25
-F .919(Remember to escape special)5.919 F(characters lik)144 384 Q 2.5
-(e*)-.1 G(.)-2.5 E F1 16.68(\255Sp p)108 400.8 R F0 2.5(oint. No)B
+.15 E F1 19.46(\255Sl l)108 585.6 R F0 .405(etter or te)B .405
+(xt string.)-.15 F(Gi)5.405 E .706 -.15(ve s)-.25 H .406
+(ize in inch, and append /).15 F F2(string)A F0 .406(after the size.)
+2.906 F .406(Note that the size is only)5.406 F .92
+(approximate; no indi)144 597.6 R .919(vidual scaling is done for dif)
+-.25 F .919(ferent characters.)-.25 F .919(Remember to escape special)
+5.919 F(characters lik)144 609.6 Q 2.5(e*)-.1 G(.)-2.5 E F1 16.68
+(\255Sp p)108 626.4 R F0 2.5(oint. No)B
 (size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)-.15 E F1
-18.35(\255Ss s)108 417.6 R F0 2.5(quare. Gi)B .3 -.15(ve s)-.25 H
-(ide in inch.).15 E F1 18.91(\255St t)108 434.4 R F0 2.5(riangle. Gi)B
-.3 -.15(ve s)-.25 H(ide in inch.).15 E F1 17.24(\255Sv v)108 451.2 R F0
+18.35(\255Ss s)108 643.2 R F0 2.5(quare. Gi)B .3 -.15(ve s)-.25 H
+(ide in inch.).15 E F1 18.91(\255St t)108 660 R F0 2.5(riangle. Gi)B .3
+-.15(ve s)-.25 H(ide in inch.).15 E F1 17.24(\255Sv v)108 676.8 R F0
 (ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(grees counterclockwise f\
 rom horizontal\) and length \(in inch\) must be)-.15 F .036
-(found in columns 3 and 4.)144 463.2 R F2(size)5.036 E F0 2.536(,i)C
+(found in columns 3 and 4.)144 688.8 R F2(size)5.036 E F0 2.536(,i)C
 2.536(fp)-2.536 G .036(resent, will be interpreted as arro)-2.536 F
-(wwidth/headlength/headwidth)-.25 E 2.103(\(in inch\) [Def)144 475.2 R
+(wwidth/headlength/headwidth)-.25 E 2.103(\(in inch\) [Def)144 700.8 R
 2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F 2.104
 (ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104(utes remains in)
 -.2 F -.25(va)-.4 G 2.104(riant to the).25 F .029(length of the arro)144
-487.2 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G -2.25 -.2(av e)-2.529 H
+712.8 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G -2.25 -.2(av e)-2.529 H
 .029(the size of the v)2.729 F .029(ector scale do)-.15 F .028
 (wn with decreasing size, append n)-.25 F F2(norm)A F0(,)A(where v)144
-499.2 Q(ectors shorter than)-.15 E F2(norm)2.5 E F0(will ha)2.5 E .3
+724.8 Q(ectors shorter than)-.15 E F2(norm)2.5 E F0(will ha)2.5 E .3
 -.15(ve t)-.2 H(heir attrib).15 E(utes scaled by length/)-.2 E F2(norm)A
-F0(.)A F1(\255SV)108 516 Q F0 .5(Same as)17.52 F F1(\255Sv)3 E F0 3(,e)C
-.5(xcept azimuth \(in de)-3.15 F .501
-(grees east of north\) should be gi)-.15 F -.15(ve)-.25 G 3.001(ni).15 G
-.501(nstead of direction.)-3.001 F(The)5.501 E .635(azimuth will be map\
-ped into an angle based on the chosen map projection \()144 528 R F1
-(\255Sv)A F0(lea)3.135 E -.15(ve)-.2 G 3.135(st).15 G .635(he direc-)
--3.135 F(tions unchanged.\))144 540 Q F1(\255Sx)108 556.8 Q F0 2.5
-(cross. Gi)19.74 F .3 -.15(ve l)-.25 H(ength in inch.).15 E F1<ad55>108
-573.6 Q F2(orientation)23.08 E F0 .2(Normally the orientation of the pl\
-ot \(portrait or landscape\) is selected automatically so as to maxi-)
-144 585.6 R .334(mize the plot scale.)144 597.6 R(The)5.333 E F1<ad55>
-2.833 E F0 .333(option allo)2.833 F .333
+F0(.)A(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(7)
+198.45 E 0 Cg EP
+%%Page: 8 8
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
+(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255SV)108 84 Q F0 .5
+(Same as)17.52 F F1(\255Sv)3 E F0 3(,e)C .5(xcept azimuth \(in de)-3.15
+F .501(grees east of north\) should be gi)-.15 F -.15(ve)-.25 G 3.001
+(ni).15 G .501(nstead of direction.)-3.001 F(The)5.501 E .635(azimuth w\
+ill be mapped into an angle based on the chosen map projection \()144 96
+R F1(\255Sv)A F0(lea)3.135 E -.15(ve)-.2 G 3.135(st).15 G .635
+(he direc-)-3.135 F(tions unchanged.\))144 108 Q F1(\255Sx)108 124.8 Q
+F0 2.5(cross. Gi)19.74 F .3 -.15(ve l)-.25 H(ength in inch.).15 E F1
+<ad55>108 141.6 Q/F2 10/Times-Italic at 0 SF(orientation)23.08 E F0 .2(Nor\
+mally the orientation of the plot \(portrait or landscape\) is selected\
+ automatically so as to maxi-)144 153.6 R .334(mize the plot scale.)144
+165.6 R(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
 (ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
 E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 609.6 Q F2(orientation)2.5 E F0
+(portrait plot will be produced; if)144 177.6 Q F2(orientation)2.5 E F0
 2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 626.4 Q F0(Causes)23.08 E F1(mbm_xyplot)2.854 E F0 .354
+<ad56>108 194.4 Q F0(Causes)23.08 E F1(mbm_xyplot)2.854 E F0 .354
 (to operate in "v)2.854 F .354
 (erbose" mode so that it outputs more information than usual.)-.15 F F1
-<ad57>108 643.2 Q F2(pen)20.3 E F0 .784(Set pen attrib)144 655.2 R .784
+<ad57>108 211.2 Q F2(pen)20.3 E F0 .784(Set pen attrib)144 223.2 R .784
 (utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .783
-(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 667.2 Q
+(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 235.2 Q
 2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1<ad58>108 684 Q F0(Normally)23.08 E(,)-.65 E
+(xture = solid].)-.15 E F1<ad58>108 252 Q F0(Normally)23.08 E(,)-.65 E
 F1(mbm_xyplot)3.72 E F0 1.221(creates an e)3.72 F -.15(xe)-.15 G 1.221
 (cutable shellscript and then e).15 F 3.721(xits. This)-.15 F 1.221
-(option will cause)3.721 F(the shellscript to be e)144 696 Q -.15(xe)
+(option will cause)3.721 F(the shellscript to be e)144 264 Q -.15(xe)
 -.15 G(cuted in the background before).15 E F1(mbm_xyplot)2.5 E F0 -.15
-(ex)2.5 G(its.).15 E F1 21.13(\255Z mbm_xyplot)108 712.8 R F0 -.15(ex)
+(ex)2.5 G(its.).15 E F1 21.13(\255Z mbm_xyplot)108 280.8 R F0 -.15(ex)
 2.6 G .099(tracts the desired columns of the input data and creates sec\
-ondary \214les with the xy).15 F -.25(va)144 724.8 S 1.987
-(lues to be plotted.).25 F 1.988(Normally these \214les are left in pla\
-ce by the plot shellscript to be used)6.987 F(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(7)204.835 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F(multiple times. The)144 84 Q/F1 10
-/Times-Bold at 0 SF<ad5a>2.5 E F0
+ondary \214les with the xy).15 F -.25(va)144 292.8 S .38
+(lues to be plotted.).25 F .38(Normally these \214les are left in place\
+ by the plot shellscript to be used multi-)5.38 F(ple times. The)144
+304.8 Q F1<ad5a>2.5 E F0
 (option causes the shellscript to delete those secondary \214les.)2.5 E
-/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 112.8 Q F0 .211(Suppose we ha)108
-124.8 R .511 -.15(ve o)-.2 H .211(btained a sw).15 F .211
+/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 333.6 Q F0 .211(Suppose we ha)108
+345.6 R .511 -.15(ve o)-.2 H .211(btained a sw).15 F .211
 (ath sonar data \214le called sb2112_e)-.1 F .21
-(xample.mb41 collected using a SeaBeam)-.15 F .826(2112 sonar)108 136.8
+(xample.mb41 collected using a SeaBeam)-.15 F .826(2112 sonar)108 357.6
 R 5.826(.I)-.55 G 3.326(no)-5.826 G .826
 (rder to obtain an xy plot of the center beam depth v)-3.326 F .827
 (ersus time, we \214rst e)-.15 F .827(xtract the time-)-.15 F
-(depth xy doubles from the sw)108 148.8 Q(ath sonar \214le using)-.1 E
-F1(mblist)2.5 E F0(:)A(mblist \255F41 \255Isb2112_e)144 172.8 Q
+(depth xy doubles from the sw)108 369.6 Q(ath sonar \214le using)-.1 E
+F1(mblist)2.5 E F0(:)A(mblist \255F41 \255Isb2112_e)144 393.6 Q
 (xample.mb41 \255OmZ > mz.dat)-.15 E .372(Here time is in seconds from \
-the start of the \214le and the depths are in meters, positi)108 196.8 R
+the start of the \214le and the depths are in meters, positi)108 417.6 R
 .671 -.15(ve u)-.25 H(pw).15 E .371(ard \(topograph)-.1 F(y)-.05 E 1.029
-(rather than bath)108 208.8 R 3.529(ymetry\). No)-.05 F 2.329 -.65(w, w)
+(rather than bath)108 429.6 R 3.529(ymetry\). No)-.05 F 2.329 -.65(w, w)
 -.25 H 3.529(eu).65 G(se)-3.529 E F1(mbm_xyplot)3.529 E F0 1.03
 (to generate shellscripts which in turn generate plots)3.529 F(when e)
-108 220.8 Q -.15(xe)-.15 G 2.5(cuted. First,).15 F
+108 441.6 Q -.15(xe)-.15 G 2.5(cuted. First,).15 F
 (we generate a simple black line plot:)2.5 E
-(mbm_xyplot \255Imz.dat \255Omz)144 244.8 Q .242(The abo)108 268.8 R
+(mbm_xyplot \255Imz.dat \255Omz)144 465.6 Q .242(The abo)108 489.6 R
 .542 -.15(ve c)-.15 H .242(ommand generates an e).15 F -.15(xe)-.15 G
 .242(cutable shellscript mz_line.cmd; e).15 F -.15(xe)-.15 G .241
 (cuting this shellscript will gener).15 F(-)-.2 E
-(ate a Postscript plot and display it on the screen.)108 280.8 Q .39
-(Suppose we also ha)108 304.8 R .69 -.15(ve a s)-.2 H .39
+(ate a Postscript plot and display it on the screen.)108 501.6 Q .39
+(Suppose we also ha)108 525.6 R .69 -.15(ve a s)-.2 H .39
 (parse set of depth estimates in a \214le called sr).15 F .39
 (.dat obtained by picking the sea\215oor)-.55 F .293
 (on a seismic re\215ection record, and we wish to compare the tw)108
-316.8 R 2.793(os)-.1 G .293(ets of depths. W)-2.793 F 2.793(ec)-.8 G
-.293(an plot the sw)-2.793 F .293(ath sonar)-.1 F(deri)108 328.8 Q -.15
+537.6 R 2.793(os)-.1 G .293(ets of depths. W)-2.793 F 2.793(ec)-.8 G
+.293(an plot the sw)-2.793 F .293(ath sonar)-.1 F(deri)108 549.6 Q -.15
 (ve)-.25 G 2.5(dd).15 G(epths as a black line and the seismic deri)-2.5
 E -.15(ve)-.25 G 2.5(dd).15 G(epths as red stars as follo)-2.5 E(ws:)
--.25 E(mbm_xyplot \255Omz_sr \255Imz.dat \\)144 352.8 Q
-(-IG255/0/0:Sa/0.1:sr)180 364.8 Q(.dat)-.55 E(As an e)108 388.8 Q
+-.25 E(mbm_xyplot \255Omz_sr \255Imz.dat \\)144 573.6 Q
+(-IG255/0/0:Sa/0.1:sr)180 585.6 Q(.dat)-.55 E(As an e)108 609.6 Q
 (xample, the contents of the plotting shellscript "mz.cmd" are:)-.15 E
-(#)110.5 412.8 Q 2.5(#S)110.5 424.8 S
+(#)110.5 633.6 Q 2.5(#S)110.5 645.6 S
 (hellscript to create Postscript plot of data in grd \214le)-2.5 E 2.5
-(#C)110.5 436.8 S(reated by macro mbm_xyplot)-2.5 E(#)110.5 448.8 Q 2.5
-(#T)110.5 460.8 S(his shellscript created by follo)-2.5 E
-(wing command line:)-.25 E 2.5(#m)110.5 472.8 S
-(bm_xyplot \255Imz.dat \255Omz)-2.5 E(#)110.5 484.8 Q 2.5(#S)110.5 496.8
+(#C)110.5 657.6 S(reated by macro mbm_xyplot)-2.5 E(#)110.5 669.6 Q 2.5
+(#T)110.5 681.6 S(his shellscript created by follo)-2.5 E
+(wing command line:)-.25 E 2.5(#m)110.5 693.6 S
+(bm_xyplot \255Imz.dat \255Omz)-2.5 E(#)110.5 705.6 Q 2.5(#S)110.5 717.6
 S -2.25 -.2(av e)-2.5 H -.15(ex)2.7 G(isting GMT def).15 E(aults)-.1 E
-(echo Sa)110.5 508.8 Q(ving GMT def)-.2 E(aults...)-.1 E(gmtdef)110.5
-520.8 Q(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 532.8 Q 2.5(#S)
-110.5 544.8 S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1 E
-(echo Setting ne)110.5 556.8 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1
-E(gmtset ANO)110.5 568.8 Q(T_FONT Helv)-.4 E(etica)-.15 E
-(gmtset LABEL_FONT Helv)110.5 580.8 Q(etica)-.15 E
-(gmtset HEADER_FONT Helv)110.5 592.8 Q(etica)-.15 E(gmtset ANO)110.5
-604.8 Q(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 616.8 Q
-(gmtset HEADER_FONT_SIZE 10)110.5 628.8 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 640.8 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 652.8 Q(gmtset P)110.5
-664.8 Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 676.8 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 688.8 Q(OUND 255/255/255)-.4 E
-(gmtset COLOR_N)110.5 700.8 Q(AN 255/255/255)-.35 E(#)110.5 712.8 Q 2.5
-(#M)110.5 724.8 S(ak)-2.5 E 2.5(ex)-.1 G 2.5(yd)-2.5 G(ata plot)-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(8)204.835 E 0
-Cg EP
+(echo Sa)110.5 729.6 Q(ving GMT def)-.2 E(aults...)-.1 E(MB-System 5.0)
+72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(8)198.45 E 0 Cg EP
 %%Page: 9 9
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F(echo Running psxy)110.5 84 Q(...)-.65 E
-(psxy mz.dat \\)110.5 96 Q
-(-Jx0.0011071486125582637/0.0062732342007434947 \\)144 108 Q
-(-R0/8128.99/-4382/-3306 \\)144 120 Q(-X1 \255Y0.5 \255K \255V > mz.ps)
-144 132 Q 2.5(##M)110.5 144 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
-(echo Running psbasemap...)110.5 156 Q
+(5.0 mbm_xyplot\(1\))2.5 F(gmtdef)110.5 84 Q(aults \255L > gmtdef)-.1 E
+(aults$$)-.1 E(#)110.5 96 Q 2.5(#S)110.5 108 S(et ne)-2.5 E 2.5(wG)-.25
+G(MT def)-2.5 E(aults)-.1 E(echo Setting ne)110.5 120 Q 2.5(wG)-.25 G
+(MT def)-2.5 E(aults...)-.1 E(gmtset ANO)110.5 132 Q(T_FONT Helv)-.4 E
+(etica)-.15 E(gmtset LABEL_FONT Helv)110.5 144 Q(etica)-.15 E
+(gmtset HEADER_FONT Helv)110.5 156 Q(etica)-.15 E(gmtset ANO)110.5 168 Q
+(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 180 Q
+(gmtset HEADER_FONT_SIZE 10)110.5 192 Q
+(gmtset FRAME_WIDTH 0.074999999999999997)110.5 204 Q
+(gmtset TICK_LENGTH 0.074999999999999997)110.5 216 Q(gmtset P)110.5 228
+Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
+(gmtset COLOR_B)110.5 240 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
+(gmtset COLOR_FOREGR)110.5 252 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
+110.5 264 Q(AN 255/255/255)-.35 E(#)110.5 276 Q 2.5(#M)110.5 288 S(ak)
+-2.5 E 2.5(ex)-.1 G 2.5(yd)-2.5 G(ata plot)-2.5 E(echo Running psxy)
+110.5 300 Q(...)-.65 E(psxy mz.dat \\)110.5 312 Q
+(-Jx0.0011071486125582637/0.0062732342007434947 \\)144 324 Q
+(-R0/8128.99/-4382/-3306 \\)144 336 Q(-X1 \255Y0.5 \255K \255V > mz.ps)
+144 348 Q 2.5(##M)110.5 360 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
+(echo Running psbasemap...)110.5 372 Q
 (psbasemap \255Jx0.0011071486125582637/0.0062732342007434947 \\)110.5
-168 Q(-R0/8128.99/-4382/-3306 \\)144 180 Q
-(-B500/100:."Data File mz.dat": \\)144 192 Q(-O \255V >> mz.ps)144 204 Q
-(#)110.5 216 Q 2.5(#D)110.5 228 S(elete surplus \214les)-2.5 E
-(echo Deleting surplus \214les...)110.5 240 Q(rm \255f)110.5 252 Q(#)
-110.5 264 Q 2.5(#R)110.5 276 S(eset GMT def)-2.5 E(ault fonts)-.1 E
-(echo Resetting GMT fonts...)110.5 288 Q(mv gmtdef)110.5 300 Q
-(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5 312 Q 2.5(#R)110.5 324 S
-(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)110.5 336 Q 2.5(wi)-.25 G
-2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5 348 Q 2.5<77ad>-.25 G
-(ps a \255or landscape \255maxp 4m mz.ps &)-2.5 E(#)110.5 360 Q 2.5(#A)
-110.5 372 S(ll done!)-2.5 E(echo All done!)110.5 384 Q/F1 10.95
-/Times-Bold at 0 SF(AD)72 412.8 Q -1.478(VA)-.438 G(NCED EXAMPLES)1.478 E
-F0 .548(Suppose we ha)108 424.8 R .848 -.15(ve a \214)-.2 H .548
+384 Q(-R0/8128.99/-4382/-3306 \\)144 396 Q
+(-B500/100:."Data File mz.dat": \\)144 408 Q(-O \255V >> mz.ps)144 420 Q
+(#)110.5 432 Q 2.5(#D)110.5 444 S(elete surplus \214les)-2.5 E
+(echo Deleting surplus \214les...)110.5 456 Q(rm \255f)110.5 468 Q(#)
+110.5 480 Q 2.5(#R)110.5 492 S(eset GMT def)-2.5 E(ault fonts)-.1 E
+(echo Resetting GMT fonts...)110.5 504 Q(mv gmtdef)110.5 516 Q
+(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5 528 Q 2.5(#R)110.5 540 S
+(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)110.5 552 Q 2.5(wi)-.25 G
+2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5 564 Q 2.5<77ad>-.25 G
+(ps a \255or landscape \255maxp 4m mz.ps &)-2.5 E(#)110.5 576 Q 2.5(#A)
+110.5 588 S(ll done!)-2.5 E(echo All done!)110.5 600 Q/F1 10.95
+/Times-Bold at 0 SF(AD)72 628.8 Q -1.478(VA)-.438 G(NCED EXAMPLES)1.478 E
+F0 .548(Suppose we ha)108 640.8 R .848 -.15(ve a \214)-.2 H .548
 (le of NMEA GGA strings logged from a GPS recei).15 F -.15(ve)-.25 G
 3.049(rw).15 G .549(hose data looks lik)-3.049 F 3.049(et)-.1 G .549
-(he fol-)-3.049 F(lo)108 436.8 Q(wing:)-.25 E(\214lename: gps.ra)108
-460.8 Q(w:)-.15 E($GPGGA,23.0,5427.89080,N,14600.29458,W)110.5 484.8 Q
+(he fol-)-3.049 F(lo)108 652.8 Q(wing:)-.25 E(\214lename: gps.ra)108
+676.8 Q(w:)-.15 E($GPGGA,23.0,5427.89080,N,14600.29458,W)110.5 700.8 Q
 (,1,10,0.9,19.01,M,6.40,M,,*70)-.92 E
-($GPGGA,24.0,5427.89248,N,14600.30088,W)110.5 496.8 Q
+($GPGGA,24.0,5427.89248,N,14600.30088,W)110.5 712.8 Q
 (,1,10,0.9,19.39,M,6.40,M,,*7B)-.92 E
-($GPGGA,25.0,5427.89424,N,14600.30713,W)110.5 508.8 Q
-(,1,10,0.9,19.72,M,6.40,M,,*7C)-.92 E 2.153 -.8(We c)108 532.8 T .553
+($GPGGA,25.0,5427.89424,N,14600.30713,W)110.5 724.8 Q
+(,1,10,0.9,19.72,M,6.40,M,,*7C)-.92 E(MB-System 5.0)72 768 Q 2.5(9J)
+140.11 G(anuary 2015)-2.5 E(9)198.45 E 0 Cg EP
+%%Page: 10 10
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
+(5.0 mbm_xyplot\(1\))2.5 F 2.153 -.8(We c)108 84 T .553
 (an specify a comma delimited \214le and con).8 F -.15(ve)-.4 G .553
 (rt the latitude and longitude \214elds to decimal de).15 F .552
-(grees on)-.15 F(the \215y with the follo)108 544.8 Q(wing:)-.25 E
-20.485(mbm_xyplot \255ID,:C')120.5 568.8 R 37.985(substr\(c[5],0,3\)+su\
-bstr\(c[5],3,length\(c[5]\)\) /60_substr\(c[3],0,2\)+sub-)-.55 F
-(str\(c[3],2,length\(c[3]\)\)/60':gps.ra)108 580.8 Q(w)-.15 E .098
-(This is about as ugly as it gets. Ho)108 604.8 R(we)-.25 E -.15(ve)-.25
-G .898 -.4(r, i).15 H 2.598(ti).4 G 2.598(sq)-2.598 G .098
+(grees on)-.15 F(the \215y with the follo)108 96 Q(wing:)-.25 E 20.485
+(mbm_xyplot \255ID,:C')120.5 120 R 37.985(substr\(c[5],0,3\)+substr\(c[\
+5],3,length\(c[5]\)\) /60_substr\(c[3],0,2\)+sub-)-.55 F
+(str\(c[3],2,length\(c[3]\)\)/60':gps.ra)108 132 Q(w)-.15 E .098
+(This is about as ugly as it gets. Ho)108 156 R(we)-.25 E -.15(ve)-.25 G
+.898 -.4(r, i).15 H 2.598(ti).4 G 2.598(sq)-2.598 G .098
 (uite straightforw)-2.598 F .098(ard and v)-.1 F .097(ery handy)-.15 F
 2.597(,s)-.65 G 2.597(ol)-2.597 G .097(et us pick this apart.)-2.597 F
 .701(The \255I \215ag speci\214es the \214le to plot and its parameters\
-. The D sub\214eld follo)108 616.8 R .701(wed by ',)-.25 F 3.201('i)-.7
-G .701(ndicates the \214le is)-3.201 F 1.453
-(comma delimited. The C sub\214eld follo)108 628.8 R 1.453
+. The D sub\214eld follo)108 168 R .701(wed by ',)-.25 F 3.201('i)-.7 G
+.701(ndicates the \214le is)-3.201 F 1.453
+(comma delimited. The C sub\214eld follo)108 180 R 1.453
 (wed by the Perl e)-.25 F 1.453(xpression e)-.15 F 1.453
-(xtracts \214elds to plot. There are tw)-.15 F(o)-.1 E -.15(ex)108 640.8
-S .53(pressions here, the x v).15 F .53
-(alues, \(longitude\) and the x v)-.25 F .53
-(alues \(latitude\) separated by an "_". In the longitude)-.25 F -.15
-(ex)108 652.8 S .85(pression, the de).15 F .85
+(xtracts \214elds to plot. There are tw)-.15 F(o)-.1 E -.15(ex)108 192 S
+.53(pressions here, the x v).15 F .53(alues, \(longitude\) and the x v)
+-.25 F .53(alues \(latitude\) separated by an "_". In the longitude)-.25
+F -.15(ex)108 204 S .85(pression, the de).15 F .85
 (gree portion of the longitude, which is the 5th \214eld \(c[5]\) is e)
 -.15 F .85(xtracted and added to the)-.15 F
-(minute portion of the longitude di)108 664.8 Q
+(minute portion of the longitude di)108 216 Q
 (vided by 60. The same is done with the latitude \214eld, \(c[3]\).)-.25
-E 1.35(Note the single quotes surrounding the C e)108 688.8 R 1.351
+E 1.35(Note the single quotes surrounding the C e)108 240 R 1.351
 (xpression. These are required to ensure comple)-.15 F 3.851(xe)-.15 G
-(xpressions)-4.001 E(such as these are not inadv)108 700.8 Q
-(ertently interpreted by the shell.)-.15 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(9)204.835 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2
-10/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbcontour)8.408 E F0
-(\(1\),)A F2(mbswath)8.408 E F0(\(1\),)A F2(mbdefaults)8.408 E F0
-(\(1\),)A F2(mbm_grdplot)8.408 E F0(\(1\),)A F2(mbm_grd3dplot)8.408 E F0
-(\(1\),)A F2(mbm_plot)108 108 Q F0(\(1\))A F1 -.11(BU)72 136.8 S(GS).11
-E F0(Please let us kno)108 148.8 Q -.65(w.)-.25 G(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(10)199.835 E 0 Cg EP
+(xpressions)-4.001 E(such as these are not inadv)108 252 Q
+(ertently interpreted by the shell.)-.15 E/F1 10.95/Times-Bold at 0 SF
+(SEE ALSO)72 304.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 316.8 Q F0
+(\(1\),)A F2(mbcontour)8.408 E F0(\(1\),)A F2(mbswath)8.408 E F0(\(1\),)
+A F2(mbdefaults)8.408 E F0(\(1\),)A F2(mbm_grdplot)8.408 E F0(\(1\),)A
+F2(mbm_grd3dplot)8.408 E F0(\(1\),)A F2(mbm_plot)108 328.8 Q F0(\(1\))A
+F1 -.11(BU)72 357.6 S(GS).11 E F0(Please let us kno)108 369.6 Q -.65(w.)
+-.25 G(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(10)
+193.45 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbmosaic.ps b/src/ps/mbmosaic.ps
index 25d084d..fa0e8e7 100644
--- a/src/ps/mbmosaic.ps
+++ b/src/ps/mbmosaic.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:18 2014
+%%CreationDate: Wed Jul  1 12:29:29 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -1161,7 +1161,7 @@ R .393(By specifying a clipping dimension of 10 we cause small g)5.393 F
 (to be \214lled in through spine interpolation .)108 552 Q
 (The output looks lik)5 E(e:)-.1 E(Program mbmosaic)110.5 576 Q -1.11
 (Ve)110.5 588 S
-(rsion $Id: mbmosaic.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbmosaic.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)110.5 600 Q(ersion 4.5)-1.11 E(MBMOSAIC P)110.5 624 Q
 (arameters:)-.15 E(List of input \214les: datalist)110.5 636 Q
 (Output \214leroot:)110.5 648 Q(perth_ss)12.5 E(Input Data T)110.5 660 Q
diff --git a/src/ps/mbnavadjust.ps b/src/ps/mbnavadjust.ps
index e55564c..d2f9202 100644
--- a/src/ps/mbnavadjust.ps
+++ b/src/ps/mbnavadjust.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -300,25 +300,25 @@ G 1.016(ossible to solv)-3.516 F 1.016(e, or in)-.15 F -.15(ve)-.4 G
 E F0 1.043(\(e.g. tidal corrections ha)3.543 F 1.343 -.15(ve b)-.2 H
 1.043(een made\).).15 F 1.043(Otherwise, the of)6.043 F 1.043
 (fset analysis)-.25 F(and in)108 458.4 Q -.15(ve)-.4 G
-(rsions are three dimensional.).15 E(Pre)108 482.4 Q 1.103(vious attemp\
-ts to address this problem \(e.g. Nishimura et al. [1988]\) ha)-.25 F
-1.403 -.15(ve f)-.2 H 1.103(ocused on automating the).15 F 1.071
-(identi\214cation of matching features and their na)108 494.4 R(vig)-.2
-E 1.071(ational of)-.05 F 1.071
-(fsets. The automated approach is problematic)-.25 F 2.61
-(because sea\215oor features are comple)108 506.4 R 2.61
-(x, and the cross correlation function of matching features often)-.15 F
--.15(ex)108 518.4 S .331(hibits multiple local minima. Our approach is \
-to automate the identi\214cation of matching features and the).15 F .271
-(ultimate solution for an optimal indenti\214cation while depending on \
-interacti)108 530.4 R .571 -.15(ve d)-.25 H .271(etermination of the na)
-.15 F(vig)-.2 E(a-)-.05 E .345(tional of)108 542.4 R .345(fsets. W)-.25
-F 2.845(eh)-.8 G -2.25 -.2(av e)-2.845 H .345
+(rsions are three dimensional.).15 E .507(Early attempts to address thi\
+s problem \(e.g. Nishimura et al. [1988]\) focused on automating the id\
+enti\214ca-)108 482.4 R 1.225(tion of matching features and their na)108
+494.4 R(vig)-.2 E 1.225(ational of)-.05 F 1.224
+(fsets. The automated approach is problematic because)-.25 F .507
+(sea\215oor features are comple)108 506.4 R .508
+(x, and the cross correlation function of matching features often e)-.15
+F .508(xhibits multi-)-.15 F .146(ple local minima. Our approach is to \
+automate the identi\214cation of matching features and the ultimate sol\
+u-)108 518.4 R .354
+(tion for an optimal indenti\214cation while depending on interacti)108
+530.4 R .655 -.15(ve d)-.25 H .355(etermination of the na).15 F(vig)-.2
+E .355(ational of)-.05 F(fsets.)-.25 E 2.438 -.8(We h)108 542.4 T -2.25
+-.2(av e).8 H .837
 (not found an automatic algorithm that can reliably replace the human e)
-3.045 F .344(ye and brain)-.15 F
-(in correctly lining up real sea\215oor features.)108 554.4 Q F2(MBna)
-108 578.4 Q -.1(va)-.25 G(djust).1 E F0 .308(operates within the conte)
-2.807 F .308(xt of the)-.15 F F2(mbpr)2.808 E(ocess)-.18 E F0 .308
+3.537 F .837(ye and brain in correctly)-.15 F
+(lining up real sea\215oor features.)108 554.4 Q F2(MBna)108 578.4 Q -.1
+(va)-.25 G(djust).1 E F0 .308(operates within the conte)2.807 F .308
+(xt of the)-.15 F F2(mbpr)2.808 E(ocess)-.18 E F0 .308
 (parallel processing scheme, b)2.808 F .308(ut it should used)-.2 F .312
 (on data for which the initial na)108 590.4 R(vig)-.2 E .311
 (ation processing \(e.g.)-.05 F F2(mbna)2.811 E -.1(ve)-.25 G(dit).1 E
@@ -326,11 +326,11 @@ F0 .311(is complete.)2.811 F .311(When sw)5.311 F .311
 (ath data \214les are)-.1 F .32(imported into)108 602.4 R F2(mbna)2.82 E
 -.1(va)-.25 G(djust).1 E F0 2.82(,t)C .32(he data is tak)-2.82 F .32
 (en from processed \214les generated by)-.1 F F2(mbpr)2.82 E(ocess)-.18
-E F0(whene)2.82 E -.15(ve)-.25 G 2.82(rp).15 G(os-)-2.82 E 1.05
-(sible \(when those \214les e)108 614.4 R 1.05
-(xist\). If no processed \214le e)-.15 F 1.05(xists, the ra)-.15 F 3.55
-(wd)-.15 G 1.05(ata is used. When the processing with)-3.55 F F2(mbna)
-108 626.4 Q -.1(va)-.25 G(djust).1 E F0 .525
+E F0(whene)2.82 E -.15(ve)-.25 G 2.82(rp).15 G(os-)-2.82 E .191
+(sible \(when those \214les e)108 614.4 R .191
+(xist\). If no processed \214le e)-.15 F .191(xists, the ra)-.15 F 2.69
+(wd)-.15 G .19(ata \214le is used. When the processing with)-2.69 F F2
+(mbna)108 626.4 Q -.1(va)-.25 G(djust).1 E F0 .525
 (is completed and an optimal na)3.025 F(vig)-.2 E .525
 (ation solution is achie)-.05 F -.15(ve)-.25 G .525(d, ne).15 F 3.025
 (wn)-.25 G -.2(av)-3.025 G(ig).2 E .525(ation \214les are gener)-.05 F
@@ -351,1928 +351,1933 @@ F0 2.837(.T)C .337(his beha)-2.837 F .337(vior can be re)-.2 F -.15(ve)
 -.25 G .337(rsed manually using).15 F F2(mbset)2.837 E F0(,)A -.2(bu)108
 686.4 S 2.5(tt).2 G
 (hen the user will unnecessarily complicating his or her ef)-2.5 E
-(forts.)-.25 E .749(The in)108 710.4 R -.15(ve)-.4 G .749
-(rsion for an optimal na).15 F(vig)-.2 E .749(ation which \214ts the of)
--.05 F .748(fsets identi\214ed at matching features must also be)-.25 F
-.75(reasonable. This is achie)108 722.4 R -.15(ve)-.25 G 3.25(db).15 G
-3.251(ym)-3.25 G .751
-(inimizing perturbations to speed and acceleration in the in)-3.251 F
--.15(ve)-.4 G 3.251(rsion. This).15 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
+(forts.)-.25 E 6.37(Ac)108 710.4 S 3.87(ompanion program)-6.37 F F2
+(mbna)6.37 E -.1(va)-.25 G(djustmer).1 E(ge)-.1 E F0 3.87(can add)6.37 F
+F2(mbna)6.37 E -.1(va)-.25 G(djust).1 E F0 3.87
+(projects together or or modify)6.37 F F2(mbna)108 722.4 Q -.1(va)-.25 G
+(djust).1 E F0(prooject settings.)2.5 E(MB-System 5.0)72 768 Q
+(22 April 2015)142.605 E(1)200.945 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .882(approach of penalizing \214rst and second deri)
-108 84 R -.25(va)-.25 G(ti).25 E -.15(ve)-.25 G 3.382(sw).15 G .882
-(ithin a linear in)-3.382 F -.15(ve)-.4 G .882
-(rse problem is common within the).15 F(geoph)108 96 Q(ysical in)-.05 E
--.15(ve)-.4 G(rse theory literature \(e.g. P).15 E(ark)-.15 E
-(er [1994]\).)-.1 E .971(Users are advised that)108 120 R/F1 10
-/Times-Bold at 0 SF(mbna)3.471 E -.1(va)-.25 G(djust).1 E F0 .972
-(is complicated in both conception and implementation. W)3.471 F 3.472
-(es)-.8 G(trongly)-3.472 E .814
-(recommend that users read all of the documentation pro)108 132 R .814
+(djust\(1\)).25 E .748(The in)108 84 R -.15(ve)-.4 G .748
+(rsion for an optimal na).15 F(vig)-.2 E .749(ation which \214ts the of)
+-.05 F .749(fsets identi\214ed at matching features must also be)-.25 F
+.751(reasonable. This is achie)108 96 R -.15(ve)-.25 G 3.251(db).15 G
+3.251(ym)-3.251 G .751
+(inimizing perturbations to speed and acceleration in the in)-3.251 F
+-.15(ve)-.4 G 3.25(rsion. This).15 F .882
+(approach of penalizing \214rst and second deri)108 108 R -.25(va)-.25 G
+(ti).25 E -.15(ve)-.25 G 3.382(sw).15 G .882(ithin a linear in)-3.382 F
+-.15(ve)-.4 G .882(rse problem is common within the).15 F(geoph)108 120
+Q(ysical in)-.05 E -.15(ve)-.4 G(rse theory literature \(e.g. P).15 E
+(ark)-.15 E(er [1994]\).)-.1 E .972(Users are advised that)108 144 R/F1
+10/Times-Bold at 0 SF(mbna)3.472 E -.1(va)-.25 G(djust).1 E F0 .971
+(is complicated in both conception and implementation. W)3.472 F 3.471
+(es)-.8 G(trongly)-3.471 E .814
+(recommend that users read all of the documentation pro)108 156 R .814
 (vided belo)-.15 F 3.314(wp)-.25 G .814
-(rior to attempting a \214rst use of this)-3.314 F(softw)108 144 Q 2.747
-(are. The)-.1 F .247(meaning and use of the indi)2.747 F .247
-(vidual widgets and windo)-.25 F .248(ws emplo)-.25 F .248
-(yed in the graphical interf)-.1 F(ace)-.1 E .207(is pro)108 156 R .207
-(vided in the)-.15 F F1(INTERA)2.707 E .206(CTIVE CONTR)-.55 F(OLS)-.3 E
-F0 .206(section. The)2.706 F F1 .206(USING MBN)2.706 F -.95 -1.45(AV A)
--.2 H(DJUST)1.45 E F0 .206(section pro)2.706 F(vides)-.15 E 3.445(am)108
-168 S .945(ore coherent discussion of ho)-3.445 F 3.445(wt)-.25 G 3.445
+(rior to attempting a \214rst use of this)-3.314 F(softw)108 168 Q 2.748
+(are. The)-.1 F .248(meaning and use of the indi)2.748 F .247
+(vidual widgets and windo)-.25 F .247(ws emplo)-.25 F .247
+(yed in the graphical interf)-.1 F(ace)-.1 E .206(is pro)108 180 R .206
+(vided in the)-.15 F F1(INTERA)2.706 E .206(CTIVE CONTR)-.55 F(OLS)-.3 E
+F0 .206(section. The)2.706 F F1 .207(USING MBN)2.707 F -.95 -1.45(AV A)
+-.2 H(DJUST)1.45 E F0 .207(section pro)2.707 F(vides)-.15 E 3.446(am)108
+192 S .946(ore coherent discussion of ho)-3.446 F 3.445(wt)-.25 G 3.445
 (ou)-3.445 G(se)-3.445 E F1(mbna)3.445 E -.1(va)-.25 G(djust).1 E F0
-3.445(,h)C 1.445 -.25(ow t)-3.445 H .946(his program interacts with the)
-.25 F F1(mbpr)3.446 E(ocess)-.18 E F0(parallel processing scheme, and t\
-he underlying concepts and algorithms.)108 180 Q/F2 10.95/Times-Bold at 0
-SF -.548(AU)72 208.8 S(THORSHIP).548 E F0(Da)108 220.8 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 232.8 Q
+3.445(,h)C 1.445 -.25(ow t)-3.445 H .945(his program interacts with the)
+.25 F F1(mbpr)3.445 E(ocess)-.18 E F0(parallel processing scheme, and t\
+he underlying concepts and algorithms.)108 204 Q/F2 10.95/Times-Bold at 0
+SF -.548(AU)72 232.8 S(THORSHIP).548 E F0(Da)108 244.8 Q(vid W)-.2 E 2.5
+(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 256.8 Q
 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 244.8 Q
-(Lamont-Doherty Earth Observ)113 256.8 Q(atory)-.25 E F2(OPTIONS)72
-285.6 Q F1<ad48>108 297.6 Q F0 .162(This "help" \215ag cause the progra\
-m to print out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 309.6 Q(.)-.65 E F1<ad44>108 326.4 Q F0
-(Normally)23.08 E(,)-.65 E F1(mbna)3.05 E -.1(va)-.25 G(djust).1 E F0
-.551(uses a white background for the interacti)3.05 F .851 -.15(ve p)
--.25 H .551(lots. This option causes the).15 F
-(program to use a black background for the plots.)144 338.4 Q F1<ad52>
-108 355.2 Q F0 1.036(This option causes)23.08 F F1(mbna)3.536 E -.1(va)
--.25 G(djust).1 E F0 1.035(to discard all na)3.536 F(vig)-.2 E 1.035
-(ation ties, set all crossings to "unanalyzed")-.05 F .082
-(status, and to sa)144 367.2 R .382 -.15(ve t)-.2 H .083
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 268.8 Q
+(Lamont-Doherty Earth Observ)113 280.8 Q(atory)-.25 E F2(OPTIONS)72
+309.6 Q F1<ad48>108 321.6 Q F0 .162(This "help" \215ag cause the progra\
+m to print out a description of its operation and then e)22.52 F .162
+(xit immedi-)-.15 F(ately)144 333.6 Q(.)-.65 E F1<ad44>108 350.4 Q F0
+(Normally)23.08 E(,)-.65 E F1(mbna)3.051 E -.1(va)-.25 G(djust).1 E F0
+.551(uses a white background for the interacti)3.051 F .851 -.15(ve p)
+-.25 H .55(lots. This option causes the).15 F
+(program to use a black background for the plots.)144 362.4 Q F1<ad52>
+108 379.2 Q F0 1.035(This option causes)23.08 F F1(mbna)3.535 E -.1(va)
+-.25 G(djust).1 E F0 1.035(to discard all na)3.535 F(vig)-.2 E 1.036
+(ation ties, set all crossings to "unanalyzed")-.05 F .083
+(status, and to sa)144 391.2 R .383 -.15(ve t)-.2 H .083
 (he project in this pristine state. Only use this option if you really)
-.15 F 2.583(,r)-.65 G .083(eally w)-2.583 F .083(ant to)-.1 F(start o)
-144 379.2 Q -.15(ve)-.15 G -.55(r.).15 G F1<ad56>108 396 Q F0(Normally)
-23.08 E(,)-.65 E F1(mbna)5.043 E -.1(va)-.25 G(djust).1 E F0 2.543
-(outputs nothing to the stderr stream.)5.043 F 2.543(If the)7.543 F F1
-<ad56>5.043 E F0 2.543(\215ag is gi)5.043 F -.15(ve)-.25 G 2.542
-(n, then).15 F F1(mbna)144 408 Q -.1(va)-.25 G(djust).1 E F0 -.1(wo)
-3.612 G 1.113(rks in a "v).1 F 1.113
+.15 F 2.582(,r)-.65 G .082(eally w)-2.582 F .082(ant to)-.1 F(start o)
+144 403.2 Q -.15(ve)-.15 G -.55(r.).15 G F1<ad56>108 420 Q F0(Normally)
+23.08 E(,)-.65 E F1(mbna)5.042 E -.1(va)-.25 G(djust).1 E F0 2.543
+(outputs nothing to the stderr stream.)5.042 F 2.543(If the)7.543 F F1
+<ad56>5.043 E F0 2.543(\215ag is gi)5.043 F -.15(ve)-.25 G 2.543
+(n, then).15 F F1(mbna)144 432 Q -.1(va)-.25 G(djust).1 E F0 -.1(wo)
+3.613 G 1.113(rks in a "v).1 F 1.113
 (erbose" mode and outputs the program v)-.15 F 1.113
-(ersion being used, all error)-.15 F(status messages, and a lar)144 420
-Q(ge amount of other information.)-.18 E F2(INTERA)72 448.8 Q
-(CTIVE CONTR)-.602 E(OLS)-.329 E F1(MBna)87 460.8 Q -.1(va)-.25 G
-(djust W).1 E(indo)-.18 E(w)-.1 E F0(This is the primary windo)108 472.8
+(ersion being used, all error)-.15 F(status messages, and a lar)144 444
+Q(ge amount of other information.)-.18 E F2(INTERA)72 472.8 Q
+(CTIVE CONTR)-.602 E(OLS)-.329 E F1(MBna)87 484.8 Q -.1(va)-.25 G
+(djust W).1 E(indo)-.18 E(w)-.1 E F0(This is the primary windo)108 496.8
 Q 2.5(wo)-.25 G(f)-2.5 E F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0(.)A
-F1(File)108 501.6 Q F0 .855(This b)19.89 F .855(utton acti)-.2 F -.25
-(va)-.25 G .855(tes a pulldo).25 F .854(wn menu with six items:)-.25 F
-F1(New)3.354 E F0(,)A F1(Open)3.354 E F0(,)A F1(Close)3.354 E F0(,)A F1
-.854(Import Swath Data)3.354 F F0(,)A(and)144 513.6 Q F1(Quit)2.5 E F0
-(.)A F1(File->New)108 542.4 Q F0 .584
-(This menu item brings up a popup windo)144 554.4 R 3.084(ww)-.25 G .584
-(hich allo)-3.084 F .585(ws the user to specify a ne)-.25 F(w)-.25 E F1
-(mbna)3.085 E -.1(va)-.25 G(djust).1 E F0 .244
-(project. As part of initializing a ne)144 566.4 R 2.744(wp)-.25 G
-(roject,)-2.744 E F1(mbna)2.744 E -.1(va)-.25 G(djust).1 E F0 .243
-(creates a \214le with a ".n)2.744 F .243(vh" suf)-.4 F .243
-(\214x and a)-.25 F(directory with a ".dir" suf)144 578.4 Q(\214x.)-.25
-E F1(File->Open)108 595.2 Q F0 .716
-(This menu item brings up a popup windo)144 607.2 R 3.216(ww)-.25 G .716
+F1(File)108 525.6 Q F0 .854(This b)19.89 F .854(utton acti)-.2 F -.25
+(va)-.25 G .854(tes a pulldo).25 F .854(wn menu with six items:)-.25 F
+F1(New)3.354 E F0(,)A F1(Open)3.354 E F0(,)A F1(Close)3.355 E F0(,)A F1
+.855(Import Swath Data)3.355 F F0(,)A(and)144 537.6 Q F1(Quit)2.5 E F0
+(.)A F1(File->New)108 566.4 Q F0 .585
+(This menu item brings up a popup windo)144 578.4 R 3.084(ww)-.25 G .584
+(hich allo)-3.084 F .584(ws the user to specify a ne)-.25 F(w)-.25 E F1
+(mbna)3.084 E -.1(va)-.25 G(djust).1 E F0 .243
+(project. As part of initializing a ne)144 590.4 R 2.743(wp)-.25 G
+(roject,)-2.743 E F1(mbna)2.743 E -.1(va)-.25 G(djust).1 E F0 .244
+(creates a \214le with a ".n)2.744 F .244(vh" suf)-.4 F .244
+(\214x and a)-.25 F(directory with a ".dir" suf)144 602.4 Q(\214x.)-.25
+E F1(File->Open)108 619.2 Q F0 .717
+(This menu item brings up a popup windo)144 631.2 R 3.216(ww)-.25 G .716
 (hich allo)-3.216 F .716(ws the user to open an e)-.25 F(xisting)-.15 E
-F1(mbna)3.217 E -.1(va)-.25 G(d-).1 E(just)144 619.2 Q F0(project.)2.5 E
-F1(File->Close)108 636 Q F0(This menu item causes)144 648 Q F1(mbna)2.5
+F1(mbna)3.216 E -.1(va)-.25 G(d-).1 E(just)144 643.2 Q F0(project.)2.5 E
+F1(File->Close)108 660 Q F0(This menu item causes)144 672 Q F1(mbna)2.5
 E -.1(va)-.25 G(djust).1 E F0(to close the current project.)2.5 E F1
-(File->Import Swath Data)108 664.8 Q F0 .123
-(This menu item brings up a popup windo)144 676.8 R 2.622(ww)-.25 G .122
-(hich allo)-2.622 F .122(ws the user to specify a sw)-.25 F .122
-(ath sonar data \214le)-.1 F .07(or a list of sw)144 688.8 R .071
-(ath \214les to be imported into the current)-.1 F F1(mbna)2.571 E -.1
-(va)-.25 G(djust).1 E F0 2.571(project. This)2.571 F .071
-(program uses the)2.571 F F1(MBIO)144 700.8 Q F0 1.355
-(library and will read an)3.855 F 3.855(ys)-.15 G -.1(wa)-3.855 G 1.354
-(th sonar formats supported by).1 F F1(MBIO)3.854 E F0 3.854(.Al)C 1.354
-(ist of the sw)-3.854 F(ath)-.1 E .39
-(sonar data formats currently supported by)144 712.8 R F1(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15
-(ve)-.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F1(MBIO)2.891 E
-F0 2.203(manual page.)144 724.8 R 2.203(If the sw)7.203 F 2.203
-(ath sonar data \214le is named using the)-.1 F F1(MB-System)4.703 E F0
-(suf)4.702 E 2.202(\214x con)-.25 F -.15(ve)-.4 G(ntion).15 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
+(File->Import Swath Data)108 688.8 Q F0 .122
+(This menu item brings up a popup windo)144 700.8 R 2.622(ww)-.25 G .122
+(hich allo)-2.622 F .122(ws the user to specify a sw)-.25 F .123
+(ath sonar data \214le)-.1 F .071(or a list of sw)144 712.8 R .071
+(ath \214les to be imported into the current)-.1 F F1(mbna)2.57 E -.1
+(va)-.25 G(djust).1 E F0 2.57(project. This)2.57 F .07(program uses the)
+2.57 F F1(MBIO)144 724.8 Q F0 1.354(library and will read an)3.854 F
+3.854(ys)-.15 G -.1(wa)-3.854 G 1.354(th sonar formats supported by).1 F
+F1(MBIO)3.855 E F0 3.855(.Al)C 1.355(ist of the sw)-3.855 F(ath)-.1 E
+(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(2)200.945 E 0 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .676(\(format 11 \214les end with ".mb11", format 41 \
-\214les end with ".mb41", etc.\), then the program will)144 84 R 1.038(\
-automatically use the appropriate format id; otherwise the format must \
-be set by the user in the)144 96 R(format te)144 108 Q(xt box.)-.15 E/F1
-10/Times-Bold at 0 SF(File->Quit)108 124.8 Q F0 .447(This b)144 136.8 R
-.447(utton causes)-.2 F F1(mbna)2.947 E -.1(va)-.25 G(djust).1 E F0 .448
+(djust\(1\)).25 E .391(sonar data formats currently supported by)144 84
+R/F1 10/Times-Bold at 0 SF(MBIO)2.891 E F0 .391(and their identi\214er v)
+2.891 F .39(alues is gi)-.25 F -.15(ve)-.25 G 2.89(ni).15 G 2.89(nt)
+-2.89 G(he)-2.89 E F1(MBIO)2.89 E F0 .681(manual page.)144 96 R .681
+(If the sw)5.681 F .681(ath sonar data \214le is named using the)-.1 F
+F1(MB-System)3.182 E F0(suf)3.182 E .682(\214x con)-.25 F -.15(ve)-.4 G
+.682(ntion \(for).15 F(-)-.2 E .162(mat 11 \214les end with ".mb11", fo\
+rmat 41 \214les end with ".mb41", etc.\), then the program will auto-)
+144 108 R .275(matically use the appropriate format id; otherwise the f\
+ormat must be set by the user in the format)144 120 R(te)144 132 Q
+(xt box.)-.15 E F1(File->Quit)108 148.8 Q F0 .448(This b)144 160.8 R
+.448(utton causes)-.2 F F1(mbna)2.948 E -.1(va)-.25 G(djust).1 E F0 .447
 (to quit. If a project has been created or opened, that project will)
-2.947 F(be closed before the program quits.)144 148.8 Q F1(Option)108
-165.6 Q F0(This b)5.99 E(utton brings up a pulldo)-.2 E
+2.948 F(be closed before the program quits.)144 172.8 Q F1(Option)108
+189.6 Q F0(This b)5.99 E(utton brings up a pulldo)-.2 E
 (wn menu with one item:)-.25 E F1(Contr)2.5 E(ols)-.18 E F0(.)A F1
-(Option->Contr)108 182.4 Q(ols)-.18 E F0 .243
-(This menu item brings up a dialog windo)144 194.4 R 2.743(ww)-.25 G
-.243(ith se)-2.743 F -.15(ve)-.25 G .242
+(Option->Contr)108 206.4 Q(ols)-.18 E F0 .242
+(This menu item brings up a dialog windo)144 218.4 R 2.743(ww)-.25 G
+.243(ith se)-2.743 F -.15(ve)-.25 G .243
 (ral slider widgets that set parameters control-).15 F .088(ling ho)144
-206.4 R 2.588(ws)-.25 G -.1(wa)-2.588 G .088
+230.4 R 2.588(ws)-.25 G -.1(wa)-2.588 G .088
 (th data are imported and displayed.).1 F .088
 (These widgets are discussed in the)5.088 F F1(Contr)2.588 E(ols)-.18 E
-F0(sec-)2.588 E(tion belo)144 218.4 Q -.65(w.)-.25 G(.TP)146.5 230.4 Q
-F1 -.37(Vi)3.327 G(ew).37 E F0 .827(This b)3.327 F .826
+F0(sec-)2.588 E(tion belo)144 242.4 Q -.65(w.)-.25 G(.TP)146.5 254.4 Q
+F1 -.37(Vi)3.326 G(ew).37 E F0 .826(This b)3.326 F .826
 (utton brings up a pulldo)-.2 F .826
 (wn menu with \214fteen items in three groups. This menu)-.25 F .26
-(controls the contents of the list widget in the lo)144 242.4 R .26
+(controls the contents of the list widget in the lo)144 266.4 R .26
 (wer right)-.25 F F1(MBna)2.76 E -.1(va)-.25 G .26(djust W).1 F(indo)
 -.18 E(w)-.1 E F0 2.76(.I)C 2.76(fa)-2.76 G(n)-2.76 E F1(mbna)2.76 E -.1
-(va)-.25 G(d-).1 E(just)144 254.4 Q F0 .868
-(project has been created or opened, the)3.368 F F1 .868(Data T)3.368 F
-(able)-.92 E F0 .867(list widget will display a table of items)3.368 F
+(va)-.25 G(d-).1 E(just)144 278.4 Q F0 .867
+(project has been created or opened, the)3.367 F F1 .868(Data T)3.368 F
+(able)-.92 E F0 .868(list widget will display a table of items)3.368 F
 .947(controlled by these menu items, and the corresponding menu item wi\
-ll be disabled. Selection of)144 266.4 R
-(another item items will change what is displayed in the)144 278.4 Q F1
+ll be disabled. Selection of)144 290.4 R
+(another item items will change what is displayed in the)144 302.4 Q F1
 (Data T)2.5 E(able)-.92 E F0(list widget accordingly)2.5 E(.)-.65 E
-1.047(The \214rst group includes the)144 302.4 R F1(Sho)3.547 E 3.547
-(wS)-.1 G(ur)-3.547 E -.1(ve)-.1 G(ys).1 E F0(,)A F1(Sho)3.546 E 3.546
-(wD)-.1 G 1.046(ata Files)-3.546 F F0(,)A F1(Sho)3.546 E 3.546(wD)-.1 G
-1.046(ata File Sections)-3.546 F F0(,)A F1(Sho)3.546 E(w)-.1 E 2.056
-(All Cr)144 314.4 R(ossings)-.18 E F0(,)A F1(Sho)4.556 E 4.556(wA)-.1 G
-2.056(ll Cr)-4.556 F(ossings)-.18 E F0(,)A F1(Sho)4.556 E 4.556(w>)-.1 G
-2.056(25% Cr)-4.556 F(ossings)-.18 E F0(,)A F1(Sho)4.557 E 4.557(w>)-.1
-G 2.057(50% Cr)-4.557 F(ossings)-.18 E F0(,)A F1(Sho)4.557 E(w)-.1 E
--.74(Tr)144 326.4 S(ue Cr).74 E(ossings)-.18 E F0 2.5(,a)C(nd)-2.5 E F1
-(Sho)2.5 E 2.5(wT)-.1 G(ies)-2.68 E F0(items.)2.5 E F1 -.37(Vi)108 343.2
-S(ew->Sho).37 E 2.5(wS)-.1 G(ur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 1.051
-(This menu item causes the)144 355.2 R F1 1.051(Data T)3.551 F(able)-.92
-E F0 1.05(list widget to display a list of the surv)3.551 F -.15(ey)-.15
-G 3.55(si).15 G 3.55(nt)-3.55 G 1.05(he current)-3.55 F F1(mbna)144
-367.2 Q -.1(va)-.25 G(djust).1 E F0 .18(project. W)2.68 F(ithin)-.4 E F1
+1.046(The \214rst group includes the)144 326.4 R F1(Sho)3.546 E 3.546
+(wS)-.1 G(ur)-3.546 E -.1(ve)-.1 G(ys).1 E F0(,)A F1(Sho)3.546 E 3.546
+(wD)-.1 G 1.047(ata Files)-3.546 F F0(,)A F1(Sho)3.547 E 3.547(wD)-.1 G
+1.047(ata File Sections)-3.547 F F0(,)A F1(Sho)3.547 E(w)-.1 E 2.057
+(All Cr)144 338.4 R(ossings)-.18 E F0(,)A F1(Sho)4.557 E 4.557(wA)-.1 G
+2.057(ll Cr)-4.557 F(ossings)-.18 E F0(,)A F1(Sho)4.556 E 4.556(w>)-.1 G
+2.056(25% Cr)-4.556 F(ossings)-.18 E F0(,)A F1(Sho)4.556 E 4.556(w>)-.1
+G 2.056(50% Cr)-4.556 F(ossings)-.18 E F0(,)A F1(Sho)4.556 E(w)-.1 E
+-.74(Tr)144 350.4 S(ue Cr).74 E(ossings)-.18 E F0 2.5(,a)C(nd)-2.5 E F1
+(Sho)2.5 E 2.5(wT)-.1 G(ies)-2.68 E F0(items.)2.5 E F1 -.37(Vi)108 367.2
+S(ew->Sho).37 E 2.5(wS)-.1 G(ur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 1.05
+(This menu item causes the)144 379.2 R F1 1.05(Data T)3.55 F(able)-.92 E
+F0 1.051(list widget to display a list of the surv)3.55 F -.15(ey)-.15 G
+3.551(si).15 G 3.551(nt)-3.551 G 1.051(he current)-3.551 F F1(mbna)144
+391.2 Q -.1(va)-.25 G(djust).1 E F0 .18(project. W)2.68 F(ithin)-.4 E F1
 (MBna)2.68 E -.1(va)-.25 G(djust).1 E F0 2.68(,as)C(urv)-2.68 E .48 -.15
 (ey i)-.15 H 2.68(sag).15 G .18(roup of sw)-2.68 F .18
-(ath \214les that are contiguous)-.1 F(in time.)144 379.2 Q F1 -.37(Vi)
-108 396 S(ew->Sho).37 E 2.5(wD)-.1 G(ata Files)-2.5 E F0 .001
-(This menu item causes the)144 408 R F1 .001(Data T)2.501 F(able)-.92 E
+(ath \214les that are contiguous)-.1 F(in time.)144 403.2 Q F1 -.37(Vi)
+108 420 S(ew->Sho).37 E 2.5(wD)-.1 G(ata Files)-2.5 E F0 .001
+(This menu item causes the)144 432 R F1 .001(Data T)2.501 F(able)-.92 E
 F0 .001(list widget to display a list of the sw)2.501 F .001
-(ath data \214les in the cur)-.1 F(-)-.2 E(rent)144 420 Q F1(mbna)2.5 E
--.1(va)-.25 G(djust).1 E F0(project.)2.5 E F1 -.37(Vi)108 436.8 S
+(ath data \214les in the cur)-.1 F(-)-.2 E(rent)144 444 Q F1(mbna)2.5 E
+-.1(va)-.25 G(djust).1 E F0(project.)2.5 E F1 -.37(Vi)108 460.8 S
 (ew->Sho).37 E 2.5(wD)-.1 G(ata File Sections)-2.5 E F0 .151
-(This menu item causes the)144 448.8 R F1 .151(Data T)2.651 F(able)-.92
+(This menu item causes the)144 472.8 R F1 .151(Data T)2.651 F(able)-.92
 E F0 .151(list widget to display a list of the sw)2.651 F .151
-(ath data sections in the)-.1 F(current)144 460.8 Q F1(mbna)2.5 E -.1
-(va)-.25 G(djust).1 E F0(project.)2.5 E F1 -.37(Vi)108 477.6 S(ew->Sho)
-.37 E 2.5(wA)-.1 G(ll Cr)-2.5 E(ossings)-.18 E F0 .239
-(This menu item causes the)144 489.6 R F1 .239(Data T)2.739 F(able)-.92
-E F0 .238(list widget to display a list of all the sw)2.739 F .238
-(ath crossings in the)-.1 F(current)144 501.6 Q F1(mbna)2.522 E -.1(va)
--.25 G(djust).1 E F0 2.523(project. When)2.522 F .023
-(this option is set, selecting a list item causes)2.523 F F1(mbna)2.523
-E -.1(va)-.25 G(djust).1 E F0(to)2.523 E
-(load and display the selected selected crossing in the "Na)144 513.6 Q
-2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108 530.4 S
-(ew->Sho).37 E 2.5(w>)-.1 G(25% Cr)-2.5 E(ossings)-.18 E F0 .239
-(This menu item causes the)144 542.4 R F1 .239(Data T)2.739 F(able)-.92
-E F0 .238(list widget to display a list of all the sw)2.739 F .238
-(ath crossings in the)-.1 F(current)144 554.4 Q F1(mbna)3.541 E -.1(va)
--.25 G(djust).1 E F0 1.041(project for which the tw)3.541 F 3.541(os)-.1
-G 1.041(ections o)-3.541 F -.15(ve)-.15 G 1.042(rlap by more than 25%.)
-.15 F 1.042(When this)6.042 F 1.055
-(option is set, selecting a list item causes)144 566.4 R F1(mbna)3.555 E
--.1(va)-.25 G(djust).1 E F0 1.054
-(to load and display the selected selected)3.555 F(crossing in the "Na)
-144 578.4 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108
-595.2 S(ew->Sho).37 E 2.5(w>)-.1 G(50% Cr)-2.5 E(ossings)-.18 E F0 .238
-(This menu item causes the)144 607.2 R F1 .238(Data T)2.738 F(able)-.92
+(ath data sections in the)-.1 F(current)144 484.8 Q F1(mbna)2.5 E -.1
+(va)-.25 G(djust).1 E F0(project.)2.5 E F1 -.37(Vi)108 501.6 S(ew->Sho)
+.37 E 2.5(wA)-.1 G(ll Cr)-2.5 E(ossings)-.18 E F0 .238
+(This menu item causes the)144 513.6 R F1 .238(Data T)2.738 F(able)-.92
 E F0 .239(list widget to display a list of all the sw)2.738 F .239
-(ath crossings in the)-.1 F(current)144 619.2 Q F1(mbna)3.363 E -.1(va)
--.25 G(djust).1 E F0 .863(project for which the tw)3.363 F 3.363(os)-.1
-G .863(ections o)-3.363 F -.15(ve)-.15 G .863(rlap by more than 50%..)
-.15 F .862(When this)5.862 F 1.054
-(option is set, selecting a list item causes)144 631.2 R F1(mbna)3.555 E
+(ath crossings in the)-.1 F(current)144 525.6 Q F1(mbna)2.523 E -.1(va)
+-.25 G(djust).1 E F0 2.523(project. When)2.523 F .023
+(this option is set, selecting a list item causes)2.523 F F1(mbna)2.522
+E -.1(va)-.25 G(djust).1 E F0(to)2.522 E
+(load and display the selected selected crossing in the "Na)144 537.6 Q
+2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108 554.4 S
+(ew->Sho).37 E 2.5(w>)-.1 G(25% Cr)-2.5 E(ossings)-.18 E F0 .238
+(This menu item causes the)144 566.4 R F1 .238(Data T)2.738 F(able)-.92
+E F0 .239(list widget to display a list of all the sw)2.738 F .239
+(ath crossings in the)-.1 F(current)144 578.4 Q F1(mbna)3.542 E -.1(va)
+-.25 G(djust).1 E F0 1.042(project for which the tw)3.542 F 3.541(os)-.1
+G 1.041(ections o)-3.541 F -.15(ve)-.15 G 1.041(rlap by more than 25%.)
+.15 F 1.041(When this)6.041 F 1.054
+(option is set, selecting a list item causes)144 590.4 R F1(mbna)3.555 E
 -.1(va)-.25 G(djust).1 E F0 1.055
 (to load and display the selected selected)3.555 F(crossing in the "Na)
-144 643.2 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108
-660 S(ew->Sho).37 E 2.5(wT)-.1 G(rue Cr)-3.24 E(ossings)-.18 E F0 .107
-(This menu item causes the)144 672 R F1 .107(Data T)2.607 F(able)-.92 E
-F0 .107(list widget to display a list of all the sw)2.607 F .106
-(ath crossings)-.1 F .106(in the)5.106 F(current)144 684 Q F1(mbna)4.634
-E -.1(va)-.25 G(djust).1 E F0 2.134(project for which the na)4.634 F
-(vig)-.2 E 2.135(ation tracks cross.)-.05 F 2.135
-(When this option is set,)7.135 F .556(selecting a list item causes)144
-696 R F1(mbna)3.056 E -.1(va)-.25 G(djust).1 E F0 .555
-(to load and display the selected selected crossing in the)3.055 F("Na)
-144 708 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
+144 602.4 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108
+619.2 S(ew->Sho).37 E 2.5(w>)-.1 G(50% Cr)-2.5 E(ossings)-.18 E F0 .239
+(This menu item causes the)144 631.2 R F1 .239(Data T)2.739 F(able)-.92
+E F0 .238(list widget to display a list of all the sw)2.739 F .238
+(ath crossings in the)-.1 F(current)144 643.2 Q F1(mbna)3.362 E -.1(va)
+-.25 G(djust).1 E F0 .863(project for which the tw)3.362 F 3.363(os)-.1
+G .863(ections o)-3.363 F -.15(ve)-.15 G .863(rlap by more than 50%..)
+.15 F .863(When this)5.863 F 1.055
+(option is set, selecting a list item causes)144 655.2 R F1(mbna)3.555 E
+-.1(va)-.25 G(djust).1 E F0 1.054
+(to load and display the selected selected)3.555 F(crossing in the "Na)
+144 667.2 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108
+684 S(ew->Sho).37 E 2.5(wT)-.1 G(rue Cr)-3.24 E(ossings)-.18 E F0 .106
+(This menu item causes the)144 696 R F1 .107(Data T)2.607 F(able)-.92 E
+F0 .107(list widget to display a list of all the sw)2.607 F .107
+(ath crossings)-.1 F .107(in the)5.107 F(current)144 708 Q F1(mbna)4.635
+E -.1(va)-.25 G(djust).1 E F0 2.135(project for which the na)4.635 F
+(vig)-.2 E 2.135(ation tracks cross.)-.05 F 2.134
+(When this option is set,)7.134 F .555(selecting a list item causes)144
+720 R F1(mbna)3.055 E -.1(va)-.25 G(djust).1 E F0 .556
+(to load and display the selected selected crossing in the)3.055 F
+(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(3)200.945 E 0 Cg EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10/Times-Bold at 0 SF -.37(Vi)108 84 S(ew->Sho).37 E
-2.5(wT)-.1 G(ies)-2.68 E F0 .642(This menu item causes the)144 96 R F1
-.642(Data T)3.142 F(able)-.92 E F0 .643
-(list widget to display a list of the tie points in the current)3.142 F
-F1(mbna)144 108 Q -.1(va)-.25 G(djust).1 E F0(project.)2.5 E 1.776
-(The second group includes the)144 132 R F1(Sho)4.276 E 4.275(wA)-.1 G
-1.775(ll Sur)-4.275 F -.1(ve)-.1 G(ys).1 E F0(,)A F1(Sho)4.275 E 4.275
-(wO)-.1 G 1.775(nly Selected Sur)-4.275 F -.1(ve)-.1 G(y).1 E F0(,)A F1
-(Sho)4.275 E 4.275(wO)-.1 G(nly)-4.275 E .412(Selected File)144 144 R F0
-2.912(,a)C(nd)-2.912 E F1(Sho)2.912 E 2.912(wO)-.1 G .412
+(djust\(1\)).25 E("Na)144 84 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)
+-.25 G/F1 10/Times-Bold at 0 SF -.37(Vi)108 100.8 S(ew->Sho).37 E 2.5(wT)
+-.1 G(ies)-2.68 E F0 .643(This menu item causes the)144 112.8 R F1 .643
+(Data T)3.143 F(able)-.92 E F0 .642
+(list widget to display a list of the tie points in the current)3.143 F
+F1(mbna)144 124.8 Q -.1(va)-.25 G(djust).1 E F0(project.)2.5 E 1.775
+(The second group includes the)144 148.8 R F1(Sho)4.275 E 4.275(wA)-.1 G
+1.775(ll Sur)-4.275 F -.1(ve)-.1 G(ys).1 E F0(,)A F1(Sho)4.275 E 4.276
+(wO)-.1 G 1.776(nly Selected Sur)-4.276 F -.1(ve)-.1 G(y).1 E F0(,)A F1
+(Sho)4.276 E 4.276(wO)-.1 G(nly)-4.276 E .412(Selected File)144 160.8 R
+F0 2.912(,a)C(nd)-2.912 E F1(Sho)2.912 E 2.912(wO)-.1 G .412
 (nly Selected Section)-2.912 F F0 .412
 (items. One of these options is al)2.912 F -.1(wa)-.1 G .412(ys acti).1
 F -.15(ve)-.25 G 2.912(,a).15 G(nd)-2.912 E
-(modi\214es what is displayed in the)144 156 Q F1(Data T)2.5 E(able)-.92
-E F0(list.)2.5 E F1 -.37(Vi)108 172.8 S(ew->Sho).37 E 2.5(wA)-.1 G
-(ll Sur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 .86(This menu item allo)144 184.8
+(modi\214es what is displayed in the)144 172.8 Q F1(Data T)2.5 E(able)
+-.92 E F0(list.)2.5 E F1 -.37(Vi)108 189.6 S(ew->Sho).37 E 2.5(wA)-.1 G
+(ll Sur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 .86(This menu item allo)144 201.6
 R .86(ws all of the possible items \(\214le, sections, crossings, ties\
-\) to be displayed in)-.25 F(the)144 196.8 Q F1(Data T)2.5 E(able)-.92 E
-F0(list.)2.5 E F1 -.37(Vi)108 213.6 S(ew->Sho).37 E 2.5(wO)-.1 G
+\) to be displayed in)-.25 F(the)144 213.6 Q F1(Data T)2.5 E(able)-.92 E
+F0(list.)2.5 E F1 -.37(Vi)108 230.4 S(ew->Sho).37 E 2.5(wO)-.1 G
 (nly Selected Sur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 .553(This menu item li\
 mits the items \(\214le, sections, crossings, ties\) displayed in the)
-144 225.6 R F1 .553(Data T)3.053 F(able)-.92 E F0 .554(list to)3.054 F
-.871(those associated with the most recently selected surv)144 237.6 R
-1.171 -.15(ey \()-.15 H .871(e.g. a surv).15 F 1.17 -.15(ey s)-.15 H .87
-(elected by clicking in the).15 F F1(Data T)144 249.6 Q(able)-.92 E F0
-(list while the <V)2.5 E(ie)-.6 E(w->Sho)-.25 E 2.5(wS)-.25 G(urv)-2.5 E
--.15(ey)-.15 G(s> option is acti).15 E -.15(ve)-.25 G(\).).15 E F1 -.37
-(Vi)108 266.4 S(ew->Sho).37 E 2.5(wO)-.1 G(nly Selected File)-2.5 E F0
-.553(This menu item limits the items \(\214le, sections, crossings, tie\
-s\) displayed in the)144 278.4 R F1 .553(Data T)3.053 F(able)-.92 E F0
-.554(list to)3.054 F .035(those associated with the most recently selec\
-ted \214le \(e.g. a \214le selected by clicking in the)144 290.4 R F1
-.034(Data T)2.534 F(a-)-.92 E(ble)144 302.4 Q F0(list while the <V)2.5 E
+144 242.4 R F1 .553(Data T)3.053 F(able)-.92 E F0 .553(list to)3.053 F
+.87(those associated with the most recently selected surv)144 254.4 R
+1.171 -.15(ey \()-.15 H .871(e.g. a surv).15 F 1.171 -.15(ey s)-.15 H
+.871(elected by clicking in the).15 F F1(Data T)144 266.4 Q(able)-.92 E
+F0(list while the <V)2.5 E(ie)-.6 E(w->Sho)-.25 E 2.5(wS)-.25 G(urv)-2.5
+E -.15(ey)-.15 G(s> option is acti).15 E -.15(ve)-.25 G(\).).15 E F1
+-.37(Vi)108 283.2 S(ew->Sho).37 E 2.5(wO)-.1 G(nly Selected File)-2.5 E
+F0 .553(This menu item limits the items \(\214le, sections, crossings, \
+ties\) displayed in the)144 295.2 R F1 .553(Data T)3.053 F(able)-.92 E
+F0 .553(list to)3.053 F .035(those associated with the most recently se\
+lected \214le \(e.g. a \214le selected by clicking in the)144 307.2 R F1
+.035(Data T)2.535 F(a-)-.92 E(ble)144 319.2 Q F0(list while the <V)2.5 E
 (ie)-.6 E(w->Sho)-.25 E 2.5(wF)-.25 G(iles> option is acti)-2.5 E -.15
-(ve)-.25 G(\).).15 E F1 -.37(Vi)108 319.2 S(ew->Sho).37 E 2.5(wO)-.1 G
+(ve)-.25 G(\).).15 E F1 -.37(Vi)108 336 S(ew->Sho).37 E 2.5(wO)-.1 G
 (nly Selected Section)-2.5 E F0 .553(This menu item limits the items \(\
-\214le, sections, crossings, ties\) displayed in the)144 331.2 R F1 .553
-(Data T)3.053 F(able)-.92 E F0 .554(list to)3.054 F .608(those associat\
+\214le, sections, crossings, ties\) displayed in the)144 348 R F1 .553
+(Data T)3.053 F(able)-.92 E F0 .553(list to)3.053 F .608(those associat\
 ed with the most recently selected section \(e.g. a section selected by\
- clicking in the)144 343.2 R F1(Data T)144 355.2 Q(able)-.92 E F0
+ clicking in the)144 360 R F1(Data T)144 372 Q(able)-.92 E F0
 (list while the <V)2.5 E(ie)-.6 E(w->Sho)-.25 E 2.5(wS)-.25 G
 (ections> option is acti)-2.5 E -.15(ve)-.25 G(\).).15 E
-(The third group includes tw)144 379.2 Q 2.5(oo)-.1 G(ptions:)-2.5 E F1
--.37(Vi)108 396 S(ew->V).37 E(isualize Sur)-.37 E -.1(ve)-.1 G(y).1 E F0
-(This option is not acti)144 408 Q -.15(ve)-.25 G 2.5(,a).15 G
-(nd is for future use.)-2.5 E F1 -.37(Vi)108 424.8 S(ew->Sho).37 E 2.5
-(wM)-.1 G(odelplot)-2.5 E F0 1.566
-(This option causes an addition "Model Plot" windo)144 436.8 R 4.066(wt)
--.25 G 4.067(ob)-4.066 G 4.067(es)-4.067 G(ho)-4.067 E 1.567
+(The third group includes tw)144 396 Q 2.5(oo)-.1 G(ptions:)-2.5 E F1
+-.37(Vi)108 412.8 S(ew->V).37 E(isualize Sur)-.37 E -.1(ve)-.1 G(y).1 E
+F0(This option is not acti)144 424.8 Q -.15(ve)-.25 G 2.5(,a).15 G
+(nd is for future use.)-2.5 E F1 -.37(Vi)108 441.6 S(ew->Sho).37 E 2.5
+(wM)-.1 G(odelplot)-2.5 E F0 1.567
+(This option causes an addition "Model Plot" windo)144 453.6 R 4.066(wt)
+-.25 G 4.066(ob)-4.066 G 4.066(es)-4.066 G(ho)-4.066 E 1.566
 (wn that displays the na)-.25 F(vig)-.2 E(ation)-.05 E .351(adjustment \
 model as three time series: longitude on top, latitude in the middle, a\
-nd v)144 448.8 R .351(ertical on the)-.15 F(bottom.)144 460.8 Q F1
-(Action)108 477.6 Q F0 .17(This b)7.67 F .17(utton brings up a pulldo)
--.2 F .171(wn menu with nine items:)-.25 F F1 .171(Set File P)2.671 F
-.171(oor Na)-.2 F(vigation)-.25 E F0(,)A F1 .171(Set File Good)2.671 F
-(Na)144 489.6 Q(vigation)-.25 E F0(,)A F1 .451(Set File Fixed Na)2.951 F
+nd v)144 465.6 R .352(ertical on the)-.15 F(bottom.)144 477.6 Q F1
+(Action)108 494.4 Q F0 .171(This b)7.67 F .171(utton brings up a pulldo)
+-.2 F .171(wn menu with nine items:)-.25 F F1 .17(Set File P)2.671 F .17
+(oor Na)-.2 F(vigation)-.25 E F0(,)A F1 .17(Set File Good)2.67 F(Na)144
+506.4 Q(vigation)-.25 E F0(,)A F1 .451(Set File Fixed Na)2.95 F
 (vigation)-.25 E F0(,)A F1 -.5(Au)2.951 G .451(to-Pick Offsets).5 F F0
 (,)A F1 .451(Check f)2.951 F .451(or New Cr)-.25 F(ossings)-.18 E F0(,)A
-F1(Analyze)2.95 E(Cr)144 501.6 Q(ossings)-.18 E F0(,)A F1(Zer)2.5 E 2.5
+F1(Analyze)2.951 E(Cr)144 518.4 Q(ossings)-.18 E F0(,)A F1(Zer)2.5 E 2.5
 (oA)-.18 G(ll Z Offsets)-2.5 E F0(,)A F1(In)2.5 E -.1(ve)-.4 G(rt Na).1
 E(vigation)-.25 E F0 2.5(,a)C(nd)-2.5 E F1 -.25(Ap)2.5 G
 (ply Adjusted Na).25 E(vigation)-.25 E F0(.)A F1(Action->Set File P)108
-518.4 Q(oor Na)-.2 E(vigation)-.25 E F0 .646(This menu item causes)144
-530.4 R F1(mbna)3.147 E -.1(va)-.25 G(djust).1 E F0 .647
+535.2 Q(oor Na)-.2 E(vigation)-.25 E F0 .647(This menu item causes)144
+547.2 R F1(mbna)3.147 E -.1(va)-.25 G(djust).1 E F0 .647
 (to treat the na)3.147 F(vig)-.2 E .647(ation of a selected sw)-.05 F
 .647(ath data \214le as poor)-.1 F(.)-.55 E .67
-(This option is only acti)144 542.4 R -.25(va)-.25 G .67(ted when the)
+(This option is only acti)144 559.2 R -.25(va)-.25 G .67(ted when the)
 .25 F F1 .67(Data T)3.17 F(able)-.92 E F0 .67(list widget sho)3.17 F .67
 (ws a list of the imported sw)-.25 F(ath)-.1 E .269
 (\214les and one \214le has been selected by clicking in that list.)144
-554.4 R .269(In the case where no \214les are \214x)5.269 F .269
-(ed, the)-.15 F 1.428(\214nal adjusted na)144 566.4 R(vig)-.2 E 1.428
+571.2 R .269(In the case where no \214les are \214x)5.269 F .269
+(ed, the)-.15 F 1.427(\214nal adjusted na)144 583.2 R(vig)-.2 E 1.428
 (ation model is centered on the a)-.05 F -.15(ve)-.2 G 1.428(rage na).15
-F(vig)-.2 E 1.427(ation of)-.05 F 1.427(fsets required for good)-.25 F
-2.5(\214les. The)144 578.4 R(of)2.5 E
+F(vig)-.2 E 1.428(ation of)-.05 F 1.428(fsets required for good)-.25 F
+2.5(\214les. The)144 595.2 R(of)2.5 E
 (fsets tieing to \214les with poor na)-.25 E(vig)-.2 E
 (ation are ignored in calculating the a)-.05 E -.15(ve)-.2 G(rages.).15
-E F1(Action->Set File Good Na)108 595.2 Q(vigation)-.25 E F0 .508
-(This menu item causes)144 607.2 R F1(mbna)3.008 E -.1(va)-.25 G(djust)
-.1 E F0 .508(to treat the na)3.008 F(vig)-.2 E .508
-(ation of a selected sw)-.05 F .508(ath data \214le as good,)-.1 F .2
-(which is in f)144 619.2 R .2(act the def)-.1 F .2(ault state for sw)-.1
-F .199(ath \214les. This option is only acti)-.1 F -.25(va)-.25 G .199
-(ted when the).25 F F1 .199(Data T)2.699 F(able)-.92 E F0 .971
-(list widget sho)144 631.2 R .971(ws a list of the imported sw)-.25 F
-.972(ath \214les and one \214le has been selected by clicking in)-.1 F
-.128(that list.)144 643.2 R .127(In the case where no \214les are \214x)
-5.128 F .127(ed, the \214nal adjusted na)-.15 F(vig)-.2 E .127
-(ation model is centered on the)-.05 F -2.25 -.2(av e)144 655.2 T .449
-(rage na).2 F(vig)-.2 E .449(ation of)-.05 F .449
-(fsets required for good \214les.)-.25 F .449(The of)5.449 F .45
+E F1(Action->Set File Good Na)108 612 Q(vigation)-.25 E F0 .509
+(This menu item causes)144 624 R F1(mbna)3.008 E -.1(va)-.25 G(djust).1
+E F0 .508(to treat the na)3.008 F(vig)-.2 E .508(ation of a selected sw)
+-.05 F .508(ath data \214le as good,)-.1 F .199(which is in f)144 636 R
+.199(act the def)-.1 F .199(ault state for sw)-.1 F .2
+(ath \214les. This option is only acti)-.1 F -.25(va)-.25 G .2
+(ted when the).25 F F1 .2(Data T)2.7 F(able)-.92 E F0 .972
+(list widget sho)144 648 R .972(ws a list of the imported sw)-.25 F .971
+(ath \214les and one \214le has been selected by clicking in)-.1 F .127
+(that list.)144 660 R .127(In the case where no \214les are \214x)5.127
+F .127(ed, the \214nal adjusted na)-.15 F(vig)-.2 E .128
+(ation model is centered on the)-.05 F -2.25 -.2(av e)144 672 T .45
+(rage na).2 F(vig)-.2 E .45(ation of)-.05 F .45
+(fsets required for good \214les.)-.25 F .449(The of)5.449 F .449
 (fsets tieing to \214les with good na)-.25 F(vig)-.2 E(ation)-.05 E
-(are used in calculating the a)144 667.2 Q -.15(ve)-.2 G(rages.).15 E F1
-(Action->Set File Fixed Na)108 684 Q(vigation)-.25 E F0 .518
-(This menu item causes)144 696 R F1(mbna)3.018 E -.1(va)-.25 G(djust).1
-E F0 .518(to treat the na)3.018 F(vig)-.2 E .517(ation of a selected sw)
--.05 F .517(ath data \214le as \214x)-.1 F(ed,)-.15 E .237
-(which means that all na)144 708 R(vig)-.2 E .237
-(ation points for this \214le will ha)-.05 F .537 -.15(ve z)-.2 H .237
-(ero of).15 F .237(fsets in the \214nal adjusted na)-.25 F(vi-)-.2 E
--.05(ga)144 720 S 5.704(tion. Ef).05 F(fecti)-.25 E -.15(ve)-.25 G(ly)
-.15 E 5.704(,a)-.65 G 3.204(ll of the of)-5.704 F 3.204
-(fsets between \214x)-.25 F 3.204(ed and un\214x)-.15 F 3.204
-(ed \214les are tak)-.15 F 3.204(en up in the)-.1 F(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
+(are used in calculating the a)144 684 Q -.15(ve)-.2 G(rages.).15 E F1
+(Action->Set File Fixed Na)108 700.8 Q(vigation)-.25 E F0 .517
+(This menu item causes)144 712.8 R F1(mbna)3.017 E -.1(va)-.25 G(djust)
+.1 E F0 .517(to treat the na)3.017 F(vig)-.2 E .518
+(ation of a selected sw)-.05 F .518(ath data \214le as \214x)-.1 F(ed,)
+-.15 E 1.68(which means that all na)144 724.8 R(vig)-.2 E 1.68
+(ation points for this \214le will ha)-.05 F 1.98 -.15(ve z)-.2 H 1.68
+(ero of).15 F 1.68(fsets in the \214nal adjusted)-.25 F(MB-System 5.0)72
+768 Q(22 April 2015)142.605 E(4)200.945 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E 1.19(adjustments of the un\214x)144 84 R 1.19
-(ed \214les.)-.15 F 1.19(This option is only acti)6.19 F -.25(va)-.25 G
-1.19(ted when the).25 F/F1 10/Times-Bold at 0 SF 1.19(Data T)3.69 F(able)
--.92 E F0 1.19(list widget)3.69 F(sho)144 96 Q
-(ws a list of the imported sw)-.25 E
+(djust\(1\)).25 E(na)144 84 Q(vig)-.2 E 2.582(ation. Ef)-.05 F(fecti)
+-.25 E -.15(ve)-.25 G(ly).15 E 2.582(,a)-.65 G .082(ll of the of)-2.582
+F .082(fsets between \214x)-.25 F .082(ed and un\214x)-.15 F .083
+(ed \214les are tak)-.15 F .083(en up in the adjust-)-.1 F .445
+(ments of the un\214x)144 96 R .444(ed \214les.)-.15 F .444
+(This option is only acti)5.444 F -.25(va)-.25 G .444(ted when the).25 F
+/F1 10/Times-Bold at 0 SF .444(Data T)2.944 F(able)-.92 E F0 .444
+(list widget sho)2.944 F .444(ws a)-.25 F(list of the imported sw)144
+108 Q
 (ath \214les and one \214le has been selected by clicking in that list.)
--.1 E F1(Action->A)108 112.8 Q(uto-Pick Offsets)-.5 E F0 .03
-(This menu item causes)144 124.8 R F1(mbna)2.53 E -.1(va)-.25 G(djust).1
-E F0 .029(to automatically pick of)2.53 F .029
-(fsets in all of the unset crossings cur)-.25 F(-)-.2 E .404
-(rently displayed in the)144 136.8 R F1 .404(Data T)2.904 F(able)-.92 E
+-.1 E F1(Action->A)108 124.8 Q(uto-Pick Offsets)-.5 E F0 .029
+(This menu item causes)144 136.8 R F1(mbna)2.529 E -.1(va)-.25 G(djust)
+.1 E F0 .029(to automatically pick of)2.529 F .03
+(fsets in all of the unset crossings cur)-.25 F(-)-.2 E .405
+(rently displayed in the)144 148.8 R F1 .404(Data T)2.905 F(able)-.92 E
 F0 2.904(list. If)2.904 F(<V)2.904 E(ie)-.6 E(w->Sho)-.25 E 2.904(wT)
--.25 G .405(rue Crossings> has been selected, then)-3.254 F .935(only t\
+-.25 G .404(rue Crossings> has been selected, then)-3.254 F .935(only t\
 rue crossings are displayed and only the unset true crossings will be a\
-utomatically pick)144 148.8 R(ed.)-.1 E .263
-(In general, unsupervised of)144 160.8 R .264
-(fset picks are frequently erroneous, and use of this e)-.25 F .264
-(xperimental option)-.15 F(is not encouraged.)144 172.8 Q F1
-(Action->Check F)108 189.6 Q(or New Cr)-.25 E(ossings)-.18 E F0 1.235
-(This menu item causes)144 201.6 R F1(mbna)3.735 E -.1(va)-.25 G(djust)
-.1 E F0 1.235(to search for ne)3.735 F 3.734(wc)-.25 G 1.234
-(rossings using the adjusted na)-3.734 F(vig)-.2 E(ation)-.05 E .42
-(from the current in)144 213.6 R -.15(ve)-.4 G .42(rsion. Often, ne).15
+utomatically pick)144 160.8 R(ed.)-.1 E .264
+(In general, unsupervised of)144 172.8 R .264
+(fset picks are frequently erroneous, and use of this e)-.25 F .263
+(xperimental option)-.15 F(is not encouraged.)144 184.8 Q F1
+(Action->Check F)108 201.6 Q(or New Cr)-.25 E(ossings)-.18 E F0 1.234
+(This menu item causes)144 213.6 R F1(mbna)3.734 E -.1(va)-.25 G(djust)
+.1 E F0 1.235(to search for ne)3.734 F 3.735(wc)-.25 G 1.235
+(rossings using the adjusted na)-3.735 F(vig)-.2 E(ation)-.05 E .42
+(from the current in)144 225.6 R -.15(ve)-.4 G .42(rsion. Often, ne).15
 F 2.92(wp)-.25 G .42(laces where sw)-2.92 F .42(aths o)-.1 F -.15(ve)
 -.15 G .42(rlap and cross emer).15 F .42(ge as the na)-.18 F(vi-)-.2 E
--.05(ga)144 225.6 S .03(tion is adjusted. The percentage of o).05 F -.15
-(ve)-.15 G .029(rlap is also recalculated for all of the e).15 F .029
-(xisting crossings. If)-.15 F(ne)144 237.6 Q 3.435(wt)-.25 G .935
-(rue crossings are found, the user will be unable to perform a ne)-3.435
-F 3.436(wi)-.25 G -1.85 -.4(nv e)-3.436 H .936(rsion until all of the).4
-F(true crossings ha)144 249.6 Q .3 -.15(ve b)-.2 H(een analyzed.).15 E
-F1(Action->Analyze Cr)108 266.4 Q(ossings)-.18 E F0 .7
-(This menu item causes)144 278.4 R F1(mbna)3.2 E -.1(va)-.25 G(djust).1
-E F0 .699(to load and display the \214rst crossing in the "Na)3.2 F
-3.199(vE)-.2 G .699(rr" win-)-3.199 F(do)144 290.4 Q -.65(w.)-.25 G F1
-(Action->Zer)108 307.2 Q 2.5(oA)-.18 G(ll Z Offsets)-2.5 E F0 .699
-(This menu item causes)144 319.2 R F1(mbna)3.199 E -.1(va)-.25 G(djust)
+-.05(ga)144 237.6 S .029(tion is adjusted. The percentage of o).05 F
+-.15(ve)-.15 G .029(rlap is also recalculated for all of the e).15 F .03
+(xisting crossings. If)-.15 F(ne)144 249.6 Q 3.436(wt)-.25 G .936
+(rue crossings are found, the user will be unable to perform a ne)-3.436
+F 3.435(wi)-.25 G -1.85 -.4(nv e)-3.435 H .935(rsion until all of the).4
+F(true crossings ha)144 261.6 Q .3 -.15(ve b)-.2 H(een analyzed.).15 E
+F1(Action->Analyze Cr)108 278.4 Q(ossings)-.18 E F0 .699
+(This menu item causes)144 290.4 R F1(mbna)3.199 E -.1(va)-.25 G(djust)
 .1 E F0 .699(to load and display the \214rst crossing in the "Na)3.199 F
-3.2(vE)-.2 G .7(rr" win-)-3.2 F(do)144 331.2 Q -.65(w.)-.25 G F1
-(Action->In)108 348 Q -.1(ve)-.4 G(rt Na).1 E(vigation)-.25 E F0 .55
-(This menu item causes)144 360 R F1(mbna)3.05 E -.1(va)-.25 G(djust).1 E
-F0 .549(to in)3.05 F -.15(ve)-.4 G .549(rt for an optimal na).15 F(vig)
--.2 E .549(ation solution that \214ts the of)-.05 F(f-)-.25 E 1.023
-(sets de\214ned at the na)144 372 R(vig)-.2 E 1.024(ation tie points wh\
-ile minimizing speed and acceleration. This option is)-.05 F .911
-(only acti)144 384 R -.25(va)-.25 G .911
-(ted when all of the true crossings in the current).25 F F1(mbna)3.41 E
--.1(va)-.25 G(djust).1 E F0 .91(project ha)3.41 F 1.21 -.15(ve b)-.2 H
-.91(een ana-).15 F(lyzed interacti)144 396 Q -.15(ve)-.25 G(ly).15 E(.)
--.65 E F1(Action->A)108 412.8 Q(pply Adjusted Na)-.25 E(vigation)-.25 E
-F0 1.397(This menu item causes)144 424.8 R F1(mbna)3.897 E -.1(va)-.25 G
-(djust).1 E F0 1.398(to e)3.898 F 1.398(xport the adjusted na)-.15 F
-(vig)-.2 E 1.398(ation model from the current)-.05 F(in)144 436.8 Q -.15
-(ve)-.4 G .791(rsion to the sw).15 F .791
+3.2(vE)-.2 G .7(rr" win-)-3.2 F(do)144 302.4 Q -.65(w.)-.25 G F1
+(Action->Zer)108 319.2 Q 2.5(oA)-.18 G(ll Z Offsets)-2.5 E F0 .7
+(This menu item causes)144 331.2 R F1(mbna)3.2 E -.1(va)-.25 G(djust).1
+E F0 .699(to load and display the \214rst crossing in the "Na)3.2 F
+3.199(vE)-.2 G .699(rr" win-)-3.199 F(do)144 343.2 Q -.65(w.)-.25 G F1
+(Action->In)108 360 Q -.1(ve)-.4 G(rt Na).1 E(vigation)-.25 E F0 .549
+(This menu item causes)144 372 R F1(mbna)3.049 E -.1(va)-.25 G(djust).1
+E F0 .549(to in)3.049 F -.15(ve)-.4 G .549(rt for an optimal na).15 F
+(vig)-.2 E .55(ation solution that \214ts the of)-.05 F(f-)-.25 E 1.024
+(sets de\214ned at the na)144 384 R(vig)-.2 E 1.023(ation tie points wh\
+ile minimizing speed and acceleration. This option is)-.05 F .91
+(only acti)144 396 R -.25(va)-.25 G .911
+(ted when all of the true crossings in the current).25 F F1(mbna)3.411 E
+-.1(va)-.25 G(djust).1 E F0 .911(project ha)3.411 F 1.211 -.15(ve b)-.2
+H .911(een ana-).15 F(lyzed interacti)144 408 Q -.15(ve)-.25 G(ly).15 E
+(.)-.65 E F1(Action->A)108 424.8 Q(pply Adjusted Na)-.25 E(vigation)-.25
+E F0 1.398(This menu item causes)144 436.8 R F1(mbna)3.898 E -.1(va)-.25
+G(djust).1 E F0 1.398(to e)3.898 F 1.398(xport the adjusted na)-.15 F
+(vig)-.2 E 1.397(ation model from the current)-.05 F(in)144 448.8 Q -.15
+(ve)-.4 G .79(rsion to the sw).15 F .791
 (ath \214les in the project.This option is only acti)-.1 F -.25(va)-.25
-G .79(ted when the in).25 F -.15(ve)-.4 G .79(rsion is cur).15 F(-)-.2 E
-.134(rent, meaning that no ne)144 448.8 R 2.634(wd)-.25 G .135(ata ha)
--2.634 F .435 -.15(ve b)-.2 H .135(een imported and no changes to of).15
-F .135(fset picks ha)-.25 F .435 -.15(ve b)-.2 H .135(een made).15 F
-(since the last in)144 460.8 Q -.15(ve)-.4 G(rsion.).15 E F1(About)108
-477.6 Q F0(This b)9.33 E(utton brings up a pulldo)-.2 E
+G .791(ted when the in).25 F -.15(ve)-.4 G .791(rsion is cur).15 F(-)-.2
+E .135(rent, meaning that no ne)144 460.8 R 2.635(wd)-.25 G .135(ata ha)
+-2.635 F .435 -.15(ve b)-.2 H .135(een imported and no changes to of).15
+F .134(fset picks ha)-.25 F .434 -.15(ve b)-.2 H .134(een made).15 F
+(since the last in)144 472.8 Q -.15(ve)-.4 G(rsion.).15 E F1(About)108
+489.6 Q F0(This b)9.33 E(utton brings up a pulldo)-.2 E
 (wn menu with one item:)-.25 E F1(About)2.5 E F0(.)A F1(About->About)108
-494.4 Q F0 .096(This menu item brings up a popup windo)144 506.4 R 2.595
-(wt)-.25 G .095(hat displays the program')-2.595 F 2.595(sn)-.55 G .095
-(ame, authors, and v)-2.595 F(ersion.)-.15 E(Clicking the)144 518.4 Q F1
+506.4 Q F0 .095(This menu item brings up a popup windo)144 518.4 R 2.595
+(wt)-.25 G .095(hat displays the program')-2.595 F 2.596(sn)-.55 G .096
+(ame, authors, and v)-2.596 F(ersion.)-.15 E(Clicking the)144 530.4 Q F1
 (Dismiss)2.5 E F0 -.2(bu)2.5 G(tton will close the windo).2 E -.65(w.)
--.25 G F1(Data T)108 535.2 Q(able)-.92 E F0 1.735
-(This list widget displays one of \214v)144 547.2 R 4.235(et)-.15 G
-1.736(ables of information re)-4.235 F -.05(ga)-.15 G 1.736
-(rding the current).05 F F1(mbna)4.236 E -.1(va)-.25 G(djust).1 E F0
-.806(project. These tables are a list of the imported sw)144 559.2 R
+-.25 G F1(Data T)108 547.2 Q(able)-.92 E F0 1.736
+(This list widget displays one of \214v)144 559.2 R 4.235(et)-.15 G
+1.735(ables of information re)-4.235 F -.05(ga)-.15 G 1.735
+(rding the current).05 F F1(mbna)4.235 E -.1(va)-.25 G(djust).1 E F0
+.806(project. These tables are a list of the imported sw)144 571.2 R
 .806(ath surv)-.1 F -.15(ey)-.15 G .806
 (s, the data \214les, the shorter data sec-).15 F .424(tions comprising\
- each data \214le, a list of the identi\214ed crossing sw)144 571.2 R
-.424(aths, and a list of the na)-.1 F(vig)-.2 E(ation)-.05 E .284
-(tie points de\214ned interacti)144 583.2 R -.15(ve)-.25 G .283
+ each data \214le, a list of the identi\214ed crossing sw)144 583.2 R
+.424(aths, and a list of the na)-.1 F(vig)-.2 E(ation)-.05 E .283
+(tie points de\214ned interacti)144 595.2 R -.15(ve)-.25 G .283
 (ly by the user).15 F 5.283(.T)-.55 G(he)-5.283 E F1 -.37(Vi)2.783 G(ew)
 .37 E F0(pulldo)2.783 E .283(wn menu allo)-.25 F .283
-(ws the user to set which)-.25 F(table is displayed.)144 595.2 Q
-(The surv)144 619.2 Q .3 -.15(ey l)-.15 H(ist will look something lik)
+(ws the user to set which)-.25 F(table is displayed.)144 607.2 Q
+(The surv)144 631.2 Q .3 -.15(ey l)-.15 H(ist will look something lik)
 .15 E(e:)-.1 E
-(00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000)180 631.2 Q
-(01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999)180 643.2 Q
-(02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999)180 655.2 Q
-1.121(Here the \214rst column is the surv)144 667.2 R 1.422 -.15(ey c)
--.15 H(ounter).15 E 3.622(,t)-.4 G 1.122(he second is the number of sw)
--3.622 F 1.122(ath \214les included in)-.1 F .656(each surv)144 679.2 R
--.15(ey)-.15 G 3.156(,a)-.5 G .656(nd the follo)-3.156 F .656(wing info\
-rmation consists of the start and end times of the data in each)-.25 F
-(surv)144 691.2 Q .3 -.15(ey s)-.15 H(ho).15 E
-(wn in YYYY/MM/DD HH:MM:SS.SSSSSS format.)-.25 E
-(The \214le list will look something lik)144 715.2 Q(e:)-.1 E
-(0000:00 gd)180 727.2 Q 2.5(11 0.0 0.0)7.5 F
-(../../20090803/20090803_081706.mb88)2.5 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0 Cg EP
+(00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000 good)180
+643.2 Q
+(01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999 good)180
+655.2 Q
+(02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999 good)180
+667.2 Q 1.122(Here the \214rst column is the surv)144 679.2 R 1.422 -.15
+(ey c)-.15 H(ounter).15 E 3.622(,t)-.4 G 1.122
+(he second is the number of sw)-3.622 F 1.121(ath \214les included in)
+-.1 F .655(each surv)144 691.2 R -.15(ey)-.15 G 3.155(,a)-.5 G .656
+(nd the follo)-3.155 F .656(wing information consists of the start and \
+end times of the data in each)-.25 F(surv)144 703.2 Q 2.676 -.15(ey s)
+-.15 H(ho).15 E 2.376(wn in YYYY/MM/DD HH:MM:SS.SSSSSS format, follo)
+-.25 F 2.376(wed by the surv)-.25 F 2.676 -.15(ey s)-.15 H(tatus).15 E
+(\(poor)144 715.2 Q 2.5(,g)-.4 G(ood, \214x)-2.5 E(ed, \214x)-.15 E
+(edxy)-.15 E 2.5<2c8c>-.65 G -.15(xe)-2.5 G(dz\).).15 E(MB-System 5.0)72
+768 Q(22 April 2015)142.605 E(5)200.945 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E(0001:00 gd)180 84 Q 2.5(11 0.0 0.0)7.5 F
-(../../20090803/20090803_083332.mb88)2.5 E(0002:00 gd)180 96 Q 2.5
-(11 0.0 0.0)7.5 F(../../20090803/20090803_085004.mb88)2.5 E(0003:00 gd)
-180 108 Q 2.5(11 0.0 0.0)7.5 F(../../20090803/20090803_090636.mb88)2.5 E
-(0004:00 gd)180 120 Q 2.5(10 0.0 0.0)7.5 F
+(djust\(1\)).25 E(The \214le list will look something lik)144 84 Q(e:)
+-.1 E 2.5(0000:00 good)180 96 R 2.5(11 0.0 0.0)7.5 F
+(../../20090803/20090803_081706.mb88)2.5 E 2.5(0001:00 good)180 108 R
+2.5(11 0.0 0.0)7.5 F(../../20090803/20090803_083332.mb88)2.5 E 2.5
+(0002:00 good)180 120 R 2.5(11 0.0 0.0)7.5 F
+(../../20090803/20090803_085004.mb88)2.5 E 2.5(0003:00 good)180 132 R
+2.5(11 0.0 0.0)7.5 F(../../20090803/20090803_090636.mb88)2.5 E 2.5
+(0004:00 good)180 144 R 2.5(10 0.0 0.0)7.5 F
 (../../20090803/20090803_092307.mb88)2.5 E
-(..........................................)216 132 Q(0053:01 gd)180 144
-Q 2.5(12 0.0 0.0)7.5 F(../../20090804/20090804_090127.mb88)2.5 E
-(0054:01 gd)180 156 Q 2.5(10 0.0 0.0)7.5 F
-(../../20090804/20090804_092036.mb88)2.5 E(0055:01 gd)180 168 Q 2.5
-(11 0.0 0.0)7.5 F(../../20090804/20090804_093707.mb88)2.5 E(0056:01 gd)
-180 180 Q 2.5(10 0.0 0.0)7.5 F(../../20090804/20090804_095339.mb88)2.5 E
-(0057:01 gd)180 192 Q 2.5(11 0.0 0.0)7.5 F
-(../../20090804/20090804_101010.mb88)2.5 E
-(..........................................)216 204 Q(0104:02 fx)180 216
-Q 5(80)10 G 2.5(.0 0.0)-5 F(../../MB)2.5 E
+(..........................................)216 156 Q 2.5(0053:01 good)
+180 168 R 2.5(12 0.0 0.0)7.5 F(../../20090804/20090804_090127.mb88)2.5 E
+2.5(0054:01 good)180 180 R 2.5(10 0.0 0.0)7.5 F
+(../../20090804/20090804_092036.mb88)2.5 E 2.5(0055:01 good)180 192 R
+2.5(11 0.0 0.0)7.5 F(../../20090804/20090804_093707.mb88)2.5 E 2.5
+(0056:01 good)180 204 R 2.5(10 0.0 0.0)7.5 F
+(../../20090804/20090804_095339.mb88)2.5 E 2.5(0057:01 good)180 216 R
+2.5(11 0.0 0.0)7.5 F(../../20090804/20090804_101010.mb88)2.5 E
+(..........................................)216 228 Q 2.5(0104:02 \214x)
+180 240 R 5(ed 8)-.15 F 2.5(0.0 0.0)5 F(../../MB)2.5 E
 (ARI/1998em300/mbari_1998_630_msn.mb57)-.35 E .326
-(Here the \214rst column is the \214le counter and surv)144 228 R .627
+(Here the \214rst column is the \214le counter and surv)144 252 R .627
 -.15(ey c)-.15 H .327(ounter separated by a colon.).15 F .327
-(The second col-)5.327 F .716(umn indicates the \214le na)144 240 R(vig)
+(The second col-)5.327 F .716(umn indicates the \214le na)144 264 R(vig)
 -.2 E .715(ations state; "gd" indicates good na)-.05 F(vig)-.2 E .715
-(ation, "pr" indicates poor na)-.05 F(vi-)-.2 E -.05(ga)144 252 S 2.518
+(ation, "pr" indicates poor na)-.05 F(vi-)-.2 E -.05(ga)144 276 S 2.518
 (tion, and "fx" indicates \214x).05 F 2.518(ed na)-.15 F(vig)-.2 E 2.518
 (ation. The third column sho)-.05 F 2.519(ws the number of sections)-.25
-F -.15(ex)144 264 S 1.47(tracted from this \214le.).15 F 1.469
+F -.15(ex)144 288 S 1.47(tracted from this \214le.).15 F 1.469
 (The fourth and \214fth columns sho)6.47 F 3.969(wa)-.25 G 1.769 -.15
 (ny h)-3.969 H 1.469(eading or roll bias of).15 F 1.469(fsets in)-.25 F
-(de)144 276 Q .378(grees applied to the sw)-.15 F .378
+(de)144 300 Q .378(grees applied to the sw)-.15 F .378
 (ath data for that \214le.)-.1 F .378(The sixth column gi)5.378 F -.15
 (ve)-.25 G 2.879(st).15 G .379(he name of the sw)-2.879 F .379(ath data)
--.1 F .007(\214le imported into)144 288 R/F1 10/Times-Bold at 0 SF(mbna)
+-.1 F .007(\214le imported into)144 312 R/F1 10/Times-Bold at 0 SF(mbna)
 2.507 E -.1(va)-.25 G(djust).1 E F0 2.507(.N)C .007
 (ote that the name sho)-2.507 F .006(wn here is that of the "ra)-.25 F
 .006(w" sw)-.15 F .006(ath \214le. The)-.1 F .888(data imported by)144
-300 R F1(mbna)3.388 E -.1(va)-.25 G(djust).1 E F0 .888
+324 R F1(mbna)3.388 E -.1(va)-.25 G(djust).1 E F0 .888
 (is, if possible, e)3.388 F .889(xtracted from a "processed" sw)-.15 F
-.889(ath \214le generated)-.1 F(by)144 312 Q F1(mbpr)2.5 E(ocess)-.18 E
+.889(ath \214le generated)-.1 F(by)144 336 Q F1(mbpr)2.5 E(ocess)-.18 E
 F0(rather than the associated "ra)2.5 E(w" \214le.)-.15 E
-(The \214le section list will look something lik)144 336 Q(e:)-.1 E
+(The \214le section list will look something lik)144 360 Q(e:)-.1 E
 (00:0000:00 2009/08/03 08:17:07.546998 2009/08/03 08:18:49.484999)180
-348 Q(00:0000:01 2009/08/03 08:18:49.984999 2009/08/03 08:20:26.952999)
-180 360 Q
-(00:0000:02 2009/08/03 08:20:27.452999 2009/08/03 08:22:05.890999)180
-372 Q(00:0000:03 2009/08/03 08:22:06.390999 2009/08/03 08:23:43.344001)
+372 Q(00:0000:01 2009/08/03 08:18:49.984999 2009/08/03 08:20:26.952999)
 180 384 Q
-(00:0000:04 2009/08/03 08:23:43.844001 2009/08/03 08:25:19.796999)180
-396 Q(00:0000:05 2009/08/03 08:25:20.296999 2009/08/03 08:26:57.265997)
+(00:0000:02 2009/08/03 08:20:27.452999 2009/08/03 08:22:05.890999)180
+396 Q(00:0000:03 2009/08/03 08:22:06.390999 2009/08/03 08:23:43.344001)
 180 408 Q
-(00:0000:06 2009/08/03 08:26:57.765997 2009/08/03 08:28:35.219001)180
-420 Q(00:0000:07 2009/08/03 08:28:35.719001 2009/08/03 08:30:16.155999)
+(00:0000:04 2009/08/03 08:23:43.844001 2009/08/03 08:25:19.796999)180
+420 Q(00:0000:05 2009/08/03 08:25:20.296999 2009/08/03 08:26:57.265997)
 180 432 Q
-(00:0000:08 2009/08/03 08:30:16.655999 2009/08/03 08:31:57.594001)180
-444 Q(00:0000:09 2009/08/03 08:31:58.094001 2009/08/03 08:33:36.546999)
+(00:0000:06 2009/08/03 08:26:57.765997 2009/08/03 08:28:35.219001)180
+444 Q(00:0000:07 2009/08/03 08:28:35.719001 2009/08/03 08:30:16.155999)
 180 456 Q
+(00:0000:08 2009/08/03 08:30:16.655999 2009/08/03 08:31:57.594001)180
+468 Q(00:0000:09 2009/08/03 08:31:58.094001 2009/08/03 08:33:36.546999)
+180 480 Q
 (00:0000:10 2009/08/03 08:33:37.046999 2009/08/03 08:33:37.546999)180
-468 Q .158(Here the \214rst column sho)144 480 R .158
+492 Q .158(Here the \214rst column sho)144 504 R .158
 (ws the section id with the surv)-.25 F .458 -.15(ey c)-.15 H(ounter).15
 E 2.657(,t)-.4 G .157(he \214le counter)-2.657 F 2.657(,a)-.4 G .157
 (nd the section)-2.657 F .272(counter separated by colons. The follo)144
-492 R .273(wing information consists of the start and end times of each)
--.25 F(section sho)144 504 Q(wn in YYYY/MM/DD HH:MM:SS.SSSSSS format.)
--.25 E(The crossing list will look something lik)144 528 Q(e:)-.1 E 7.5
-(-X 0)180 540 R(000:009 001:000)2.5 E 2.5(21 0)5 F 12.5(-1)180 552 S
-(001:009 002:000)-10 E 2.5(10 0)5 F 12.5(-2)180 564 S(002:009 003:000)
--10 E 2.5(10 0)5 F 12.5(U3)180 576 S(003:009 004:000)-10 E 5(60)7.5 G
-12.5(-4)180 588 S(005:009 006:000)-10 E 2.5(13 0)5 F 12.5(U5)180 600 S
-(007:009 008:000)-10 E 5(30)7.5 G 12.5(U6)180 612 S(009:008 009:010)-10
-E 5(20)7.5 G 12.5(*7)180 624 S(009:008 010:000)-10 E 2.5(16 1)5 F 7.5
-(*X 8)180 636 R(009:009 010:000)2.5 E 2.5(41 1)5 F 12.5(-9)180 648 S
+516 R .273(wing information consists of the start and end times of each)
+-.25 F(section sho)144 528 Q(wn in YYYY/MM/DD HH:MM:SS.SSSSSS format.)
+-.25 E(The crossing list will look something lik)144 552 Q(e:)-.1 E 7.5
+(-X 0)180 564 R(000:009 001:000)2.5 E 2.5(21 0)5 F 12.5(-1)180 576 S
+(001:009 002:000)-10 E 2.5(10 0)5 F 12.5(-2)180 588 S(002:009 003:000)
+-10 E 2.5(10 0)5 F 12.5(U3)180 600 S(003:009 004:000)-10 E 5(60)7.5 G
+12.5(-4)180 612 S(005:009 006:000)-10 E 2.5(13 0)5 F 12.5(U5)180 624 S
+(007:009 008:000)-10 E 5(30)7.5 G 12.5(U6)180 636 S(009:008 009:010)-10
+E 5(20)7.5 G 12.5(*7)180 648 S(009:008 010:000)-10 E 2.5(16 1)5 F 7.5
+(*X 8)180 660 R(009:009 010:000)2.5 E 2.5(41 1)5 F 12.5(-9)180 672 S
 (009:008 010:001)-10 E 5(10)7.5 G .293(Here the \214rst column indicate\
 s the processing status for the crossing. The \214rst character is the \
-sta-)144 660 R 1.332(tus \215ag. If the status \215ag is "U", then no d\
-ecision has been made about skipping or tieing this)144 672 R 3.758
-(crossing. Ne)144 684 R 3.757(wc)-.25 G 1.257(rossings al)-3.757 F -.1
+sta-)144 684 R 1.332(tus \215ag. If the status \215ag is "U", then no d\
+ecision has been made about skipping or tieing this)144 696 R 3.758
+(crossing. Ne)144 708 R 3.757(wc)-.25 G 1.257(rossings al)-3.757 F -.1
 (wa)-.1 G 1.257(ys sho).1 F 3.757(wa")-.25 G 1.257
 (U" \215ag prior to being inspected by a user)-3.757 F 3.757(.I)-.55 G
 3.757(ft)-3.757 G 1.257(he \214rst)-3.757 F .836(character is "-", then\
  the crossing has been skipped, and if the \214rst character is "*", th\
-en at least)144 696 R .961
-(one tie point has been set. The second column is the crossing counter)
-144 708 R 3.46(.T)-.55 G .96(he third and fourth col-)-3.46 F .315
-(umns identify the sw)144 720 R .315(ath data sections that o)-.1 F -.15
-(ve)-.15 G .316
-(rlap in this crossing. Each are identi\214ed by their \214le).15 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)204.835 E 0
-Cg EP
+en at least)144 720 R(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(6)
+200.945 E 0 Cg EP
 %%Page: 7 7
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .424(id and section id separated by ":". The \214fth \
-column indicates the percentage of o)144 84 R -.15(ve)-.15 G .423
-(rlap of the tw).15 F(o)-.1 E .1(sections in this crossing. The lar)144
-96 R .101(ger the de)-.18 F .101(gree of o)-.15 F -.15(ve)-.15 G .101
-(rlap, the more lik).15 F .101(ely that diagnostic matching)-.1 F 1.314
-(topographic features e)144 108 R 1.314
-(xist that can be used to determine the na)-.15 F(vig)-.2 E 1.313
+(djust\(1\)).25 E .961
+(one tie point has been set. The second column is the crossing counter)
+144 84 R 3.46(.T)-.55 G .96(he third and fourth col-)-3.46 F .315
+(umns identify the sw)144 96 R .315(ath data sections that o)-.1 F -.15
+(ve)-.15 G .316
+(rlap in this crossing. Each are identi\214ed by their \214le).15 F .424
+(id and section id separated by ":". The \214fth column indicates the p\
+ercentage of o)144 108 R -.15(ve)-.15 G .423(rlap of the tw).15 F(o)-.1
+E .1(sections in this crossing. The lar)144 120 R .101(ger the de)-.18 F
+.101(gree of o)-.15 F -.15(ve)-.15 G .101(rlap, the more lik).15 F .101
+(ely that diagnostic matching)-.1 F 1.314(topographic features e)144 132
+R 1.314(xist that can be used to determine the na)-.15 F(vig)-.2 E 1.313
 (ation of)-.05 F 1.313(fsets required for this)-.25 F 2.573
-(crossing. The)144 120 R .073(sixth, and last column gi)2.573 F -.15(ve)
+(crossing. The)144 144 R .073(sixth, and last column gi)2.573 F -.15(ve)
 -.25 G 2.573(st).15 G .074(he number of tie points that ha)-2.573 F .374
--.15(ve b)-.2 H .074(een de\214ned for each).15 F(crossing. Ne)144 132 Q
+-.15(ve b)-.2 H .074(een de\214ned for each).15 F(crossing. Ne)144 156 Q
 2.5(wc)-.25 G(rossings al)-2.5 E -.1(wa)-.1 G(ys be).1 E
 (gin with 0 tie points prior to being inspected by a user)-.15 E(.)-.55
-E(The tie point list will look something lik)144 156 Q(e:)-.1 E 2.592
-(700)187.592 168 S .092(09:008:07 010:000:04 00:00)-2.592 F .091
+E(The tie point list will look something lik)144 180 Q(e:)-.1 E 2.592
+(700)187.592 192 S .092(09:008:07 010:000:04 00:00)-2.592 F .091
 (1.02 \2552.87 0.00 |)5.091 F 2.591(9.61 8.49)5.091 F .091
-(1.40 | 0.041 0.107 0.027)2.591 F 2.591(800)187.591 180 S .091
+(1.40 | 0.041 0.107 0.027)2.591 F 2.591(800)187.591 204 S .091
 (09:009:02 010:000:00 00:00)-2.591 F .091(0.90 \2554.47 0.00 |)5.091 F
 2.591(7.37 6.30)5.091 F .092(2.29 | 0.040 0.184 0.033)2.591 F 1.598
-(12 0 009:008:04 010:002:04 00:00)186.598 192 R 1.597
+(12 0 009:008:04 010:002:04 00:00)186.598 216 R 1.597
 (4.11 \2558.24 0.00 |)6.597 F 4.097(9.28 5.99)6.597 F 1.597
-(1.80 | 0.037 0.021)4.097 F(0.025)144 204 Q 1.597
-(14 0 010:000:02 010:002:06 00:00)186.597 216 R 1.597
+(1.80 | 0.037 0.021)4.097 F(0.025)144 228 Q 1.597
+(14 0 010:000:02 010:002:06 00:00)186.597 240 R 1.597
 (2.12 \2554.38 0.00 |)6.597 F 4.098(7.50 6.70)6.597 F 1.598
-(1.10 | 0.007 0.065)4.098 F(0.005)144 228 Q 1.598
-(16 0 009:007:04 010:003:04 00:00)186.598 240 R 1.597
+(1.10 | 0.007 0.065)4.098 F(0.005)144 252 Q 1.598
+(16 0 009:007:04 010:003:04 00:00)186.598 264 R 1.597
 (5.90 \2555.90 0.00 |)6.597 F 4.097(8.66 6.84)6.597 F 1.597
-(1.70 | 0.019 0.085)4.097 F(0.027)144 252 Q 1.597
-(19 0 009:006:04 010:004:04 00:00)186.597 264 R 1.597
+(1.70 | 0.019 0.085)4.097 F(0.027)144 276 Q 1.597
+(19 0 009:006:04 010:004:04 00:00)186.597 288 R 1.597
 (8.32 \2556.83 0.00 |)6.597 F 4.098(8.78 8.55)6.597 F 1.598
-(6.65 | 0.026 0.066)4.098 F(0.024)144 276 Q 1.431
-(21 0 009:005:05 010:005:03 00:00)186.431 288 R 1.431
+(6.65 | 0.026 0.066)4.098 F(0.024)144 300 Q 1.431
+(21 0 009:005:05 010:005:03 00:00)186.431 312 R 1.431
 (8.96 \2558.75 0.00 | 12.38)6.431 F 1.43(8.74 5.16 | 0.008 0.045)6.43 F
-(0.008)144 300 Q 1.43
-(23 0 009:004:04 010:006:04 00:00 12.23 \2555.98 0.00 |)186.43 312 R
-3.931(7.03 4.49)6.431 F 1.431(1.40 | 0.019 0.034)3.931 F(0.010)144 324 Q
+(0.008)144 324 Q 1.43
+(23 0 009:004:04 010:006:04 00:00 12.23 \2555.98 0.00 |)186.43 336 R
+3.931(7.03 4.49)6.431 F 1.431(1.40 | 0.019 0.034)3.931 F(0.010)144 348 Q
 1.097(26 0 009:003:04 010:007:04 00:00 17.42 \2554.36 0.00 | 13.92 10.1\
-1 1.80 | 0.025 0.037)186.098 336 R(0.028)144 348 Q .847(Here the \214rs\
+1 1.80 | 0.025 0.037)186.098 360 R(0.028)144 372 Q .847(Here the \214rs\
 t column indicates the crossing which contains the tie point, and the s\
-econd column)144 360 R(sho)144 372 Q .044(ws which tie point \(of those\
+econd column)144 384 R(sho)144 396 Q .044(ws which tie point \(of those\
  de\214ned for that crossing\) is displayed in a particular line. The t\
-hird)-.25 F .763(and fourth columns identify the na)144 384 R(vig)-.2 E
+hird)-.25 F .763(and fourth columns identify the na)144 408 R(vig)-.2 E
 .764(ation control points of the tie point. The na)-.05 F(vig)-.2 E .764
 (ation control)-.05 F .192
-(points are speci\214ed by \214le, section, and na)144 396 R 2.691(vp)
+(points are speci\214ed by \214le, section, and na)144 420 R 2.691(vp)
 -.2 G .191(oint numbers separated by ":". The \214fth through se)-2.691
-F(v-)-.25 E 1.462(enth columns are the longitude, latitude and v)144 408
+F(v-)-.25 E 1.462(enth columns are the longitude, latitude and v)144 432
 R 1.462(ertical of)-.15 F 1.462(fsets \(in meters\) set interacti)-.25 F
--.15(ve)-.25 G 1.463(ly by the).15 F(user)144 420 Q 3.418(.T)-.55 G .917
+-.15(ve)-.25 G 1.463(ly by the).15 F(user)144 444 Q 3.418(.T)-.55 G .917
 (hese represent the distance the second na)-3.418 F(vig)-.2 E .917
 (ation control point must be mo)-.05 F -.15(ve)-.15 G 3.417(dr).15 G
 (elati)-3.417 E 1.217 -.15(ve t)-.25 H(o).15 E .8
-(the \214rst in order to mak)144 432 R 3.3(et)-.1 G .8(he bath)-3.3 F
+(the \214rst in order to mak)144 456 R 3.3(et)-.1 G .8(he bath)-3.3 F
 .801(ymetry in the tw)-.05 F 3.301(os)-.1 G -.1(wa)-3.301 G .801
-(ths match. The tenth through twelth col-).1 F .912(umns sho)144 444 R
+(ths match. The tenth through twelth col-).1 F .912(umns sho)144 468 R
 3.412(wt)-.25 G .912(he magnitude of the three ax)-3.412 F .912
 (es of the uncertainly ellipsoid associated with each tie.)-.15 F .114(\
 The uncertainly ellipsoid is estimated as a 3x3 tensor and used to weig\
-ht the tie of)144 456 R .114(fsets in the na)-.25 F(vi-)-.2 E -.05(ga)
-144 468 S .899(tion adjustment in).05 F -.15(ve)-.4 G .899
+ht the tie of)144 480 R .114(fsets in the na)-.25 F(vi-)-.2 E -.05(ga)
+144 492 S .899(tion adjustment in).05 F -.15(ve)-.4 G .899
 (rsion. Here the major and second ax).15 F .898(es are al)-.15 F -.1(wa)
 -.1 G .898(ys close to horizontal, and).1 F 1.407
-(the minor is axis is al)144 480 R -.1(wa)-.1 G 1.407(ys close to v).1 F
+(the minor is axis is al)144 504 R -.1(wa)-.1 G 1.407(ys close to v).1 F
 3.907(ertical. The)-.15 F 1.407
-(last three columns are nonzero only after an)3.907 F(in)144 492 Q -.15
+(last three columns are nonzero only after an)3.907 F(in)144 516 Q -.15
 (ve)-.4 G .721(rsion for an optimal na).15 F(vig)-.2 E .721
 (ation solution has been performed. These represent the residual, or)
--.05 F(dif)144 504 Q .55(ference, between the of)-.25 F .55
+-.05 F(dif)144 528 Q .55(ference, between the of)-.25 F .55
 (fset calculated for this tie point in the in)-.25 F -.15(ve)-.4 G .55
 (rsion and that set by the user).15 F
-(\(displayed in the \214fth through se)144 516 Q -.15(ve)-.25 G
+(\(displayed in the \214fth through se)144 540 Q -.15(ve)-.25 G
 (nth columns\).).15 E .869(If the \214le list is displayed and one \214\
 le is selected by clicking in the list, then the user can \214x or)144
-540 R .823(un\214x the na)144 552 R(vig)-.2 E .824(ation of that \214le\
+564 R .823(un\214x the na)144 576 R(vig)-.2 E .824(ation of that \214le\
  using the <Action->Fix File> or <Action->Un\214x File> pulldo)-.05 F
-(wn)-.25 E .552(menu items.)144 564 R .551(If either the crossing list \
+(wn)-.25 E .552(menu items.)144 588 R .551(If either the crossing list \
 or the tie point list are displayed, selecting one crossing or)5.552 F
 .674(one tie point by clicking in the list widget will cause the speci\
-\214ed crossing to be loaded and dis-)144 576 R(played in the)144 588 Q
+\214ed crossing to be loaded and dis-)144 600 R(played in the)144 612 Q
 /F1 10/Times-Bold at 0 SF(Na)2.5 E 2.5(vE)-.25 G(rr)-2.5 E F0(windo)2.5 E
--.65(w.)-.25 G F1(Contr)87 616.8 Q(ols W)-.18 E(indo)-.18 E(w)-.1 E F0
-.132(This dialog windo)108 628.8 R 2.632(wi)-.25 G 2.632(sb)-2.632 G
+-.65(w.)-.25 G F1(Contr)87 640.8 Q(ols W)-.18 E(indo)-.18 E(w)-.1 E F0
+.132(This dialog windo)108 652.8 R 2.632(wi)-.25 G 2.632(sb)-2.632 G
 .131(rought up by clicking the)-2.632 F F1(Option->Contr)2.631 E(ols)
 -.18 E F0 .131(menu item in the)2.631 F F1(MBna)2.631 E -.1(va)-.25 G
-.131(djust W).1 F(in-)-.18 E(do)108 640.8 Q(w)-.1 E F0 2.836(.T)C .336
+.131(djust W).1 F(in-)-.18 E(do)108 664.8 Q(w)-.1 E F0 2.836(.T)C .336
 (his windo)-2.836 F 2.836(wi)-.25 G .336(ncludes tw)-2.836 F 2.836(os)
 -.1 G .337(lider widgets setting data importation parameters, four slid\
-er widgets set-)-2.836 F(ting data display parameters, a b)108 652.8 Q
+er widgets set-)-2.836 F(ting data display parameters, a b)108 676.8 Q
 (utton to apply an)-.2 E 2.5(yc)-.15 G(hanges, and a b)-2.5 E
 (utton to dismiss the windo)-.2 E -.65(w.)-.25 G F1
-(Max Section Length \(km\))108 681.6 Q F0(When)144 693.6 Q F1(mbna)2.589
+(Max Section Length \(km\))108 705.6 Q F0(When)144 717.6 Q F1(mbna)2.589
 E -.1(va)-.25 G(djust).1 E F0 .089(imports sw)2.589 F .088(ath data, it\
  breaks each data \214le up into a set of sections, or pieces.)-.1 F .63
-(The geographical co)144 705.6 R -.15(ve)-.15 G .631
+(The geographical co)144 729.6 R -.15(ve)-.15 G .631
 (rages of all sections are then compared to determine where sw).15 F
-.631(aths o)-.1 F -.15(ve)-.15 G(rlap).15 E .741(or cross. This control\
- sets the section track length. The ideal section length v)144 717.6 R
-.741(aries with the sonar)-.25 F .498(altitude and ping rate. If the se\
-ction length is too short, there will be too man)144 729.6 R 2.998(ys)
--.15 G .498(mall sections and)-2.998 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(7)204.835 E 0 Cg EP
+.631(aths o)-.1 F -.15(ve)-.15 G(rlap).15 E(MB-System 5.0)72 768 Q
+(22 April 2015)142.605 E(7)200.945 E 0 Cg EP
 %%Page: 8 8
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .525(an e)144 84 R(xcessi)-.15 E .825 -.15(ve n)-.25 H
-.525(umber of crossings to analyze. If the section length is too lar).15
-F .524(ge, indi)-.18 F .524(vidual sections)-.25 F(will be slo)144 96 Q
+(djust\(1\)).25 E .741(or cross. This control sets the section track le\
+ngth. The ideal section length v)144 84 R .741(aries with the sonar)-.25
+F .498(altitude and ping rate. If the section length is too short, ther\
+e will be too man)144 96 R 2.998(ys)-.15 G .498(mall sections and)-2.998
+F .525(an e)144 108 R(xcessi)-.15 E .825 -.15(ve n)-.25 H .525
+(umber of crossings to analyze. If the section length is too lar).15 F
+.524(ge, indi)-.18 F .524(vidual sections)-.25 F(will be slo)144 120 Q
 2.5(wt)-.25 G 2.5(ol)-2.5 G(oad and display)-2.5 E(.)-.65 E/F1 10
-/Times-Bold at 0 SF(Max # Soundings in Section)108 112.8 Q F0 1.084
-(This slider widget sets an additional or alternati)144 124.8 R 1.385
+/Times-Bold at 0 SF(Max # Soundings in Section)108 136.8 Q F0 1.084
+(This slider widget sets an additional or alternati)144 148.8 R 1.385
 -.15(ve c)-.25 H 1.085(ontrol on sw).15 F 1.085
 (ath data section size: the maxi-)-.1 F .307
 (mum number of soundings \(not pings\) that may be included in a gi)144
-136.8 R -.15(ve)-.25 G 2.807(ns).15 G .307(ection. F)-2.807 F .306
-(or some datasets,)-.15 F 1.548(it may be more con)144 148.8 R -.15(ve)
+160.8 R -.15(ve)-.25 G 2.807(ns).15 G .307(ection. F)-2.807 F .306
+(or some datasets,)-.15 F 1.548(it may be more con)144 172.8 R -.15(ve)
 -.4 G 1.549(nient to use the number of soundings rather than the track \
 length as the).15 F(criterea for breaking \214les up into sections.)144
-160.8 Q F1(Decimation)108 177.6 Q F0 .625(When sw)144 189.6 R .625
+184.8 Q F1(Decimation)108 201.6 Q F0 .625(When sw)144 213.6 R .625
 (ath bath)-.1 F .625(ymetry sections are displayed in the)-.05 F F1(Na)
 3.125 E 3.125(vE)-.25 G(rr)-3.125 E F0(windo)3.125 E 1.925 -.65(w, t)
--.25 H .625(he primary display con-).65 F .832(sists of bath)144 201.6 R
+-.25 H .625(he primary display con-).65 F .832(sists of bath)144 225.6 R
 .833(ymetric contours.)-.05 F .833
 (The time required for calculating these contours is linear with the)
-5.833 F .29(number of soundings. This slider allo)144 213.6 R .289
+5.833 F .29(number of soundings. This slider allo)144 237.6 R .289
 (ws users to decimate the pings used for the contour displays.)-.25 F
 1.019(If the decimation is set to 1, all soundings are used. If the dec\
-imation is set to 2, the soundings)144 225.6 R(from e)144 237.6 Q -.15
+imation is set to 2, the soundings)144 249.6 R(from e)144 261.6 Q -.15
 (ve)-.25 G(ry second ping are used for contouring.).15 E F1
-(Contour Inter)108 254.4 Q -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0
-(This slider widget sets the depth interv)144 266.4 Q
+(Contour Inter)108 278.4 Q -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0
+(This slider widget sets the depth interv)144 290.4 Q
 (al in meters for the bath)-.25 E(ymetric contours.)-.05 E F1
-(Color Inter)108 283.2 Q -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0 .554
-(This slider widget sets the the depth interv)144 295.2 R .553
+(Color Inter)108 307.2 Q -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0 .554
+(This slider widget sets the the depth interv)144 319.2 R .553
 (al in meters at which the color of the bath)-.25 F .553(ymetric con-)
 -.05 F 1.111(tours changes. The contours are generated in four colors: \
-black, red, green, and blue. The color)144 307.2 R(interv)144 319.2 Q
+black, red, green, and blue. The color)144 331.2 R(interv)144 343.2 Q
 (al should be a multiple of the contour interv)-.25 E(al.)-.25 E F1 -.18
-(Ti)108 336 S(ck Inter).18 E -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0 .93
-(This slider widget sets the depth interv)144 348 R .929
+(Ti)108 360 S(ck Inter).18 E -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0 .93
+(This slider widget sets the depth interv)144 372 R .929
 (al in meters at which contours ha)-.25 F 1.229 -.15(ve d)-.2 H -.25(ow)
 .15 G .929(nhill f).25 F .929(acing tick-)-.1 F(marks. The tick interv)
-144 360 Q(al should be a multiple of the contour interv)-.25 E(al.)-.25
-E F1(In)108 376.8 Q -.1(ve)-.4 G(rsion Smoothing).1 E F0 .46
+144 384 Q(al should be a multiple of the contour interv)-.25 E(al.)-.25
+E F1(In)108 400.8 Q -.1(ve)-.4 G(rsion Smoothing).1 E F0 .46
 (This slider widget sets the importance of smoothing in the adjusted na)
-144 388.8 R(vig)-.2 E .46(ation model. Lar)-.05 F .46(ger v)-.18 F(al-)
--.25 E 1.242(ues yield a smoother model, smaller v)144 400.8 R 1.241
+144 412.8 R(vig)-.2 E .46(ation model. Lar)-.05 F .46(ger v)-.18 F(al-)
+-.25 E 1.242(ues yield a smoother model, smaller v)144 424.8 R 1.241
 (alues a rougher model.)-.25 F 1.241(The def)6.241 F 1.241
 (ault is 4.00, and possible)-.1 F .377(ranges are 0.10 to 10.0, where t\
 he smoothing penalty weight applied to the \214rst and second deri)144
-412.8 R(v-)-.25 E(ati)144 424.8 Q -.15(ve)-.25 G 2.5(so).15 G 2.5(ft)
+436.8 R(v-)-.25 E(ati)144 448.8 Q -.15(ve)-.25 G 2.5(so).15 G 2.5(ft)
 -2.5 G(he adjusted na)-2.5 E(vig)-.2 E
 (ation perturbation is ten raised to this po)-.05 E(wer)-.25 E(.)-.55 E
-F1 -.25(Ap)108 441.6 S(ply).25 E F0 1.566(This b)10.13 F 1.566
+F1 -.25(Ap)108 465.6 S(ply).25 E F0 1.566(This b)10.13 F 1.566
 (utton applies an)-.2 F 4.066(yc)-.15 G 1.566(hanged v)-4.066 F 1.565
 (alues in the slider widgets of the)-.25 F F1(Contr)4.065 E 1.565(ols W)
 -.18 F(indo)-.18 E(w)-.1 E F0 6.565(.I)C 4.065(ft)-6.565 G(he)-4.065 E
-F1(Contr)144 453.6 Q .04(ols W)-.18 F(indo)-.18 E(w)-.1 E F0 .04
+F1(Contr)144 477.6 Q .04(ols W)-.18 F(indo)-.18 E(w)-.1 E F0 .04
 (is closed without the)2.54 F F1 -.25(Ap)2.541 G(ply).25 E F0 -.2(bu)
 2.541 G .041(tton being click).2 F .041(ed, all changes to the v)-.1 F
-.041(alues con-)-.25 F(trolled by the sliders are lost.)144 465.6 Q F1
-(Dismiss)108 482.4 Q F0(This b)144 494.4 Q(utton closes the)-.2 E F1
-(Contr)2.5 E(ols W)-.18 E(indo)-.18 E(w)-.1 E F0(.)A F1(Na)87 523.2 Q
-2.5(vE)-.25 G(rr W)-2.5 E(indo)-.18 E(w)-.1 E F0 .1(This windo)108 535.2
+.041(alues con-)-.25 F(trolled by the sliders are lost.)144 489.6 Q F1
+(Dismiss)108 506.4 Q F0(This b)144 518.4 Q(utton closes the)-.2 E F1
+(Contr)2.5 E(ols W)-.18 E(indo)-.18 E(w)-.1 E F0(.)A F1(Na)87 547.2 Q
+2.5(vE)-.25 G(rr W)-2.5 E(indo)-.18 E(w)-.1 E F0 .1(This windo)108 559.2
 R 2.6(wa)-.25 G(llo)-2.6 E .1(ws users to interacti)-.25 F -.15(ve)-.25
 G .1(ly inspect crossing sw).15 F .1(aths, de\214ne na)-.1 F(vig)-.2 E
 .1(ation tie points where bath)-.05 F(y-)-.05 E 1.653
-(metric features can be matched, and set the na)108 547.2 R(vig)-.2 E
+(metric features can be matched, and set the na)108 571.2 R(vig)-.2 E
 1.653(ation of)-.05 F 1.653(fsets at those tie points. This windo)-.25 F
 4.153(wc)-.25 G 1.653(an be)-4.153 F .898(brought up in a number of w)
-108 559.2 R .898(ays. If one pulls do)-.1 F .897
+108 583.2 R .898(ays. If one pulls do)-.1 F .897
 (wn the menu option <Action->Analyze Crossings>, then)-.25 F .221
-(the "Na)108 571.2 R 2.721(vE)-.2 G .221(rror" windo)-2.721 F 2.721(ww)
+(the "Na)108 595.2 R 2.721(vE)-.2 G .221(rror" windo)-2.721 F 2.721(ww)
 -.25 G .221(ill come up with the \214rst crossing loaded. Alternati)
 -2.721 F -.15(ve)-.25 G(ly).15 E 2.722(,i)-.65 G 2.722(ft)-2.722 G .222
 (he <V)-2.722 F(ie)-.6 E(w->Sho)-.25 E 2.722(wA)-.25 G(ll)-2.722 E .719
 (Crossings> menu item has been selected so that a table of crossings is\
- displayed, clicking once on an)108 583.2 R 3.219(yo)-.15 G(f)-3.219 E
-.275(the crossing items in this tabel will bring up the)108 595.2 R("Na)
+ displayed, clicking once on an)108 607.2 R 3.219(yo)-.15 G(f)-3.219 E
+.275(the crossing items in this tabel will bring up the)108 619.2 R("Na)
 5.275 E 2.775(vE)-.2 G .275(rror" windo)-2.775 F 2.776(ww)-.25 G .276
 (ith that crossing loaded.)-2.776 F(Similarly)5.276 E(,)-.65 E 1.024
-(if tie points ha)108 607.2 R 1.323 -.15(ve b)-.2 H 1.023
+(if tie points ha)108 631.2 R 1.323 -.15(ve b)-.2 H 1.023
 (een established and the tie point table displayed by selecting the <V)
 .15 F(ie)-.6 E(w->Sho)-.25 E 3.523(wT)-.25 G(ies>)-3.873 E .571
-(menu item, then clicking on an)108 619.2 R 3.071(yo)-.15 G 3.071(ft)
+(menu item, then clicking on an)108 643.2 R 3.071(yo)-.15 G 3.071(ft)
 -3.071 G .571(he tie items this table will bring up the "Na)-3.071 F
 3.071(vE)-.2 G .571(rror" windo)-3.071 F 3.071(wa)-.25 G .571(nd load)
 -3.071 F .142
-(the crossing that includes the selected tie point. If the "Na)108 631.2
+(the crossing that includes the selected tie point. If the "Na)108 655.2
 R 2.642(vE)-.2 G .142(rror" windo)-2.642 F 2.642(wi)-.25 G 2.641(sa)
 -2.642 G .141(lready displayed, clicking on)-2.641 F .482(crossing or t\
 ie items in the display tables will load the selected crossing in place\
- of whate)108 643.2 R -.15(ve)-.25 G 2.982(rc).15 G .482(rossing w)
--2.982 F(as)-.1 E(pre)108 655.2 Q(viously sho)-.25 E(wn.)-.25 E .21
-(The Na)108 679.2 R 2.71(vE)-.2 G .21(rr windo)-2.71 F 2.71(wi)-.25 G
+ of whate)108 667.2 R -.15(ve)-.25 G 2.982(rc).15 G .482(rossing w)
+-2.982 F(as)-.1 E(pre)108 679.2 Q(viously sho)-.25 E(wn.)-.25 E .21
+(The Na)108 703.2 R 2.71(vE)-.2 G .21(rr windo)-2.71 F 2.71(wi)-.25 G
 .21(ncludes a number of b)-2.71 F .209
 (utton widgets and three display can)-.2 F -.25(va)-.4 G .209
 (ses. The lar).25 F .209(ger display to)-.18 F .471(the right sho)108
-691.2 R .471(ws bath)-.25 F .471(ymetric contour maps of the o)-.05 F
+715.2 R .471(ws bath)-.25 F .471(ymetric contour maps of the o)-.05 F
 -.15(ve)-.15 G .471(rlapping sw).15 F .471(aths o)-.1 F -.15(ve)-.15 G
 .472(rlain by na).15 F(vig)-.2 E .472(ation tracks and an)-.05 F(y)-.15
-E .602(tie points that ha)108 703.2 R .901 -.15(ve b)-.2 H .601
+E .602(tie points that ha)108 727.2 R .901 -.15(ve b)-.2 H .601
 (een de\214ned for the current crossing. The smaller can).15 F -.25(va)
 -.4 G 3.101(so).25 G 3.101(nt)-3.101 G .601(he middle left sho)-3.101 F
-.601(ws the)-.25 F .821(RMS bath)108 715.2 R .821
-(ymetry mis\214t between the tw)-.05 F 3.321(os)-.1 G -.1(wa)-3.321 G
-.821(ths as a function of lateral \(x and y\) of).1 F .822
-(fset using the current)-.25 F -.15(ve)108 727.2 S .287(rtical \(z\)of)
-.15 F .287(fset. The smallest can)-.25 F -.25(va)-.4 G 2.787(so).25 G
-2.787(nt)-2.787 G .287(he lo)-2.787 F .287(wer left sho)-.25 F .287
-(ws the RMS Bath)-.25 F .287(ymetry mis\214t between the tw)-.05 F(o)-.1
-E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(8)204.835 E 0
-Cg EP
+.601(ws the)-.25 F(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(8)
+200.945 E 0 Cg EP
 %%Page: 9 9
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E(sw)108 84 Q(aths as a function of v)-.1 E(ertical of)
--.15 E(fset using the current lateral of)-.25 E(fset.)-.25 E/F1 10
-/Times-Bold at 0 SF(Contour Display)108 112.8 Q F0 .023(This can)144 124.8
+(djust\(1\)).25 E .821(RMS bath)108 84 R .821
+(ymetry mis\214t between the tw)-.05 F 3.321(os)-.1 G -.1(wa)-3.321 G
+.821(ths as a function of lateral \(x and y\) of).1 F .822
+(fset using the current)-.25 F -.15(ve)108 96 S .287(rtical \(z\)of).15
+F .287(fset. The smallest can)-.25 F -.25(va)-.4 G 2.787(so).25 G 2.787
+(nt)-2.787 G .287(he lo)-2.787 F .287(wer left sho)-.25 F .287
+(ws the RMS Bath)-.25 F .287(ymetry mis\214t between the tw)-.05 F(o)-.1
+E(sw)108 108 Q(aths as a function of v)-.1 E(ertical of)-.15 E
+(fset using the current lateral of)-.25 E(fset.)-.25 E/F1 10
+/Times-Bold at 0 SF(Contour Display)108 136.8 Q F0 .023(This can)144 148.8
 R -.25(va)-.4 G 2.523(sd).25 G .024(isplays color bath)-2.523 F .024
 (ymetric contours from both o)-.05 F -.15(ve)-.15 G .024(rlapping sw).15
 F .024(aths in the current sw)-.1 F(ath)-.1 E 1.029(crossing. Initially)
-144 136.8 R 3.529(,t)-.65 G 1.029
+144 160.8 R 3.529(,t)-.65 G 1.029
 (he display is scaled so that the entire area co)-3.529 F -.15(ve)-.15 G
 1.028(red by the current crossing is).15 F .014(visible. The bath)144
-148.8 R .014(ymetric contours of the second sw)-.05 F .014
+172.8 R .014(ymetric contours of the second sw)-.05 F .014
 (ath can be mo)-.1 F -.15(ve)-.15 G 2.514(dr).15 G(elati)-2.514 E .314
 -.15(ve t)-.25 H 2.514(ot).15 G .014(hose of the \214rst by)-2.514 F
-.717(dragging with the left mouse b)144 160.8 R .717(utton in the can)
+.717(dragging with the left mouse b)144 184.8 R .717(utton in the can)
 -.2 F -.25(va)-.4 G .717(s. The current na).25 F(vig)-.2 E .716
 (ational of)-.05 F .716(fset changes as the)-.25 F .588
-(contours shift. The location of the current lateral of)144 172.8 R .589
+(contours shift. The location of the current lateral of)144 196.8 R .589
 (fset also changes simultaneously on the mis\214t)-.25 F 1.026
-(plot. The user can display a subre)144 184.8 R 1.026
+(plot. The user can display a subre)144 208.8 R 1.026
 (gion of the current map by dragging a rectangle in the can)-.15 F -.25
-(va)-.4 G(s).25 E .122(with the middle mouse b)144 196.8 R .122
+(va)-.4 G(s).25 E .122(with the middle mouse b)144 220.8 R .122
 (utton. This zoom operation can be repeated as man)-.2 F 2.623(yt)-.15 G
-.123(imes as desired. The)-2.623 F .512(right mouse b)144 208.8 R .512
+.123(imes as desired. The)-2.623 F .512(right mouse b)144 232.8 R .512
 (utton is used to set the location of the current na)-.2 F(vig)-.2 E
-.511(ational tie point. When the right)-.05 F .636(mouse b)144 220.8 R
+.511(ational tie point. When the right)-.05 F .636(mouse b)144 244.8 R
 .636(utton is click)-.2 F .636
 (ed on a point in the contour map, the closest na)-.1 F(vig)-.2 E .637
-(ation control points from)-.05 F .413(each sw)144 232.8 R .412(ath to \
+(ation control points from)-.05 F .413(each sw)144 256.8 R .412(ath to \
 that position are selected for the current tie point. In practice, the \
-user should right-)-.1 F(click on the bath)144 244.8 Q
+user should right-)-.1 F(click on the bath)144 268.8 Q
 (ymetric feature being matched to set the tie point correctly)-.05 E(.)
--.65 E F1(Lateral Mis\214t Display)108 261.6 Q F0 .83(This can)144 273.6
+-.65 E F1(Lateral Mis\214t Display)108 285.6 Q F0 .83(This can)144 297.6
 R -.25(va)-.4 G 3.33(ss).25 G(ho)-3.33 E .83(ws a color tw)-.25 F 3.33
 (od)-.1 G .83(imensional plot of the RMS bath)-3.33 F .83
-(ymetric mis\214t between the tw)-.05 F(o)-.1 E -.15(ove)144 285.6 S
+(ymetric mis\214t between the tw)-.05 F(o)-.1 E -.15(ove)144 309.6 S
 .513(rlapping sw).15 F .513(aths. The mis\214t is sho)-.1 F .513
 (wn as a function of relati)-.25 F .812 -.15(ve l)-.25 H .512
 (ateral \(x and y\) of).15 F .512(fsets between)-.25 F .597(the tw)144
-297.6 R 5.597(os)-.1 G -.1(wa)-5.597 G .597(ths using the current v).1 F
+321.6 R 5.597(os)-.1 G -.1(wa)-5.597 G .597(ths using the current v).1 F
 .597(ertical \(z\) of)-.15 F 3.098(fset. Put)-.25 F 3.098(another w)
 3.098 F(ay)-.1 E 5.598(,t)-.65 G .598(he mis\214t plot sho)-5.598 F .598
 (ws ho)-.25 F(w)-.25 E .842
-(good, or bad, the mis\214t becomes as one mo)144 309.6 R -.15(ve)-.15 G
+(good, or bad, the mis\214t becomes as one mo)144 333.6 R -.15(ve)-.15 G
 3.342(so).15 G .842(ne sw)-3.342 F .842(ath relati)-.1 F 1.142 -.15
 (ve t)-.25 H 3.342(oa).15 G(nother)-3.342 E 5.842(.T)-.55 G 3.341(he lo)
--5.842 F .841(west mis\214t)-.25 F -.25(va)144 321.6 S .039
+-5.842 F .841(west mis\214t)-.25 F -.25(va)144 345.6 S .039
 (lues are sho).25 F .039(wn in red; higher mis\214ts are sho)-.25 F .04
 (wn in blues to purples. The location of the minimum)-.25 F 3.248
-(mis\214t is mark)144 333.6 R .748
+(mis\214t is mark)144 357.6 R .748
 (ed by a black "X", and the location of the current na)-.1 F(vig)-.2 E
 .748(ation of)-.05 F .747(fset is sho)-.25 F .747(wn by a)-.25 F 2.943
-(small red square)144 345.6 R .443(with a black outline. If an in)2.943
+(small red square)144 369.6 R .443(with a black outline. If an in)2.943
 F -.15(ve)-.4 G .444(rsion has been performed, a small black "+" will)
-.15 F .209(mark the location of the of)144 357.6 R .208
+.15 F .209(mark the location of the of)144 381.6 R .208
 (fset calculated by the in)-.25 F -.15(ve)-.4 G .208
 (rsion. If a user left-clicks in the Lateral Mis\214t).15 F(Display)144
-369.6 Q 3.061(,t)-.65 G .561(he location of the cursor is tak)-3.061 F
+393.6 Q 3.061(,t)-.65 G .561(he location of the cursor is tak)-3.061 F
 .561(en as the ne)-.1 F 3.061(wn)-.25 G -.2(av)-3.061 G(ig).2 E .561
 (ation of)-.05 F .562(fset and the red square mo)-.25 F -.15(ve)-.15 G
-(s).15 E 1.008(to that location. Simultaneously)144 381.6 R 3.508(,t)
+(s).15 E 1.008(to that location. Simultaneously)144 405.6 R 3.508(,t)
 -.65 G 1.008(he bath)-3.508 F 1.008
 (ymetric contours in the Contour Display shift to re\215ect)-.05 F
-(the ne)144 393.6 Q 2.5(wo)-.25 G -.25(ff)-2.5 G(set.).25 E F1 -1(Ve)108
-410.4 S(rtical Mis\214t Display)1 E F0 .177(This can)144 422.4 R -.25
+(the ne)144 417.6 Q 2.5(wo)-.25 G -.25(ff)-2.5 G(set.).25 E F1 -1(Ve)108
+434.4 S(rtical Mis\214t Display)1 E F0 .177(This can)144 446.4 R -.25
 (va)-.4 G 2.677(ss).25 G(ho)-2.677 E .177
 (ws a color pro\214le plot of the RMS bath)-.25 F .178
 (ymetric mis\214t between the tw)-.05 F 2.678(oo)-.1 G -.15(ve)-2.828 G
-(rlapping).15 E(sw)144 434.4 Q 1.124(aths. The mis\214t is sho)-.1 F
+(rlapping).15 E(sw)144 458.4 Q 1.124(aths. The mis\214t is sho)-.1 F
 1.123(wn as a function of relati)-.25 F 1.423 -.15(ve ve)-.25 H 1.123
 (rtical \(z\) of).15 F 1.123(fset between the tw)-.25 F 6.123(os)-.1 G
 -.1(wa)-6.123 G(ths).1 E 1.027(using the current lateral \(x andy\) of)
-144 446.4 R 3.527(fsets. Put)-.25 F 3.527(another w)3.527 F(ay)-.1 E
+144 470.4 R 3.527(fsets. Put)-.25 F 3.527(another w)3.527 F(ay)-.1 E
 6.027(,t)-.65 G 1.027(he mis\214t plot sho)-6.027 F 1.027(ws ho)-.25 F
 3.527(wg)-.25 G 1.027(ood, or)-3.527 F .612
-(bad, the mis\214t becomes as one mo)144 458.4 R -.15(ve)-.15 G 3.112
+(bad, the mis\214t becomes as one mo)144 482.4 R -.15(ve)-.15 G 3.112
 (so).15 G .612(ne sw)-3.112 F .612(ath v)-.1 F .612(ertically relati)
 -.15 F .912 -.15(ve t)-.25 H 3.112(oa).15 G(nother)-3.112 E 5.612(.T)
--.55 G 3.112(he lo)-5.612 F .612(west mis\214t)-.25 F -.25(va)144 470.4
+-.55 G 3.112(he lo)-5.612 F .612(west mis\214t)-.25 F -.25(va)144 494.4
 S .382(lues are sho).25 F .382(wn in red and as high points in the pro\
 \214le; higher mis\214ts are sho)-.25 F .382(wn in blues to pur)-.25 F
-(-)-.2 E 1.012(ples and as lo)144 482.4 R 3.512(wp)-.25 G 1.012
+(-)-.2 E 1.012(ples and as lo)144 506.4 R 3.512(wp)-.25 G 1.012
 (oints. The location of the minimum mis\214t)-3.512 F 3.512(is mark)
 6.012 F 1.011(ed by a black "X", and the)-.1 F .003
-(location of the current v)144 494.4 R .003(ertical of)-.15 F .003
+(location of the current v)144 518.4 R .003(ertical of)-.15 F .003
 (fset is sho)-.25 F .003(wn by a solid line. If an in)-.25 F -.15(ve)-.4
 G .004(rsion has been performed, a).15 F .181
-(small black "+" will mark the location of the of)144 506.4 R .18
+(small black "+" will mark the location of the of)144 530.4 R .18
 (fset calculated by the in)-.25 F -.15(ve)-.4 G .18
-(rsion. If a user left-clicks).15 F .491(in the V)144 518.4 R .491
+(rsion. If a user left-clicks).15 F .491(in the V)144 542.4 R .491
 (ertical Mis\214t Display)-1.11 F 2.991(,t)-.65 G .492
 (he location of the cursor is tak)-2.991 F .492(en as the ne)-.1 F 2.992
 (wv)-.25 G .492(ertical of)-3.142 F .492(fset and the)-.25 F .261
-(solid line mo)144 530.4 R -.15(ve)-.15 G 2.761(st).15 G 2.761(ot)-2.761
+(solid line mo)144 554.4 R -.15(ve)-.15 G 2.761(st).15 G 2.761(ot)-2.761
 G .261(hat location. Simultaneously)-2.761 F 2.761(,t)-.65 G .261
 (he bath)-2.761 F .26(ymetric contours in the Contour Display)-.05 F
-(shift to re\215ect the ne)144 542.4 Q 2.5(wo)-.25 G -.25(ff)-2.5 G
-(set.).25 E F1(Settings)108 559.2 Q F0(This b)144 571.2 Q
+(shift to re\215ect the ne)144 566.4 Q 2.5(wo)-.25 G -.25(ff)-2.5 G
+(set.).25 E F1(Settings)108 583.2 Q F0(This b)144 595.2 Q
 (utton brings up a pulldo)-.2 E(wn menu with tw)-.25 E 2.5(oi)-.1 G
 (tems:)-2.5 E F1(Biases)2.5 E F0(and)2.5 E F1(ContoursB)2.5 E
-(Settings->Biases)108 588 Q F0 1.042
-(This menu item brings up a dialog windo)144 600 R 3.542(ww)-.25 G 1.043
+(Settings->Biases)108 612 Q F0 1.042
+(This menu item brings up a dialog windo)144 624 R 3.542(ww)-.25 G 1.043
 (ith se)-3.542 F -.15(ve)-.25 G 1.043
-(ral slider widgets that set roll and heading).15 F(bias v)144 612 Q 2.5
+(ral slider widgets that set roll and heading).15 F(bias v)144 636 Q 2.5
 (alues. These)-.25 F(widgets are discussed in the)2.5 E F1(Biases)2.5 E
-F0(section belo)2.5 E -.65(w.)-.25 G F1(Settings->Contours)108 628.8 Q
-F0 .243(This menu item brings up a dialog windo)144 640.8 R 2.743(ww)
+F0(section belo)2.5 E -.65(w.)-.25 G F1(Settings->Contours)108 652.8 Q
+F0 .243(This menu item brings up a dialog windo)144 664.8 R 2.743(ww)
 -.25 G .243(ith se)-2.743 F -.15(ve)-.25 G .242
 (ral slider widgets that set parameters control-).15 F .088(ling ho)144
-652.8 R 2.588(ws)-.25 G -.1(wa)-2.588 G .088
+676.8 R 2.588(ws)-.25 G -.1(wa)-2.588 G .088
 (th data are imported and displayed.).1 F .088
 (These widgets are discussed in the)5.088 F F1(Contr)2.588 E(ols)-.18 E
-F0(sec-)2.588 E(tion abo)144 664.8 Q -.15(ve)-.15 G(.).15 E F1(Pr)108
-681.6 Q -.15(ev)-.18 G(ious).15 E F0(Clicking this b)144 693.6 Q
+F0(sec-)2.588 E(tion abo)144 688.8 Q -.15(ve)-.15 G(.).15 E F1(Pr)108
+705.6 Q -.15(ev)-.18 G(ious).15 E F0(Clicking this b)144 717.6 Q
 (utton causes the Na)-.2 E 2.5(vE)-.2 G(rr windo)-2.5 E 2.5(wt)-.25 G
-2.5(ol)-2.5 G(oad and display the pre)-2.5 E(vious crossing.)-.25 E F1
-(Next)108 710.4 Q F0(Clicking this b)16.01 E(utton causes the Na)-.2 E
-2.5(vE)-.2 G(rr windo)-2.5 E 2.5(wt)-.25 G 2.5(ol)-2.5 G
-(oad and display the ne)-2.5 E(xt crossing.)-.15 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(9)204.835 E 0 Cg EP
+2.5(ol)-2.5 G(oad and display the pre)-2.5 E(vious crossing.)-.25 E
+(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(9)200.945 E 0 Cg EP
 %%Page: 10 10
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10/Times-Bold at 0 SF(Next Unset)108 84 Q F0 .059
-(Clicking this b)144 96 R .059(utton causes the Na)-.2 F 2.559(vE)-.2 G
-.059(rr windo)-2.559 F 2.559(wt)-.25 G 2.559(ol)-2.559 G .059
-(oad and display the ne)-2.559 F .058(xt crossing which has no)-.15 F
-(tie points set and has not been e)144 108 Q(xplicitly skipped.)-.15 E
-F1(Skip Cr)108 124.8 Q(ossing)-.18 E F0 .321(This b)144 136.8 R .321(ut\
+(djust\(1\)).25 E/F1 10/Times-Bold at 0 SF(Next)108 84 Q F0
+(Clicking this b)16.01 E(utton causes the Na)-.2 E 2.5(vE)-.2 G
+(rr windo)-2.5 E 2.5(wt)-.25 G 2.5(ol)-2.5 G(oad and display the ne)-2.5
+E(xt crossing.)-.15 E F1(Next Unset)108 100.8 Q F0 .059(Clicking this b)
+144 112.8 R .059(utton causes the Na)-.2 F 2.559(vE)-.2 G .059(rr windo)
+-2.559 F 2.559(wt)-.25 G 2.559(ol)-2.559 G .059(oad and display the ne)
+-2.559 F .058(xt crossing which has no)-.15 F
+(tie points set and has not been e)144 124.8 Q(xplicitly skipped.)-.15 E
+F1(Skip Cr)108 141.6 Q(ossing)-.18 E F0 .321(This b)144 153.6 R .321(ut\
 ton indicates that no good tie points can be de\214ned for the current \
-crossing.)-.2 F .322(The program)5.322 F F1(mbna)144 148.8 Q -.1(va)-.25
+crossing.)-.2 F .322(The program)5.322 F F1(mbna)144 165.6 Q -.1(va)-.25
 G(djust).1 E F0 1.076(will not allo)3.576 F 3.576(wa)-.25 G 3.576(ni)
 -3.576 G -1.85 -.4(nv e)-3.576 H 1.076
 (rsion to be calculated until all true crossings either ha).4 F 1.376
--.15(ve t)-.2 H(ie).15 E(points de\214ned or ha)144 160.8 Q .3 -.15
-(ve b)-.2 H(een e).15 E(xplicitly skipped.)-.15 E F1(Full Size)108 177.6
-Q F0 .187(Clicking this b)144 189.6 R .188
+-.15(ve t)-.2 H(ie).15 E(points de\214ned or ha)144 177.6 Q .3 -.15
+(ve b)-.2 H(een e).15 E(xplicitly skipped.)-.15 E F1(Full Size)108 194.4
+Q F0 .187(Clicking this b)144 206.4 R .188
 (utton causes the contour display to resize so that it sho)-.2 F .188
 (ws the entire area co)-.25 F -.15(ve)-.15 G .188(red by).15 F(the sw)
-144 201.6 Q(ath sections in the current crossing.)-.1 E F1(Unset Cr)108
-218.4 Q(ossing)-.18 E F0 .335(This b)144 230.4 R .335(utton returns the\
+144 218.4 Q(ath sections in the current crossing.)-.1 E F1(Unset Cr)108
+235.2 Q(ossing)-.18 E F0 .335(This b)144 247.2 R .335(utton returns the\
  current crossing to the original unset state, deleting an)-.2 F 2.835
 (yt)-.15 G .335(ies that ha)-2.835 F .635 -.15(ve b)-.2 H(een).15 E
-(set.)144 242.4 Q F1(Reset Cr)108 259.2 Q(ossing)-.18 E F0 .522(This b)
-144 271.2 R .522(utton is acti)-.2 F .823 -.15(ve o)-.25 H .523
+(set.)144 259.2 Q F1(Reset Cr)108 276 Q(ossing)-.18 E F0 .522(This b)144
+288 R .522(utton is acti)-.2 F .823 -.15(ve o)-.25 H .523
 (nly if a tie has been set for the current crossing. If a tie e).15 F
-.523(xists, and the user)-.15 F .176(has changed the current of)144
-283.2 R .176(fset from that of the current tie, then this b)-.25 F .176
-(utton returns the w)-.2 F .175(orking of)-.1 F(f-)-.25 E(set v)144
-295.2 Q(alues to that of the e)-.25 E(xisting tie.)-.15 E F1(Set Offset)
-108 312 Q F0 .431(This v)144 324 R .431(ery important b)-.15 F .432
+.523(xists, and the user)-.15 F .176(has changed the current of)144 300
+R .176(fset from that of the current tie, then this b)-.25 F .176
+(utton returns the w)-.2 F .175(orking of)-.1 F(f-)-.25 E(set v)144 312
+Q(alues to that of the e)-.25 E(xisting tie.)-.15 E F1(Set Offset)108
+328.8 Q F0 .431(This v)144 340.8 R .431(ery important b)-.15 F .432
 (utton causes the current na)-.2 F(vig)-.2 E .432(ational of)-.05 F .432
 (fset to be set for the current tie point)-.25 F .827
-(and crossing. This b)144 336 R .827(utton is the only w)-.2 F .827
+(and crossing. This b)144 352.8 R .827(utton is the only w)-.2 F .827
 (ay that the na)-.1 F(vig)-.2 E .827(ational of)-.05 F .827
-(fsets are actually applied to the)-.25 F F1(mbna)144 348 Q -.1(va)-.25
-G(djust).1 E F0 1.747(project. If the user closes the Na)4.247 F 4.247
-(vE)-.2 G 1.747(rr windo)-4.247 F 3.047 -.65(w, c)-.25 H 1.747
-(hanges the loaded crossing, or).65 F 2.504(changes the acti)144 360 R
+(fsets are actually applied to the)-.25 F F1(mbna)144 364.8 Q -.1(va)
+-.25 G(djust).1 E F0 1.747(project. If the user closes the Na)4.247 F
+4.247(vE)-.2 G 1.747(rr windo)-4.247 F 3.047 -.65(w, c)-.25 H 1.747
+(hanges the loaded crossing, or).65 F 2.504(changes the acti)144 376.8 R
 2.804 -.15(ve t)-.25 H 2.503(ie point without clicking <Set Of).15 F
 2.503(fset>, whate)-.25 F -.15(ve)-.25 G 5.003(rn).15 G -.2(av)-5.003 G
 (ig).2 E 2.503(ational of)-.05 F 2.503(fset w)-.25 F(as)-.1 E(vie)144
-372 Q .094(wed will be lost. T)-.25 F .094
+388.8 Q .094(wed will be lost. T)-.25 F .094
 (ie points are displayed in yello)-.35 F 2.594(wo)-.25 G .094(nce the)
 -2.594 F 2.594(ya)-.15 G .095(re set, and in red when either the)-2.594
-F(na)144 384 Q(vig)-.2 E(ational of)-.05 E(fset or the na)-.25 E(vig)-.2
-E(ation points ha)-.05 E .3 -.15(ve b)-.2 H(een changed b).15 E
-(ut not yet set.)-.2 E F1(Zer)108 400.8 Q 2.5(oZO)-.18 G(ffset)-2.5 E F0
-(This b)144 412.8 Q(utton sets the current v)-.2 E(ertical of)-.15 E
-(fset to zero meters.)-.25 E F1(Add T)108 429.6 Q(ie)-.18 E F0 .542
-(This b)144 441.6 R .542(utton adds a ne)-.2 F 3.042(wt)-.25 G .542
+F(na)144 400.8 Q(vig)-.2 E(ational of)-.05 E(fset or the na)-.25 E(vig)
+-.2 E(ation points ha)-.05 E .3 -.15(ve b)-.2 H(een changed b).15 E
+(ut not yet set.)-.2 E F1(Zer)108 417.6 Q 2.5(oZO)-.18 G(ffset)-2.5 E F0
+(This b)144 429.6 Q(utton sets the current v)-.2 E(ertical of)-.15 E
+(fset to zero meters.)-.25 E F1(Add T)108 446.4 Q(ie)-.18 E F0 .542
+(This b)144 458.4 R .542(utton adds a ne)-.2 F 3.042(wt)-.25 G .542
 (ie point for the current crossing and mak)-3.042 F .541(es this ne)-.1
 F 3.041(wt)-.25 G .541(ie point acti)-3.041 F -.15(ve)-.25 G 3.041(.T)
-.15 G(he)-3.041 E(tie point initially adopts the current na)144 453.6 Q
-(vig)-.2 E(ational of)-.05 E(fset.)-.25 E F1(Zer)108 470.4 Q 2.5(oO)-.18
-G(ffset)-2.5 E F0(This b)144 482.4 Q(utton sets the current na)-.2 E
+.15 G(he)-3.041 E(tie point initially adopts the current na)144 470.4 Q
+(vig)-.2 E(ational of)-.05 E(fset.)-.25 E F1(Zer)108 487.2 Q 2.5(oO)-.18
+G(ffset)-2.5 E F0(This b)144 499.2 Q(utton sets the current na)-.2 E
 (vig)-.2 E(ational of)-.05 E
 (fset to zero meters for longitude, latitude, and v)-.25 E(ertical.)-.15
-E F1(Select T)108 499.2 Q(ie)-.18 E F0 .01(If more than one na)144 511.2
-R(vig)-.2 E .011(ation tie point has been de\214ned for a crossing, the\
-n only one tie point can be)-.05 F(acti)144 523.2 Q 1.184 -.15(ve a)-.25
-H 3.384(ta).15 G 1.184 -.15(ny t)-3.384 H .884(ime. The na).15 F(vig)-.2
-E .884(ation control points of the acti)-.05 F 1.183 -.15(ve t)-.25 H
-.883(ie points will be displayed as red).15 F(box)144 535.2 Q .088
+E F1(Select T)108 516 Q(ie)-.18 E F0 .01(If more than one na)144 528 R
+(vig)-.2 E .011(ation tie point has been de\214ned for a crossing, then\
+ only one tie point can be)-.05 F(acti)144 540 Q 1.184 -.15(ve a)-.25 H
+3.384(ta).15 G 1.184 -.15(ny t)-3.384 H .884(ime. The na).15 F(vig)-.2 E
+.884(ation control points of the acti)-.05 F 1.183 -.15(ve t)-.25 H .883
+(ie points will be displayed as red).15 F(box)144 552 Q .088
 (es, and those of an)-.15 F 2.589(yi)-.15 G(nacti)-2.589 E .389 -.15
 (ve t)-.25 H .089(ie points will be sho).15 F .089
 (wn as smaller red box)-.25 F .089(es. This b)-.15 F .089(utton changes)
--.2 F .742(the acti)144 547.2 R 1.042 -.15(ve t)-.25 H .742(ie point.)
-.15 F .741(Repeatedly clicking this b)5.741 F .741(utton will c)-.2 F
-.741(ycle through all of the tie points in the)-.15 F .532
-(current crossing. Note that each tie point has its o)144 559.2 R .532
+-.2 F .742(the acti)144 564 R 1.042 -.15(ve t)-.25 H .742(ie point.).15
+F .741(Repeatedly clicking this b)5.741 F .741(utton will c)-.2 F .741
+(ycle through all of the tie points in the)-.15 F .532
+(current crossing. Note that each tie point has its o)144 576 R .532
 (wn of)-.25 F .533(fset de\214ned, so in general the positions of)-.25 F
-(the bath)144 571.2 Q(ymetric contours will change as the acti)-.05 E .3
--.15(ve t)-.25 H(ie point changes.).15 E F1(Delete T)108 588 Q(ie)-.18 E
-F0(This b)144 600 Q(utton deletes the current acti)-.2 E .3 -.15(ve t)
--.25 H(ie point.).15 E F1(Dismiss)108 616.8 Q F0(This b)144 628.8 Q
-(utton closes the Na)-.2 E 2.5(vE)-.2 G(rr windo)-2.5 E -.65(w.)-.25 G
-F1(Minimum Mis\214t)108 645.6 Q F0 1.149(This b)144 657.6 R 1.149
+(the bath)144 588 Q(ymetric contours will change as the acti)-.05 E .3
+-.15(ve t)-.25 H(ie point changes.).15 E F1(Delete T)108 604.8 Q(ie)-.18
+E F0(This b)144 616.8 Q(utton deletes the current acti)-.2 E .3 -.15
+(ve t)-.25 H(ie point.).15 E F1(Dismiss)108 633.6 Q F0(This b)144 645.6
+Q(utton closes the Na)-.2 E 2.5(vE)-.2 G(rr windo)-2.5 E -.65(w.)-.25 G
+F1(Minimum Mis\214t)108 662.4 Q F0 1.149(This b)144 674.4 R 1.149
 (utton shifts the current of)-.2 F 1.149(fset to the v)-.25 F 1.149
 (alue identi\214ed as the minimum mis\214t in the current)-.25 F .873
-(mis\214t display)144 669.6 R 3.373(.T)-.65 G .873
+(mis\214t display)144 686.4 R 3.373(.T)-.65 G .873
 (he minimum mis\214t is sho)-3.373 F .873(wn as the lar)-.25 F .874
 (ge black X on the color lateral mis\214t plot)-.18 F(and on the v)144
-681.6 Q(ertical mis\214t pro\214le.)-.15 E F1(Minimum XY Mis\214t)108
-698.4 Q F0 .316(This b)144 710.4 R .316
-(utton shifts the current lateral of)-.2 F .316(fset to the v)-.25 F
-.315(alues identi\214ed as the minimum lateral mis\214t in)-.25 F .432
-(the current mis\214t display)144 722.4 R 2.932(.T)-.65 G .432(he v)
--2.932 F .433(ertical of)-.15 F .433
-(fset is not changed. The minimum lateral mis\214t is sho)-.25 F(wn)-.25
-E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(10)199.835 E 0
-Cg EP
+698.4 Q(ertical mis\214t pro\214le.)-.15 E(MB-System 5.0)72 768 Q
+(22 April 2015)142.605 E(10)195.945 E 0 Cg EP
 %%Page: 11 11
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E 1.319
-(as the small black X on the lateral mis\214t plot. This b)144 84 R
-1.319(utton is generally used when the data are)-.2 F .096
-(already corrected for all v)144 96 R .096(ertical of)-.15 F .097
+(djust\(1\)).25 E/F1 10/Times-Bold at 0 SF(Minimum XY Mis\214t)108 84 Q F0
+.316(This b)144 96 R .316(utton shifts the current lateral of)-.2 F .316
+(fset to the v)-.25 F .315
+(alues identi\214ed as the minimum lateral mis\214t in)-.25 F .432
+(the current mis\214t display)144 108 R 2.932(.T)-.65 G .432(he v)-2.932
+F .433(ertical of)-.15 F .433
+(fset is not changed. The minimum lateral mis\214t is sho)-.25 F(wn)-.25
+E 1.319(as the small black X on the lateral mis\214t plot. This b)144
+120 R 1.319(utton is generally used when the data are)-.2 F .096
+(already corrected for all v)144 132 R .096(ertical of)-.15 F .097
 (fsets \(e.g. tides\), and so all z of)-.25 F .097
-(fsets can be con\214ned to zero v)-.25 F(al-)-.25 E(ues.)144 108 Q/F1
-10/Times-Bold at 0 SF(Center on Zer)108 124.8 Q 2.5(oO)-.18 G(ffset)-2.5 E
-F0 .259(This b)144 136.8 R .259(utton causes the mis\214t plot to be re)
--.2 F .259(generated using a zero na)-.15 F(vig)-.2 E .259(ational of)
--.05 F .258(fset as the plot ori-)-.25 F(gin.)144 148.8 Q F1
-(Center on Curr)108 165.6 Q(ent Offset)-.18 E F0 .153(This b)144 177.6 R
-.153(utton causes the mis\214t plot to be re)-.2 F .153
+(fsets can be con\214ned to zero v)-.25 F(al-)-.25 E(ues.)144 144 Q F1
+(Center on Zer)108 160.8 Q 2.5(oO)-.18 G(ffset)-2.5 E F0 .259(This b)144
+172.8 R .259(utton causes the mis\214t plot to be re)-.2 F .259
+(generated using a zero na)-.15 F(vig)-.2 E .259(ational of)-.05 F .258
+(fset as the plot ori-)-.25 F(gin.)144 184.8 Q F1(Center on Curr)108
+201.6 Q(ent Offset)-.18 E F0 .153(This b)144 213.6 R .153
+(utton causes the mis\214t plot to be re)-.2 F .153
 (generated using the current na)-.15 F(vig)-.2 E .153(ational of)-.05 F
-.154(fset as the plot)-.25 F(origin.)144 189.6 Q F1(Biases W)87 218.4 Q
-(indo)-.18 E(w)-.1 E F0 .912(This dialog windo)108 230.4 R 3.412(wi)-.25
+.154(fset as the plot)-.25 F(origin.)144 225.6 Q F1(Biases W)87 254.4 Q
+(indo)-.18 E(w)-.1 E F0 .912(This dialog windo)108 266.4 R 3.412(wi)-.25
 G 3.412(sb)-3.412 G .911(rought up by clicking the)-3.412 F F1
 (Settings->Biases)3.411 E F0 .911(menu item in the)3.411 F F1(Na)3.411 E
 3.411(vE)-.25 G .911(rr W)-3.411 F(indo)-.18 E(w)-.1 E F0(.)A .456
-(The controls allo)108 242.4 R 2.956(wu)-.25 G .456
+(The controls allo)108 278.4 R 2.956(wu)-.25 G .456
 (sers to set roll and heading bias \(or of)-2.956 F .456(fset\) v)-.25 F
-.457(alues to be a applied to some or all of the)-.25 F(sw)108 254.4 Q
+.457(alues to be a applied to some or all of the)-.25 F(sw)108 290.4 Q
 .063(ath bath)-.1 F .063(ymetry in the)-.05 F F1(mbna)2.562 E -.1(va)
 -.25 G(djust).1 E F0 .062
 (project. Under most circumstances, roll bias and pitch bias problems)
-2.562 F .235(should be resolv)108 266.4 R .235(ed before sw)-.15 F .235
+2.562 F .235(should be resolv)108 302.4 R .235(ed before sw)-.15 F .235
 (ath data are imported into)-.1 F F1(mbna)2.735 E -.1(va)-.25 G(djust).1
 E F0 2.735(.H)C -.25(ow)-2.735 G -2.15 -.25(ev e).25 H 1.036 -.4(r, t)
 .25 H .236(hese settings mak).4 F 2.736(ei)-.1 G 2.736(tp)-2.736 G(os-)
--2.736 E .378(sible to deal with bias issues if the)108 278.4 R 2.878
+-2.736 E .378(sible to deal with bias issues if the)108 314.4 R 2.878
 (ya)-.15 G .378(re disco)-2.878 F -.15(ve)-.15 G .378(red during the na)
 .15 F(vig)-.2 E .378(ation adjustment process. This windo)-.05 F(w)-.25
-E .469(includes tw)108 290.4 R 2.969(ot)-.1 G .469(oggle b)-2.969 F .47
+E .469(includes tw)108 326.4 R 2.969(ot)-.1 G .469(oggle b)-2.969 F .47
 (uttons to set the bias mode, four slider widgets to set the bias param\
 eters, a b)-.2 F .47(utton to)-.2 F .658
-(apply the bias settings to all sw)108 302.4 R .658(ath \214les, a b)-.1
+(apply the bias settings to all sw)108 338.4 R .658(ath \214les, a b)-.1
 F .657(utton to apply the bias settings to the current sw)-.2 F .657
-(ath \214le, and a)-.1 F -.2(bu)108 314.4 S(tton to dismiss the windo).2
-E -.65(w.)-.25 G F1(Same Biases \(km\))108 343.2 Q F0 .628
-(This toggle b)144 355.2 R .629(utton sets the bias mode so that the he\
+(ath \214le, and a)-.1 F -.2(bu)108 350.4 S(tton to dismiss the windo).2
+E -.65(w.)-.25 G F1(Same Biases \(km\))108 379.2 Q F0 .628
+(This toggle b)144 391.2 R .629(utton sets the bias mode so that the he\
 ading and roll bias is identical for both sw)-.2 F(ath)-.1 E .3
-(data sections in the current crossing. The <Dif)144 367.2 R .3
+(data sections in the current crossing. The <Dif)144 403.2 R .3
 (ferent Biases> toggle is deselected when this toggle)-.25 F
-(is selected.)144 379.2 Q F1(Differ)108 396 Q(ent Biases \(km\))-.18 E
-F0 .114(This toggle b)144 408 R .114
+(is selected.)144 415.2 Q F1(Differ)108 432 Q(ent Biases \(km\))-.18 E
+F0 .114(This toggle b)144 444 R .114
 (utton sets the bias mode so that the heading and roll bias can be dif)
--.2 F .115(ferent between the)-.25 F(tw)144 420 Q 2.517(os)-.1 G -.1(wa)
+-.2 F .115(ferent between the)-.25 F(tw)144 456 Q 2.517(os)-.1 G -.1(wa)
 -2.517 G .017(th data sections in the current crossing.).1 F .016
 (The <Same Biases> toggle is deselected when this)5.017 F
-(toggle is selected.)144 432 Q F1
-(Section 1 Biases \(deg\) \255> Heading)108 448.8 Q F0
-(This slider widget sets the heading bias for sw)144 460.8 Q
+(toggle is selected.)144 468 Q F1
+(Section 1 Biases \(deg\) \255> Heading)108 484.8 Q F0
+(This slider widget sets the heading bias for sw)144 496.8 Q
 (ath section 1. The)-.1 E F1(Section 1 Biases \(deg\) \255> Roll)108
-477.6 Q F0(This slider widget sets the roll bias for sw)144 489.6 Q
+513.6 Q F0(This slider widget sets the roll bias for sw)144 525.6 Q
 (ath section 1.)-.1 E F1(Section 2 Biases \(deg\) \255> Heading)108
-506.4 Q F0(This slider widget sets the heading bias for sw)144 518.4 Q
-(ath section 2.)-.1 E F1(Section 2 Biases \(deg\) \255> Roll)108 535.2 Q
-F0(This slider widget sets the roll bias for sw)144 547.2 Q
-(ath section 2.)-.1 E F1 -.25(Ap)108 564 S(ply to All Files).25 E F0
-.257(This b)144 576 R .258
+542.4 Q F0(This slider widget sets the heading bias for sw)144 554.4 Q
+(ath section 2.)-.1 E F1(Section 2 Biases \(deg\) \255> Roll)108 571.2 Q
+F0(This slider widget sets the roll bias for sw)144 583.2 Q
+(ath section 2.)-.1 E F1 -.25(Ap)108 600 S(ply to All Files).25 E F0
+.257(This b)144 612 R .258
 (utton sets the current heading and roll bias v)-.2 F .258
 (alues as the bias v)-.25 F .258(alues for all sw)-.25 F .258
-(ath \214les in the)-.1 F F1(mbna)144 588 Q -.1(va)-.25 G(djust).1 E F0
+(ath \214les in the)-.1 F F1(mbna)144 624 Q -.1(va)-.25 G(djust).1 E F0
 2.5(project. This)2.5 F -.2(bu)2.5 G
 (tton is only enabled when the <Same Biases> toggle is selected.).2 E F1
--.25(Ap)108 604.8 S(ply).25 E F0 .103(This b)10.13 F .103
+-.25(Ap)108 640.8 S(ply).25 E F0 .103(This b)10.13 F .103
 (utton sets the current heading and roll bias v)-.2 F .103
 (alues as the bias v)-.25 F .102(alues for the sw)-.25 F .102
-(ath sections in)-.1 F 1.69(the current crossing. The bath)144 616.8 R
+(ath sections in)-.1 F 1.69(the current crossing. The bath)144 652.8 R
 1.691
 (ymetry contours and mis\214t plot are recalculated and redisplayed)-.05
-F(using the ne)144 628.8 Q 2.5(wb)-.25 G(ias v)-2.5 E(alues.)-.25 E F1
-(Dismiss)108 645.6 Q F0(This b)144 657.6 Q(utton closes the)-.2 E F1
-(Contr)2.5 E(ols W)-.18 E(indo)-.18 E(w)-.1 E F0(.)A/F2 10.95
-/Times-Bold at 0 SF(USING MBN)72 698.4 Q -1.04 -1.588(AV A)-.219 H
-(DJUST 1: IMPOR)1.588 E(TING D)-.438 E -1.644 -1.04(AT A)-.383 H F0
-(Users be)108 710.4 Q(gin using)-.15 E F1(mbna)2.5 E -.1(va)-.25 G
-(djust).1 E F0(by starting up the program on the command line:)2.5 E
-(mbna)144 722.4 Q -.25(va)-.2 G(djust).25 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(11)199.835 E 0 Cg EP
+F(using the ne)144 664.8 Q 2.5(wb)-.25 G(ias v)-2.5 E(alues.)-.25 E F1
+(Dismiss)108 681.6 Q F0(This b)144 693.6 Q(utton closes the)-.2 E F1
+(Contr)2.5 E(ols W)-.18 E(indo)-.18 E(w)-.1 E F0(.)A(MB-System 5.0)72
+768 Q(22 April 2015)142.605 E(11)195.945 E 0 Cg EP
 %%Page: 12 12
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .402
-(In order to get started, one must either open an e)108 84 R(xisting)
--.15 E/F1 10/Times-Bold at 0 SF(mbna)2.902 E -.1(va)-.25 G(djust).1 E F0
-.402(project or initialize a ne)2.902 F 2.902(wo)-.25 G .402(ne. Both)
--2.902 F .102(options are a)108 96 R -.25(va)-.2 G .103
+(djust\(1\)).25 E/F1 10.95/Times-Bold at 0 SF(USING MBN)72 84 Q -1.04
+-1.588(AV A)-.219 H(DJUST 1: IMPOR)1.588 E(TING D)-.438 E -1.644 -1.04
+(AT A)-.383 H F0(Users be)108 96 Q(gin using)-.15 E/F2 10/Times-Bold at 0
+SF(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0
+(by starting up the program on the command line:)2.5 E(mbna)144 108 Q
+-.25(va)-.2 G(djust).25 E .402
+(In order to get started, one must either open an e)108 120 R(xisting)
+-.15 E F2(mbna)2.902 E -.1(va)-.25 G(djust).1 E F0 .402
+(project or initialize a ne)2.902 F 2.902(wo)-.25 G .402(ne. Both)-2.902
+F .102(options are a)108 132 R -.25(va)-.2 G .103
 (ilable under the <File> menu with the <File->Ne).25 F .103
 (w> and <File->Open> menu b)-.25 F .103(uttons. When)-.2 F .052
-(one pulls do)108 108 R .052(wn the <File->Ne)-.25 F .052
+(one pulls do)108 144 R .052(wn the <File->Ne)-.25 F .052
 (w> option, a dialog opens that allo)-.25 F .052(ws na)-.25 F(vig)-.2 E
 .052(ation of the \214lesystem and speci\214-)-.05 F 7.563
-(cation of a project name. Whate)108 120 R -.15(ve)-.25 G 10.063(rp).15
+(cation of a project name. Whate)108 156 R -.15(ve)-.25 G 10.063(rp).15
 G 7.563(roject location and name is chosen, a directory)-10.063 F .38("\
 {project_path}/{project_name}.dir" and a \214le "{project_path}/{projec\
-t_name}.n)108 132 R .38(vh" will be created. Once)-.4 F 3.3(ap)108 144 S
+t_name}.n)108 168 R .38(vh" will be created. Once)-.4 F 3.3(ap)108 180 S
 .8(roject e)-3.3 F .8(xists and has been opened, sw)-.15 F .8
 (ath data can be imported and then analyzed. T)-.1 F 3.3(oo)-.8 G .8
-(pen an e)-3.3 F(xisting)-.15 E F1(mbna)108 156 Q -.1(va)-.25 G(djust).1
+(pen an e)-3.3 F(xisting)-.15 E F2(mbna)108 192 Q -.1(va)-.25 G(djust).1
 E F0(project, click the <File->Open> option and select the correspondin\
-g "*.n)2.5 E(vh" \214le.)-.4 E .122(The main)108 180 R F1(mbna)2.622 E
+g "*.n)2.5 E(vh" \214le.)-.4 E .122(The main)108 216 R F2(mbna)2.622 E
 -.1(va)-.25 G(djust).1 E F0(windo)2.622 E 2.622(wd)-.25 G .122(isplays \
 basic information in a set of labels in the upper left, including the)
 -2.622 F .736(open project name, the number of \214les imported, the nu\
-mber of crossings found, the number of crossings)108 192 R .634
-(analyzed, the number of na)108 204 R(vig)-.2 E .634
+mber of crossings found, the number of crossings)108 228 R .634
+(analyzed, the number of na)108 240 R(vig)-.2 E .634
 (ation tie points set, and whether an up-to-date in)-.05 F -.15(ve)-.4 G
 .634(rsion for optimal na).15 F(vig)-.2 E(a-)-.05 E .269
-(tion has been performed. A scrollable te)108 216 R .269(xt windo)-.15 F
+(tion has been performed. A scrollable te)108 252 R .269(xt windo)-.15 F
 2.769(wi)-.25 G 2.769(nt)-2.769 G .269(he lo)-2.769 F .27
 (wer left displays messages re)-.25 F -.05(ga)-.15 G .27
 (rding all actions).05 F .451(performed by the program during the curre\
-nt session. Another scrollable windo)108 228 R 2.95(wo)-.25 G 2.95(nt)
+nt session. Another scrollable windo)108 264 R 2.95(wo)-.25 G 2.95(nt)
 -2.95 G .45(he right displays one)-2.95 F .72
 (of three tables of information according a user selection under the <V)
-108 240 R(ie)-.6 E .72(w> menu. The three choices are a)-.25 F .02
-(table of the imported sw)108 252 R .02(ath \214les, a table of the sw)
+108 276 R(ie)-.6 E .72(w> menu. The three choices are a)-.25 F .02
+(table of the imported sw)108 288 R .02(ath \214les, a table of the sw)
 -.1 F .019(ath crossings, and a table of the interacti)-.1 F -.15(ve)
--.25 G .019(ly de\214ned na).15 F(vi-)-.2 E -.05(ga)108 264 S .03
+-.25 G .019(ly de\214ned na).15 F(vi-)-.2 E -.05(ga)108 300 S .03
 (tion tie points. If no sw).05 F .03(ath data has yet been imported, th\
 en the all of the tables will be empty)-.1 F 2.53(.O)-.65 G .03
-(nce some)-2.53 F .464(data \214les are imported, the sw)108 276 R .463
+(nce some)-2.53 F .464(data \214les are imported, the sw)108 312 R .463
 (ath \214le table will ha)-.1 F .763 -.15(ve e)-.2 H .463
 (ntries and some number of crossings will be de\214ned).15 F
-(\(assuming that sw)108 288 Q(aths do o)-.1 E -.15(ve)-.15 G
+(\(assuming that sw)108 324 Q(aths do o)-.1 E -.15(ve)-.15 G
 (rlap and cross\), b).15 E(ut no tie points will yet be de\214ned.)-.2 E
-1.542(In order to import sw)108 312 R 1.542(ath data into an)-.1 F F1
+1.542(In order to import sw)108 348 R 1.542(ath data into an)-.1 F F2
 (mbna)4.042 E -.1(va)-.25 G(djust).1 E F0 1.542(project, pull do)4.042 F
 1.542(wn the <File->Import Sw)-.25 F 1.542(ath Data>)-.1 F .459
-(menu item. A \214le selection dialog will appear)108 324 R 2.958(.S)
+(menu item. A \214le selection dialog will appear)108 360 R 2.958(.S)
 -.55 G -.1(wa)-2.958 G .458
 (th data can be imported in single \214les or through datal-).1 F .758
-(ists \(see the)108 336 R F1(MB-System)3.258 E F0 .758
+(ists \(see the)108 372 R F2(MB-System)3.258 E F0 .758
 (manual page for a description of recursi)3.258 F 1.058 -.15(ve d)-.25 H
-.758(atalists\). As with other).15 F F1(MB-System)3.258 E F0 1.015(prog\
+.758(atalists\). As with other).15 F F2(MB-System)3.258 E F0 1.015(prog\
 rams, the format id will be automatically determined if possible for ea\
-ch \214le selected.)108 348 R 1.015(If a \214lename)6.015 F .204
-(does not follo)108 360 R 2.704(wt)-.25 G .204(he the)-2.704 F F1
+ch \214le selected.)108 384 R 1.015(If a \214lename)6.015 F .204
+(does not follo)108 396 R 2.704(wt)-.25 G .204(he the)-2.704 F F2
 (MB-System)2.704 E F0 .204(naming con)2.704 F -.15(ve)-.4 G .205
 (ntion, the user may need to manually set the format id in).15 F
-(the appropriately labeled dialog te)108 372 Q(xt widget.)-.15 E .99
-(Each \214le that is imported is brok)108 396 R .989
+(the appropriately labeled dialog te)108 408 Q(xt widget.)-.15 E .99
+(Each \214le that is imported is brok)108 432 R .989
 (en into a number of sections. The maximum size of the sections in line)
 -.1 F .386(length or in number of soundings is set in a dialog opened b\
-y clicking on <Option->Controls>. Na)108 408 R(vig)-.2 E(ation)-.05 E
-1.256(control points are selected at re)108 420 R 1.255(gular interv)
+y clicking on <Option->Controls>. Na)108 444 R(vig)-.2 E(ation)-.05 E
+1.256(control points are selected at re)108 456 R 1.255(gular interv)
 -.15 F 1.255(als within each section. The control point distance interv)
--.25 F 1.255(al is)-.25 F 2.932(approximately one)108 432 R .432
+-.25 F 1.255(al is)-.25 F 2.932(approximately one)108 468 R .432
 (tenth of the speci\214ed se)2.932 F .432
 (gment length, so there are up to 11 control points for each sec-)-.15 F
 .082(tion. The data for each section is written as a format 71 bath)108
-444 R .081(ymetry-only \214le in the "*.dir" directory)-.05 F 5.081(.A)
+480 R .081(ymetry-only \214le in the "*.dir" directory)-.05 F 5.081(.A)
 -.65 G 2.581(st)-5.081 G(he)-2.581 E .78
-(\214les are imported, the areal e)108 456 R .781
+(\214les are imported, the areal e)108 492 R .781
 (xtent of each section is compared to the other sections. An)-.15 F
-3.281(yp)-.15 G .781(air of sections)-3.281 F 1.573(that o)108 468 R
+3.281(yp)-.15 G .781(air of sections)-3.281 F 1.573(that o)108 504 R
 -.15(ve)-.15 G 1.573(rlap is added to a list of crossings to be in).15 F
 -.15(ve)-.4 G(stig).15 E 1.573(ated graphically)-.05 F 4.073(.T)-.65 G
-1.572(his list can be displayed by)-4.073 F(pulling do)108 480 Q
+1.572(his list can be displayed by)-4.073 F(pulling do)108 516 Q
 (wn the <V)-.25 E(ie)-.6 E(w->Sho)-.25 E 2.5(wC)-.25 G
-(rossings> menu item.)-2.5 E .143(As the user later w)108 504 R .143(or\
+(rossings> menu item.)-2.5 E .143(As the user later w)108 540 R .143(or\
 ks through the crossings, he or she will will de\214ne tie points whene)
 -.1 F -.15(ve)-.25 G 2.644(rt).15 G .144(he o)-2.644 F -.15(ve)-.15 G
-(rlapping).15 E(bath)108 516 Q .301(ymetry allo)-.05 F .301(ws the na)
+(rlapping).15 E(bath)108 552 Q .301(ymetry allo)-.05 F .301(ws the na)
 -.25 F(vig)-.2 E .301(ational of)-.05 F .301(fset to be determined reli\
 ably in three dimensions. Each tie point will)-.25 F 1.674(reference tw)
-108 528 R 4.174(oo)-.1 G 4.174(ft)-4.174 G 1.674(he na)-4.174 F(vig)-.2
+108 564 R 4.174(oo)-.1 G 4.174(ft)-4.174 G 1.674(he na)-4.174 F(vig)-.2
 E 1.674(ation control points, one from each sw)-.05 F 1.674
 (ath in the crossing.)-.1 F(Ultimately)6.674 E 4.174(,s)-.65 G(ome)
--4.174 E .124(crossings will allo)108 540 R 2.624(wo)-.25 G .123(ne, or\
+-4.174 E .124(crossings will allo)108 576 R 2.624(wo)-.25 G .123(ne, or\
  in some case multiple tie points to be de\214ned. Other crossings will\
  still ha)-2.624 F .423 -.15(ve n)-.2 H(o).15 E .612
-(tie points, either because the sw)108 552 R .612(aths don')-.1 F 3.112
+(tie points, either because the sw)108 588 R .612(aths don')-.1 F 3.112
 (tr)-.18 G .612(eally o)-3.112 F -.15(ve)-.15 G .613
 (rlap or because there aren').15 F 3.113(ta)-.18 G .913 -.15(ny d)-3.113
 H(istincti).15 E .913 -.15(ve f)-.25 H .613(eatures to).15 F 1.083
-(match. When all of the crossings ha)108 564 R 1.382 -.15(ve b)-.2 H
+(match. When all of the crossings ha)108 600 R 1.382 -.15(ve b)-.2 H
 1.082(een inspected, then the user can in).15 F -.2(vo)-.4 G 1.282 -.1
 (ke i).2 H -1.85 -.4(nv e).1 H 1.082(rsion for an optimal).4 F(na)108
-576 Q(vig)-.2 E .438(ation solution.)-.05 F .439
+612 Q(vig)-.2 E .438(ation solution.)-.05 F .439
 (In cases where the data are kno)5.438 F .439
 (wn to be already corrected for v)-.25 F .439(ertical of)-.15 F .439
 (fsets, such as)-.25 F(tides, then the user can uniformly set the v)108
-588 Q(ertical \(z\) components of of)-.15 E(fsets to zero.)-.25 E/F2
-10.95/Times-Bold at 0 SF(USING MBN)72 616.8 Q -1.04 -1.588(AV A)-.219 H
-(DJUST 2: INSPECTING CR)1.588 E(OSSINGS)-.329 E F1(Bringing Up The Na)87
-628.8 Q 2.5(vE)-.25 G(rr)-2.5 E(or W)-.18 E(indo)-.18 E(w)-.1 E F0 .4
-(The heart of)108 640.8 R F1(mbna)2.9 E -.1(va)-.25 G(djust).1 E F0 .4
-(is the interacti)2.9 F .7 -.15(ve i)-.25 H .4(nspection of the sw).15 F
-.4(ath crossings. One can bring up the cross-)-.1 F 1.452
-(ing inspection windo)108 652.8 R 3.952(w\()-.25 G 1.452(entitled "Na)
+624 Q(ertical \(z\) components of of)-.15 E(fsets to zero.)-.25 E F1
+(USING MBN)72 652.8 Q -1.04 -1.588(AV A)-.219 H(DJUST 2: INSPECTING CR)
+1.588 E(OSSINGS)-.329 E F2(Bringing Up The Na)87 664.8 Q 2.5(vE)-.25 G
+(rr)-2.5 E(or W)-.18 E(indo)-.18 E(w)-.1 E F0 .4(The heart of)108 676.8
+R F2(mbna)2.9 E -.1(va)-.25 G(djust).1 E F0 .4(is the interacti)2.9 F .7
+-.15(ve i)-.25 H .4(nspection of the sw).15 F .4
+(ath crossings. One can bring up the cross-)-.1 F 1.452
+(ing inspection windo)108 688.8 R 3.952(w\()-.25 G 1.452(entitled "Na)
 -3.952 F 3.952(vE)-.2 G 1.452(rror"\) in a number of w)-3.952 F 1.453
 (ays. If one pulls do)-.1 F 1.453(wn the menu option)-.25 F .848
-(<Action->Analyze Crossings>, then the "Na)108 664.8 R 3.347(vE)-.2 G
+(<Action->Analyze Crossings>, then the "Na)108 700.8 R 3.347(vE)-.2 G
 .847(rror" windo)-3.347 F 3.347(ww)-.25 G .847
 (ill come up with the \214rst crossing loaded.)-3.347 F(Alternati)108
-676.8 Q -.15(ve)-.25 G(ly).15 E 3.25(,i)-.65 G 3.25(ft)-3.25 G .75
+712.8 Q -.15(ve)-.25 G(ly).15 E 3.25(,i)-.65 G 3.25(ft)-3.25 G .75
 (he <V)-3.25 F(ie)-.6 E(w->Sho)-.25 E 3.25(wC)-.25 G .75
 (rossings> menu item has been selected so that a table of crossings is)
--3.25 F .805(displayed, clicking once on an)108 688.8 R 3.305(yo)-.15 G
+-3.25 F .805(displayed, clicking once on an)108 724.8 R 3.305(yo)-.15 G
 3.305(ft)-3.305 G .804
 (he crossing items in this tabel will bring up the)-3.305 F("Na)5.804 E
-3.304(vE)-.2 G .804(rror" windo)-3.304 F(w)-.25 E .308
-(with that crossing loaded.)108 700.8 R(Similarly)5.309 E 2.809(,i)-.65
-G 2.809(ft)-2.809 G .309(ie points ha)-2.809 F .609 -.15(ve b)-.2 H .309
-(een established and the tie point table displayed by).15 F .543
-(selecting the <V)108 712.8 R(ie)-.6 E(w->Sho)-.25 E 3.043(wT)-.25 G
-.542(ies> menu item, then clicking on an)-3.393 F 3.042(yo)-.15 G 3.042
-(ft)-3.042 G .542(he tie items this table will bring up)-3.042 F 1.88
-(the "Na)108 724.8 R 4.38(vE)-.2 G 1.88(rror" windo)-4.38 F 4.38(wa)-.25
-G 1.88
-(nd load the crossing that includes the selected tie point. If the "Na)
--4.38 F 4.38(vE)-.2 G(rror")-4.38 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(12)199.835 E 0 Cg EP
+3.304(vE)-.2 G .804(rror" windo)-3.304 F(w)-.25 E(MB-System 5.0)72 768 Q
+(22 April 2015)142.605 E(12)195.945 E 0 Cg EP
 %%Page: 13 13
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E(windo)108 84 Q 3.419(wi)-.25 G 3.419(sa)-3.419 G .919
-(lready displayed, clicking on crossing or tie items in the display tab\
-les will load the selected)-3.419 F(crossing in place of whate)108 96 Q
--.15(ve)-.25 G 2.5(rc).15 G(rossing w)-2.5 E(as pre)-.1 E(viously sho)
--.25 E(wn.)-.25 E .613(Once the "Na)108 120 R 3.113(vE)-.2 G .613
-(rr" windo)-3.113 F 3.113(wi)-.25 G 3.113(sd)-3.113 G .613
-(isplayed, the user can also mo)-3.113 F .913 -.15(ve t)-.15 H .614
-(hrough the crossings by clicking on the).15 F(<Pre)108 132 Q .02
-(vious>, <Ne)-.25 F .02(xt>, and <Ne)-.15 F .02(xt Unset> b)-.15 F .02
-(uttons. The <Pre)-.2 F .02(vious> and <Ne)-.25 F .02(xt> b)-.15 F .02
-(uttons will load the pre)-.2 F(vious)-.25 E .998(or ne)108 144 R .998
-(xt, respecti)-.15 F -.15(ve)-.25 G(ly).15 E 3.498(,c)-.65 G .998
+(djust\(1\)).25 E .308(with that crossing loaded.)108 84 R(Similarly)
+5.309 E 2.809(,i)-.65 G 2.809(ft)-2.809 G .309(ie points ha)-2.809 F
+.609 -.15(ve b)-.2 H .309
+(een established and the tie point table displayed by).15 F .543
+(selecting the <V)108 96 R(ie)-.6 E(w->Sho)-.25 E 3.043(wT)-.25 G .542
+(ies> menu item, then clicking on an)-3.393 F 3.042(yo)-.15 G 3.042(ft)
+-3.042 G .542(he tie items this table will bring up)-3.042 F .618
+(the "Na)108 108 R 3.118(vE)-.2 G .618(rror" windo)-3.118 F 3.118(wa)
+-.25 G .618
+(nd load the crossing that includes the selected tie point. If the "Na)
+-3.118 F 3.119(vE)-.2 G .619(rror" win-)-3.119 F(do)108 120 Q 2.736(wi)
+-.25 G 2.736(sa)-2.736 G .236(lready displayed, clicking on crossing or\
+ tie items in the display tables will load the selected cross-)-2.736 F
+(ing in place of whate)108 132 Q -.15(ve)-.25 G 2.5(rc).15 G(rossing w)
+-2.5 E(as pre)-.1 E(viously sho)-.25 E(wn.)-.25 E .613(Once the "Na)108
+156 R 3.113(vE)-.2 G .613(rr" windo)-3.113 F 3.113(wi)-.25 G 3.113(sd)
+-3.113 G .613(isplayed, the user can also mo)-3.113 F .913 -.15(ve t)
+-.15 H .614(hrough the crossings by clicking on the).15 F(<Pre)108 168 Q
+.02(vious>, <Ne)-.25 F .02(xt>, and <Ne)-.15 F .02(xt Unset> b)-.15 F
+.02(uttons. The <Pre)-.2 F .02(vious> and <Ne)-.25 F .02(xt> b)-.15 F
+.02(uttons will load the pre)-.2 F(vious)-.25 E .998(or ne)108 180 R
+.998(xt, respecti)-.15 F -.15(ve)-.25 G(ly).15 E 3.498(,c)-.65 G .998
 (rossings in the crossing list. As discussed belo)-3.498 F 2.298 -.65
-(w, e)-.25 H .998(ach crossing must ultimately be).65 F("resolv)108 156
+(w, e)-.25 H .998(ach crossing must ultimately be).65 F("resolv)108 192
 Q 2.27(ed" by either ha)-.15 F 2.27(ving one or more na)-.2 F(vig)-.2 E
 2.269(ation of)-.05 F 2.269
 (fsets set at particular "tie points", or by being)-.25 F .95
 ("skipped" because no matchable sea\215oor features are found. The <Ne)
-108 168 R .95(xt Unset> b)-.15 F .95(utton will load the ne)-.2 F(xt)
--.15 E(crossing that has not been resolv)108 180 Q 2.5(ed. T)-.15 F 2.5
+108 204 R .95(xt Unset> b)-.15 F .95(utton will load the ne)-.2 F(xt)
+-.15 E(crossing that has not been resolv)108 216 Q 2.5(ed. T)-.15 F 2.5
 (oc)-.8 G(lose the "Na)-2.5 E 2.5(vE)-.2 G(rr" windo)-2.5 E 1.3 -.65
 (w, c)-.25 H(lick the <Dismiss> b).65 E(utton.)-.2 E/F1 10/Times-Bold at 0
-SF(Interacti)87 208.8 Q -.1(ve)-.1 G(ly Matching Sea\215oor F).1 E
-(eatur)-.25 E(es)-.18 E F0 .622(The "Na)108 220.8 R 3.122(vE)-.2 G .622
+SF(Interacti)87 244.8 Q -.1(ve)-.1 G(ly Matching Sea\215oor F).1 E
+(eatur)-.25 E(es)-.18 E F0 .622(The "Na)108 256.8 R 3.122(vE)-.2 G .622
 (rror" windo)-3.122 F 3.122(wi)-.25 G 3.122(sc)-3.122 G .621
 (omplicated in appearance, and re)-3.122 F .621
 (grettably complicated in function also.)-.15 F(The)5.621 E .185
-(purpose is to allo)108 232.8 R 2.685(wt)-.25 G .185
+(purpose is to allo)108 268.8 R 2.685(wt)-.25 G .185
 (he user to determine if an)-2.685 F 2.686(ys)-.15 G .186
 (ea\215oor features can be con\214dently matched in the o)-2.686 F -.15
-(ve)-.15 G(rlap-).15 E .151(ping sw)108 244.8 R .15(aths. If so, one or\
+(ve)-.15 G(rlap-).15 E .151(ping sw)108 280.8 R .15(aths. If so, one or\
  more tie points can be de\214ned. In order to ease the identi\214catio\
-n of matching fea-)-.1 F .262(tures, tw)108 256.8 R 2.762(os)-.1 G .262
+n of matching fea-)-.1 F .262(tures, tw)108 292.8 R 2.762(os)-.1 G .262
 (imultaneous displays are pro)-2.762 F 2.763(vided. The)-.15 F(lar)2.763
 E .263(ger plot on the right consists of o)-.18 F -.15(ve)-.15 G .263
-(rlain bath).15 F(ymetric)-.05 E 1.115(contours deri)108 268.8 R -.15
+(rlain bath).15 F(ymetric)-.05 E 1.115(contours deri)108 304.8 R -.15
 (ve)-.25 G 3.615(df).15 G 1.115(rom each of the tw)-3.615 F 3.615(os)-.1
 G -.1(wa)-3.615 G 1.115(ths. The smaller can).1 F -.25(va)-.4 G 3.615
 (so).25 G 3.615(nt)-3.615 G 1.115(he left sho)-3.615 F 1.115
 (ws a color tw)-.25 F 3.615(od)-.1 G(imen-)-3.615 E .56
-(sional plot of the RMS mis\214t between the tw)108 280.8 R 3.06(os)-.1
+(sional plot of the RMS mis\214t between the tw)108 316.8 R 3.06(os)-.1
 G -.1(wa)-3.06 G .561(ths. The mis\214t is sho).1 F .561
 (wn as a function of relati)-.25 F .861 -.15(ve l)-.25 H(ateral).15 E
-(of)108 292.8 Q 2.131(fsets between the tw)-.25 F 4.631(os)-.1 G -.1(wa)
+(of)108 328.8 Q 2.131(fsets between the tw)-.25 F 4.631(os)-.1 G -.1(wa)
 -4.631 G 2.131(ths. Put another w).1 F(ay)-.1 E 4.631(,t)-.65 G 2.131
 (he mis\214t plot sho)-4.631 F 2.13(ws ho)-.25 F 4.63(wg)-.25 G 2.13
-(ood, or bad, the mis\214t)-4.63 F .123(becomes as one mo)108 304.8 R
+(ood, or bad, the mis\214t)-4.63 F .123(becomes as one mo)108 340.8 R
 -.15(ve)-.15 G 2.623(so).15 G .123(ne sw)-2.623 F .123(ath relati)-.1 F
 .423 -.15(ve t)-.25 H 2.623(oa).15 G(nother)-2.623 E 2.623(.T)-.55 G
 .123(he lo)-2.623 F .123(west mis\214t v)-.25 F .124(alues are sho)-.25
-F .124(wn in red; higher mis-)-.25 F .205(\214ts are sho)108 316.8 R
+F .124(wn in red; higher mis-)-.25 F .205(\214ts are sho)108 352.8 R
 .205(wn in blues to purples. The location of the global \(three dimensi\
 onal\) minimum mis\214t is mark)-.25 F(ed)-.1 E .345(by the lar)108
-328.8 R .345
+364.8 R .345
 (ge black "X", the location of the minimum mis\214t using the current v)
 -.18 F .345(ertical of)-.15 F .345(fset v)-.25 F .345(alue is mark)-.25
 F(ed)-.1 E .195
-(by a small black "x", and the location of the current na)108 340.8 R
+(by a small black "x", and the location of the current na)108 376.8 R
 (vig)-.2 E .195(ation of)-.05 F .195(fset is sho)-.25 F .195
-(wn by a small red square with a)-.25 F(black outline.)108 352.8 Q .528
-(The interacti)108 376.8 R .828 -.15(ve a)-.25 H .528(spect of the "Na)
+(wn by a small red square with a)-.25 F(black outline.)108 388.8 Q .528
+(The interacti)108 412.8 R .828 -.15(ve a)-.25 H .528(spect of the "Na)
 .15 F 3.029(vE)-.2 G .529(rror" windo)-3.029 F 3.029(ww)-.25 G .529
 (orks simultaneously in both displays. If the user holds)-3.129 F(do)108
-388.8 Q 1.106(wn the left mouse b)-.25 F 1.106
+424.8 Q 1.106(wn the left mouse b)-.25 F 1.106
 (utton in the contour plot and mo)-.2 F -.15(ve)-.15 G 3.606(st).15 G
 1.106(he cursor)-3.606 F 3.606(,t)-.4 G 1.106(he bath)-3.606 F 1.105
-(ymetry contours from one)-.05 F(sw)108 400.8 Q .45(ath will mo)-.1 F
+(ymetry contours from one)-.05 F(sw)108 436.8 Q .45(ath will mo)-.1 F
 .75 -.15(ve a)-.15 H .45(long with the cursor).15 F 2.95(.I)-.55 G 2.95
 (nt)-2.95 G .45(his w)-2.95 F(ay)-.1 E 2.95(,t)-.65 G .451
 (he user can mo)-2.95 F .751 -.15(ve o)-.15 H .451(ne of the sw).15 F
 .451(aths around relati)-.1 F .751 -.15(ve t)-.25 H(o).15 E .67(the oth\
 er until the contours line up and features match. As the contours mo)108
-412.8 R -.15(ve)-.15 G 3.17(,t).15 G .67(he red square sho)-3.17 F .67
-(wing the)-.25 F .283(current of)108 424.8 R .283(fset location also mo)
+448.8 R -.15(ve)-.15 G 3.17(,t).15 G .67(he red square sho)-3.17 F .67
+(wing the)-.25 F .283(current of)108 460.8 R .283(fset location also mo)
 -.25 F -.15(ve)-.15 G 2.783(so).15 G 2.783(nt)-2.783 G .284(he mis\214t\
  plot. The user can thus visually relate the contour matching)-2.783 F
-.933(to the mis\214t function. The combination of these tw)108 436.8 R
+.933(to the mis\214t function. The combination of these tw)108 472.8 R
 3.432(od)-.1 G .932(isplays greatly impro)-3.432 F -.15(ve)-.15 G 3.432
 (sau).15 G(ser')-3.432 E 3.432(sa)-.55 G .932(bility to reliably)-3.432
-F(determine na)108 448.8 Q(vig)-.2 E(ational of)-.05 E
+F(determine na)108 484.8 Q(vig)-.2 E(ational of)-.05 E
 (fsets \(and to conclude where na)-.25 E(vig)-.2 E(ational of)-.05 E
-(fsets cannot be determined\).)-.25 E .03(The "Na)108 472.8 R 2.53(vE)
+(fsets cannot be determined\).)-.25 E .03(The "Na)108 508.8 R 2.53(vE)
 -.2 G .03(rr" windo)-2.53 F 2.53(wi)-.25 G .03(ncludes tw)-2.53 F 2.53
 (ob)-.1 G .03(uttons that are particularly useful during ef)-2.73 F .03
 (forts to match sea\215oor fea-)-.25 F 1.027
-(tures. The <Minimum Mis\214t> b)108 484.8 R 1.027(utton belo)-.2 F
+(tures. The <Minimum Mis\214t> b)108 520.8 R 1.027(utton belo)-.2 F
 3.527(wt)-.25 G 1.027(he mis\214t display will cause)-3.527 F F1(mbna)
 3.526 E -.1(va)-.25 G(djust).1 E F0 1.026(to set the current)3.526 F(na)
-108 496.8 Q(vig)-.2 E .956(ational of)-.05 F .956(fset to that associat\
+108 532.8 Q(vig)-.2 E .956(ational of)-.05 F .956(fset to that associat\
 ed with the smallest mis\214t for the current mis\214t display)-.25 F
 3.457(.T)-.65 G .957(his b)-3.457 F .957(utton is)-.2 F .839
-(often used \214rst to get close to the right of)108 508.8 R 3.339
+(often used \214rst to get close to the right of)108 544.8 R 3.339
 (fsets. The)-.25 F .839(<Zero Of)3.339 F .839(fset> b)-.25 F .839
 (utton abo)-.2 F 1.139 -.15(ve t)-.15 H .838(he contour display will).15
-F(return both displays to a state of zero na)108 520.8 Q(vig)-.2 E
+F(return both displays to a state of zero na)108 556.8 Q(vig)-.2 E
 (ational of)-.05 E(fset.)-.25 E .773
-(The relationship between the contoured bath)108 544.8 R .773
+(The relationship between the contoured bath)108 580.8 R .773
 (ymetry and the mis\214t plot is usually quite clear)-.05 F 3.273(.I)
 -.55 G 3.274(fas)-3.273 G(trongly)-3.274 E .024
-(matching sea\215oor feature e)108 556.8 R .024
+(matching sea\215oor feature e)108 592.8 R .024
 (xists, then a distinct minimum will sho)-.15 F 2.524(wu)-.25 G 2.524
 (pi)-2.524 G 2.524(nt)-2.524 G .024(he mis\214t plot. If the na)-2.524 F
 (vig)-.2 E .023(ation is)-.05 F .105(good and the feature already match\
 es, then the mis\214t minimum will be located at the center of the plot\
-, cor)108 568.8 R(-)-.2 E .446(responding to an of)108 580.8 R .445(fse\
+, cor)108 604.8 R(-)-.2 E .446(responding to an of)108 616.8 R .445(fse\
 t that is zero distance in both the east-west and north-south direction\
 s. If the na)-.25 F(vig)-.2 E(a-)-.05 E .36
-(tion is bad, then the mis\214t minimum will be of)108 592.8 R .36
+(tion is bad, then the mis\214t minimum will be of)108 628.8 R .36
 (fset from the origin, and the of)-.25 F .36(fset v)-.25 F .36
-(ector will correspond to)-.15 F(ho)108 604.8 Q 3.385(wf)-.25 G .885
+(ector will correspond to)-.15 F(ho)108 640.8 Q 3.385(wf)-.25 G .885
 (ar and what direction one must mo)-3.485 F 1.185 -.15(ve o)-.15 H .885
 (ne sw).15 F .885(ath so that the features in both sw)-.1 F .884
-(aths match. In cases)-.1 F .991(where there is no distincti)108 616.8 R
+(aths match. In cases)-.1 F .991(where there is no distincti)108 652.8 R
 1.292 -.15(ve s)-.25 H .992(ea\215oor feature to match, the mis\214t pl\
 ot will not display a strong minimum).15 F .406
-(and it will be impossible to determine the relati)108 628.8 R .706 -.15
+(and it will be impossible to determine the relati)108 664.8 R .706 -.15
 (ve n)-.25 H -.2(av).15 G(ig).2 E .406(ational of)-.05 F .406
 (fset. Alternati)-.25 F -.15(ve)-.25 G(ly).15 E 2.906(,t)-.65 G .406
 (he e)-2.906 F .406(xistence of multi-)-.15 F 2.071(ple similar feature\
 s can produce multiple local minima in the mis\214t map. In this case, \
-the ambiguity)108 640.8 R 1(between multiple possible solutions pre)108
-652.8 R -.15(ve)-.25 G .999(nts the determination of the na).15 F(vig)
+the ambiguity)108 676.8 R 1(between multiple possible solutions pre)108
+688.8 R -.15(ve)-.25 G .999(nts the determination of the na).15 F(vig)
 -.2 E .999(ational of)-.05 F .999(fset. W)-.25 F 3.499(eh)-.8 G -2.25
 -.2(av e)-3.499 H(found)3.699 E .805
-(that combining both contour and mis\214t displays allo)108 664.8 R .805
+(that combining both contour and mis\214t displays allo)108 700.8 R .805
 (ws interacti)-.25 F -.15(ve)-.25 G 3.305(,v).15 G .805
 (isually based decision making that is)-3.305 F
-(more generally reliable than an)108 676.8 Q 2.5(ya)-.15 G
-(utomated scheme we can de)-2.5 E(vise.)-.25 E(Na)108 700.8 Q(vig)-.2 E
-1.516(ational of)-.05 F 1.516(fsets can only be used when the)-.25 F
-4.016(ya)-.15 G 1.516(re associated with speci\214c points on the o)
--4.016 F -.15(ve)-.15 G(rlapping).15 E(sw)108 712.8 Q .142(ath na)-.1 F
-(vig)-.2 E .142(ation. These points are called "tie points".)-.05 F .142
-(All crossings will be)5.142 F .143(gin with no tie points, and users)
--.15 F 1.456(can generate one or more tie points for an)108 724.8 R
-3.955(yc)-.15 G 1.455(rossing as required.)-3.955 F 1.455
-(The creation and manipulation of tie)6.455 F(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(13)199.835 E 0 Cg EP
+(more generally reliable than an)108 712.8 Q 2.5(ya)-.15 G
+(utomated scheme we can de)-2.5 E(vise.)-.25 E(MB-System 5.0)72 768 Q
+(22 April 2015)142.605 E(13)195.945 E 0 Cg EP
 %%Page: 14 14
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E(points is discussed in detail in a later section.)108
-84 Q 1.288(It is also important to understand that an)108 108 R 3.789
-(ya)-.15 G 1.289(pparent na)-3.789 F(vig)-.2 E 1.289(ation of)-.05 F
-1.289(fset observ)-.25 F 1.289(ed in the contour and mis\214t)-.15 F
-.522(plots is relati)108 120 R -.15(ve)-.25 G 3.022(.I).15 G 3.022(tm)
--3.022 G .522(ay turn out that both sw)-3.022 F .521(aths are poorly na)
--.1 F(vig)-.2 E .521(ated and ha)-.05 F .821 -.15(ve t)-.2 H 3.021(ob)
-.15 G 3.021(em)-3.021 G -.15(ove)-3.021 G .521(d, or that all of).15 F
-.371(the of)108 132 R .371(fset can be applied to one sw)-.25 F .371
+(djust\(1\)).25 E(Na)108 84 Q(vig)-.2 E 1.516(ational of)-.05 F 1.516
+(fsets can only be used when the)-.25 F 4.016(ya)-.15 G 1.516
+(re associated with speci\214c points on the o)-4.016 F -.15(ve)-.15 G
+(rlapping).15 E(sw)108 96 Q .142(ath na)-.1 F(vig)-.2 E .142
+(ation. These points are called "tie points".)-.05 F .142
+(All crossings will be)5.142 F .143(gin with no tie points, and users)
+-.15 F 1.456(can generate one or more tie points for an)108 108 R 3.955
+(yc)-.15 G 1.455(rossing as required.)-3.955 F 1.455
+(The creation and manipulation of tie)6.455 F
+(points is discussed in detail in a later section.)108 120 Q 1.288
+(It is also important to understand that an)108 144 R 3.789(ya)-.15 G
+1.289(pparent na)-3.789 F(vig)-.2 E 1.289(ation of)-.05 F 1.289
+(fset observ)-.25 F 1.289(ed in the contour and mis\214t)-.15 F .522
+(plots is relati)108 156 R -.15(ve)-.25 G 3.022(.I).15 G 3.022(tm)-3.022
+G .522(ay turn out that both sw)-3.022 F .521(aths are poorly na)-.1 F
+(vig)-.2 E .521(ated and ha)-.05 F .821 -.15(ve t)-.2 H 3.021(ob).15 G
+3.021(em)-3.021 G -.15(ove)-3.021 G .521(d, or that all of).15 F .371
+(the of)108 168 R .371(fset can be applied to one sw)-.25 F .371
 (ath or the other)-.1 F 2.872(.T)-.55 G .372
 (he set of decisions about ho)-2.872 F 2.872(wt)-.25 G 2.872(od)-2.872 G
-(istrib)-2.872 E .372(ute the relati)-.2 F -.15(ve)-.25 G(na)108 144 Q
+(istrib)-2.872 E .372(ute the relati)-.2 F -.15(ve)-.25 G(na)108 180 Q
 (vig)-.2 E .14(ation of)-.05 F .14(fsets among the af)-.25 F .139
 (fected sw)-.25 F .139(ath \214les intrinsically in)-.1 F -.2(vo)-.4 G
 (lv).2 E .139(es speed and acceleration changes. F)-.15 F(or)-.15 E(-)
--.2 E(tunately)108 156 Q 3.66(,w)-.65 G 3.66(ea)-3.66 G 1.16
+-.2 E(tunately)108 192 Q 3.66(,w)-.65 G 3.66(ea)-3.66 G 1.16
 (re able to formulate the automated in)-3.66 F -.15(ve)-.4 G 1.16
 (rsion process discussed belo).15 F 3.66(wt)-.25 G 3.66(oo)-3.66 G 1.16
-(btain an optimal)-3.66 F(na)108 168 Q(vig)-.2 E(ation solution.)-.05 E
-/F1 10/Times-Bold at 0 SF(Display Contr)87 196.8 Q(ols)-.18 E F0 1.284
-(The user controls the appearance of the bath)108 208.8 R 1.284
+(btain an optimal)-3.66 F(na)108 204 Q(vig)-.2 E(ation solution.)-.05 E
+/F1 10/Times-Bold at 0 SF(Display Contr)87 232.8 Q(ols)-.18 E F0 1.284
+(The user controls the appearance of the bath)108 244.8 R 1.284
 (ymetry contour plot.)-.05 F 1.284(The contours are generated at re)
-6.284 F(gular)-.15 E(interv)108 220.8 Q .38
+6.284 F(gular)-.15 E(interv)108 256.8 Q .38
 (als in depth, and also change color and are annotated with do)-.25 F
 .381(wnhill f)-.25 F .381(acing tickmarks at re)-.1 F .381(gular inter)
--.15 F(-)-.2 E -.25(va)108 232.8 S 3.314(ls. A).25 F .813
+-.15 F(-)-.2 E -.25(va)108 268.8 S 3.314(ls. A).25 F .813
 (controls dialog brought up by clicking on the <Settings->Contours> b)
 3.314 F .813(utton allo)-.2 F .813(ws the user to set)-.25 F .885
-(the contour)108 244.8 R 3.385(,c)-.4 G .885
+(the contour)108 280.8 R 3.385(,c)-.4 G .885
 (olor change, and tickmark interv)-3.385 F .886
 (als. This same dialog also sets a decimation parameter that)-.25 F .407
-(causes the contours to be calculated from fe)108 256.8 R .407
+(causes the contours to be calculated from fe)108 292.8 R .407
 (wer soundings \(the data are decimated by ignoring pings\). The)-.25 F
 .15(application of decimation may speed up the crossing loadings, b)108
-268.8 R .15(ut is not generally recommended unless the)-.2 F(bath)108
-280.8 Q(ymetry is strongly o)-.05 E -.15(ve)-.15 G(rsampled.).15 E .436
+304.8 R .15(ut is not generally recommended unless the)-.2 F(bath)108
+316.8 Q(ymetry is strongly o)-.05 E -.15(ve)-.15 G(rsampled.).15 E .436
 (Users may also use a "zoom" feature to focus on small areas in the con\
-tour plot.)108 304.8 R .435(The center mouse b)5.435 F(utton)-.2 E .486
-(is used to drag a box o)108 316.8 R -.15(ve)-.15 G -5.485 2.986(ra r)
+tour plot.)108 340.8 R .435(The center mouse b)5.435 F(utton)-.2 E .486
+(is used to drag a box o)108 352.8 R -.15(ve)-.15 G -5.485 2.986(ra r)
 .15 H -.15(eg)-2.986 G .487
 (ion of interest in the contour plot. When the center b).15 F .487
 (utton is released, both)-.2 F .825
-(the contour and mis\214t plots are re)108 328.8 R .825
+(the contour and mis\214t plots are re)108 364.8 R .825
 (generated to sho)-.15 F 3.324(wt)-.25 G .824(he smaller area.)-3.324 F
 .824(Users may zoom as man)5.824 F 3.324(yt)-.15 G .824(imes in)-3.324 F
-.563(succession as desired. One cannot undo the indi)108 340.8 R .564
+.563(succession as desired. One cannot undo the indi)108 376.8 R .564
 (vidual zoom e)-.25 F -.15(ve)-.25 G .564(nts, b).15 F .564
 (ut clicking the <Full Size> b)-.2 F .564(utton in)-.2 F .519(the "Na)
-108 352.8 R 3.019(vE)-.2 G .519(rr" windo)-3.019 F 3.019(ww)-.25 G .519
+108 388.8 R 3.019(vE)-.2 G .519(rr" windo)-3.019 F 3.019(ww)-.25 G .519
 (ill cause the plots to sho)-3.019 F 3.019(wt)-.25 G .519
 (he original, full area co)-3.019 F -.15(ve)-.15 G .519(red by the tw)
 .15 F 3.019(os)-.1 G -.1(wa)-3.019 G .519(ths in the).1 F
-(current crossing.)108 364.8 Q .893
-(The mis\214t plot represents lateral of)108 388.8 R .893
+(current crossing.)108 400.8 Q .893
+(The mis\214t plot represents lateral of)108 424.8 R .893
 (fsets scaled according to the current contour plot display)-.25 F 3.393
 (.S)-.65 G(peci\214cally)-3.393 E(,)-.65 E .563(the width and height of\
  the mis\214t plot correspond to one half the width and height of the b\
-ath)108 400.8 R .563(ymetry con-)-.05 F .248(tour plot.)108 412.8 R .248
+ath)108 436.8 R .563(ymetry con-)-.05 F .248(tour plot.)108 448.8 R .248
 (When the bath)5.248 F .248(ymetry plot area changes due to a zoom e)
 -.05 F -.15(ve)-.25 G .249(nt, the mis\214t is recalculated and redis-)
-.15 F .302(played centered around the current of)108 424.8 R .302(fset.\
+.15 F .302(played centered around the current of)108 460.8 R .302(fset.\
  The color map used for the mis\214t display is automatically scaled)
--.25 F(according to the minimum and maximum mis\214t v)108 436.8 Q
-(alues.)-.25 E F1(Setting Cr)87 465.6 Q(ossing T)-.18 E(ies and Offsets)
--.18 E F0 1.614(In order to actually set the relati)108 477.6 R 1.914
+-.25 F(according to the minimum and maximum mis\214t v)108 472.8 Q
+(alues.)-.25 E F1(Setting Cr)87 501.6 Q(ossing T)-.18 E(ies and Offsets)
+-.18 E F0 1.614(In order to actually set the relati)108 513.6 R 1.914
 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E 1.614(ational of)-.05 F 1.614
 (fset between tw)-.25 F 4.114(op)-.1 G 1.614(articular points on o)
 -4.114 F -.15(ve)-.15 G 1.614(rlapping or).15 F .608(crossing sw)108
-489.6 R .607(aths, the user must \214rst create a tie point.)-.1 F .607
+525.6 R .607(aths, the user must \214rst create a tie point.)-.1 F .607
 (This is accomplished by clicking on the <Add T)5.607 F(ie>)-.35 E -.2
-(bu)108 501.6 S .202(tton in the "Na).2 F 2.702(vE)-.2 G .202(rr" windo)
+(bu)108 537.6 S .202(tton in the "Na).2 F 2.702(vE)-.2 G .202(rr" windo)
 -2.702 F 4.002 -.65(w. O)-.25 H .202(nce a tie point e).65 F .202
 (xists, it will be sho)-.15 F .203(wn on the contour plot as tw)-.25 F
 2.703(oy)-.1 G(ello)-2.703 E(w)-.25 E .147(or red-\214lled, black outli\
 ned squares connected by a thin black line. Each of the squares is loca\
-ted along one)108 513.6 R 1.696(of the sw)108 525.6 R 1.696(ath na)-.1 F
+ted along one)108 549.6 R 1.696(of the sw)108 561.6 R 1.696(ath na)-.1 F
 (vig)-.2 E 1.696(ation tracks, and represents one of the na)-.05 F(vig)
 -.2 E 1.696(ation control points de\214ned during data)-.05 F 2.94
-(importation. There)108 537.6 R .439(can be multiple tie points for eac\
+(importation. There)108 573.6 R .439(can be multiple tie points for eac\
 h crossing, and each one is created by clicking on the)2.94 F(<Add T)108
-549.6 Q(ie> b)-.35 E(utton.)-.2 E .061(Only one tie point will be acti)
-108 573.6 R .361 -.15(ve a)-.25 H 2.561(ta).15 G .361 -.15(ny t)-2.561 H
+585.6 Q(ie> b)-.35 E(utton.)-.2 E .061(Only one tie point will be acti)
+108 609.6 R .361 -.15(ve a)-.25 H 2.561(ta).15 G .361 -.15(ny t)-2.561 H
 .061(ime. The acti).15 F .362 -.15(ve t)-.25 H .062
 (ie point is displayed with lar).15 F .062(ger box)-.18 F .062
 (es \(the inacti)-.15 F -.15(ve)-.25 G .336(tie points are only 1/4 the\
- size. If only one tie point has been de\214ned, it will al)108 585.6 R
+ size. If only one tie point has been de\214ned, it will al)108 621.6 R
 -.1(wa)-.1 G .335(ys be acti).1 F -.15(ve)-.25 G 2.835(.I).15 G 2.835
-(fm)-2.835 G .335(ore than)-2.835 F .364(one tie point e)108 597.6 R
+(fm)-2.835 G .335(ore than)-2.835 F .364(one tie point e)108 633.6 R
 .365(xists, clicking on the <Select T)-.15 F .365(ie> b)-.35 F .365
 (utton in the "Na)-.2 F 2.865(vE)-.2 G .365(rr" windo)-2.865 F 2.865(ww)
 -.25 G .365(ill change the acti)-2.865 F .665 -.15(ve t)-.25 H(ie).15 E
-.443(point to the ne)108 609.6 R .442(xt in the list for the displayed \
+.443(point to the ne)108 645.6 R .442(xt in the list for the displayed \
 crossing \(the tie points are selected in the order in which the)-.15 F
 (y)-.15 E .309(were created\). If the user wishes to delete a tie point\
-, then click <Select T)108 621.6 R .309
-(ie> until the undesirable tie point)-.35 F .472(is acti)108 633.6 R
+, then click <Select T)108 657.6 R .309
+(ie> until the undesirable tie point)-.35 F .472(is acti)108 669.6 R
 -.15(ve)-.25 G 2.972(,a).15 G .472(nd then click <Delete T)-2.972 F
 2.972(ie>. The)-.35 F(acti)2.972 E .772 -.15(ve t)-.25 H .471
 (ie point will be displayed in red \214ll if either the associ-).15 F
-.52(ated na)108 645.6 R(vig)-.2 E .52(ation control points or the na)
+.52(ated na)108 681.6 R(vig)-.2 E .52(ation control points or the na)
 -.05 F(vig)-.2 E .52(ational of)-.05 F .52(fset ha)-.25 F .82 -.15(ve b)
 -.2 H .52(een changed since it w).15 F .52(as created or last set.)-.1 F
-.1(If the acti)108 657.6 R .399 -.15(ve t)-.25 H .099
+.1(If the acti)108 693.6 R .399 -.15(ve t)-.25 H .099
 (ie point is up-to-date, then it will be displayed in yello).15 F 2.599
 <778c>-.25 G .099(ll. Each ne)-2.599 F 2.599(wt)-.25 G .099
-(ie point is initially dis-)-2.599 F(played in yello)108 669.6 Q 1.3
+(ie point is initially dis-)-2.599 F(played in yello)108 705.6 Q 1.3
 -.65(w. A)-.25 H(ll inacti).65 E .3 -.15(ve t)-.25 H
 (ie points will be sho).15 E(wn in yello)-.25 E 2.5<778c>-.25 G(ll.)-2.5
-E .543(When vie)108 693.6 R .543
+E .543(When vie)108 729.6 R .543
 (wing a crossing with one or more tie points, the of)-.25 F .544
-(fsets displayed are associated with the current)-.25 F 1.055
-(tie point. As one mo)108 705.6 R -.15(ve)-.15 G 3.554(st).15 G 1.054
-(he contours to match o)-3.554 F -.15(ve)-.15 G 1.054
-(rlapping features, it is important to remember that the).15 F(na)108
-717.6 Q(vig)-.2 E .974(ational of)-.05 F .974
-(fset will be applied to the na)-.25 F(vig)-.2 E .975
-(ation points indicated for the current tie. Thus, the feature)-.05 F
-.156(being matched should deri)108 729.6 R .456 -.15(ve f)-.25 H .156(r\
-om data \(soundings\) associated with those particular points on the sh\
-iptrack.).15 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(14)199.835 E 0 Cg EP
+(fsets displayed are associated with the current)-.25 F(MB-System 5.0)72
+768 Q(22 April 2015)142.605 E(14)195.945 E 0 Cg EP
 %%Page: 15 15
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E 1.137(This is accomplished by clicking on the bath)108
-84 R 1.138(ymetric feature in the contour display with the right mouse)
--.05 F -.2(bu)108 96 S .335(tton. The "right-click" causes).2 F/F1 10
+(djust\(1\)).25 E 1.055(tie point. As one mo)108 84 R -.15(ve)-.15 G
+3.554(st).15 G 1.054(he contours to match o)-3.554 F -.15(ve)-.15 G
+1.054(rlapping features, it is important to remember that the).15 F(na)
+108 96 Q(vig)-.2 E .974(ational of)-.05 F .974
+(fset will be applied to the na)-.25 F(vig)-.2 E .975
+(ation points indicated for the current tie. Thus, the feature)-.05 F
+.156(being matched should deri)108 108 R .456 -.15(ve f)-.25 H .156(rom\
+ data \(soundings\) associated with those particular points on the ship\
+track.).15 F 1.137(This is accomplished by clicking on the bath)108 120
+R 1.138(ymetric feature in the contour display with the right mouse)-.05
+F -.2(bu)108 132 S .335(tton. The "right-click" causes).2 F/F1 10
 /Times-Bold at 0 SF(mbna)2.835 E -.1(va)-.25 G(djust).1 E F0 .335
 (to \214nd the soundings from each sw)2.835 F .335
-(ath that are closest to the)-.1 F .072(point click)108 108 R .072
+(ath that are closest to the)-.1 F .072(point click)108 144 R .072
 (ed, and then to shift the current tie point to the na)-.1 F(vig)-.2 E
 .073(ation points on each sw)-.05 F .073(ath that include these)-.1 F
-.207(soundings \(that is, the na)108 120 R(vig)-.2 E .207(ation points \
+.207(soundings \(that is, the na)108 156 R(vig)-.2 E .207(ation points \
 associated with the sonar pings that include the closest soundings\).)
--.05 F .708(In order to set, and sa)108 144 R -.15(ve)-.2 G 3.208(,an)
+-.05 F .708(In order to set, and sa)108 180 R -.15(ve)-.2 G 3.208(,an)
 .15 G -.2(av)-3.208 G(ig).2 E .708(ational of)-.05 F .708
 (fset that causes a bath)-.25 F .709(ymetric feature to be matched in o)
--.05 F -.15(ve)-.15 G(rlap-).15 E .899(ping sw)108 156 R .899
+-.05 F -.15(ve)-.15 G(rlap-).15 E .899(ping sw)108 192 R .899
 (aths, the user must click the <Set Of)-.1 F .898(fset> b)-.25 F .898
 (utton abo)-.2 F 1.198 -.15(ve t)-.15 H .898(he contour display).15 F
 3.398(.I)-.65 G 3.398(fau)-3.398 G .898(ser changes the)-3.398 F(acti)
-108 168 Q .875 -.15(ve t)-.25 H .576(ie point or loads a dif).15 F .576
+108 204 Q .875 -.15(ve t)-.25 H .576(ie point or loads a dif).15 F .576
 (ferent crossing without clicking <Set T)-.25 F .576(ie>, then no of)
--.35 F .576(fset information will be)-.25 F(sa)108 180 Q -.15(ve)-.2 G
+-.35 F .576(fset information will be)-.25 F(sa)108 216 Q -.15(ve)-.2 G
 3.408(d. Con).15 F -.15(ve)-.4 G(rsely).15 E 3.407(,f)-.65 G .907(or an)
 -3.407 F 3.407(yc)-.15 G .907
 (rossing with one or more tie points, the <Reset Of)-3.407 F .907
-(fset> b)-.25 F .907(utton will reset the)-.2 F(na)108 192 Q(vig)-.2 E
+(fset> b)-.25 F .907(utton will reset the)-.2 F(na)108 228 Q(vig)-.2 E
 (ational of)-.05 E(fset to the last v)-.25 E
 (alue set for the current crossing and tie point.)-.25 E 1.276
-(So, in practice, setting na)108 216 R(vig)-.2 E 1.276(ational of)-.05 F
+(So, in practice, setting na)108 252 R(vig)-.2 E 1.276(ational of)-.05 F
 1.277(fsets that will be used in obtaining an optimal na)-.25 F(vig)-.2
-E 1.277(ation solution)-.05 F(in)108 228 Q -.2(vo)-.4 G(lv).2 E
-(es the follo)-.15 E(wing steps:)-.25 E(1. Identify a bath)144 240 Q
-(ymetric feature with)-.05 E -.15(ove)151.5 252 S
-(rlapping data so that it can be).15 E(matched.)151.5 264 Q
-(2. Create a tie point by clicking the)144 276 Q(<Add T)151.5 288 Q
+E 1.277(ation solution)-.05 F(in)108 264 Q -.2(vo)-.4 G(lv).2 E
+(es the follo)-.15 E(wing steps:)-.25 E(1. Identify a bath)144 276 Q
+(ymetric feature with)-.05 E -.15(ove)151.5 288 S
+(rlapping data so that it can be).15 E(matched.)151.5 300 Q
+(2. Create a tie point by clicking the)144 312 Q(<Add T)151.5 324 Q
 (ie> b)-.35 E(utton.)-.2 E(3. Set the tie point location by right)144
-300 Q(\255clicking on the feature.)151.5 312 Q(4. If necessary)144 324 Q
-2.5(,z)-.65 G(oom the display to)-2.5 E(focus on the bath)151.5 336 Q
-(ymetric feature)-.05 E(of interest by dragging a box)151.5 348 Q
-(with the middle mouse b)151.5 360 Q(utton.)-.2 E(5. Adjust the of)144
-372 Q(fsets so that the)-.25 E(feature is matched in both sw)151.5 384 Q
-(aths)-.1 E(\(operating in the contour display)151.5 396 Q(,)-.65 E
-(the mis\214t display)151.5 408 Q 2.5(,o)-.65 G 2.5(rb)-2.5 G(oth\).)
--2.5 E(6. Click the <Set Of)144 420 Q(fset> b)-.25 E(utton.)-.2 E
-(These steps should be follo)108 432 Q(wed for e)-.25 E -.15(ve)-.25 G
+336 Q(\255clicking on the feature.)151.5 348 Q(4. If necessary)144 360 Q
+2.5(,z)-.65 G(oom the display to)-2.5 E(focus on the bath)151.5 372 Q
+(ymetric feature)-.05 E(of interest by dragging a box)151.5 384 Q
+(with the middle mouse b)151.5 396 Q(utton.)-.2 E(5. Adjust the of)144
+408 Q(fsets so that the)-.25 E(feature is matched in both sw)151.5 420 Q
+(aths)-.1 E(\(operating in the contour display)151.5 432 Q(,)-.65 E
+(the mis\214t display)151.5 444 Q 2.5(,o)-.65 G 2.5(rb)-2.5 G(oth\).)
+-2.5 E(6. Click the <Set Of)144 456 Q(fset> b)-.25 E(utton.)-.2 E
+(These steps should be follo)108 468 Q(wed for e)-.25 E -.15(ve)-.25 G
 (ry feature that can be matched in o).15 E -.15(ve)-.15 G(rlapping sw)
 .15 E(aths.)-.1 E .963(In some cases, the user will \214nd it useful to\
- create and set multiple tie points in a single crossing. Other)108 456
-R 1.351(crossings may not allo)108 468 R 3.852(wa)-.25 G 1.652 -.15
+ create and set multiple tie points in a single crossing. Other)108 492
+R 1.351(crossings may not allo)108 504 R 3.852(wa)-.25 G 1.652 -.15
 (ny f)-3.852 H 1.352
 (eatures to be matched. Users should click the <Skip Crossing> b).15 F
-1.352(utton on)-.2 F .365(crossings that do not allo)108 480 R 2.865(wo)
+1.352(utton on)-.2 F .365(crossings that do not allo)108 516 R 2.865(wo)
 -.25 G .365(ne or more of)-2.865 F .365(fsets to be determined. In f)
 -.25 F(act,)-.1 E F1(mbna)2.865 E -.1(va)-.25 G(djust).1 E F0 .365
 (will only allo)2.865 F 2.865(wt)-.25 G(he)-2.865 E .22
-(calculation of a na)108 492 R(vig)-.2 E .22
+(calculation of a na)108 528 R(vig)-.2 E .22
 (ation solution when all of the crossings ha)-.05 F .521 -.15(ve b)-.2 H
 .221(een acted on by either ha).15 F .221(ving tie points)-.2 F
-(set or by ha)108 504 Q(ving been e)-.2 E(xplicitly skipped.)-.15 E .56
-(Users should feel free to iterate an)108 528 R 3.059(yw)-.15 G .559
+(set or by ha)108 540 Q(ving been e)-.2 E(xplicitly skipped.)-.15 E .56
+(Users should feel free to iterate an)108 564 R 3.059(yw)-.15 G .559
 (ay the)-3.159 F 3.059(yl)-.15 G(ik)-3.059 E 3.059(ed)-.1 G .559
 (uring crossing inspection. Crossings may be displayed)-3.059 F .344
-(as man)108 540 R 2.844(yt)-.15 G .344(imes as desired, and ties can be\
+(as man)108 576 R 2.844(yt)-.15 G .344(imes as desired, and ties can be\
  created, deleted, and changed without restriction. Users may also)
--2.844 F(quit)108 552 Q F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0
+-2.844 F(quit)108 588 Q F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0
 (and then later reopen the same project without losing an)2.5 E 2.5(yi)
--.15 G(nformation.)-2.5 E F1(Setting Good, P)87 580.8 Q
+-.15 G(nformation.)-2.5 E F1(Setting Good, P)87 616.8 Q
 (oor and Fixed Na)-.2 E(vigation)-.25 E F0 .101(The adjusted na)108
-592.8 R(vig)-.2 E .101(ation model produced by)-.05 F F1(MBna)2.601 E
+628.8 R(vig)-.2 E .101(ation model produced by)-.05 F F1(MBna)2.601 E
 -.1(va)-.25 G(djust).1 E F0 .101(should be accurate to the bath)2.601 F
-.1(ymetric resolution)-.05 F .415(in a relati)108 604.8 R .715 -.15
+.1(ymetric resolution)-.05 F .415(in a relati)108 640.8 R .715 -.15
 (ve s)-.25 H .415(ense, b).15 F .415(ut \214tting a set of relati)-.2 F
 .715 -.15(ve o)-.25 H -.25(ff).15 G .415(set ties does not pro).25 F
 .416(vide constraints on the global location)-.15 F .252(of the surv)108
-616.8 R .552 -.15(ey d)-.15 H(ata.).15 E F1(MBna)2.752 E -.1(va)-.25 G
+652.8 R .552 -.15(ey d)-.15 H(ata.).15 E F1(MBna)2.752 E -.1(va)-.25 G
 (djust).1 E F0(pro)2.752 E .252(vides tw)-.15 F 2.752(om)-.1 G .252
 (eans to control the global location of the adjusted na)-2.752 F(vig)-.2
 E(a-)-.05 E .778
 (tion. First, the global location of the model is essentially an a)108
-628.8 R -.15(ve)-.2 G .778(rage of the o).15 F -.15(ve)-.15 G .779
-(rall of).15 F .779(fsets associated with)-.25 F .284(good na)108 640.8
+664.8 R -.15(ve)-.2 G .778(rage of the o).15 F -.15(ve)-.15 G .779
+(rall of).15 F .779(fsets associated with)-.25 F .284(good na)108 676.8
 R(vig)-.2 E .284(ation. Users may use the <Action->Set File Poor Na)-.05
 F(vig)-.2 E .283(ation> menu item to set selected surv)-.05 F -.15(ey)
 -.15 G(s).15 E .902(or \214les to be ignored in setting the global mode\
-l. Second, if certain data \214les are thought to ha)108 652.8 R 1.202
--.15(ve c)-.2 H(orrect).15 E(na)108 664.8 Q(vig)-.2 E .318(ation, the)
+l. Second, if certain data \214les are thought to ha)108 688.8 R 1.202
+-.15(ve c)-.2 H(orrect).15 E(na)108 700.8 Q(vig)-.2 E .318(ation, the)
 -.05 F 2.818(yc)-.15 G .318(an be \214x)-2.818 F .317(ed \(e.g. to ha)
 -.15 F .617 -.15(ve z)-.2 H .317
 (ero adjustment\) using the <Action->Set File Fix).15 F .317(ed Na)-.15
 F(vig)-.2 E(ation>)-.05 E(menu item. In this case, all of the non-\214x)
-108 676.8 Q(ed \214les are adjusted relati)-.15 E .3 -.15(ve t)-.25 H
-2.5(ot).15 G(he \214x)-2.5 E(ed \214les.)-.15 E/F2 10.95/Times-Bold at 0 SF
-(USING MBN)72 705.6 Q -1.04 -1.588(AV A)-.219 H(DJUST 3: INVER)1.588 E
-(TING FOR AN OPTIMAL N)-.438 E -1.588(AV)-.219 G(IGA)1.588 E
-(TION SOLUTION)-1.04 E F0(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(15)199.835 E 0 Cg EP
+108 712.8 Q(ed \214les are adjusted relati)-.15 E .3 -.15(ve t)-.25 H
+2.5(ot).15 G(he \214x)-2.5 E(ed \214les.)-.15 E(MB-System 5.0)72 768 Q
+(22 April 2015)142.605 E(15)195.945 E 0 Cg EP
 %%Page: 16 16
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10/Times-Bold at 0 SF -.2(Pe)87 84 S(rf).2 E
-(orming the In)-.25 E -.1(ve)-.4 G(rsion).1 E F0 .558
-(Once the user has interacti)108 96 R -.15(ve)-.25 G .559
+(djust\(1\)).25 E/F1 10.95/Times-Bold at 0 SF(USING MBN)72 84 Q -1.04
+-1.588(AV A)-.219 H(DJUST 3: INVER)1.588 E(TING FOR AN OPTIMAL N)-.438 E
+-1.588(AV)-.219 G(IGA)1.588 E(TION SOLUTION)-1.04 E/F2 10/Times-Bold at 0
+SF -.2(Pe)87 96 S(rf).2 E(orming the In)-.25 E -.1(ve)-.4 G(rsion).1 E
+F0 .558(Once the user has interacti)108 108 R -.15(ve)-.25 G .559
 (ly analyzed all of the crossings and closed the "Na).15 F 3.059(vE)-.2
 G .559(rr" windo)-3.059 F 3.059(wb)-.25 G 3.059(yc)-3.059 G(licking)
--3.059 E 2.52(the <Dismiss> b)108 108 R 2.519(utton, the <Action->In)-.2
+-3.059 E 2.52(the <Dismiss> b)108 120 R 2.519(utton, the <Action->In)-.2
 F -.15(ve)-.4 G 2.519(rt na).15 F(vig)-.2 E 2.519(ation> b)-.05 F 2.519
-(utton becomes enabled. Clicking this b)-.2 F(utton)-.2 E(causes)108 120
-Q F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0(to construct and solv)2.5 E
+(utton becomes enabled. Clicking this b)-.2 F(utton)-.2 E(causes)108 132
+Q F2(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0(to construct and solv)2.5 E
 2.5(ea)-.15 G 2.5(ni)-2.5 G -1.85 -.4(nv e)-2.5 H
 (rsion for the optimal na).4 E(vig)-.2 E(ation.)-.05 E .214(The in)108
-144 R -.15(ve)-.4 G .214(rsion solv).15 F .214(es for na)-.15 F(vig)-.2
+156 R -.15(ve)-.4 G .214(rsion solv).15 F .214(es for na)-.15 F(vig)-.2
 E .215(ation adjustments at each na)-.05 F(vig)-.2 E .215
 (ation control point which satisfy the of)-.05 F .215(fsets at)-.25 F
 .911(the tie points while minimizing speed and acceleration. The speed \
-and acceleration penalty is set using a)108 156 R .551(penalty weight v)
-108 168 R .551(alue that may be v)-.25 F .552
+and acceleration penalty is set using a)108 168 R .551(penalty weight v)
+108 180 R .551(alue that may be v)-.25 F .552
 (aried. If the penalty weight is lar)-.25 F .552(ge, the na)-.18 F(vig)
 -.2 E .552(ation adjustments may be)-.05 F .636(smooth and small b)108
-180 R .635(ut not \214t the tie point of)-.2 F .635
+192 R .635(ut not \214t the tie point of)-.2 F .635
 (fsets well. An in\214nite penalty weight produces uniformly zero)-.25 F
-.169(adjustments. In contrast, a small penalty weight allo)108 192 R
+.169(adjustments. In contrast, a small penalty weight allo)108 204 R
 .169(ws the tie point of)-.25 F .169
 (fsets to be \214t as well as possible e)-.25 F -.15(ve)-.25 G(n).15 E
-.11(if lar)108 204 R .11(ge speed and acceleration spik)-.18 F .11
+.11(if lar)108 216 R .11(ge speed and acceleration spik)-.18 F .11
 (es are a consequence. Hoe)-.1 F -.15(ve)-.25 G .91 -.4(r, e).15 H -.15
 (ve).15 G 2.61(nw).15 G .11(ith a zero penalty weight the in)-2.61 F
--.15(ve)-.4 G -.2(r-).15 G .034(sion may not be able to e)108 216 R .034
+-.15(ve)-.4 G -.2(r-).15 G .034(sion may not be able to e)108 228 R .034
 (xactly satisfy all of the tie point of)-.15 F .035
 (fsets. If some of the tie point of)-.25 F .035(fsets are con\215ict-)
--.25 F 1.841(ing \(e.g. one tie point requires a na)108 228 R(vig)-.2 E
+-.25 F 1.841(ing \(e.g. one tie point requires a na)108 240 R(vig)-.2 E
 1.841(ation control point to mo)-.05 F 2.141 -.15(ve t)-.15 H 4.341(ot)
 .15 G 1.841(he west while another tie point)-4.341 F(requires a mo)108
-240 Q .3 -.15(ve t)-.15 H 2.5(ot).15 G(he east\), then the of)-2.5 E
+252 Q .3 -.15(ve t)-.15 H 2.5(ot).15 G(he east\), then the of)-2.5 E
 (fsets cannot all be simultaneously \214t e)-.25 E(xactly)-.15 E(.)-.65
-E .914(The in)108 264 R -.15(ve)-.4 G .914
+E .914(The in)108 276 R -.15(ve)-.4 G .914
 (rsion is actually performed man).15 F 3.415(yt)-.15 G .915
 (imes with dif)-3.415 F .915
 (ferent penalty weights, and the "best" solution is)-.25 F .356
-(selected and applied to the data. The details of ho)108 276 R 2.856(wt)
+(selected and applied to the data. The details of ho)108 288 R 2.856(wt)
 -.25 G .356(he "best" solution is identi\214ed are gi)-2.856 F -.15(ve)
 -.25 G 2.855(ni).15 G 2.855(nt)-2.855 G .355(he section)-2.855 F 1.214
-("Details of the In)108 288 R -.15(ve)-.4 G 1.214(rsion" section belo)
+("Details of the In)108 300 R -.15(ve)-.4 G 1.214(rsion" section belo)
 .15 F 2.514 -.65(w. A l)-.25 H 1.214(og of the in).65 F -.15(ve)-.4 G
-1.214(rsion parameters, the results from each of the).15 F(in)108 300 Q
+1.214(rsion parameters, the results from each of the).15 F(in)108 312 Q
 -.15(ve)-.4 G .02
 (rsion iterations, and detailed results from the \214nal in).15 F -.15
 (ve)-.4 G .019(rsion are output to the Message te).15 F .019(xt windo)
 -.15 F 1.319 -.65(w. T)-.25 H(he).65 E .747
-(program then outputs an adjusted na)108 312 R(vig)-.2 E .747
+(program then outputs an adjusted na)108 324 R(vig)-.2 E .747
 (ation \214le for each of the input sw)-.05 F .747
 (ath \214les and updates \(or creates\))-.1 F
-(the parameter \214le for each sw)108 324 Q(ath \214le so that)-.1 E F1
+(the parameter \214le for each sw)108 336 Q(ath \214le so that)-.1 E F2
 (mbpr)2.5 E(ocess)-.18 E F0(will mer)2.5 E(ge the adjusted na)-.18 E
-(vig)-.2 E(ation.)-.05 E .019(The output adjusted na)108 348 R(vig)-.2 E
+(vig)-.2 E(ation.)-.05 E .019(The output adjusted na)108 360 R(vig)-.2 E
 .019(ation \214les are named by adding a ".na#" suf)-.05 F .019
 (\214x to the original sw)-.25 F .018(ath data \214lename.)-.1 F
-(If a sw)108 360 Q(ath \214le imported into)-.1 E F1(mbna)2.5 E -.1(va)
+(If a sw)108 372 Q(ath \214le imported into)-.1 E F2(mbna)2.5 E -.1(va)
 -.25 G(djust).1 E F0(for the \214rst time is named:)2.5 E
-(mbari_1998_55.mb57)144 372 Q(then the adjusted na)108 384 Q(vig)-.2 E
+(mbari_1998_55.mb57)144 384 Q(then the adjusted na)108 396 Q(vig)-.2 E
 (ation resulting from that project will be named:)-.05 E
-(mbari_1998_55.mb57.na0)144 396 Q
-(If this \214le is imported into a second)108 408 Q F1(mbna)2.5 E -.1
+(mbari_1998_55.mb57.na0)144 408 Q
+(If this \214le is imported into a second)108 420 Q F2(mbna)2.5 E -.1
 (va)-.25 G(djust).1 E F0(project, the result from in)2.5 E -.15(ve)-.4 G
-(rsion in that project will be:).15 E(mbari_1998_55.mb57.na1)144 420 Q
-.16(In addition to generating the adjusted na)108 432 R(vig)-.2 E
-(ation,)-.05 E F1(mbna)2.66 E -.1(va)-.25 G(djust).1 E F0 .16
+(rsion in that project will be:).15 E(mbari_1998_55.mb57.na1)144 432 Q
+.16(In addition to generating the adjusted na)108 444 R(vig)-.2 E
+(ation,)-.05 E F2(mbna)2.66 E -.1(va)-.25 G(djust).1 E F0 .16
 (also sets the N)2.66 F -1.35(AVA)-.35 G .16(DJMODE and N)1.35 F -1.35
-(AVA)-.35 G(D-)1.35 E(JFILE v)108 444 Q(alues in the)-.25 E F1(mbpr)2.5
+(AVA)-.35 G(D-)1.35 E(JFILE v)108 456 Q(alues in the)-.25 E F2(mbpr)2.5
 E(ocess)-.18 E F0
 (parameter \214le. In this case, the parameter \214le is named:)2.5 E
-(mbari_1998_55.mb57.par)144 456 Q(and the processed sw)108 468 Q
-(ath \214le generated by running)-.1 E F1(mbpr)2.5 E(ocess)-.18 E F0
-(is:)2.5 E(mbari_1998_55p.mb57)144 480 Q(Refer to the)108 492 Q F1(mbpr)
-2.5 E(ocess)-.18 E F0(and)2.5 E F1(mbset)2.5 E F0
-(manual pages for details on the control and use of)2.5 E F1(mbpr)2.5 E
-(ocess)-.18 E F0(.)A .545(Note that the rele)108 516 R -.25(va)-.25 G
+(mbari_1998_55.mb57.par)144 468 Q(and the processed sw)108 480 Q
+(ath \214le generated by running)-.1 E F2(mbpr)2.5 E(ocess)-.18 E F0
+(is:)2.5 E(mbari_1998_55p.mb57)144 492 Q(Refer to the)108 504 Q F2(mbpr)
+2.5 E(ocess)-.18 E F0(and)2.5 E F2(mbset)2.5 E F0
+(manual pages for details on the control and use of)2.5 E F2(mbpr)2.5 E
+(ocess)-.18 E F0(.)A .545(Note that the rele)108 528 R -.25(va)-.25 G
 .545(nt parameter \214le settings will re\215ect the most recent in).25
-F -.15(ve)-.4 G .544(rsion in).15 F F1(mbna)3.044 E -.1(va)-.25 G(djust)
-.1 E F0 5.544(.U)C(sers)-5.544 E .078(do need to be a)108 528 R -.1(wa)
+F -.15(ve)-.4 G .544(rsion in).15 F F2(mbna)3.044 E -.1(va)-.25 G(djust)
+.1 E F0 5.544(.U)C(sers)-5.544 E .078(do need to be a)108 540 R -.1(wa)
 -.15 G .078(re that the order of na).1 F(vig)-.2 E .078
-(ation processing is important because, when possible,)-.05 F F1(mbna)
-2.579 E -.1(va)-.25 G(d-).1 E(just)108 540 Q F0 1.448(imports e)3.948 F
+(ation processing is important because, when possible,)-.05 F F2(mbna)
+2.579 E -.1(va)-.25 G(d-).1 E(just)108 552 Q F0 1.448(imports e)3.948 F
 1.447(xisting processed data \214les.)-.15 F 1.447(The data within the)
-6.447 F F1(mbna)3.947 E -.1(va)-.25 G(djust).1 E F0 1.447
+6.447 F F2(mbna)3.947 E -.1(va)-.25 G(djust).1 E F0 1.447
 (projects are not, ho)3.947 F(we)-.25 E -.15(ve)-.25 G -.4(r,).15 G .977
-(updated when the source data are updated. Consequently)108 552 R 3.477
+(updated when the source data are updated. Consequently)108 564 R 3.477
 (,s)-.65 G .977(tandard na)-3.477 F(vig)-.2 E .977
 (ation processing should be com-)-.05 F .229(pleted and applied with)108
-564 R F1(mbpr)2.729 E(ocess)-.18 E F0 .229(before a sw)2.729 F .229
-(ath \214le is imported into an)-.1 F F1(mbna)2.729 E -.1(va)-.25 G
+576 R F2(mbpr)2.729 E(ocess)-.18 E F0 .229(before a sw)2.729 F .229
+(ath \214le is imported into an)-.1 F F2(mbna)2.729 E -.1(va)-.25 G
 (djust).1 E F0 .228(project. If a sw)2.729 F(ath)-.1 E 1.446
-(\214le is to be used in multiple)108 576 R F1(mbna)3.946 E -.1(va)-.25
+(\214le is to be used in multiple)108 588 R F2(mbna)3.946 E -.1(va)-.25
 G(djust).1 E F0 1.446
 (projects, the \214rst project should be \214nalized and the results)
-3.946 F(applied before data are imported into the second.)108 588 Q F1
-(Fine-T)87 616.8 Q(uning the In)-.92 E -.1(ve)-.4 G(rsion).1 E F0 1.582
-(Once an in)108 628.8 R -.15(ve)-.4 G 1.582(rsion has been performed, t\
+3.946 F(applied before data are imported into the second.)108 600 Q F2
+(Fine-T)87 628.8 Q(uning the In)-.92 E -.1(ve)-.4 G(rsion).1 E F0 1.582
+(Once an in)108 640.8 R -.15(ve)-.4 G 1.582(rsion has been performed, t\
 he user should inspect the \214t for each of the tie points before).15 F
-.595(accepting and applying the adjusted na)108 640.8 R(vig)-.2 E .595
+.595(accepting and applying the adjusted na)108 652.8 R(vig)-.2 E .595
 (ation. The relationship between the interacti)-.05 F -.15(ve)-.25 G
-.595(ly de\214ned na).15 F(vig)-.2 E(a-)-.05 E .169(tion of)108 652.8 R
+.595(ly de\214ned na).15 F(vig)-.2 E(a-)-.05 E .169(tion of)108 664.8 R
 .169(fsets and the of)-.25 F .169(fsets associated with the in)-.25 F
 -.15(ve)-.4 G .169(rsion can be in).15 F -.15(ve)-.4 G(stig).15 E .169
 (ated numerically in the tie points ta-)-.05 F
-(ble or visually in the "Na)108 664.8 Q 2.5(vE)-.2 G(rr" windo)-2.5 E
--.65(w.)-.25 G 2.344 -.8(We s)108 688.8 T .744(uggest \214rst e).8 F
+(ble or visually in the "Na)108 676.8 Q 2.5(vE)-.2 G(rr" windo)-2.5 E
+-.65(w.)-.25 G 2.344 -.8(We s)108 700.8 T .744(uggest \214rst e).8 F
 .744(xamining the tie points table by pulling do)-.15 F .745(wn the <V)
 -.25 F(ie)-.6 E(w->Sho)-.25 E 3.245(wT)-.25 G .745(ies> menu item. This)
--3.595 F .046(table sho)108 700.8 R .046(ws, from left to right, the id\
+-3.595 F .046(table sho)108 712.8 R .046(ws, from left to right, the id\
 entity of each tie point, the longitude and latitude of)-.25 F .045
 (fsets de\214ned by the)-.25 F 1.265
 (user \(in meters\), and the longitude and latitude residuals, or dif)
-108 712.8 R 1.266(ferences between these of)-.25 F 1.266
-(fsets and those)-.25 F .541(associated with the in)108 724.8 R -.15(ve)
--.4 G .541(rsion \(in meters\).).15 F .541(If an)5.541 F 3.041(yo)-.15 G
-3.041(ft)-3.041 G .54(hese residuals are une)-3.041 F .54(xpectedly lar)
--.15 F .54(ge, simply clicking)-.18 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(16)199.835 E 0 Cg EP
+108 724.8 R 1.266(ferences between these of)-.25 F 1.266
+(fsets and those)-.25 F(MB-System 5.0)72 768 Q(22 April 2015)142.605 E
+(16)195.945 E 0 Cg EP
 %%Page: 17 17
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .24(on the table line sho)108 84 R .24
+(djust\(1\)).25 E .541(associated with the in)108 84 R -.15(ve)-.4 G
+.541(rsion \(in meters\).).15 F .541(If an)5.541 F 3.041(yo)-.15 G 3.041
+(ft)-3.041 G .54(hese residuals are une)-3.041 F .54(xpectedly lar)-.15
+F .54(ge, simply clicking)-.18 F .24(on the table line sho)108 96 R .24
 (wing the suspect na)-.25 F(vig)-.2 E .24
 (ation tie will bring up the "Na)-.05 F 2.74(vE)-.2 G .24(rr" windo)
 -2.74 F 2.74(wa)-.25 G .24(nd load the cross-)-2.74 F .322
-(ing including that na)108 96 R(vig)-.2 E .321(ation tie. Once an in)
+(ing including that na)108 108 R(vig)-.2 E .321(ation tie. Once an in)
 -.05 F -.15(ve)-.4 G .321(rsion is performed, the "Na).15 F 2.821(vE)-.2
 G .321(rr" crossing displays sho)-2.821 F 2.821(wt)-.25 G(he)-2.821 E
-(in)108 108 Q -.15(ve)-.4 G .183(rted of).15 F .183(fset as a small '+'\
+(in)108 120 Q -.15(ve)-.4 G .183(rted of).15 F .183(fset as a small '+'\
  symbol on the mis\214t plot. The user can then determine whether the p\
-re)-.25 F(viously)-.25 E .297(set na)108 120 R(vig)-.2 E .297(ation of)
+re)-.25 F(viously)-.25 E .297(set na)108 132 R(vig)-.2 E .297(ation of)
 -.05 F .297(fset is truly required by the data. On occasion, one disco)
 -.25 F -.15(ve)-.15 G .296(rs that the of).15 F .296
-(fset obtained in the)-.25 F(in)108 132 Q -.15(ve)-.4 G .266
+(fset obtained in the)-.25 F(in)108 144 Q -.15(ve)-.4 G .266
 (rsion is as consistent with the bath).15 F .266(ymetry as the of)-.05 F
 .266(fset originally set by the user)-.25 F 2.766(.O)-.55 G .266
-(nce the of)-2.766 F .267(fset v)-.25 F(alues)-.25 E(ha)108 144 Q .445
+(nce the of)-2.766 F .267(fset v)-.25 F(alues)-.25 E(ha)108 156 Q .445
 -.15(ve b)-.2 H .145(een adjusted as necessary).15 F 2.645(,t)-.65 G(he)
 -2.645 E 2.645(yc)-.15 G .145(an be reset by clicking on the <Set Of)
 -2.645 F .144(fset> b)-.25 F .144(utton \(just as in the ear)-.2 F(-)-.2
-E(lier interacti)108 156 Q .3 -.15(ve s)-.25 H(essions\).).15 E .134
-(Once all of the suspect na)108 180 R(vig)-.2 E .134(ation ties ha)-.05
+E(lier interacti)108 168 Q .3 -.15(ve s)-.25 H(essions\).).15 E .134
+(Once all of the suspect na)108 192 R(vig)-.2 E .134(ation ties ha)-.05
 F .434 -.15(ve b)-.2 H .135
 (een inspected, and perhaps corrected, another in).15 F -.15(ve)-.4 G
-.135(rsion can be).15 F .335(generated using the re)108 192 R .335
+.135(rsion can be).15 F .335(generated using the re)108 204 R .335
 (vised set of of)-.25 F .335(fsets. In this w)-.25 F(ay)-.1 E 2.834(,u)
 -.65 G .334(sers can iterate o)-2.834 F -.15(ve)-.15 G 2.834(rc).15 G
 .334(ycles of in)-2.984 F -.15(ve)-.4 G .334(rsion and inspec-).15 F
-.192(tion until a satisf)108 204 R .193
+.192(tion until a satisf)108 216 R .193
 (actory \(self-consistemt\) solution is obtained. When the \214nal in)
 -.1 F -.15(ve)-.4 G .193(rsion has been performed,).15 F .715
-(the user can then run)108 216 R/F1 10/Times-Bold at 0 SF(mbpr)3.215 E
+(the user can then run)108 228 R/F1 10/Times-Bold at 0 SF(mbpr)3.215 E
 (ocess)-.18 E F0 .715(on all of the af)3.215 F .714(fected sw)-.25 F
 .714(ath data \214les to produce a set of processed \214les)-.1 F .56
-(incorporating the optimally adjusted na)108 228 R(vig)-.2 E .56
+(incorporating the optimally adjusted na)108 240 R(vig)-.2 E .56
 (ation. Once ag)-.05 F .56(ain, we emphasize that users should al)-.05 F
--.1(wa)-.1 G .56(ys \214nal-).1 F(ize an)108 240 Q F1(mbna)2.5 E -.1(va)
+-.1(wa)-.1 G .56(ys \214nal-).1 F(ize an)108 252 Q F1(mbna)2.5 E -.1(va)
 -.25 G(djust).1 E F0(project before importing af)2.5 E(fected sw)-.25 E
 (ath data into another)-.1 E F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0
-(project.)2.5 E F1(Details of the In)87 268.8 Q -.1(ve)-.4 G(rsion).1 E
-F0 .516(The in)108 280.8 R -.15(ve)-.4 G .516
+(project.)2.5 E F1(Details of the In)87 280.8 Q -.1(ve)-.4 G(rsion).1 E
+F0 .516(The in)108 292.8 R -.15(ve)-.4 G .516
 (rsion is constructed as a sparse o).15 F -.15(ve)-.15 G .515
 (rdetermined least squares matrix problem. Suppose we ha).15 F .815 -.15
-(ve N)-.2 H(na)108 292.8 Q(vig)-.2 E .122
+(ve N)-.2 H(na)108 304.8 Q(vig)-.2 E .122
 (ation control points in all of the sw)-.05 F .122(ath \214les and ha)
 -.1 F .423 -.15(ve d)-.2 H .123
 (e\214ned M tie points. The form of the problem is:).15 F F1 2.5(AX)144
-316.8 S F0(=)A F1(D)2.5 E F0(Here)108 340.8 Q F1(X)3.112 E F0 .611
+328.8 S F0(=)A F1(D)2.5 E F0(Here)108 352.8 Q F1(X)3.112 E F0 .611
 (is the v)3.111 F .611(ector of unkno)-.15 F .611
 (wns, which happen to be the changes in the longitude and latitude v)
--.25 F .611(alues of)-.25 F .405(all of the na)108 352.8 R(vig)-.2 E
+-.25 F .611(alues of)-.25 F .405(all of the na)108 364.8 R(vig)-.2 E
 .405(ation control points. So, there are 2N unkno)-.05 F .405
 (wns. Note that we do not solv)-.25 F 2.906(ed)-.15 G .406
-(irectly for lon-)-2.906 F 1.355(gitude and latitude, b)108 364.8 R
+(irectly for lon-)-2.906 F 1.355(gitude and latitude, b)108 376.8 R
 1.355(ut rather for the change, or perturbation, to the longitude and l\
-atitude v)-.2 F 3.855(alues. The)-.25 F(matrix)108 376.8 Q F1(A)2.643 E
+atitude v)-.2 F 3.855(alues. The)-.25 F(matrix)108 388.8 Q F1(A)2.643 E
 F0 .143(contains 2N columns corresponding to the unkno)2.643 F .143
 (wns and a ro)-.25 F 2.643(wf)-.25 G .144
 (or each of the constraints we can)-2.643 F 1.329(apply to the na)108
-388.8 R(vig)-.2 E 1.328
+400.8 R(vig)-.2 E 1.328
 (ation adjustment problem. The number of elements in the "data" v)-.05 F
 (ector)-.15 E F1(D)3.828 E F0 1.328(also corre-)3.828 F
-(sponds to the number of constraints.)108 400.8 Q 1.6 -.8(We a)5 H
+(sponds to the number of constraints.)108 412.8 Q 1.6 -.8(We a)5 H
 (pply four sets of constraints in this in).8 E -.15(ve)-.4 G
-(rse problem:).15 E(1\) Fix)144 412.8 Q(ed na)-.15 E(vig)-.2 E
-(ation points)-.05 E(2\) Penalize speed \(\214rst deri)144 424.8 Q -.25
+(rse problem:).15 E(1\) Fix)144 424.8 Q(ed na)-.15 E(vig)-.2 E
+(ation points)-.05 E(2\) Penalize speed \(\214rst deri)144 436.8 Q -.25
 (va)-.25 G(ti).25 E -.15(ve)-.25 G(\)).15 E
-(3\) Penalize acceleration \(second deri)144 436.8 Q -.25(va)-.25 G(ti)
-.25 E -.15(ve)-.25 G(\)).15 E(4\) Fit na)144 448.8 Q(vig)-.2 E(ation of)
+(3\) Penalize acceleration \(second deri)144 448.8 Q -.25(va)-.25 G(ti)
+.25 E -.15(ve)-.25 G(\)).15 E(4\) Fit na)144 460.8 Q(vig)-.2 E(ation of)
 -.05 E(fsets at tie points)-.25 E
-(The \214rst kind of constraint is simply e)108 472.8 Q(xpressed as:)
--.15 E(XLONj = 0)144 496.8 Q(XLA)144 520.8 Q(Tj = 0)-1.11 E 1.197
-(where XLONj is the longitude change and XLA)108 544.8 R 1.197
+(The \214rst kind of constraint is simply e)108 484.8 Q(xpressed as:)
+-.15 E(XLONj = 0)144 508.8 Q(XLA)144 532.8 Q(Tj = 0)-1.11 E 1.197
+(where XLONj is the longitude change and XLA)108 556.8 R 1.197
 (Tj is the latitude change for the "j"th na)-1.11 F(vig)-.2 E 1.197
-(ation control)-.05 F(point.)108 556.8 Q
-(The second contraint \(speed\) is also one of minimization:)108 580.8 Q
-(-XLONj + XLONj+1)144 604.8 Q 2.5(---------------- =)144 616.8 R(0)2.5 E
-(\255Tj + Tj+1)154 628.8 Q(-XLA)144 652.8 Q(Tj + XLA)-1.11 E(Tj+1)-1.11
-E 2.5(---------------- =)144 664.8 R(0)2.5 E(\255Tj + Tj+1)154 676.8 Q
-.954(Here XLONj+1 and XLA)108 700.8 R .954
+(ation control)-.05 F(point.)108 568.8 Q
+(The second contraint \(speed\) is also one of minimization:)108 592.8 Q
+(-XLONj + XLONj+1)144 616.8 Q 2.5(---------------- =)144 628.8 R(0)2.5 E
+(\255Tj + Tj+1)154 640.8 Q(-XLA)144 664.8 Q(Tj + XLA)-1.11 E(Tj+1)-1.11
+E 2.5(---------------- =)144 676.8 R(0)2.5 E(\255Tj + Tj+1)154 688.8 Q
+.954(Here XLONj+1 and XLA)108 712.8 R .954
 (Tj+1 are the longitude and latitude changes for the "j+1"th na)-1.11 F
 (vig)-.2 E .953(ational control)-.05 F .09
 (point and Tj and Tj+1 are the times of the "j"th and "j+1"th na)108
-712.8 R(vig)-.2 E .09(ational control points. The denominator in)-.05 F
-.855(these e)108 724.8 R .855(xpressions is thus the time dif)-.15 F
-.855(ference between the tw)-.25 F 3.355(on)-.1 G -.2(av)-3.355 G(ig).2
-E .854(ation points. The speed constraint can)-.05 F(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(17)199.835 E 0 Cg EP
+724.8 R(vig)-.2 E .09(ational control points. The denominator in)-.05 F
+(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(17)195.945 E 0 Cg EP
 %%Page: 18 18
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E 1.507(only be applied to na)108 84 R(vig)-.2 E 1.508(\
-ation control points that are sequential, and is not applied across bre\
-aks in the)-.05 F(sw)108 96 Q .381(ath data. Note that multiple sw)-.1 F
-.381(ath \214les may be sequential without breaks, while time g)-.1 F
-.38(aps or breaks can)-.05 F .568(occur within a single sw)108 108 R
-.568(ath \214le. The e)-.1 F .568(xistence of g)-.15 F .569
+(djust\(1\)).25 E .855(these e)108 84 R .855
+(xpressions is thus the time dif)-.15 F .855(ference between the tw)-.25
+F 3.355(on)-.1 G -.2(av)-3.355 G(ig).2 E .854
+(ation points. The speed constraint can)-.05 F 1.507
+(only be applied to na)108 96 R(vig)-.2 E 1.508(ation control points th\
+at are sequential, and is not applied across breaks in the)-.05 F(sw)108
+108 Q .381(ath data. Note that multiple sw)-.1 F .381
+(ath \214les may be sequential without breaks, while time g)-.1 F .38
+(aps or breaks can)-.05 F .568(occur within a single sw)108 120 R .568
+(ath \214le. The e)-.1 F .568(xistence of g)-.15 F .569
 (aps or breaks in the sw)-.05 F .569(ath data is determined solely on)
--.1 F(the basis of time g)108 120 Q(aps as the data are imported.)-.05 E
+-.1 F(the basis of time g)108 132 Q(aps as the data are imported.)-.05 E
 (The third contraint \(acceleration\) is also one of minimization:)108
-144 Q(XLONj \255 2 * XLONj+1 + XLONj+2)144 168 Q 10
-(----------------------------- =)144 180 R(0)2.5 E(\255Tj + Tj+2)154 192
-Q(XLA)144 216 Q(Tj \2552 * XLA)-1.11 E(Tj+1 + XLA)-1.11 E(Tj+2)-1.11 E
-10(----------------------------- =)144 228 R(0)2.5 E(\255Tj + Tj+2)154
-240 Q .496(The second deri)108 264 R -.25(va)-.25 G(ti).25 E .796 -.15
+156 Q(XLONj \255 2 * XLONj+1 + XLONj+2)144 180 Q 10
+(----------------------------- =)144 192 R(0)2.5 E(\255Tj + Tj+2)154 204
+Q(XLA)144 228 Q(Tj \2552 * XLA)-1.11 E(Tj+1 + XLA)-1.11 E(Tj+2)-1.11 E
+10(----------------------------- =)144 240 R(0)2.5 E(\255Tj + Tj+2)154
+252 Q .496(The second deri)108 276 R -.25(va)-.25 G(ti).25 E .796 -.15
 (ve c)-.25 H .496(alculation requires three sequential na).15 F(vig)-.2
 E .496(ation control points: j, j+1, and j+2.)-.05 F(Here)5.495 E .872
-(XLONj+2 and XLA)108 276 R .873
+(XLONj+2 and XLA)108 288 R .873
 (Tj+2 are the longitude and latitude changes for the "j+2"th na)-1.11 F
 (vig)-.2 E .873(ational control point)-.05 F .091
-(and Tj and Tj+2 are the times of the "j"th and "j+2"th na)108 288 R
+(and Tj and Tj+2 are the times of the "j"th and "j+2"th na)108 300 R
 (vig)-.2 E .09(ational control points. The denominator in these)-.05 F
--.15(ex)108 300 S(pressions is thus the time dif).15 E
+-.15(ex)108 312 S(pressions is thus the time dif).15 E
 (ference between the "j"th and "j+1"th na)-.25 E(vig)-.2 E
 (ation points.)-.05 E 1.14
-(The \214nal, and most important constraints are the relati)108 324 R
+(The \214nal, and most important constraints are the relati)108 336 R
 1.44 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E 1.14
 (ation ofsets de\214ned for each of the M tie)-.05 F 3.294
-(points. Since)108 336 R .794(each of)3.294 F .794
+(points. Since)108 348 R .794(each of)3.294 F .794
 (fset has a longitude and a latitude v)-.25 F .794
 (alue, there are 2M ro)-.25 F .794(ws in)-.25 F/F1 10/Times-Bold at 0 SF(A)
 3.294 E F0 .794(and elements in)3.294 F F1(D)3.294 E F0 1.522
-(associated with the tie points.)108 348 R 1.522
+(associated with the tie points.)108 360 R 1.522
 (If the "i"th tie point speci\214es an of)6.522 F 1.523
 (fset DLONi and DLA)-.25 F 2.223 -.35(Ti b)-1.11 H 1.523(etween the).35
-F("j1"th and "j2"th na)108 360 Q(vig)-.2 E
+F("j1"th and "j2"th na)108 372 Q(vig)-.2 E
 (ation control points, then the constraint may be e)-.05 E(xpressed as:)
--.15 E(-XLONj1 + XLONj2 = DLONi)144 384 Q(-XLA)144 408 Q(Tj1 + XLA)-1.11
+-.15 E(-XLONj1 + XLONj2 = DLONi)144 396 Q(-XLA)144 420 Q(Tj1 + XLA)-1.11
 E(Tj2 = DLA)-1.11 E -.35(Ti)-1.11 G 1.318
-(The size of the matrix problem will v)108 444 R 1.318
+(The size of the matrix problem will v)108 456 R 1.318
 (ary with the number of na)-.25 F(vig)-.2 E 1.317
 (ation control points, tie points, \214x)-.05 F(ed)-.15 E .736
-(points, and time g)108 456 R .736(aps. Ho)-.05 F(we)-.25 E -.15(ve)-.25
+(points, and time g)108 468 R .736(aps. Ho)-.05 F(we)-.25 E -.15(ve)-.25
 G 1.536 -.4(r, t).15 H .737(he addition of the speed and acceleration m\
 inimization constraints guar).4 F(-)-.2 E .814
-(entees that the number of constraints will al)108 468 R -.1(wa)-.1 G
+(entees that the number of constraints will al)108 480 R -.1(wa)-.1 G
 .813(ys be lar).1 F .813(ger than the number of unkno)-.18 F .813
-(wns, and so we will)-.25 F(al)108 480 Q -.1(wa)-.1 G 1.053
+(wns, and so we will)-.25 F(al)108 492 Q -.1(wa)-.1 G 1.053
 (ys be solving an o).1 F -.15(ve)-.15 G 1.053
 (rdetermined least squares problem.).15 F 1.054(Each of the abo)6.054 F
 1.354 -.15(ve e)-.15 H 1.054(quations contrib).15 F 1.054(ute one)-.2 F
-(ro)108 492 Q 2.57(wt)-.25 G 2.57(ot)-2.57 G .07
+(ro)108 504 Q 2.57(wt)-.25 G 2.57(ot)-2.57 G .07
 (he matrix problem, and each of these ro)-2.57 F .069
 (ws has at most three nonzero elements in)-.25 F F1(A)2.569 E F0 2.569
 (.A)C 2.569(sar)-2.569 G .069(esult, this)-2.569 F .533
-(matrix problem is also al)108 504 R -.1(wa)-.1 G .533(ys e).1 F .533
+(matrix problem is also al)108 516 R -.1(wa)-.1 G .533(ys e).1 F .533
 (xtremely sparse. This condition allo)-.15 F .534
 (ws us to use one of a class of approxi-)-.25 F .376
-(mate least squares solution algorithms that are ef)108 516 R .375
+(mate least squares solution algorithms that are ef)108 528 R .375
 (\214cient in solving sparse problems. The algorithm used for)-.25 F F1
-(mbna)108 528 Q -.1(va)-.25 G(djust).1 E F0(in)2.5 E -.15(ve)-.4 G
+(mbna)108 540 Q -.1(va)-.25 G(djust).1 E F0(in)2.5 E -.15(ve)-.4 G
 (rsions is that of Olsen [1987].).15 E .403(The importance of the speed\
- and acceleration minimization constraints is v)108 552 R .403
-(aried by multiplying the associ-)-.25 F 1.021(ated matrix ro)108 564 R
+ and acceleration minimization constraints is v)108 564 R .403
+(aried by multiplying the associ-)-.25 F 1.021(ated matrix ro)108 576 R
 3.521(we)-.25 G 1.021(lements by a penalty weight v)-3.521 F 3.521
 (alue. In)-.25 F 1.02(practice, the in)3.521 F -.15(ve)-.4 G 1.02
-(rsion is constructed and solv).15 F(ed)-.15 E .684(with man)108 576 R
+(rsion is constructed and solv).15 F(ed)-.15 E .684(with man)108 588 R
 3.184(yd)-.15 G(if)-3.184 E .684
 (ferent penalty weights, and the "best" in)-.25 F -.15(ve)-.4 G .685
 (rsion is selected and applied. Generally speaking,).15 F 1.119
-(we seek the smoothest in)108 588 R -.15(ve)-.4 G 1.118
+(we seek the smoothest in)108 600 R -.15(ve)-.4 G 1.118
 (rsion that satisf).15 F 1.118(actorily \214ts the tie point of)-.1 F
 1.118(fsets. W)-.25 F 3.618(es)-.8 G 1.118(et smoothness using the)
--3.618 F .066(penalty weight v)108 600 R .066(alue so that lar)-.25 F
+-3.618 F .066(penalty weight v)108 612 R .066(alue so that lar)-.25 F
 .066(ger penalty weights correspond to smoother solutions.)-.18 F 1.667
--.8(We m)5.066 H .067(easure the \214t to).8 F(the tie point of)108 612
+-.8(We m)5.066 H .067(easure the \214t to).8 F(the tie point of)108 624
 Q(fsets using the usual least squares calculation:)-.25 E 57.5 15(22 2)
-151.5 624 T 2.5(Fit =)144 636 R 2.5(Chi =)2.5 F 2.5(SUM\( \(DLONi)2.5 F
-2.5<ad28>2.5 G(XLONj2 \255 XLONj1\)\))-2.5 E(2)261.5 648 Q 2.5(+\()189
-660 S(DLA)-2.5 E .7 -.35(Ti \255 \()-1.11 H(XLA).35 E(Tj2 \255 XLA)-1.11
-E 2.5(Tj1\)\) \))-1.11 F .242(using the same notation as abo)108 672 R
+151.5 636 T 2.5(Fit =)144 648 R 2.5(Chi =)2.5 F 2.5(SUM\( \(DLONi)2.5 F
+2.5<ad28>2.5 G(XLONj2 \255 XLONj1\)\))-2.5 E(2)261.5 660 Q 2.5(+\()189
+672 S(DLA)-2.5 E .7 -.35(Ti \255 \()-1.11 H(XLA).35 E(Tj2 \255 XLA)-1.11
+E 2.5(Tj1\)\) \))-1.11 F .242(using the same notation as abo)108 684 R
 -.15(ve)-.15 G 2.742(.N).15 G .242
 (ote that the units of Chi are distance, and so are ph)-2.742 F .241
-(ysically meaningful.)-.05 F 3.203(As)108 684 S .703
+(ysically meaningful.)-.05 F 3.203(As)108 696 S .703
 (maller Chi corresponds to a better \214t to the tie point of)-3.203 F
 .703(fsets. The Chi v)-.25 F .704(alue will be smallest for a zero)-.25
-F(penalty weight, and increase as more smoothing is applied.)108 696 Q
-.153(The initial solution is generated using a v)108 720 R .152
-(ery small penalty weight to insure that the smoothing is ne)-.15 F
-(gligible)-.15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(18)199.835 E 0 Cg EP
+F(penalty weight, and increase as more smoothing is applied.)108 708 Q
+(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(18)195.945 E 0 Cg EP
 %%Page: 19 19
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
 (djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .053(and that the tie point of)108 84 R .054
+(djust\(1\)).25 E .153(The initial solution is generated using a v)108
+84 R .152(ery small penalty weight to insure that the smoothing is ne)
+-.15 F(gligible)-.15 E .053(and that the tie point of)108 96 R .054
 (fsets are \214t to the maximum de)-.25 F .054
 (gree possible. This \214rst in)-.15 F -.15(ve)-.4 G .054
-(rsion is used to set a "ref-).15 F .373(erence" v)108 96 R .372
+(rsion is used to set a "ref-).15 F .373(erence" v)108 108 R .372
 (alue of Chi. In some cases, the tie points of)-.25 F .372
 (fsets do not substantially con\215ict and it is possible for)-.25 F
-.591(the in)108 108 R -.15(ve)-.4 G .591(rsion to \214t the of).15 F
+.591(the in)108 120 R -.15(ve)-.4 G .591(rsion to \214t the of).15 F
 .591(fsets nearly e)-.25 F .592(xactly so that Chi is quite small. If t\
-he initial Chi is greater than the)-.15 F(tar)108 120 Q .839
+he initial Chi is greater than the)-.15 F(tar)108 132 Q .839
 (get precision for the in)-.18 F -.15(ve)-.4 G .838
 (rsion \(set from the Controls panel\),).15 F/F1 10/Times-Bold at 0 SF
 (mbna)3.338 E -.1(va)-.25 G(djust).1 E F0 .838
-(sets the reference \214t to this)3.338 F .081(initial v)108 132 R .081
+(sets the reference \214t to this)3.338 F .081(initial v)108 144 R .081
 (alue. Otherwise, the reference \214t is set to the tar)-.25 F .082
 (get precision. The def)-.18 F .082(ault v)-.1 F .082
 (alue is 0.1 meters, which)-.25 F 1.264
-(is appropriate for high resolution, lo)108 144 R 1.264(w-altitude surv)
+(is appropriate for high resolution, lo)108 156 R 1.264(w-altitude surv)
 -.25 F -.15(ey)-.15 G 1.264(s. Lar).15 F 1.264(ger v)-.18 F 1.263
 (alues will be more appropriate for lar)-.25 F(ge)-.18 E 1.778
-(altitude \(e.g. deep w)108 156 R 1.778(ater hull-mounted\) surv)-.1 F
+(altitude \(e.g. deep w)108 168 R 1.778(ater hull-mounted\) surv)-.1 F
 -.15(ey)-.15 G 1.779
 (s. The program then recalculates solutions with dif).15 F(ferent)-.25 E
 .529(penalty weights until the resulting Chi is between 1.05 and 1.1 ti\
-mes the reference \214t. This last solution is)108 168 R 1.17
-(chosen as the best solution, reported as the na)108 180 R(vig)-.2 E
+mes the reference \214t. This last solution is)108 180 R 1.17
+(chosen as the best solution, reported as the na)108 192 R(vig)-.2 E
 1.17(ation adjustment in)-.05 F -.15(ve)-.4 G 1.17
-(rsion solution, and applied to that).15 F(sw)108 192 Q 2.293
+(rsion solution, and applied to that).15 F(sw)108 204 Q 2.293
 (ath data na)-.1 F(vig)-.2 E 4.793(ation. The)-.05 F 2.293
 (justi\214cation for choosing the optimal solution in this f)4.793 F
 2.292(ashion is that this)-.1 F .788
-(approach insures that the smoothness constraint is suf)108 204 R .788
+(approach insures that the smoothness constraint is suf)108 216 R .788
 (\214cient lar)-.25 F .788(ge to be impacting the \214t, b)-.18 F .789
 (ut not so lar)-.2 F(ge)-.18 E(that the \214t has been substantially de)
-108 216 Q(graded.)-.15 E/F2 10.95/Times-Bold at 0 SF(REFERENCES)72 244.8 Q
-F0 1.392(Nishimura, C. E., and D. W)108 256.8 R 3.892(.F)-.92 G 1.392
+108 228 Q(graded.)-.15 E/F2 10.95/Times-Bold at 0 SF(REFERENCES)72 256.8 Q
+F0 1.392(Nishimura, C. E., and D. W)108 268.8 R 3.892(.F)-.92 G 1.392
 (orsyth, Impro)-4.042 F -.15(ve)-.15 G 1.392(ments in na).15 F(vig)-.2 E
 1.392(ation using SeaBeam crossing errors,)-.05 F/F3 10/Times-Italic at 0
-SF(Mar)3.892 E(.)-1.11 E(Geophys. Res.)108 268.8 Q F0(,)A F1(9)2.5 E F0
-2.5(,3)C(33-352, 1988.)-2.5 E 1.648(Olson, A. H., A Chebyshe)108 280.8 R
+SF(Mar)3.892 E(.)-1.11 E(Geophys. Res.)108 280.8 Q F0(,)A F1(9)2.5 E F0
+2.5(,3)C(33-352, 1988.)-2.5 E 1.648(Olson, A. H., A Chebyshe)108 292.8 R
 4.148(vc)-.25 G 1.648(ondition for accelerating con)-4.148 F -.15(ve)-.4
 G -.18(rg).15 G 1.649(ence of iterati).18 F 1.949 -.15(ve t)-.25 H 1.649
-(omographic methods \255).15 F(Solving lar)108 292.8 Q
+(omographic methods \255).15 F(Solving lar)108 304.8 Q
 (ge least squares problems, Ph)-.18 E(ys. Earth Planet. Inter)-.05 E
-(., 47, 333-345, 1987.)-.55 E -.15(Pa)108 304.8 S(rk).15 E(er)-.1 E 2.5
+(., 47, 333-345, 1987.)-.55 E -.15(Pa)108 316.8 S(rk).15 E(er)-.1 E 2.5
 (,R)-.4 G 2.5(.L)-2.5 G(.,)-2.5 E F1(Geoph)2.5 E(ysical In)-.15 E -.1
 (ve)-.4 G(rse Theory).1 E F0 2.5(,P)C(rinceton Uni)-2.5 E -.15(ve)-.25 G
-(rsity Press, Princeton, NJ, 1994.).15 E F2(SEE ALSO)72 333.6 Q F1
-(mbsystem)108 345.6 Q F0(\(1\),)A F1(mbio)2.5 E F0(\(1\),)A F1(mbpr)2.5
-E(ocess)-.18 E F0(\(1\),)A F1(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0
-(\(1\),)A F1(mbset)2.5 E F0(\(1\))A F2 -.11(BU)72 374.4 S(GS).11 E F0
-(It used to be too ne)108 386.4 Q 2.5(wt)-.25 G 2.5(ob)-2.5 G 2.5(eb)
+(rsity Press, Princeton, NJ, 1994.).15 E F2(SEE ALSO)72 345.6 Q F1(mbna)
+108 357.6 Q -.1(va)-.25 G(djustmer).1 E(ge\(1\))-.1 E F0(,)A F1
+(mbsystem)2.5 E F0(\(1\),)A F1(mbio)2.5 E F0(\(1\),)A F1(mbpr)2.5 E
+(ocess)-.18 E F0(\(1\),)A F1(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0
+(\(1\),)A F1(mbset)2.5 E F0(\(1\))A F2 -.11(BU)72 386.4 S(GS).11 E F0
+(It used to be too ne)108 398.4 Q 2.5(wt)-.25 G 2.5(ob)-2.5 G 2.5(eb)
 -2.5 G(ulletproof, no)-2.7 E 2.5(wi)-.25 G(ts too complicated to be b)
--2.5 E 2.5(ulletproof. Good)-.2 F(luck.)2.5 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(19)199.835 E 0 Cg EP
+-2.5 E 2.5(ulletproof. Good)-.2 F(luck.)2.5 E(MB-System 5.0)72 768 Q
+(22 April 2015)142.605 E(19)195.945 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbnavadjustmerge.ps b/src/ps/mbnavadjustmerge.ps
index d7c3629..7d5b1df 100644
--- a/src/ps/mbnavadjustmerge.ps
+++ b/src/ps/mbnavadjustmerge.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -239,307 +239,364 @@ E F0 2.762<ad54>2.762 G .262(ool to mer)-3.562 F .262(ge tw)-.18 F 2.761
 2.5(an)108 108 S .5 -.25(ew p)-2.5 H(roject combining both e).25 E
 (xisting projects.)-.15 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
 (rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbna)108 189.6 Q -.1(va)-.25
-G(djustmer).1 E(ge)-.1 E F0 8.348(--input=project-base [--input=project\
--add --output=project-output --add-cross-)10.847 F 12.975(ing=\214le1:s\
-ection1/\214le2:section2 --set-tie=\214le1:section1/\214le2:section2/xo\
-f)108 201.6 R(fset/yof)-.25 E(fset/zof)-.25 E 12.975(fset --set-tie-)
--.25 F 9.5(xyz=\214le1:section1/\214le2:section2 --set-tie-xyonly=\214l\
-e1:section1/\214le2:section2 --set-tie-zonly=\214le1:sec-)108 213.6 R
-.317(tion1/\214le2:section2 --set-ties-xyz-with-\214le=\214le --set-tie\
-s-xyonly-with-\214le=\214le --set-ties-zonly-with-\214le=\214le)108
-225.6 R(--set-ties-xyz-by-surv)108 237.6 Q -.15(ey)-.15 G(=surv).15 E
-11.57 -.15(ey -)-.15 H(-set-ties-xyonly-by-surv).15 E -.15(ey)-.15 G
-(=surv).15 E 11.57 -.15(ey -)-.15 H(-set-ties-zonly-by-surv).15 E -.15
-(ey)-.15 G(=surv).15 E -.15(ey)-.15 G(--set-ties-xyz-by-block=surv)108
-249.6 Q -.15(ey)-.15 G(1/surv).15 E -.15(ey)-.15 G 7.95(2-).15 G
-(-set-ties-xyonly-by-block=surv)-7.95 E -.15(ey)-.15 G(1/surv).15 E -.15
-(ey)-.15 G 7.95(2-).15 G(-set-ties-zonly-by-)-7.95 E(block=surv)108
-261.6 Q -.15(ey)-.15 G(1/surv).15 E -.15(ey)-.15 G 2.5(2-).15 G
-(-set-ties-zof)-2.5 E(fset-by-block=surv)-.25 E -.15(ey)-.15 G(1/surv)
-.15 E -.15(ey)-.15 G(2/zof).15 E(fset --skip-unset-crossings)-.25 E(--v)
-110.5 273.6 Q(erbose --help ])-.15 E F1(DESCRIPTION)72 302.4 Q F2(MBna)
-108 314.4 Q -.1(va)-.25 G(djustmer).1 E(ge)-.1 E F0 .272
-(is a command line program that mer)2.772 F .272(ges tw)-.18 F 2.772(oe)
--.1 G(xisting)-2.922 E F2(MBna)2.773 E -.1(va)-.25 G(djust).1 E F0 .273
-(projects or modi-)2.773 F(\214es a single)108 326.4 Q F2(MBna)2.5 E -.1
-(va)-.25 G(djust).1 E F0(project.)2.5 E F2(MBna)108 350.4 Q -.1(va)-.25
-G(djust).1 E F0 .388(is an interacti)2.888 F .687 -.15(ve g)-.25 H .387
-(raphical program used to adjust sw).15 F .387(ath data na)-.1 F(vig)-.2
-E .387(ation by matching bath)-.05 F(y-)-.05 E .894
-(metric features in o)108 362.4 R -.15(ve)-.15 G .894
+G(djustmer).1 E(ge)-.1 E F0 8.068(--input=project-base [--input=project\
+-add --output=project-output --set-global-)10.567 F
+(tie=\214le:section[:sna)108 201.6 Q(v]/xof)-.2 E(fset/yof)-.25 E
+(fset/zof)-.25 E 36.45
+(fset[/xsigma/ysigma/zsigma] --set-global-tie-xyz=\214le:sec-)-.25 F
+(tion[:sna)108 213.6 Q 6.85
+(v] --set-global-tie-xyonly=\214le:section[:sna)-.2 F 6.85
+(v] --set-global-tie-zonly=\214le:section[:sna)-.2 F 6.85(v] --unset-)
+-.2 F 17.555(global-tie=\214le:section --add-crossing=\214le1:section1/\
+\214le2:section2 --set-tie=\214le1:section1/\214le2:sec-)108 225.6 R
+(tion2/xof)108 237.6 Q(fset/yof)-.25 E(fset/zof)-.25 E 23.26(fset --set\
+-tie-xyz=\214le1:section1/\214le2:section2 --set-tie-xyonly=\214le1:sec\
+-)-.25 F 9.81(tion1/\214le2:section2 --set-tie-zonly=\214le1:section1/\
+\214le2:section2 --unset-tie=\214le1:section1/\214le2:section2)108 249.6
+R 2.92(--set-ties-xyz-with-\214le=\214le --set-ties-xyonly-with-\214le=\
+\214le --set-ties-zonly-with-\214le=\214le --set-ties-xyz-by-)108 261.6
+R(surv)108 273.6 Q -.15(ey)-.15 G(=surv).15 E 6.98 -.15(ey -)-.15 H
+(-set-ties-xyonly-by-surv).15 E -.15(ey)-.15 G(=surv).15 E 6.98 -.15
+(ey -)-.15 H(-set-ties-zonly-by-surv).15 E -.15(ey)-.15 G(=surv).15 E
+6.98 -.15(ey -)-.15 H(-set-ties-xyz-by-).15 E(block=surv)108 285.6 Q
+-.15(ey)-.15 G(1/surv).15 E -.15(ey)-.15 G 3.985(2-).15 G
+(-set-ties-xyonly-by-block=surv)-3.985 E -.15(ey)-.15 G(1/surv).15 E
+-.15(ey)-.15 G 3.985(2-).15 G(-set-ties-zonly-by-block=surv)-3.985 E
+-.15(ey)-.15 G(1/sur).15 E(-)-.2 E -.15(vey)108 297.6 S 14.097(2-).15 G
+(-set-ties-zof)-14.097 E(fset-by-block=surv)-.25 E -.15(ey)-.15 G
+(1/surv).15 E -.15(ey)-.15 G(2/zof).15 E 11.597
+(fset --skip-unset-crossings --insert-discontinu-)-.25 F
+(ity=\214le:section --v)108 309.6 Q(erbose --help ])-.15 E F1
+(DESCRIPTION)72 338.4 Q F2(MBna)108 350.4 Q -.1(va)-.25 G(djustmer).1 E
+(ge)-.1 E F0 .272(is a command line program that mer)2.772 F .272
+(ges tw)-.18 F 2.772(oe)-.1 G(xisting)-2.922 E F2(MBna)2.773 E -.1(va)
+-.25 G(djust).1 E F0 .273(projects or modi-)2.773 F(\214es a single)108
+362.4 Q F2(MBna)2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E F2
+(MBna)108 386.4 Q -.1(va)-.25 G(djust).1 E F0 .388(is an interacti)2.888
+F .687 -.15(ve g)-.25 H .387(raphical program used to adjust sw).15 F
+.387(ath data na)-.1 F(vig)-.2 E .387(ation by matching bath)-.05 F(y-)
+-.05 E .894(metric features in o)108 398.4 R -.15(ve)-.15 G .894
 (rlapping and crossing sw).15 F .894(aths. The primary purpose of)-.1 F
 F2(mbna)3.395 E -.1(va)-.25 G(djust).1 E F0 .895(is to eliminate)3.395 F
-(relati)108 374.4 Q .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E
+(relati)108 410.4 Q .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E
 (ational errors in sw)-.05 E(ath data obtained from poorly na)-.1 E(vig)
--.2 E(ated sonars.)-.05 E -.4(Wi)108 398.4 S .805(th respect to the mer)
+-.2 E(ated sonars.)-.05 E -.4(Wi)108 434.4 S .805(th respect to the mer)
 .4 F .805(ging function, if the)-.18 F F2(MBna)3.305 E -.1(va)-.25 G
 (djustmer).1 E(ge)-.1 E F0 .805(user speci\214es tw)3.305 F 3.304(oi)-.1
 G .804(nput projects and no)-3.304 F .873(output project, then the seco\
 nd project is added to the \214rst. If an output project is speci\214ed\
-, then the tw)108 410.4 R(o)-.1 E(projects are mer)108 422.4 Q
+, then the tw)108 446.4 R(o)-.1 E(projects are mer)108 458.4 Q
 (ged and the ne)-.18 E 2.5(wc)-.25 G(ombined project is output.)-2.5 E
-.405(In order to mak)108 446.4 R 2.904(eu)-.1 G .404(se of the project \
+.405(In order to mak)108 482.4 R 2.904(eu)-.1 G .404(se of the project \
 modi\214cation commands, a single input project must be speci\214ed, al\
 ong)-2.904 F 1.024(with one or more of the modi\214cation commands. The\
-se can include adding crossings, setting tie z-of)108 458.4 R(fset)-.25
-E -.25(va)108 470.4 S .912(lues, setting tie of).25 F .912(fsets \(e)
+se can include adding crossings, setting tie z-of)108 494.4 R(fset)-.25
+E -.25(va)108 506.4 S .912(lues, setting tie of).25 F .912(fsets \(e)
 -.25 F -.15(ve)-.25 G 3.412(ni).15 G 3.412(fn)-3.412 G 3.412(oc)-3.412 G
 .912(orresponding crossing already e)-3.412 F .912
 (xists\), setting tie modes \(xy only)-.15 F 3.411(,z)-.65 G(only)108
-482.4 Q 2.5(,x)-.65 G 2.5(yz\), and)-2.5 F(deleting ties.)2.5 E F1 -.548
-(AU)72 511.2 S(THORSHIP).548 E F0(Da)108 523.2 Q(vid W)-.2 E 2.5(.C)-.92
-G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 535.2 Q 2.5(yB)
+518.4 Q 2.5(,x)-.65 G 2.5(yz\), and)-2.5 F(deleting ties.)2.5 E F1 -.548
+(AU)72 547.2 S(THORSHIP).548 E F0(Da)108 559.2 Q(vid W)-.2 E 2.5(.C)-.92
+G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 571.2 Q 2.5(yB)
 -.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 547.2 Q
-(Lamont-Doherty Earth Observ)113 559.2 Q(atory)-.25 E F1(OPTIONS)72 588
-Q F2(\255-input=pr)108 600 Q(oject-base)-.18 E(\255-input=pr)144 612 Q
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 583.2 Q
+(Lamont-Doherty Earth Observ)113 595.2 Q(atory)-.25 E F1(OPTIONS)72 624
+Q F2(\255-input=pr)108 636 Q(oject-base)-.18 E(\255-input=pr)144 648 Q
 (oject-add)-.18 E F0(The)5.028 E F2(--input)5.028 E F0 2.528
 (option de\214nes an e)5.028 F 2.528(xisting, input)-.15 F F2(MBna)5.028
 E -.1(va)-.25 G(djust).1 E F0 2.528(project. A)5.028 F .814
-(project may be de\214ned by a relati)144 624 R 1.113 -.15(ve o)-.25 H
+(project may be de\214ned by a relati)144 660 R 1.113 -.15(ve o)-.25 H
 3.313(ra).15 G .813(bsolute path to the project *.n)-3.313 F .813
-(vh \214le or the project *.dir)-.4 F(directory)144 636 Q 3.931(.T)-.65
+(vh \214le or the project *.dir)-.4 F(directory)144 672 Q 3.931(.T)-.65
 G 1.431(his option can be used twice to specify tw)-3.931 F 3.931(oi)-.1
 G 1.432(nput projects. The \214rst use of)-3.931 F F2(--input)3.932 E F0
 .57(de\214nes the base input project, and the second de\214nes the add \
-input project. In the case where the)144 648 R F2(--output)144 660 Q F0
+input project. In the case where the)144 684 R F2(--output)144 696 Q F0
 .817(option is used to de\214ne an output project, the tw)3.317 F 3.317
 (oi)-.1 G .817(nput projects will both be copied to)-3.317 F 1.503
-(the ne)144 672 R 4.003(wo)-.25 G 1.503(utput project \()-4.003 F/F3 10
+(the ne)144 708 R 4.003(wo)-.25 G 1.503(utput project \()-4.003 F/F3 10
 /Times-Italic at 0 SF(pr)A(oject-base)-.45 E F0 1.503(\214rst follo)4.003 F
 1.503(wed by)-.25 F F3(pr)4.003 E(oject-add)-.45 E F0 1.503(\). If the)B
 F2(output)4.003 E F0 1.502(option is not)4.003 F .593
-(speci\214ed, then the)144 684 R F3(pr)3.093 E(oject-base)-.45 E F0 .593
+(speci\214ed, then the)144 720 R F3(pr)3.093 E(oject-base)-.45 E F0 .593
 (project is used as the output, and the)3.093 F F3(pr)3.094 E(oject-add)
--.45 E F0 .594(project is added)3.094 F .66(on to the)144 696 R F3(pr)
-3.16 E(oject-base)-.45 E F0 .66(project. If only the base input project\
- is speci\214ed, then that project will be)3.16 F(modi\214ed according \
-to one or more of the "add", "delete", "skip", or "set" commands.)144
-708 Q(MB-System 5.0)72 768 Q(28 May 2014)143.995 E(1)202.335 E 0 Cg EP
+-.45 E F0 .594(project is added)3.094 F(MB-System 5.0)72 768 Q
+(21 March 2015)140.11 E(1)198.45 E 0 Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
 (ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
-.25 E(ge\(1\))-.18 E/F1 10/Times-Bold at 0 SF(\255-output=pr)108 84 Q
-(oject-output)-.18 E F0 .524(This option de\214nes the ne)144 96 R(w)
--.25 E F1(MBna)3.024 E -.1(va)-.25 G .524(djust output pr).1 F .524
-(oject. The tw)-.18 F 3.024(oi)-.1 G .525(nput pr)-3.024 F .525
-(ojects will both be)-.18 F 1.216(copied to the new output pr)144 108 R
-1.215(oject \()-.18 F/F2 10/Times-Italic at 0 SF(pr)A(oject-base)-.45 E F1
-1.215(\214rst f)6.215 F(ollo)-.25 E 1.215(wed by)-.1 F F2(pr)3.715 E
-(oject-add)-.45 E F1 3.715(\). If)B 1.215(the output)3.715 F .305
-(option is not speci\214ed, then the)144 120 R F2(pr)2.805 E(oject-base)
--.45 E F1(pr)2.805 E .306(oject is used as the output, and the)-.18 F F2
-(pr)2.806 E(oject-add)-.45 E F1(pr)144 132 Q(oject is added on to the)
--.18 E F2(pr)2.5 E(oject-base)-.45 E F1(pr)2.5 E(oject.)-.18 E
-(\255-add-cr)108 148.8 Q(ossing=\214le1:section1/\214le2:section2)-.18 E
-F0(This option adds the speci\214ed crossing to the)144 160.8 Q F1(MBna)
-2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E F1
-(\255-set-tie=\214le1:section1/\214le2:section2/xoffset/y)108 177.6 Q
+.25 E(ge\(1\))-.18 E .66(on to the)144 84 R/F1 10/Times-Italic at 0 SF(pr)
+3.16 E(oject-base)-.45 E F0 .66(project. If only the base input project\
+ is speci\214ed, then that project will be)3.16 F(modi\214ed according \
+to one or more of the "add", "delete", "skip", or "set" commands.)144 96
+Q/F2 10/Times-Bold at 0 SF(\255-output=pr)108 112.8 Q(oject-output)-.18 E
+F0 .524(This option de\214nes the ne)144 124.8 R(w)-.25 E F2(MBna)3.024
+E -.1(va)-.25 G .524(djust output pr).1 F .524(oject. The tw)-.18 F
+3.024(oi)-.1 G .525(nput pr)-3.024 F .525(ojects will both be)-.18 F
+1.216(copied to the new output pr)144 136.8 R 1.215(oject \()-.18 F F1
+(pr)A(oject-base)-.45 E F2 1.215(\214rst f)6.215 F(ollo)-.25 E 1.215
+(wed by)-.1 F F1(pr)3.715 E(oject-add)-.45 E F2 3.715(\). If)B 1.215
+(the output)3.715 F .305(option is not speci\214ed, then the)144 148.8 R
+F1(pr)2.805 E(oject-base)-.45 E F2(pr)2.805 E .306
+(oject is used as the output, and the)-.18 F F1(pr)2.806 E(oject-add)
+-.45 E F2(pr)144 160.8 Q(oject is added on to the)-.18 E F1(pr)2.5 E
+(oject-base)-.45 E F2(pr)2.5 E(oject.)-.18 E
+(\255-set-global-tie=\214le:section[:sna)108 177.6 Q(v]/xoffset/y)-.25 E
+(offset/zoffset[/xsigma/ysigma/zsigma])-.25 E F0 .301
+(This options sets a global tie for a na)144 189.6 R(vig)-.2 E .301
+(ation point in the project. Global ties are ties to the global)-.05 F
+1.151
+(reference frame, which generally means GPS positions \(e.g. WGS84\).)
+144 201.6 R 1.151(The \214le and section id')6.151 F(s)-.55 E .754(must\
+ be speci\214ed, along with the x \(east-west\), y \(north-south\), and\
+ z \(v)144 213.6 R .754(ertical posti)-.15 F 1.054 -.15(ve u)-.25 H .754
+(p\) of).15 F(fset)-.25 E -.25(va)144 225.6 S .266
+(lues in meters. If the sna).25 F 2.766(vi)-.2 G 2.766(d\()-2.766 G(na)
+-2.766 E(vig)-.2 E .267(ation point id\) is not speci\214ed, it is assu\
+med to be 0, the \214rst)-.05 F(na)144 237.6 Q(vig)-.2 E 1.5(ation poin\
+t in the speci\214ed section. If the uncertainties in the global tie \(\
+xsigma, ysigma,)-.05 F(zsigma\) are not speci\214ed, then xsigma = ysig\
+ma = 10 m and zsigma = 0.5 m are assumed.)144 249.6 Q F2
+(\255-set-global-tie-xyz=\214le:section[:sna)108 266.4 Q(v])-.25 E F0
+1.101(This option sets the mode of the e)144 278.4 R 1.101
+(xisting speci\214ed global tie in the)-.15 F F2(MBna)3.602 E -.1(va)
+-.25 G(djust).1 E F0 1.102(project to be)3.602 F .529("XYZ". This means\
+ all three coordinates of the tie will be used as constraints in the in)
+144 290.4 R -.15(ve)-.4 G .529(rsion for).15 F(an optimal na)144 302.4 Q
+(vig)-.2 E(ation model.)-.05 E F2(\255-set-global-tie-xy)108 319.2 Q
+(only=\214le:section[:sna)-.25 E(v])-.25 E F0 1.101
+(This option sets the mode of the e)144 331.2 R 1.101
+(xisting speci\214ed global tie in the)-.15 F F2(MBna)3.602 E -.1(va)
+-.25 G(djust).1 E F0 1.102(project to be)3.602 F 1.586("XY". This means\
+ only the horizontal coordinates of the tie will be used as constraints\
+ in the)144 343.2 R(in)144 355.2 Q -.15(ve)-.4 G
+(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F2
+(\255-set-global-tie-zonly=\214le:section[:sna)108 372 Q(v])-.25 E F0
+1.101(This option sets the mode of the e)144 384 R 1.101
+(xisting speci\214ed global tie in the)-.15 F F2(MBna)3.602 E -.1(va)
+-.25 G(djust).1 E F0 1.102(project to be)3.602 F .339
+("Z". This means only the v)144 396 R .338
+(ertical coordinate of the tie will be used as a constraint in the in)
+-.15 F -.15(ve)-.4 G(rsion).15 E(for an optimal na)144 408 Q(vig)-.2 E
+(ation model.)-.05 E F2(\255-unset-global-tie=\214le:section)108 424.8 Q
+F0(This option unsets \(deletes\) the speci\214ed global tie in the)144
+436.8 Q F2(MBna)2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E F2
+(\255-add-cr)108 453.6 Q(ossing=\214le1:section1/\214le2:section2)-.18 E
+F0(This option adds the speci\214ed crossing to the)144 465.6 Q F2(MBna)
+2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E F2
+(\255-set-tie=\214le1:section1/\214le2:section2/xoffset/y)108 482.4 Q
 (offset/zoffset)-.25 E F0 .218
-(This option adds the speci\214ed tie to the)144 189.6 R F1(MBna)2.718 E
--.1(va)-.25 G(djust).1 E F0 2.718(project. If)2.718 F .217
-(the corresponding crossing does)2.718 F(not already e)144 201.6 Q
-(xist, it will be created.)-.15 E F1
-(\255-set-tie-xyz=\214le1:section1/\214le2:section2)108 218.4 Q F0 .713
-(This option sets the mode of the e)144 230.4 R .713
-(xisting speci\214ed tie in the)-.15 F F1(MBna)3.213 E -.1(va)-.25 G
-(djust).1 E F0 .714(project to be "XYZ".)3.213 F .521(This means all th\
+(This option adds the speci\214ed tie to the)144 494.4 R F2(MBna)2.718 E
+-.1(va)-.25 G(djust).1 E F0 2.718(project. If)2.718 F .218
+(the corresponding crossing does)2.718 F(not already e)144 506.4 Q
+(xist, it will be created.)-.15 E F2
+(\255-set-tie-xyz=\214le1:section1/\214le2:section2)108 523.2 Q F0 .713
+(This option sets the mode of the e)144 535.2 R .713
+(xisting speci\214ed tie in the)-.15 F F2(MBna)3.213 E -.1(va)-.25 G
+(djust).1 E F0 .713(project to be "XYZ".)3.213 F .521(This means all th\
 ree coordinates of the tie will be used as constraints in the in)144
-242.4 R -.15(ve)-.4 G .521(rsion for an opti-).15 F(mal na)144 254.4 Q
-(vig)-.2 E(ation model.)-.05 E F1(\255-set-tie-xy)108 271.2 Q
+547.2 R -.15(ve)-.4 G .522(rsion for an opti-).15 F(mal na)144 559.2 Q
+(vig)-.2 E(ation model.)-.05 E F2(\255-set-tie-xy)108 576 Q
 (only=\214le1:section1/\214le2:section2)-.25 E F0 1.095
-(This option sets the mode of the e)144 283.2 R 1.095
-(xisting speci\214ed tie in the)-.15 F F1(MBna)3.595 E -.1(va)-.25 G
+(This option sets the mode of the e)144 588 R 1.095
+(xisting speci\214ed tie in the)-.15 F F2(MBna)3.595 E -.1(va)-.25 G
 (djust).1 E F0 1.095(project to be "XY".)3.595 F .863(This means only t\
 he horizontal coordinates of the tie will be used as constraints in the\
- in)144 295.2 R -.15(ve)-.4 G(rsion).15 E(for an optimal na)144 307.2 Q
-(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-tie-zonly=\214le1:section1/\214le2:section2)108 324 Q F0 .327
-(This option sets the mode of the e)144 336 R .328
-(xisting speci\214ed tie in the)-.15 F F1(MBna)2.828 E -.1(va)-.25 G
-(djust).1 E F0 .328(project to be "Z". This)2.828 F 1.086
-(means only the v)144 348 R 1.086
+ in)144 600 R -.15(ve)-.4 G(rsion).15 E(for an optimal na)144 612 Q(vig)
+-.2 E(ation model.)-.05 E F2
+(\255-set-tie-zonly=\214le1:section1/\214le2:section2)108 628.8 Q F0
+.328(This option sets the mode of the e)144 640.8 R .328
+(xisting speci\214ed tie in the)-.15 F F2(MBna)2.827 E -.1(va)-.25 G
+(djust).1 E F0 .327(project to be "Z". This)2.827 F 1.085
+(means only the v)144 652.8 R 1.086
 (ertical coordinate of the tie will be used as a constraint in the in)
--.15 F -.15(ve)-.4 G 1.085(rsion for an).15 F(optimal na)144 360 Q(vig)
--.2 E(ation model.)-.05 E F1(\255-set-ties-xyz-with-\214le=\214le)108
-376.8 Q F0 .14(This option sets the mode of all ties in)144 388.8 R -.2
-(vo)-.4 G(lv).2 E .14(ed with the speci\214ed \214le in the)-.15 F F1
-(MBna)2.64 E -.1(va)-.25 G(djust).1 E F0 .14(project to)2.64 F .738(be \
-"XYZ". This means all three coordinates of these ties will be used as c\
-onstraints in the in)144 400.8 R -.15(ve)-.4 G -.2(r-).15 G
-(sion for an optimal na)144 412.8 Q(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-xy)108 429.6 Q(only-with-\214le=\214le)-.25 E F0 .14
-(This option sets the mode of all ties in)144 441.6 R -.2(vo)-.4 G(lv).2
+-.15 F -.15(ve)-.4 G 1.086(rsion for an).15 F(optimal na)144 664.8 Q
+(vig)-.2 E(ation model.)-.05 E F2
+(\255-unset-tie=\214le1:section1/\214le2:section2)108 681.6 Q F0
+(This option unsets \(deletes\) the speci\214ed tie in the)144 693.6 Q
+F2(MBna)2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E(MB-System 5.0)
+72 768 Q(21 March 2015)140.11 E(2)198.45 E 0 Cg EP
+%%Page: 3 3
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
+(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
+.25 E(ge\(1\))-.18 E/F1 10/Times-Bold at 0 SF
+(\255-set-ties-xyz-with-\214le=\214le)108 84 Q F0 .14
+(This option sets the mode of all ties in)144 96 R -.2(vo)-.4 G(lv).2 E
+.14(ed with the speci\214ed \214le in the)-.15 F F1(MBna)2.64 E -.1(va)
+-.25 G(djust).1 E F0 .14(project to)2.64 F .738(be "XYZ". This means al\
+l three coordinates of these ties will be used as constraints in the in)
+144 108 R -.15(ve)-.4 G -.2(r-).15 G(sion for an optimal na)144 120 Q
+(vig)-.2 E(ation model.)-.05 E F1(\255-set-ties-xy)108 136.8 Q
+(only-with-\214le=\214le)-.25 E F0 .14
+(This option sets the mode of all ties in)144 148.8 R -.2(vo)-.4 G(lv).2
 E .14(ed with the speci\214ed \214le in the)-.15 F F1(MBna)2.64 E -.1
 (va)-.25 G(djust).1 E F0 .14(project to)2.64 F .072(be "XY". This means\
  only the horizontal coordinates of these ties will be used as constrai\
-nts in the)144 453.6 R(in)144 465.6 Q -.15(ve)-.4 G
+nts in the)144 160.8 R(in)144 172.8 Q -.15(ve)-.4 G
 (rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-zonly-with-\214le=\214le)108 482.4 Q F0 .14
-(This option sets the mode of all ties in)144 494.4 R -.2(vo)-.4 G(lv).2
+(\255-set-ties-zonly-with-\214le=\214le)108 189.6 Q F0 .14
+(This option sets the mode of all ties in)144 201.6 R -.2(vo)-.4 G(lv).2
 E .14(ed with the speci\214ed \214le in the)-.15 F F1(MBna)2.64 E -.1
-(va)-.25 G(djust).1 E F0 .14(project to)2.64 F 1.421
-(be "Z". This means only the v)144 506.4 R 1.42
+(va)-.25 G(djust).1 E F0 .14(project to)2.64 F 1.42
+(be "Z". This means only the v)144 213.6 R 1.421
 (ertical coordinate of these ties will be used as constraints in the)
--.15 F(in)144 518.4 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)
--.2 E(ation model.)-.05 E F1(\255-set-ties-xyz-with-sur)108 535.2 Q -.1
-(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 1.956
-(This option sets the mode of all ties in)144 547.2 R -.2(vo)-.4 G(lv).2
-E 1.957(ed with the speci\214ed surv)-.15 F 2.257 -.15(ey i)-.15 H 4.457
-(nt).15 G(he)-4.457 E F1(MBna)4.457 E -.1(va)-.25 G(djust).1 E F0 .726(\
+-.15 F(in)144 225.6 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)
+-.2 E(ation model.)-.05 E F1(\255-set-ties-xyz-with-sur)108 242.4 Q -.1
+(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 1.957
+(This option sets the mode of all ties in)144 254.4 R -.2(vo)-.4 G(lv).2
+E 1.957(ed with the speci\214ed surv)-.15 F 2.256 -.15(ey i)-.15 H 4.456
+(nt).15 G(he)-4.456 E F1(MBna)4.456 E -.1(va)-.25 G(djust).1 E F0 .726(\
 project to be "XYZ". This means all three coordinates of these ties wil\
-l be used as constraints in)144 559.2 R(the in)144 571.2 Q -.15(ve)-.4 G
+l be used as constraints in)144 266.4 R(the in)144 278.4 Q -.15(ve)-.4 G
 (rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-xy)108 588 Q(only-with-sur)-.25 E -.1(ve)-.1 G(y=sur).1 E
--.1(ve)-.1 G(y).1 E F0 1.956(This option sets the mode of all ties in)
-144 600 R -.2(vo)-.4 G(lv).2 E 1.957(ed with the speci\214ed surv)-.15 F
-2.257 -.15(ey i)-.15 H 4.457(nt).15 G(he)-4.457 E F1(MBna)4.457 E -.1
+(\255-set-ties-xy)108 295.2 Q(only-with-sur)-.25 E -.1(ve)-.1 G(y=sur).1
+E -.1(ve)-.1 G(y).1 E F0 1.957(This option sets the mode of all ties in)
+144 307.2 R -.2(vo)-.4 G(lv).2 E 1.957(ed with the speci\214ed surv)-.15
+F 2.256 -.15(ey i)-.15 H 4.456(nt).15 G(he)-4.456 E F1(MBna)4.456 E -.1
 (va)-.25 G(djust).1 E F0 .661(project to be "XY". This means only the h\
-orizontal coordinates of these ties will be used as con-)144 612 R
-(straints in the in)144 624 Q -.15(ve)-.4 G(rsion for an optimal na).15
-E(vig)-.2 E(ation model.)-.05 E F1(\255-set-ties-zonly-with-sur)108
-640.8 Q -.1(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 1.956
-(This option sets the mode of all ties in)144 652.8 R -.2(vo)-.4 G(lv).2
-E 1.957(ed with the speci\214ed surv)-.15 F 2.257 -.15(ey i)-.15 H 4.457
-(nt).15 G(he)-4.457 E F1(MBna)4.457 E -.1(va)-.25 G(djust).1 E F0 .506
-(project to be "Z". This means only the v)144 664.8 R .506
+orizontal coordinates of these ties will be used as con-)144 319.2 R
+(straints in the in)144 331.2 Q -.15(ve)-.4 G(rsion for an optimal na)
+.15 E(vig)-.2 E(ation model.)-.05 E F1(\255-set-ties-zonly-with-sur)108
+348 Q -.1(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 1.957
+(This option sets the mode of all ties in)144 360 R -.2(vo)-.4 G(lv).2 E
+1.957(ed with the speci\214ed surv)-.15 F 2.256 -.15(ey i)-.15 H 4.456
+(nt).15 G(he)-4.456 E F1(MBna)4.456 E -.1(va)-.25 G(djust).1 E F0 .506
+(project to be "Z". This means only the v)144 372 R .506
 (ertical coordinate of these ties will be used as constraints)-.15 F
-(in the in)144 676.8 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)
--.2 E(ation model.)-.05 E F1(\255-set-ties-xyz-by-sur)108 693.6 Q -.1
-(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .055
-(This option sets the mode of all ties between tw)144 705.6 R 2.555(os)
--.1 G .055(ections in the speci\214ed surv)-2.555 F .356 -.15(ey i)-.15
-H 2.556(nt).15 G(he)-2.556 E F1(MBna)2.556 E -.1(va)-.25 G(d-).1 E(just)
-144 717.6 Q F0 .236(project to be "XYZ". This means all three coordinat\
-es of these ties will be used as constraints)2.736 F(in the in)144 729.6
+(in the in)144 384 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2
+E(ation model.)-.05 E F1(\255-set-ties-xyz-by-sur)108 400.8 Q -.1(ve)-.1
+G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .056
+(This option sets the mode of all ties between tw)144 412.8 R 2.555(os)
+-.1 G .055(ections in the speci\214ed surv)-2.555 F .355 -.15(ey i)-.15
+H 2.555(nt).15 G(he)-2.555 E F1(MBna)2.555 E -.1(va)-.25 G(d-).1 E(just)
+144 424.8 Q F0 .236(project to be "XYZ". This means all three coordinat\
+es of these ties will be used as constraints)2.735 F(in the in)144 436.8
 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2 E(ation model.)
--.05 E(MB-System 5.0)72 768 Q(28 May 2014)143.995 E(2)202.335 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
-(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
-.25 E(ge\(1\))-.18 E/F1 10/Times-Bold at 0 SF(\255-set-ties-xy)108 84 Q
-(only-by-sur)-.25 E -.1(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .055
-(This option sets the mode of all ties between tw)144 96 R 2.555(os)-.1
-G .055(ections in the speci\214ed surv)-2.555 F .356 -.15(ey i)-.15 H
-2.556(nt).15 G(he)-2.556 E F1(MBna)2.556 E -.1(va)-.25 G(d-).1 E(just)
-144 108 Q F0 .758(project to be "XY". This means only the horizontal co\
-ordinates of these ties will be used as)3.259 F(constraints in the in)
-144 120 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2 E
-(ation model.)-.05 E F1(\255-set-ties-zonly-by-sur)108 136.8 Q -.1(ve)
--.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .055
-(This option sets the mode of all ties between tw)144 148.8 R 2.555(os)
--.1 G .055(ections in the speci\214ed surv)-2.555 F .356 -.15(ey i)-.15
-H 2.556(nt).15 G(he)-2.556 E F1(MBna)2.556 E -.1(va)-.25 G(d-).1 E(just)
-144 160.8 Q F0 .864(project to be "Z". This means only the v)3.364 F
+-.05 E F1(\255-set-ties-xy)108 453.6 Q(only-by-sur)-.25 E -.1(ve)-.1 G
+(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .056
+(This option sets the mode of all ties between tw)144 465.6 R 2.555(os)
+-.1 G .055(ections in the speci\214ed surv)-2.555 F .355 -.15(ey i)-.15
+H 2.555(nt).15 G(he)-2.555 E F1(MBna)2.555 E -.1(va)-.25 G(d-).1 E(just)
+144 477.6 Q F0 .758(project to be "XY". This means only the horizontal \
+coordinates of these ties will be used as)3.258 F(constraints in the in)
+144 489.6 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2 E
+(ation model.)-.05 E F1(\255-set-ties-zonly-by-sur)108 506.4 Q -.1(ve)
+-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .056
+(This option sets the mode of all ties between tw)144 518.4 R 2.555(os)
+-.1 G .055(ections in the speci\214ed surv)-2.555 F .355 -.15(ey i)-.15
+H 2.555(nt).15 G(he)-2.555 E F1(MBna)2.555 E -.1(va)-.25 G(d-).1 E(just)
+144 530.4 Q F0 .864(project to be "Z". This means only the v)3.363 F
 .864(ertical coordinate of these ties will be used as con-)-.15 F
-(straints in the in)144 172.8 Q -.15(ve)-.4 G(rsion for an optimal na)
+(straints in the in)144 542.4 Q -.15(ve)-.4 G(rsion for an optimal na)
 .15 E(vig)-.2 E(ation model.)-.05 E F1(\255-set-ties-xyz-by-block=sur)
-108 189.6 Q -.1(ve)-.1 G(y1/sur).1 E -.1(ve)-.1 G(y2).1 E F0 2.763(This\
+108 559.2 Q -.1(ve)-.1 G(y1/sur).1 E -.1(ve)-.1 G(y2).1 E F0 2.763(This\
  option sets the mode of all ties between sections of the speci\214ed t\
-w)144 201.6 R 5.263(os)-.1 G(urv)-5.263 E -.15(ey)-.15 G 5.264(si).15 G
-5.264(nt)-5.264 G(he)-5.264 E F1(MBna)144 213.6 Q -.1(va)-.25 G(djust).1
-E F0 .497(project to be "XYZ". This means all three coordinates of thes\
-e ties will be used as)2.998 F(constraints in the in)144 225.6 Q -.15
+w)144 571.2 R 5.263(os)-.1 G(urv)-5.263 E -.15(ey)-.15 G 5.263(si).15 G
+5.263(nt)-5.263 G(he)-5.263 E F1(MBna)144 583.2 Q -.1(va)-.25 G(djust).1
+E F0 .498(project to be "XYZ". This means all three coordinates of thes\
+e ties will be used as)2.997 F(constraints in the in)144 595.2 Q -.15
 (ve)-.4 G(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-xy)108 242.4 Q(only-by-block=sur)-.25 E -.1(ve)-.1 G
-(y1/sur).1 E -.1(ve)-.1 G(y2).1 E F0 2.797(This option sets the mode of\
- all ties between sections in the speci\214ed tw)144 254.4 R 5.298(os)
--.1 G(urv)-5.298 E -.15(ey)-.15 G 5.298(si).15 G 5.298(nt)-5.298 G(he)
--5.298 E F1(MBna)144 266.4 Q -.1(va)-.25 G(djust).1 E F0 .178(project t\
-o be "XY". This means only the horizontal coordinates of these ties wil\
-l be)2.678 F(used as constraints in the in)144 278.4 Q -.15(ve)-.4 G
+(\255-set-ties-xy)108 612 Q(only-by-block=sur)-.25 E -.1(ve)-.1 G
+(y1/sur).1 E -.1(ve)-.1 G(y2).1 E F0 2.798(This option sets the mode of\
+ all ties between sections in the speci\214ed tw)144 624 R 5.297(os)-.1
+G(urv)-5.297 E -.15(ey)-.15 G 5.297(si).15 G 5.297(nt)-5.297 G(he)-5.297
+E F1(MBna)144 636 Q -.1(va)-.25 G(djust).1 E F0 .178(project to be "XY"\
+. This means only the horizontal coordinates of these ties will be)2.678
+F(used as constraints in the in)144 648 Q -.15(ve)-.4 G
 (rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-zonly-by-block=sur)108 295.2 Q -.1(ve)-.1 G(y1/sur).1 E
--.1(ve)-.1 G(y2).1 E F0 2.797(This option sets the mode of all ties bet\
-ween sections in the speci\214ed tw)144 307.2 R 5.298(os)-.1 G(urv)
--5.298 E -.15(ey)-.15 G 5.298(si).15 G 5.298(nt)-5.298 G(he)-5.298 E F1
-(MBna)144 319.2 Q -.1(va)-.25 G(djust).1 E F0 .298
-(project to be "Z". This means only the v)2.799 F .298
+(\255-set-ties-zonly-by-block=sur)108 664.8 Q -.1(ve)-.1 G(y1/sur).1 E
+-.1(ve)-.1 G(y2).1 E F0 2.798(This option sets the mode of all ties bet\
+ween sections in the speci\214ed tw)144 676.8 R 5.297(os)-.1 G(urv)
+-5.297 E -.15(ey)-.15 G 5.297(si).15 G 5.297(nt)-5.297 G(he)-5.297 E F1
+(MBna)144 688.8 Q -.1(va)-.25 G(djust).1 E F0 .298
+(project to be "Z". This means only the v)2.798 F .298
 (ertical coordinate of these ties will be used)-.15 F
-(as constraints in the in)144 331.2 Q -.15(ve)-.4 G
-(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-zoffset-by-block=sur)108 348 Q -.1(ve)-.1 G(y1/sur).1 E
--.1(ve)-.1 G(y2/zoffset).1 E F0(This option resets the zof)144 360 Q
+(as constraints in the in)144 700.8 Q -.15(ve)-.4 G
+(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E
+(MB-System 5.0)72 768 Q(21 March 2015)140.11 E(3)198.45 E 0 Cg EP
+%%Page: 4 4
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
+(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
+.25 E(ge\(1\))-.18 E/F1 10/Times-Bold at 0 SF
+(\255-set-ties-zoffset-by-block=sur)108 84 Q -.1(ve)-.1 G(y1/sur).1 E
+-.1(ve)-.1 G(y2/zoffset).1 E F0(This option resets the zof)144 96 Q
 (fset v)-.25 E(alue of all ties between sections in the speci\214ed tw)
 -.25 E 2.5(os)-.1 G(urv)-2.5 E -.15(ey)-.15 G(s.).15 E F1
-(\255-skip-unset-cr)108 376.8 Q(ossings)-.18 E F0 .45(This option sets \
+(\255-skip-unset-cr)108 112.8 Q(ossings)-.18 E F0 .45(This option sets \
 all unset crossings in the input projects to be skipped. This does not \
-apply to an)144 388.8 R(y)-.15 E(ne)144 400.8 Q 2.5(wc)-.25 G
+apply to an)144 124.8 R(y)-.15 E(ne)144 136.8 Q 2.5(wc)-.25 G
 (rossings between the tw)-2.5 E 2.5(om)-.1 G(er)-2.5 E(ged projects.)
--.18 E F1(\255-v)108 417.6 Q(erbose)-.1 E F0 1.009
-(This option increases the v)144 429.6 R 1.008(erbosity of)-.15 F F1
+-.18 E F1(\255-v)108 153.6 Q(erbose)-.1 E F0 1.008
+(This option increases the v)144 165.6 R 1.008(erbosity of)-.15 F F1
 (MBna)3.508 E -.1(va)-.25 G(djustmer).1 E(ge)-.1 E F0 3.508(,w)C 1.008
-(hich means that more information)-3.508 F(than by def)144 441.6 Q
+(hich means that more information)-3.508 F(than by def)144 177.6 Q
 (ault is output to the stderr stream of the shell.)-.1 E F1(\255-help)
-108 458.4 Q F0 .153(This option causes)8.63 F F1(MBna)2.654 E -.1(va)
+108 194.4 Q F0 .154(This option causes)8.63 F F1(MBna)2.654 E -.1(va)
 -.25 G(djustmer).1 E .154
 (geP to output a list of the possible command line options,)-.1 F
-(and then exit.)144 470.4 Q/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 499.2 Q
-F0 .643(Suppose you ha)108 511.2 R .942 -.15(ve t)-.2 H .842 -.1(wo A)
+(and then exit.)144 206.4 Q/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 235.2 Q
+F0 .642(Suppose you ha)108 247.2 R .942 -.15(ve t)-.2 H .842 -.1(wo A)
 .15 H .642(UV surv)-.45 F .942 -.15(ey m)-.15 H .642
 (issions, 20140515m1 and 10140515m2, that o).15 F -.15(ve)-.15 G .642
-(rlap slightly).15 F 3.142(.I)-.65 G 3.142(fy)-3.142 G(ou)-3.142 E(ha)
-108 523.2 Q 1.201 -.15(ve u)-.2 H(sed).15 E F1(MBna)3.401 E -.1(va)-.25
-G(djust).1 E F0 .901(to adjust the na)3.401 F(vig)-.2 E .901
-(ation of the tw)-.05 F 3.401(om)-.1 G .902(issions separately)-3.401 F
-3.402(,y)-.65 G .902(ou can use)-3.402 F F1(MBna)3.402 E -.1(va)-.25 G
-(d-).1 E(justmer)108 535.2 Q(ge)-.1 E F0 .334(to mer)2.834 F .334
-(ge the tw)-.18 F(o)-.1 E F1(MBna)2.834 E -.1(va)-.25 G(djust).1 E F0
-.334(projects into a single ne)2.834 F 2.833(wp)-.25 G .333
-(roject without losing an)-2.833 F 2.833(yo)-.15 G 2.833(ft)-2.833 G
-.333(he ties)-2.833 F .35(made between o)108 547.2 R -.15(ve)-.15 G .35
-(rlapping sections in the e).15 F .351(xisting projects. If the tw)-.15
-F 2.851(oe)-.1 G .351(xisting projects are named "Na)-3.001 F -.25(va)
--.2 G(d-).25 E 1.598(just20140515m1" and "Na)108 559.2 R -.25(va)-.2 G
-1.598(djust20140515m2", respecti).25 F -.15(ve)-.25 G(ly).15 E 4.097(,t)
--.65 G 1.597(hen there e)-4.097 F 1.597(xist project \214les with a ".n)
--.15 F(vh")-.4 E(suf)108 571.2 Q .333
+(rlap slightly).15 F 3.143(.I)-.65 G 3.143(fy)-3.143 G(ou)-3.143 E(ha)
+108 259.2 Q 1.202 -.15(ve u)-.2 H(sed).15 E F1(MBna)3.402 E -.1(va)-.25
+G(djust).1 E F0 .902(to adjust the na)3.402 F(vig)-.2 E .901
+(ation of the tw)-.05 F 3.401(om)-.1 G .901(issions separately)-3.401 F
+3.401(,y)-.65 G .901(ou can use)-3.401 F F1(MBna)3.401 E -.1(va)-.25 G
+(d-).1 E(justmer)108 271.2 Q(ge)-.1 E F0 .333(to mer)2.833 F .333
+(ge the tw)-.18 F(o)-.1 E F1(MBna)2.833 E -.1(va)-.25 G(djust).1 E F0
+.333(projects into a single ne)2.833 F 2.834(wp)-.25 G .334
+(roject without losing an)-2.834 F 2.834(yo)-.15 G 2.834(ft)-2.834 G
+.334(he ties)-2.834 F .351(made between o)108 283.2 R -.15(ve)-.15 G
+.351(rlapping sections in the e).15 F .351(xisting projects. If the tw)
+-.15 F 2.85(oe)-.1 G .35(xisting projects are named "Na)-3 F -.25(va)-.2
+G(d-).25 E 1.597(just20140515m1" and "Na)108 295.2 R -.25(va)-.2 G 1.597
+(djust20140515m2", respecti).25 F -.15(ve)-.25 G(ly).15 E 4.097(,t)-.65
+G 1.597(hen there e)-4.097 F 1.598(xist project \214les with a ".n)-.15
+F(vh")-.4 E(suf)108 307.2 Q .334
 (\214x and project directories with a ".dir" suf)-.25 F .334(\214x. T)
 -.25 F 2.834(oc)-.8 G .334(reate a ne)-2.834 F(w)-.25 E F1(MBna)2.834 E
--.1(va)-.25 G(djust).1 E F0 .334(project combining the tw)2.834 F(o)-.1
-E -.15(ex)108 583.2 S(isting projects, the follo).15 E(wing will suf)
--.25 E(\214ce:)-.25 E(mbna)120.5 595.2 Q -.25(va)-.2 G(djustmer).25 E
+-.1(va)-.25 G(djust).1 E F0 .333(project combining the tw)2.833 F(o)-.1
+E -.15(ex)108 319.2 S(isting projects, the follo).15 E(wing will suf)
+-.25 E(\214ce:)-.25 E(mbna)120.5 331.2 Q -.25(va)-.2 G(djustmer).25 E
 39.675(ge --input=Na)-.18 F -.25(va)-.2 G(djust20140515m1.n).25 E 94.675
-(vh --input=Na)-.4 F -.25(va)-.2 G(d-).25 E(just20140515m2.n)108 607.2 Q
+(vh --input=Na)-.4 F -.25(va)-.2 G(d-).25 E(just20140515m2.n)108 343.2 Q
 55(vh --output=Na)-.4 F -.25(va)-.2 G(djust20140515All.n).25 E(vh)-.4 E
-1.163(The ne)108 631.2 R 3.663(wp)-.25 G 1.163(roject Na)-3.663 F -.25
+1.164(The ne)108 367.2 R 3.664(wp)-.25 G 1.164(roject Na)-3.664 F -.25
 (va)-.2 G 1.163
 (djust20140515All can be opened and analyzed further using).25 F F1
-(MBna)3.664 E -.1(va)-.25 G(djust).1 E F0 3.664(.W)C(hen)-3.664 E .948
-(opening the ne)108 643.2 R 3.448(wp)-.25 G .947
-(roject, the user should \214rst solv)-3.448 F 3.447(ef)-.15 G .947
-(or a comprehensi)-3.447 F 1.247 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E
-.947(ation adjustment model by)-.05 F .786(selecting the <Action->In)108
-655.2 R -.15(ve)-.4 G .786(rt Na).15 F(vig)-.2 E .786
+(MBna)3.663 E -.1(va)-.25 G(djust).1 E F0 3.663(.W)C(hen)-3.663 E .947
+(opening the ne)108 379.2 R 3.447(wp)-.25 G .947
+(roject, the user should \214rst solv)-3.447 F 3.447(ef)-.15 G .947
+(or a comprehensi)-3.447 F 1.248 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E
+.948(ation adjustment model by)-.05 F .787(selecting the <Action->In)108
+391.2 R -.15(ve)-.4 G .787(rt Na).15 F(vig)-.2 E .786
 (ation> menu item, and then \214nd the crossings between the tw)-.05 F
-3.287(op)-.1 G(re)-3.287 E(vi-)-.25 E
-(ously separate missions by selecting the <Action->Check F)108 667.2 Q
-(or Ne)-.15 E 2.5(wC)-.25 G(rossings> menu item.)-2.5 E 1.153(If the)108
-691.2 R F1(--skip-unset-cr)3.653 E(ossings)-.18 E F0 1.153
-(option is added to the abo)3.653 F 1.452 -.15(ve c)-.15 H 1.152
+3.286(op)-.1 G(re)-3.286 E(vi-)-.25 E
+(ously separate missions by selecting the <Action->Check F)108 403.2 Q
+(or Ne)-.15 E 2.5(wC)-.25 G(rossings> menu item.)-2.5 E 1.152(If the)108
+427.2 R F1(--skip-unset-cr)3.652 E(ossings)-.18 E F0 1.152
+(option is added to the abo)3.652 F 1.453 -.15(ve c)-.15 H 1.153
 (ommand, then all unset crossings in the tw).15 F(o)-.1 E
 (input projects will be set to "skipped" mode in the output project.)108
-703.2 Q(MB-System 5.0)72 768 Q(28 May 2014)143.995 E(3)202.335 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
-(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
-.25 E(ge\(1\))-.18 E/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbio)2.5 E F0(\(1\),)A
-F2(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A F2(mbna)2.5 E -.1(va)-.25 G
-(djust).1 E F0(\(1\),)A F2(mbset)2.5 E F0(\(1\))A F1 -.11(BU)72 124.8 S
-(GS).11 E F0(It started out simple and b)108 136.8 Q(ulletproof, b)-.2 E
-(ut no)-.2 E 2.5(wi)-.25 G(t')-2.5 E 2.5(st)-.55 G
-(oo complicated to be b)-2.5 E 2.5(ulletproof. Good)-.2 F(luck.)2.5 E
-(MB-System 5.0)72 768 Q(28 May 2014)143.995 E(4)202.335 E 0 Cg EP
+439.2 Q F2(SEE ALSO)72 468 Q F1(mbsystem)108 480 Q F0(\(1\),)A F1(mbio)
+2.5 E F0(\(1\),)A F1(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A F1(mbna)2.5 E
+-.1(va)-.25 G(djust).1 E F0(\(1\),)A F1(mbset)2.5 E F0(\(1\))A F2 -.11
+(BU)72 508.8 S(GS).11 E F0 .528(It started out simple and b)108 520.8 R
+.528(ulletproof, b)-.2 F .528(ut no)-.2 F 3.028(wi)-.25 G(t')-3.028 E
+3.027(st)-.55 G .527(oo complicated to be b)-3.027 F .527
+(ulletproof. It')-.2 F 3.027(sp)-.55 G .527(robably nerfgun-)-3.027 F
+(proof, though.)108 532.8 Q(Good luck.)5 E(MB-System 5.0)72 768 Q
+(21 March 2015)140.11 E(4)198.45 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbnavedit.ps b/src/ps/mbnavedit.ps
index fe0fb5e..01d2f01 100644
--- a/src/ps/mbnavedit.ps
+++ b/src/ps/mbnavedit.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbnavlist.ps b/src/ps/mbnavlist.ps
index d9c720a..b04d550 100644
--- a/src/ps/mbnavlist.ps
+++ b/src/ps/mbnavlist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbneptune2esf.ps b/src/ps/mbneptune2esf.ps
index 044b30f..6fb29f5 100644
--- a/src/ps/mbneptune2esf.ps
+++ b/src/ps/mbneptune2esf.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbotps.ps b/src/ps/mbotps.ps
index a960af1..1b38984 100644
--- a/src/ps/mbotps.ps
+++ b/src/ps/mbotps.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -446,7 +446,7 @@ itude and latitude position at which the tidal model will be calculated\
 1/00/00/00 \255E2009/02/21/23/59/59 \255V)144 304.8 Q
 (The shell output looks lik)108 316.8 Q(e:)-.1 E(Program mbotps)144
 340.8 Q -1.11(Ve)144 352.8 S
-(rsion $Id: mbotps.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)144 364.8 Q(ersion 5.4.2137)-1.11 E(Checking for a)144
 388.8 Q -.25(va)-.2 G(ilable O).25 E(TPS tide models)-.4 E -.4(OT)144
 400.8 S(PS location: /usr/local/O).4 E(TPSnc)-.4 E -1.11(Va)144 412.8 S
@@ -468,7 +468,7 @@ itude and latitude position at which the tidal model will be calculated\
 l is in the \214le tide_model.txt, which includes data that look lik)108
 664.8 Q(e:)-.1 E 2.5(#T)144 676.8 S
 (ide model generated by program mbotps)-2.85 E 2.5(#V)144 688.8 S
-(ersion: $Id: mbotps.ps 2219 2014-12-11 21:22:25Z caress $)-3.61 E 2.5
+(ersion: $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)-3.61 E 2.5
 (#M)144 700.8 S(B-System V)-2.5 E(ersion: 5.4.2137)-1.11 E 2.5(#T)144
 712.8 S(ide model generated by program mbotps)-2.85 E 2.5(#w)144 724.8 S
 (hich in turn calls O)-2.5 E(TPS program predict_tide obtained from:)-.4
@@ -510,7 +510,7 @@ to a set of EM3002 data in GSF format.)-.1 F(First, e)108 468 Q -.15(xe)
 (mbotps \255Idatalist.mb-1 \255V)144 480 Q
 (The resulting shell output looks lik)108 492 Q(e:)-.1 E(Program mbotps)
 144 504 Q -1.11(Ve)144 516 S
-(rsion $Id: mbotps.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)144 528 Q(ersion 5.4.2137)-1.11 E(Checking for a)144 552 Q
 -.25(va)-.2 G(ilable O).25 E(TPS tide models)-.4 E -.4(OT)144 564 S
 (PS location: /usr/local/O).4 E(TPSnc)-.4 E -1.11(Va)144 576 S(lid O)
@@ -543,7 +543,7 @@ BP
 (The output tide \214les ha)108 264 Q .3 -.15(ve t)-.2 H
 (he same structure sho).15 E(wn abo)-.25 E -.15(ve)-.15 G(:).15 E 2.5
 (#T)144 276 S(ide model generated by program mbotps)-2.85 E 2.5(#V)144
-288 S(ersion: $Id: mbotps.ps 2219 2014-12-11 21:22:25Z caress $)-3.61 E
+288 S(ersion: $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)-3.61 E
 2.5(#M)144 300 S(B-System V)-2.5 E(ersion: 5.4.2137)-1.11 E 2.5(#T)144
 312 S(ide model generated by program mbotps)-2.85 E 2.5(#w)144 324 S
 (hich in turn calls O)-2.5 E(TPS program predict_tide obtained from:)-.4
diff --git a/src/ps/mbpreprocess.ps b/src/ps/mbpreprocess.ps
index d9f18e7..2e24feb 100644
--- a/src/ps/mbpreprocess.ps
+++ b/src/ps/mbpreprocess.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbprocess.ps b/src/ps/mbprocess.ps
index 6d30831..cd97ccb 100644
--- a/src/ps/mbprocess.ps
+++ b/src/ps/mbprocess.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -1301,7 +1301,7 @@ S(olumns separated by tabs)-2.5 E 2.5<ad65>144 216 S
 (contents of the parameter \214le are:)2.5 E
 (## MB\255System processing parameter \214le)110.5 520.8 Q
 (## Written by mb_pr_writepar v)110.5 532.8 Q
-(ersion $Id: mbprocess.ps 2219 2014-12-11 21:22:25Z caress $)-.15 E
+(ersion $Id: mbprocess.ps 2252 2015-07-01 19:35:37Z caress $)-.15 E
 (## MB\255system V)110.5 544.8 Q(ersion 5.0.beta22)-1.11 E
 (## Generated by user <caress> on cpu <menard> at <Fri Sep)110.5 556.8 Q
 2.5(62)5 G(1:27:41 2002>)-2.5 E(##)110.5 568.8 Q(##)110.5 580.8 Q(## F)
@@ -1454,10 +1454,10 @@ BP
 (mbprocess \255I0051_20010829_223755.mb57 \255V)128 288 Q
 (The output to the terminal is:)110.5 312 Q(Program mbprocess)110.5 324
 Q -1.11(Ve)110.5 336 S
-(rsion $Id: mbprocess.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB\255System V)110.5 348 Q(ersion 5.0.beta07)-1.11 E
 (Program <mbprocess>)110.5 372 Q -1.11(Ve)110.5 384 S
-(rsion $Id: mbprocess.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB\255system V)110.5 396 Q(ersion 5.0.beta07)-1.11 E
 (Program Operation:)110.5 420 Q(Input \214le:)115.5 432 Q
 (0051_20010829_223755.mb57)15 E -.15(Fo)115.5 444 S 22.5(rmat: 57).15 F
diff --git a/src/ps/mbps.ps b/src/ps/mbps.ps
index 1e54c9a..6ae16fb 100644
--- a/src/ps/mbps.ps
+++ b/src/ps/mbps.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbrollbias.ps b/src/ps/mbrollbias.ps
index 7c5571c..9b4a4da 100644
--- a/src/ps/mbrollbias.ps
+++ b/src/ps/mbrollbias.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -336,7 +336,7 @@ F(nearly opposite directions.)108 153.6 Q(Run)5 E F1(mbr)2.5 E(ollbias)
 177.6 Q(-Ihs_le)180 189.6 Q(g1_z.mb22 \255Jhs_le)-.15 E(g2_z.mb22 \255V)
 -.15 E(The output looks lik)108 213.6 Q(e:)-.1 E(Program mbrollbias)
 110.5 237.6 Q -1.11(Ve)110.5 249.6 S
-(rsion $Id: mbrollbias.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbrollbias.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)110.5 261.6 Q(ersion 4.00)-1.11 E(mbrollbias P)110.5 285.6
 Q(arameters:)-.15 E(Input \214le 1:)110.5 297.6 Q(hs_le)12.5 E
 (g1_z.mb22)-.15 E(Input \214le 2:)110.5 309.6 Q(hs_le)12.5 E(g2_z.mb22)
diff --git a/src/ps/mbrolltimelag.ps b/src/ps/mbrolltimelag.ps
index d6c909d..5ada657 100644
--- a/src/ps/mbrolltimelag.ps
+++ b/src/ps/mbrolltimelag.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbroutetime.ps b/src/ps/mbroutetime.ps
index 62a918d..b3607c4 100644
--- a/src/ps/mbroutetime.ps
+++ b/src/ps/mbroutetime.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbsegygrid.ps b/src/ps/mbsegygrid.ps
index e158588..208ad71 100644
--- a/src/ps/mbsegygrid.ps
+++ b/src/ps/mbsegygrid.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbsegyinfo.ps b/src/ps/mbsegyinfo.ps
index 9d150fb..d97ae77 100644
--- a/src/ps/mbsegyinfo.ps
+++ b/src/ps/mbsegyinfo.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbsegylist.ps b/src/ps/mbsegylist.ps
index 5b8ed27..63efa13 100644
--- a/src/ps/mbsegylist.ps
+++ b/src/ps/mbsegylist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:19 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbsegypsd.ps b/src/ps/mbsegypsd.ps
index f1713b1..f7f0881 100644
--- a/src/ps/mbsegypsd.ps
+++ b/src/ps/mbsegypsd.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:30 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -389,7 +389,7 @@ amples, which means that the PSD estimate)3.145 F
 (for each trace is the a)108 566.4 Q -.15(ve)-.2 G(rage of 64865 / 1024\
  = 63 calculations. The shell output of the program is:).15 E
 (Program mbse)144 578.4 Q(gypsd)-.15 E -1.11(Ve)144 590.4 S
-(rsion $Id: mbsegypsd.ps 2219 2014-12-11 21:22:25Z caress $)-.15
+(rsion $Id: mbsegypsd.ps 2252 2015-07-01 19:35:37Z caress $)-.15
 E(MB-system V)144 602.4 Q(ersion 5.1.2beta12)-1.11 E(MBse)144 626.4 Q
 (gypsd P)-.15 E(arameters:)-.15 E(Input se)144 638.4 Q(gy \214le:)-.15 E
 (20090922_1833_V3422_S7_CH025ms.se)22.5 E(gy)-.15 E(Output \214leroot:)
diff --git a/src/ps/mbset.ps b/src/ps/mbset.ps
index 45d9ef4..6aaba85 100644
--- a/src/ps/mbset.ps
+++ b/src/ps/mbset.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -1110,7 +1110,7 @@ F1(mbset)3.13 E F0 -.1(wo)3.13 G .63(rks in a "v).1 F .63
 (contents of the parameter \214le are:)2.5 E
 (## MB-System processing parameter \214le)110.5 273.6 Q
 (## Written by mb_pr_writepar v)110.5 285.6 Q
-(ersion $Id: mbset.ps 2219 2014-12-11 21:22:25Z caress $)-.15 E
+(ersion $Id: mbset.ps 2252 2015-07-01 19:35:37Z caress $)-.15 E
 (## MB-system V)110.5 297.6 Q(ersion 5.0.beta22)-1.11 E
 (## Generated by user <caress> on cpu <menard> at <Fri Sep)110.5 309.6 Q
 2.5(62)5 G(1:27:41 2002>)-2.5 E(##)110.5 321.6 Q(##)110.5 333.6 Q(## F)
@@ -1256,7 +1256,7 @@ Q(OFFSET 0.000000)-.18 E(DRAFTMUL)110.5 552 Q(TIPL)-.92 E 2.5(Y1)-1 G
 (mbprocess \255I0051_20010829_223755.mb57 \255V)128 672 Q
 (The output to the terminal is:)110.5 696 Q(Program mbprocess)110.5 708
 Q -1.11(Ve)110.5 720 S
-(rsion $Id: mbset.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbset.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
 (18)185.545 E 0 Cg EP
 %%Page: 19 19
@@ -1266,7 +1266,7 @@ BP
 /F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
 (5.0 mbset\(1\))2.5 F(MB-System V)110.5 84 Q(ersion 5.0.beta07)-1.11 E
 (Program <mbprocess>)110.5 108 Q -1.11(Ve)110.5 120 S
-(rsion $Id: mbset.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbset.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)110.5 132 Q(ersion 5.0.beta07)-1.11 E(Program Operation:)
 110.5 156 Q(Input \214le:)115.5 168 Q(0051_20010829_223755.mb57)15 E
 -.15(Fo)115.5 180 S 22.5(rmat: 57).15 F
diff --git a/src/ps/mbstripnan.ps b/src/ps/mbstripnan.ps
index 456140d..6521a9b 100644
--- a/src/ps/mbstripnan.ps
+++ b/src/ps/mbstripnan.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%DocumentSuppliedResources: procset grops 1.19 2
diff --git a/src/ps/mbsvplist.ps b/src/ps/mbsvplist.ps
index d2a74f0..ab349d1 100644
--- a/src/ps/mbsvplist.ps
+++ b/src/ps/mbsvplist.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -398,13 +398,13 @@ in an SVP list from a Simrad EM300 data \214le in the MB)108 525.6 R
 (mbsvplist \255F57 \255I mbari_1998_526_msn.mb57 \255V)144 561.6 Q
 (The output will be as follo)108 585.6 Q(ws:)-.25 E(Program mbsvplist)
 110.5 609.6 Q -1.11(Ve)110.5 621.6 S
-(rsion $Id: mbsvplist.ps 2219 2014-12-11 21:22:25Z caress $)1.11 E
+(rsion $Id: mbsvplist.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
 (MB-system V)110.5 633.6 Q(ersion 5.0)-1.11 E
 (Searching mbari_1998_526_msn.mb57 for SVP records)110.5 657.6 Q
 (Outputting SVP to \214le:)110.5 669.6 Q(## W)110.5 681.6 Q
 (ater Sound V)-.8 E(elocity Pro\214le \(SVP\))-1.11 E
 (## Output by Program mbsvplist)110.5 693.6 Q(## Program V)110.5 705.6 Q
-(ersion $Id: mbsvplist.ps 2219 2014-12-11 21:22:25Z caress $)-1.11 E
+(ersion $Id: mbsvplist.ps 2252 2015-07-01 19:35:37Z caress $)-1.11 E
 (## MB-System V)110.5 717.6 Q(ersion 5.0.alpha01)-1.11 E
 (## Run by user <caress> on cpu <menard> at <Thu Jan)110.5 729.6 Q 2.5
 (41)5 G(3:36:44 2001>)-2.5 E(MB-System 5.0)72 768 Q(17 March 2014)140.11
diff --git a/src/ps/mbsvpselect.ps b/src/ps/mbsvpselect.ps
index c3d7a8c..aedaefa 100644
--- a/src/ps/mbsvpselect.ps
+++ b/src/ps/mbsvpselect.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbswath.ps b/src/ps/mbswath.ps
index 6a32035..040ba14 100644
--- a/src/ps/mbswath.ps
+++ b/src/ps/mbswath.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -231,488 +231,503 @@ BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
 152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF -.219(NA)
-72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbswath)108 96 Q F0 3.722<ad47>
-3.722 G 1.222
-(MT compatible utility for color \214ll or color shaded relief sw)-3.722
-F 1.221(ath plots of sw)-.1 F 1.221(ath sonar data)-.1 F
-(using Postscript.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8
-S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 11.402(mbswath \255C)108
-189.6 R/F3 10/Times-Italic at 0 SF(cpt\214le)A F2<ad4a>13.902 E F3(par)A
-(ameter)-.15 E(s)-.1 E F2<ad52>13.902 E F3(west/east/south/north)A F2
-([\255A)13.902 E F3(factor/mode/depth)A F2<ad42>13.902 E F3(tic)A(kinfo)
--.2 E F2<ad62>108 201.6 Q F3(yr/mo/da/hr/mn/sc)A F2<ad63>4.824 E F3
-(copies)A F2<ad44>4.824 E F3(mode/scale/min/max)A F2<ad45>4.824 E F3
-(yr/mo/da/hr/mn/sc)A F2<ad66>4.824 E F3(format)A F2<ad46>4.824 E F3 -.37
-(re)C(d/gr).37 E(een/blue)-.37 E F2<ad47>108 213.6 Q F3(ma)A
-(gnitude/azimuth)-.1 E F2<ad49>3.291 E F3(datalist)A F2 .791<ad4b20ad4e>
-3.291 F F3(cpt\214le)A F2 .792<ad4f20ad5020ad70>3.291 F F3(pings)A F2
-<ad51>3.292 E F3(dpi)A F2<ad53>3.292 E F3(speed)A F2<ad54>3.292 E F3
-(time)A(gap)-.4 E F2 .792<ad5520ad5720ad58>3.292 F F3(x-)A(shift)108
-225.6 Q F2<ad59>2.5 E F3(y-shift)A F2<ad5a>2.5 E F3(mode[F])A F2
-(\2550 \2551 \2552 \255V \255H])2.5 E F1(DESCRIPTION)72 254.4 Q F2
-(mbswath)108 266.4 Q F0 .401(is a utility for plotting sw)2.902 F .401(\
-ath sonar data in color \214ll or color shaded relief using Postscript.)
--.1 F(Lik)5.401 E(e)-.1 E F2(mbcontour)108 278.4 Q F0(,)A F2(mbswath)
-3.849 E F0 1.349(is fully compatible with the GMT package v)3.849 F 1.35
-(ersion 3, including the use of GMT)-.15 F .018
-(style color pallete \(cpt\) \214les to control the color table.)108
-290.4 R 2.517(A2)5.017 G .017(4-bit true color)-2.517 F F3 -.8(Po)2.517
-G(stScript).8 E F0 .017(\214le is output using one)2.517 F .991
-(of three methods. Unless indi)108 302.4 R .992
-(vidual polygon \214lls are used \()-.25 F F2<ad31>A F0 .992
-(option\), only one call to)3.492 F F2(mbswath)3.492 E F0 .992(can be)
-3.492 F .715(made for each plot because the color image produced co)108
-314.4 R -.15(ve)-.15 G .715(rs the entire plot space.).15 F .714
-(The program can read)5.714 F(data from stdin \(the def)108 326.4 Q
-(ault\) or from one or more sw)-.1 E(ath sonar \214les.)-.1 E .531
-(Before opening an input sw)108 350.4 R .531(ath data \214le,)-.1 F F2
+72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbswath)108 96 Q F0<ad>2.744 E
+F2(GMT)2.744 E F0 .243
+(plug-in module for color \214ll or color shaded relief sw)2.744 F .243
+(ath plots of sw)-.1 F .243(ath sonar data using)-.1 F(Postscript.)108
+108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
+(SYNOPSIS)72 177.6 Q F2 6.308(gmt mbswath \255C)108 189.6 R/F3 10
+/Times-Italic at 0 SF(cpt\214le)A F2<ad4a>8.808 E F3(par)A(ameter)-.15 E(s)
+-.1 E F2<ad52>8.808 E F3(west/east/south/north)A F2([\255A)8.809 E F3
+(factor/mode/depth)A F2<ad42>8.809 E F3(tic)A(kinfo)-.2 E F2<ad62>108
+201.6 Q F3(yr/mo/da/hr/mn/sc)A F2<ad63>4.824 E F3(copies)A F2<ad44>4.824
+E F3(mode/scale/min/max)A F2<ad45>4.824 E F3(yr/mo/da/hr/mn/sc)A F2
+<ad66>4.824 E F3(format)A F2<ad46>4.824 E F3 -.37(re)C(d/gr).37 E
+(een/blue)-.37 E F2<ad47>108 213.6 Q F3(ma)A(gnitude/azimuth)-.1 E F2
+<ad49>3.291 E F3(datalist)A F2 .791<ad4b20ad4e>3.291 F F3(cpt\214le)A F2
+.792<ad4f20ad5020ad70>3.291 F F3(pings)A F2<ad51>3.292 E F3(dpi)A F2
+<ad53>3.292 E F3(speed)A F2<ad54>3.292 E F3(time)A(gap)-.4 E F2 .792
+<ad5520ad5720ad58>3.292 F F3(x-)A(shift)108 225.6 Q F2<ad59>2.5 E F3
+(y-shift)A F2<ad5a>2.5 E F3(mode[F])A F2(\2550 \2551 \2552 \255V \255H])
+2.5 E F1(DESCRIPTION)72 254.4 Q F2(mbswath)108 266.4 Q F0 .613
+(is a plug-in module for plotting sw)3.113 F .612
+(ath sonar data in color \214ll or color shaded relief using)-.1 F F2
+(GMT)3.112 E F0 .409(\(Generic Mapping T)108 278.4 R 2.909(ools\). Lik)
+-.8 F(e)-.1 E F2(mbcontour)2.909 E F0(,)A F2(mbswath)2.909 E F0 .409
+(is fully compatible with the)2.909 F F2(GMT)2.91 E F0 .41(package v)
+2.91 F(ersion)-.15 E 1.102(5, including the use of GMT style color pall\
+ete \(cpt\) \214les to control the color table.)108 290.4 R 3.602(A2)
+6.102 G 1.102(4-bit true color)-3.602 F F3 -.8(Po)108 302.4 S(stScript)
+.8 E F0 .876(\214le is output using one of three methods. Unless indi)
+3.376 F .877(vidual polygon \214lls are used \()-.25 F F2<ad31>A F0
+(option\),)3.377 E .905(only one call to)108 314.4 R F2(mbswath)3.405 E
+F0 .905(can be made for each plot because the color image produced co)
+3.405 F -.15(ve)-.15 G .905(rs the entire).15 F .042(plot space.)108
+326.4 R .042(The program can read data from a single sw)5.042 F .043
+(ath sonar \214le or from multiple \214les as referenced by)-.1 F
+(an MB-System datalist \214le.)108 338.4 Q .532
+(Before opening an input sw)108 362.4 R .531(ath data \214le,)-.1 F F2
 (mbmbswath)3.031 E F0 .531
 (checks for an ascii \214le in the same directory ha)3.031 F(ving)-.2 E
-.627(the same name e)108 362.4 R .626(xcept that ".inf" is appended to \
-the end. The program assumes that this ascii \214le contains)-.15 F .088
-(the output of the program)108 374.4 R F2(mbinf)2.588 E(o)-.25 E F0 .089
-(run on the input data \214le. If the ".inf" \214le e)2.588 F(xists,)
--.15 E F2(mbswath)2.589 E F0 .089(reads the min-)2.589 F 1.577
-(imum and maximum longitude and latitude bounds from the)108 386.4 R F2
-(mbinf)4.077 E(o)-.25 E F0 1.576(output and compares those to the)4.077
+.626(the same name e)108 374.4 R .626(xcept that ".inf" is appended to \
+the end. The program assumes that this ascii \214le contains)-.15 F .089
+(the output of the program)108 386.4 R F2(mbinf)2.589 E(o)-.25 E F0 .088
+(run on the input data \214le. If the ".inf" \214le e)2.589 F(xists,)
+-.15 E F2(mbswath)2.588 E F0 .088(reads the min-)2.588 F 1.576
+(imum and maximum longitude and latitude bounds from the)108 398.4 R F2
+(mbinf)4.077 E(o)-.25 E F0 1.577(output and compares those to the)4.077
 F 1.388(bounds for the plot. If the ".inf" \214le indicates that none o\
-f the data in the input \214le lies inside the plot)108 398.4 R .042
-(bounds, that input \214le is skipped. This allo)108 410.4 R .041(ws us\
+f the data in the input \214le lies inside the plot)108 410.4 R .041
+(bounds, that input \214le is skipped. This allo)108 422.4 R .042(ws us\
 ers to maintain a single master list of data \214les for use in all)-.25
-F .274(plotting without the performance penalty of)108 422.4 R F2
-(mbswath)2.774 E F0 .274(reading through all the data \214les, e)2.774 F
--.15(ve)-.25 G 2.775(nt).15 G .275(hose with no)-2.775 F(rele)108 434.4
+F .275(plotting without the performance penalty of)108 434.4 R F2
+(mbswath)2.775 E F0 .274(reading through all the data \214les, e)2.774 F
+-.15(ve)-.25 G 2.774(nt).15 G .274(hose with no)-2.774 F(rele)108 446.4
 Q -.15(ve)-.25 G .63(nt data. W).15 F 3.13(er)-.8 G .63
 (ecommend that users maintain a ".inf" \214le for each sw)-3.13 F .63
-(ath data \214le used for gridding or)-.1 F(plotting. The programs)108
-446.4 Q F2(mbcontour)2.5 E F0(and)2.5 E F2(mbgrid)2.5 E F0
-(also use ".inf" \214les in the same f)2.5 E(ashion.)-.1 E(If)108 470.4
-Q F2(mb\214lter)3.238 E F0 .738(has been used to \214lter amplitude and\
-/or sidescan data in the desired input, then the)3.238 F F2<ad5a>3.239 E
-F0(option)3.239 E(can be used to specify plotting the \214ltered rather\
- than un\214ltered data.)108 482.4 Q F1 -.548(AU)72 511.2 S(THORSHIP)
-.548 E F0(Da)108 523.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 535.2 Q 2.5(yB)
+(ath data \214le used for gridding or)-.1 F(plotting. The)108 458.4 Q F2
+(GMT)2.5 E F0(modules)2.5 E F2(mbcontour)2.5 E F0(and)2.5 E F2(mbgrid)
+2.5 E F0(also use ".inf" \214les in the same f)2.5 E(ashion.)-.1 E(If)
+108 482.4 Q F2(mb\214lter)3.239 E F0 .738(has been used to \214lter amp\
+litude and/or sidescan data in the desired input, then the)3.239 F F2
+<ad5a>3.238 E F0(option)3.238 E(can be used to specify plotting the \
+\214ltered rather than un\214ltered data.)108 494.4 Q .232(In order for)
+108 518.4 R F2(GMT)2.732 E F0 .232(to successfully e)2.732 F -.15(xe)
+-.15 G(cute).15 E F2(mbswath)2.732 E F0 2.732(,t)C .232
+(he location of the shared library)-2.732 F F3(libmbgmt)2.732 E F0
+(containing)2.732 E 2.652(this module must be kno)108 530.4 R 2.652
+(wn to)-.25 F F2(GMT)5.151 E F0 7.651(.T)C 2.651
+(his can be accomplished by either setting the GMT_CUS-)-7.651 F -.18
+(TO)108 542.4 S .375(M_LIBS parameter in the \214le gmt.conf that is pa\
+rt of the GMT installation, by setting this parameter in).18 F .335
+(the \214le gmt.conf in the user')108 554.4 R 2.835(sh)-.55 G .335
+(ome directory)-2.835 F 2.835(,o)-.65 G 2.835(rb)-2.835 G 2.835(yu)
+-2.835 G .335(sing the GMT module)-2.835 F F2(gmtset)2.835 E F0 .335
+(to modify this parame-)2.835 F .853(ter in the current w)108 566.4 R
+.853(orking directory)-.1 F 3.353(.I)-.65 G .853(f, for instance, the)
+-3.353 F F3(libmbgmt)3.353 E F0 .853
+(shared library has been installed in the)3.353 F
+(\214le /usr/lib/libmbgmt.dylib, then the GMT_CUST)108 578.4 Q
+(OM_LIBS parameter in a gmt.conf \214le can be set to:)-.18 E(GMT_CUST)
+128 590.4 Q(OM_LIBS = /usr/lib/libmbgmt.dylib)-.18 E F1 -.548(AU)72
+619.2 S(THORSHIP).548 E F0(Da)108 631.2 Q(vid W)-.2 E 2.5(.C)-.92 G
+(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 643.2 Q 2.5(yB)
 -.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 547.2 Q
-(Lamont-Doherty Earth Observ)113 559.2 Q(atory)-.25 E F1(OPTIONS)72 588
-Q F2<ad41>108 600 Q F3(factor/mode/depth)23.08 E F0 1.215
-(This option determines ho)144 612 R 3.715(wt)-.25 G 1.214
-(he along-track dimension of the beam or pix)-3.715 F 1.214
-(el footprints is calcu-)-.15 F 1.762(lated. If)144 624 R F3(mode)4.262
-E F0 4.262(=1)4.262 G 4.262(,t)-4.262 G 1.762(hen the fore-aft beam ang\
-le width of the sonar is used so that the width)-4.262 F .403
-(increases to)144 636 R -.1(wa)-.25 G .403
+(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 655.2 Q
+(Lamont-Doherty Earth Observ)113 667.2 Q(atory)-.25 E F1(OPTIONS)72 696
+Q F2<ad41>108 708 Q F3(factor/mode/depth)23.08 E F0 3.38
+(This option determines ho)144 720 R 5.879(wt)-.25 G 3.379
+(he along-track dimension of the beam or pix)-5.879 F 3.379
+(el footprints is)-.15 F(MB-System 5.0)72 768 Q 2.5(5F)137.61 G
+(ebruary 2015)-2.5 E(1)195.95 E 0 Cg EP
+%%Page: 2 2
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
+152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E .651(calculated. If)144 84 R/F1 10
+/Times-Italic at 0 SF(mode)3.151 E F0 3.151(=1)3.151 G 3.151(,t)-3.151 G
+.652(hen the fore-aft beam angle width of the sonar is used so that the\
+ width)-3.151 F .403(increases to)144 96 R -.1(wa)-.25 G .403
 (rds the outer parts of the sw).1 F 2.903(ath. The)-.1 F .403
-(fore-aft beam angle width \()2.903 F F2(MB-System)A F0(inter)2.902 E(-)
--.2 E .529(nally stores a v)144 648 R .529
-(alue for each format/sonar\) is multiplied by the)-.25 F F3(factor)3.03
-E F0 -.25(va)3.03 G .53(lue; a).25 F F3(factor)3.03 E F0 3.03(<1)3.03 G
-.53(.0 can be)-3.03 F .388(useful if the data highly o)144 660 R -.15
-(ve)-.15 G .388(rsamples the sea\215oor and a).15 F F3(factor)2.888 E F0
+(fore-aft beam angle width \()2.903 F/F2 10/Times-Bold at 0 SF(MB-System)A
+F0(inter)2.902 E(-)-.2 E .529(nally stores a v)144 108 R .529
+(alue for each format/sonar\) is multiplied by the)-.25 F F1(factor)3.03
+E F0 -.25(va)3.03 G .53(lue; a).25 F F1(factor)3.03 E F0 3.03(<1)3.03 G
+.53(.0 can be)-3.03 F .388(useful if the data highly o)144 120 R -.15
+(ve)-.15 G .388(rsamples the sea\215oor and a).15 F F1(factor)2.888 E F0
 2.888(>1)2.888 G .388(.0 can \214ll in plots of data which)-2.888 F .064
-(undersample the sea\215oor)144 672 R 2.564(.I)-.55 G 2.564(ft)-2.564 G
+(undersample the sea\215oor)144 132 R 2.564(.I)-.55 G 2.564(ft)-2.564 G
 .064(he data stream does not include depth v)-2.564 F .065
 (alues \(e.g. one is plotting pure)-.25 F 1.019
-(sidescan data\), then the)144 684 R F3(depth)3.518 E F0 -.25(va)3.518 G
+(sidescan data\), then the)144 144 R F1(depth)3.518 E F0 -.25(va)3.518 G
 1.018(lue sets the depth v).25 F 1.018
 (alue in meters used in the footprint calcula-)-.25 F 2.515(tions. If)
-144 696 R F3(mode)2.515 E F0 2.515(=2)2.515 G 2.515(,t)-2.515 G .015
+144 156 R F1(mode)2.515 E F0 2.515(=2)2.515 G 2.515(,t)-2.515 G .015
 (hen the along-track dimension of the beam or pix)-2.515 F .015
 (el footprints is just the along-)-.15 F .66
-(track distance between pings multiplied by the)144 708 R F3(factor)3.16
-E F0 -.25(va)3.16 G 3.16(lue. If).25 F F3(mode)3.16 E F0 3.16(=3)3.16 G
+(track distance between pings multiplied by the)144 168 R F1(factor)3.16
+E F0 -.25(va)3.16 G 3.16(lue. If).25 F F1(mode)3.16 E F0 3.16(=3)3.16 G
 3.16(,t)-3.16 G .66(hen each data point is)-3.16 F .385
-(plotted as a point, and the)144 720 R F3(factor)2.885 E F0(and)2.885 E
-F3(depth)2.885 E F0 .385(parameters are ignored.)2.885 F(Def)5.385 E
-(ault:)-.1 E F3(factor)2.886 E F0 2.886(=1)2.886 G(.0,)-2.886 E F3(mode)
-2.886 E F0(=)2.886 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E(1,)144 84 Q/F1 10/Times-Italic at 0 SF
-(depth)2.5 E F0 2.5(=3)2.5 G(000.0.)-2.5 E/F2 10/Times-Bold at 0 SF<ad42>
-108 100.8 Q F1(tic)23.63 E(kinfo)-.2 E F0
-(Sets map boundary tickmark interv)144 112.8 Q(als. See the)-.25 E F2
-(psbasemap)2.5 E F0(manual page for details.)2.5 E F2<ad62>108 129.6 Q
+(plotted as a point, and the)144 180 R F1(factor)2.885 E F0(and)2.885 E
+F1(depth)2.885 E F0 .385(parameters are ignored.)2.885 F(Def)5.385 E
+(ault:)-.1 E F1(factor)2.886 E F0 2.886(=1)2.886 G(.0,)-2.886 E F1(mode)
+2.886 E F0(=)2.886 E(1,)144 192 Q F1(depth)2.5 E F0 2.5(=3)2.5 G(000.0.)
+-2.5 E F2<ad42>108 208.8 Q F1(tic)23.63 E(kinfo)-.2 E F0
+(Sets map boundary tickmark interv)144 220.8 Q(als. See the)-.25 E F2
+(psbasemap)2.5 E F0(manual page for details.)2.5 E F2<ad62>108 237.6 Q
 F1(yr/mo/da/hr/mn/sc)24.74 E F0 .614
-(Sets the starting time for data allo)144 141.6 R .614
+(Sets the starting time for data allo)144 249.6 R .614
 (wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 153.6 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad43>108 170.4 Q F0
+(will be ignored.)144 261.6 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)
+2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad43>108 278.4 Q F0
 1.245
 (Sets the color palette \214le which controls the color of the plot.)
 23.08 F 1.246(See documentation of the GMT)6.246 F
-(package for a complete description of cpt \214les.)144 182.4 Q F2<ad63>
-108 199.2 Q F1(copies)25.86 E F0
-(Speci\214es the number of plot copies \(the def)144 211.2 Q
-(ault is 1\).)-.1 E F2<ad44>108 228 Q F1(mode/scale/min/max)23.08 E F0
-.876(Sets scaling of beam amplitude or sidescan pix)144 240 R .875(el v)
+(package for a complete description of cpt \214les.)144 290.4 Q F2<ad63>
+108 307.2 Q F1(copies)25.86 E F0
+(Speci\214es the number of plot copies \(the def)144 319.2 Q
+(ault is 1\).)-.1 E F2<ad44>108 336 Q F1(mode/scale/min/max)23.08 E F0
+.876(Sets scaling of beam amplitude or sidescan pix)144 348 R .875(el v)
 -.15 F .875(alues which can be applied before plotting. If)-.25 F F1
-(mode)144 252 Q F0 2.5(=1o)2.5 G 2.5(r2)-2.5 G 2.5(,t)-2.5 G
-(hen a linear scaling of the form:)-2.5 E(scaled_v)180 264 Q
+(mode)144 360 Q F0 2.5(=1o)2.5 G 2.5(r2)-2.5 G 2.5(,t)-2.5 G
+(hen a linear scaling of the form:)-2.5 E(scaled_v)180 372 Q
 (alue = scale * \(v)-.25 E(alue \255 min\) / \(max \255 min\))-.25 E
-(is applied.)144 276 Q(If)5 E F1(mode)2.5 E F0 2.5(=3o)2.5 G 2.5(r4)-2.5
-G 2.5(,t)-2.5 G(hen a log10 scaling of the form:)-2.5 E(scaled_v)180 288
+(is applied.)144 384 Q(If)5 E F1(mode)2.5 E F0 2.5(=3o)2.5 G 2.5(r4)-2.5
+G 2.5(,t)-2.5 G(hen a log10 scaling of the form:)-2.5 E(scaled_v)180 396
 Q(alue = scale * \(20 * log10\(v)-.25 E
-(alue\) \255 min\) / \(max \255 min\))-.25 E 1.142(is applied.)144 300 R
+(alue\) \255 min\) / \(max \255 min\))-.25 E 1.142(is applied.)144 408 R
 (If)6.142 E F1(mode)3.642 E F0 3.642(=2o)3.642 G 3.642(r4)-3.642 G 3.642
 (,t)-3.642 G 1.142(hen the v)-3.642 F 1.143(alue \(or 20*log10\(v)-.25 F
 1.143(alue\)\) will be clipped to)-.25 F F1(min)3.643 E F0 1.143
-(if it is)3.643 F .502(smaller than)144 312 R F1(min)3.002 E F0(or)3.002
+(if it is)3.643 F .502(smaller than)144 420 R F1(min)3.002 E F0(or)3.002
 E F1(max)3.002 E F0 .502(if it is greater than)3.002 F F1(max)3.002 E F0
 3.002(;t)C .501(his clipping happens prior to the multiplication)-3.002
-F(by)144 324 Q F1(scale)2.5 E F0 2.5(.D)C(ef)-2.5 E(ault:)-.1 E F1(mode)
+F(by)144 432 Q F1(scale)2.5 E F0 2.5(.D)C(ef)-2.5 E(ault:)-.1 E F1(mode)
 2.5 E F0 2.5(=1)2.5 G(,)-2.5 E F1(scale)2.5 E F0 2.5(=1)2.5 G(.0,)-2.5 E
 F1(min)2.5 E F0 2.5(=0)2.5 G(.0,)-2.5 E F1(max)2.5 E F0 2.5(=1)2.5 G
-(.0.)-2.5 E F2<ad45>108 340.8 Q F1(yr/mo/da/hr/mn/sc)23.63 E F0 .286
-(Sets the ending time for data allo)144 352.8 R .287
+(.0.)-2.5 E F2<ad45>108 448.8 Q F1(yr/mo/da/hr/mn/sc)23.63 E F0 .286
+(Sets the ending time for data allo)144 460.8 R .287
 (wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 364.8 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad46>108 381.6 Q F1 -.37(re)
+F(be ignored.)144 472.8 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)2.5 E
+F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad46>108 489.6 Q F1 -.37(re)
 24.19 G(d/gr).37 E(een/blue)-.37 E F0
-(Sets the color used for Frame and annotation. [Def)144 393.6 Q
-(ault is black])-.1 E F2<ad66>108 410.4 Q F1(format)26.97 E F0 .22(Sets\
+(Sets the color used for Frame and annotation. [Def)144 501.6 Q
+(ault is black])-.1 E F2<ad66>108 518.4 Q F1(format)26.97 E F0 .22(Sets\
  the data format used if the input is read from stdin or from a \214le.\
- If)144 422.4 R F1(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G .22
-(hen the input)-2.72 F .007(\214le speci\214ed with the)144 434.4 R F2
+ If)144 530.4 R F1(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G .22
+(hen the input)-2.72 F .007(\214le speci\214ed with the)144 542.4 R F2
 <ad49>2.507 E F0 .008(option will actually contain a list of input sw)
 2.508 F .008(ath sonar data \214les. This pro-)-.1 F .012(gram uses the)
-144 446.4 R F2(MBIO)2.512 E F0 .012(library and will read or write an)
+144 554.4 R F2(MBIO)2.512 E F0 .012(library and will read or write an)
 2.512 F 2.512(ys)-.15 G -.1(wa)-2.512 G .012
 (th sonar format supported by).1 F F2(MBIO)2.511 E F0 2.511(.A)C 1.296
-(list of the sw)144 458.4 R 1.297
+(list of the sw)144 566.4 R 1.297
 (ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
 1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144
-470.4 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
+578.4 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
 E F0(manual page. Def)2.5 E(ault:)-.1 E F1(format)2.5 E F0 2.5<3dad>2.5
-G(1.)-2.5 E F2<ad47>108 487.2 Q F1(ma)22.52 E(gnitude/azimuth)-.1 E F0
+G(1.)-2.5 E F2<ad47>108 595.2 Q F1(ma)22.52 E(gnitude/azimuth)-.1 E F0
 (or)2.5 E F1(ma)2.5 E(gnitude/median)-.1 E F0 .535
-(Sets the parameters which control ho)144 499.2 R(w)-.25 E F2(mbswath)
+(Sets the parameters which control ho)144 607.2 R(w)-.25 E F2(mbswath)
 3.035 E F0 .534(generates simulated illumination of bath)3.034 F(ymetry)
--.05 E(,)-.65 E .521(which can be either shaded relief bath)144 511.2 R
+-.05 E(,)-.65 E .521(which can be either shaded relief bath)144 619.2 R
 .521(ymetry or bath)-.05 F .522(ymetry draped with amplitude data.)-.05
 F(If)5.522 E F1(mode)3.022 E F0 .246(is set to 2 \(shaded relief bath)
-144 523.2 R .246(ymetry\) using the)-.05 F F2<ad5a>2.746 E F0 .246
+144 631.2 R .246(ymetry\) using the)-.05 F F2<ad5a>2.746 E F0 .246
 (option, then the v)2.746 F(alue)-.25 E F1(ma)2.746 E(gnitude)-.1 E F0
-.245(is an ef)2.746 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 535.2 S
+.245(is an ef)2.746 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 643.2 S
 1.424(rtical e).15 F 1.424
 (xageration which modulates the intensity of the shading; typical v)-.15
-F 1.425(alues are in the 1-5)-.25 F 2.758(range. The)144 547.2 R -.25
+F 1.425(alues are in the 1-5)-.25 F 2.758(range. The)144 655.2 R -.25
 (va)2.758 G(lue).25 E F1(azimuth)2.758 E F0 .258
 (is the azimuth from which the bath)2.758 F .257(ymetry is illuminated.)
 -.05 F(If)5.257 E F1(mode)2.757 E F0 .257(is set)2.757 F .666
-(to 3 \(bath)144 559.2 R .666
+(to 3 \(bath)144 667.2 R .666
 (ymetry shaded using amplitudes\) using the)-.05 F F2<ad5a>3.166 E F0
 .667(option, then the v)3.167 F(alue)-.25 E F1(ma)3.167 E(gnitude)-.1 E
-F0(modu-)3.167 E .94(lates the intensity of the shading; the v)144 571.2
+F0(modu-)3.167 E .94(lates the intensity of the shading; the v)144 679.2
 R(alue)-.25 E F1(median)3.439 E F0 .939(sets the amplitude v)3.439 F
 .939(alue which serv)-.25 F .939(es as the)-.15 F(zero or neutral le)144
-583.2 Q -.15(ve)-.25 G(l.).15 E F2<ad48>108 600 Q F0 .162(This "help" \
+691.2 Q -.15(ve)-.25 G(l.).15 E F2<ad48>108 708 Q F0 .162(This "help" \
 \215ag cause the program to print out a description of its operation an\
-d then e)22.52 F .162(xit immedi-)-.15 F(ately)144 612 Q(.)-.65 E F2
-<ad49>108 628.8 Q F1(in\214le)26.41 E F0 .468
-(Sets the input \214lename. If)144 640.8 R F1(format)2.967 E F0 2.967
-(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .467(ath sonar data contained)-.1 F(in)144
-652.8 Q F1(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F1
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F1
-(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .869(list of the input sw)144 664.8 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .868
-(The program will read)5.869 F .194
-(and plot the data in each one of these \214les.)144 676.8 R .195
-(In the)5.195 F F1(in\214le)2.695 E F0 .195
-(\214le, each data \214le should be follo)2.695 F .195(wed by a)-.25 F
-(data format identi\214er)144 688.8 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 700.8 Q(data\214le2 24)180 712.8 Q .03
-(This program uses the)144 724.8 R F2(MBIO)2.53 E F0 .029
-(library and will read an)2.53 F 2.529(ys)-.15 G -.1(wa)-2.529 G .029
-(th sonar format supported by).1 F F2(MBIO)2.529 E F0 2.529(.A)C
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
+d then e)22.52 F .162(xit immedi-)-.15 F(ately)144 720 Q(.)-.65 E
+(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(2)195.95 E 0
 Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E 1.296(list of the sw)144 84 R 1.297
-(ath sonar data formats currently supported by)-.1 F/F1 10/Times-Bold at 0
-SF(MBIO)3.797 E F0 1.297(and their identi\214er v)3.797 F 1.297
-(alues is)-.25 F(gi)144 96 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G
-(he)-2.5 E F1(MBIO)2.5 E F0(manual page.)2.5 E .42
-(An input data\214le may be accompanied by a "f)144 108 R .42(ast bath)
--.1 F .42(ymetry" or "fbt" \214le.)-.05 F .42(The "fbt" \214ne naming)
-5.42 F(con)144 120 Q -.15(ve)-.4 G 1.166(ntion is to add the ".fbt" suf)
-.15 F 1.166(\214x to the original sw)-.25 F 1.166(ath data \214lename.)
--.1 F 1.167(An "fbt" \214le contains)6.167 F .597(only sw)144 132 R .597
-(ath bath)-.1 F .596(ymetry information in a compact format \(format 71\
-\), and is thus quick to read. If)-.05 F F1(mbswath)144 144 Q F0 2.133
+152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E/F1 10/Times-Bold at 0 SF<ad49>108 84 Q
+/F2 10/Times-Italic at 0 SF(in\214le)26.41 E F0 .468
+(Sets the input \214lename. If)144 96 R F2(format)2.967 E F0 2.967(>0\()
+2.967 G .467(set with the)-2.967 F F1<ad66>2.967 E F0 .467
+(option\) then the sw)2.967 F .467(ath sonar data contained)-.1 F(in)144
+108 Q F2(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F2
+(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F2
+(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
+2.937 F .869(list of the input sw)144 120 R .869
+(ath sonar data \214les to be processed and their formats.)-.1 F .868
+(The program will read)5.869 F .194
+(and plot the data in each one of these \214les.)144 132 R .195(In the)
+5.195 F F2(in\214le)2.695 E F0 .195
+(\214le, each data \214le should be follo)2.695 F .195(wed by a)-.25 F
+(data format identi\214er)144 144 Q 2.5(,e)-.4 G(.g.:)-2.5 E
+(data\214le1 11)180 156 Q(data\214le2 24)180 168 Q .03
+(This program uses the)144 180 R F1(MBIO)2.53 E F0 .029
+(library and will read an)2.53 F 2.529(ys)-.15 G -.1(wa)-2.529 G .029
+(th sonar format supported by).1 F F1(MBIO)2.529 E F0 2.529(.A)C 1.296
+(list of the sw)144 192 R 1.297
+(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
+1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144 204
+Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
+(manual page.)2.5 E .42(An input data\214le may be accompanied by a "f)
+144 216 R .42(ast bath)-.1 F .42(ymetry" or "fbt" \214le.)-.05 F .42
+(The "fbt" \214ne naming)5.42 F(con)144 228 Q -.15(ve)-.4 G 1.166
+(ntion is to add the ".fbt" suf).15 F 1.166(\214x to the original sw)
+-.25 F 1.166(ath data \214lename.)-.1 F 1.167(An "fbt" \214le contains)
+6.167 F .597(only sw)144 240 R .597(ath bath)-.1 F .596(ymetry informat\
+ion in a compact format \(format 71\), and is thus quick to read. If)
+-.05 F F1(mbswath)144 252 Q F0 2.133
 (is generating a plot containing only bath)4.633 F 2.133(ymetry \()-.05
-F F1<ad5a>A/F2 10/Times-Italic at 0 SF(1)A F0(and)4.633 E F1<ad5a>4.633 E
-F2(2)A F0 4.633(\). the)B 2.134(program will)4.633 F
-(attempt to read an "fbt" \214le in lieu of the original data.)144 156 Q
-(Def)144 168 Q(ault:)-.1 E F2(in\214le)2.5 E F0 2.5(=")2.5 G(stdin".)
--2.5 E F1<ad4a>108 184.8 Q F0 .96
-(Selects the map projection. Scale is inch/de)25.3 F .959
-(gree, 1:xxxxx.)-.15 F .959(or width in inches \(upper case modi-)5.959
-F(\214er\).)144 196.8 Q F1(CYLINDRICAL PR)144 220.8 Q(OJECTIONS:)-.3 E
-(\255Jc)144 244.8 Q F2(lon0/lat0/scale)A F0(\(Cassini\))2.5 E F1(\255Jm)
-144 256.8 Q F2(scale)A F0(\(Mercator\))2.5 E F1<ad4a>144 268.8 Q(oa)-.15
-E F2(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 280.8 Q
+F F1<ad5a>A F2(1)A F0(and)4.633 E F1<ad5a>4.633 E F2(2)A F0 4.633
+(\). the)B 2.134(program will)4.633 F
+(attempt to read an "fbt" \214le in lieu of the original data.)144 264 Q
+F1<ad4a>108 280.8 Q F0 .96(Selects the map projection. Scale is inch/de)
+25.3 F .959(gree, 1:xxxxx.)-.15 F .959
+(or width in inches \(upper case modi-)5.959 F(\214er\).)144 292.8 Q F1
+(CYLINDRICAL PR)144 316.8 Q(OJECTIONS:)-.3 E(\255Jc)144 340.8 Q F2
+(lon0/lat0/scale)A F0(\(Cassini\))2.5 E F1(\255Jm)144 352.8 Q F2(scale)A
+F0(\(Mercator\))2.5 E F1<ad4a>144 364.8 Q(oa)-.15 E F2
+(lon0/lat0/azimuth/scale)A F0
+(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 376.8 Q
 (ob)-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 292.8 Q(oc)-.15 E F2
+2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 388.8 Q(oc)-.15 E F2
 (lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 304.8 Q F2
+(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 400.8 Q F2
 (lon0/scale)A F0
 (\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 316.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 328.8 Q(u)-.15 E F2(zone/scale)A F0
+(\255Jt)144 412.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
+(erse Mercator\))-.15 E F1<ad4a>144 424.8 Q(u)-.15 E F2(zone/scale)A F0
 (\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 340.8 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 364.8 Q
-(OJECTIONS:)-.3 E<ad4a>144 388.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F1<ad4a>144 400.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F1(\255Jg)144 412.8 Q F2(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F1(\255Js)144 424.8 Q F2(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F1(CONIC PR)144 448.8 Q(OJECTIONS:)-.3
-E(\255Jb)144 472.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F1(\255Jl)144 484.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F1(MISCELLANEOUS PR)144 508.8 Q(OJECTIONS:)-.3 E(\255Jh)144 532.8 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 544.8 Q F2(lon0/scale)A
-F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 556.8 Q F2(lon0/scale)A F0(\(Eck)
-2.5 E(ert VI\))-.1 E F1(\255Jn)144 568.8 Q F2(lon0/scale)A F0
-(\(Robinson\))2.5 E F1(\255Jr)144 580.8 Q F2(lon0/scale)A F0(\(W)2.5 E
-(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1(\255Jw)144 592.8 Q F2
+(erse Mercator\))-.15 E F1(\255Jy)144 436.8 Q F2(lon0/lats/scale)A F0
+(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 460.8 Q
+(OJECTIONS:)-.3 E<ad4a>144 484.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
+(\(Lambert\).)2.5 E F1<ad4a>144 496.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
+(\(Equidistant\).)2.5 E F1(\255Jg)144 508.8 Q F2(lon0/lat0/scale)A F0
+(\(Orthographic\).)2.5 E F1(\255Js)144 520.8 Q F2(lon0/lat0/scale)A F0
+(\(General Stereographic\))2.5 E F1(CONIC PR)144 544.8 Q(OJECTIONS:)-.3
+E(\255Jb)144 568.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
+F1(\255Jl)144 580.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
+E F1(MISCELLANEOUS PR)144 604.8 Q(OJECTIONS:)-.3 E(\255Jh)144 628.8 Q F2
+(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 640.8 Q F2(lon0/scale)A
+F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 652.8 Q F2(lon0/scale)A F0(\(Eck)
+2.5 E(ert VI\))-.1 E F1(\255Jn)144 664.8 Q F2(lon0/scale)A F0
+(\(Robinson\))2.5 E F1(\255Jr)144 676.8 Q F2(lon0/scale)A F0(\(W)2.5 E
+(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1(\255Jw)144 688.8 Q F2
 (lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144
-616.8 Q(OJECTIONS:)-.3 E(\255Jp)144 640.8 Q F2(scale)A F0
+712.8 Q(OJECTIONS:)-.3 E F0(MB-System 5.0)72 768 Q 2.5(5F)137.61 G
+(ebruary 2015)-2.5 E(3)195.95 E 0 Cg EP
+%%Page: 4 4
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
+152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E/F1 10/Times-Bold at 0 SF(\255Jp)144 84
+Q/F2 10/Times-Italic at 0 SF(scale)A F0
 (\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 652.8 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
+(\255Jx)144 96 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
 (/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
 (og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 664.8 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 681.6 Q F0(More)22.52 E F2 -.8(Po)2.5 G
+(More details can be found in the)144 108 Q F1(psbasemap)2.5 E F0
+(manpages.)2.5 E F1<ad4b>108 124.8 Q F0(More)22.52 E F2 -.8(Po)2.5 G
 (stScript).8 E F0(code will be appended later [Def)2.5 E
-(ault terminates the plot system].)-.1 E F1<ad4c>108 698.4 Q F2
-(lon\215ip)23.63 E F0 .458(Sets the range of the longitude v)144 710.4 R
+(ault terminates the plot system].)-.1 E F1<ad4c>108 141.6 Q F2
+(lon\215ip)23.63 E F0 .458(Sets the range of the longitude v)144 153.6 R
 .459(alues returned by the sw)-.25 F .459(ath sonar i/o routines.)-.1 F
 (If)5.459 E F2(lon\215ip)2.959 E F0 .459(=\2551 then)B .892
-(the longitude v)144 722.4 R .892
+(the longitude v)144 165.6 R .892
 (alues will be in the range from \255360 to 0 de)-.25 F .892(grees. If)
--.15 F F2(lon\215ip)3.391 E F0 .891(=0 then the longitude)B
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E -.25(va)144 84 S .131
-(lues will be in the range from \255180 to 180 de).25 F .131(grees. If)
--.15 F/F1 10/Times-Italic at 0 SF(lon\215ip)2.631 E F0 .131
-(=1 then the longitude v)B .132(alues will be)-.25 F
-(in the range from 0 to 360 de)144 96 Q 2.5(grees. Def)-.15 F(ault:)-.1
-E F1(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E/F2 10/Times-Bold at 0 SF
-<ad4e>108 112.8 Q F1(cpt\214le)23.08 E F0(Normally)144 124.8 Q 2.924(,s)
--.65 G .424(hading of bath)-2.924 F .424(ymetry with amplitudes \()-.05
-F F1(mode)A F0 2.924(=3a)2.924 G 2.924(ss)-2.924 G .424(et with the)
--2.924 F F2<ad5a>2.923 E F0 .423(option\) is accom-)2.923 F .707
-(plished by linearly mapping the amplitudes to shade v)144 136.8 R .707
-(alues. This option speci\214es a grayscale cpt)-.25 F
-(\214le used to map amplitude v)144 148.8 Q(alues to grayscale shade v)
--.25 E(alues.)-.25 E F2<ad4f>108 165.6 Q F0(Selects Ov)22.52 E
+-.15 F F2(lon\215ip)3.391 E F0 .891(=0 then the longitude)B -.25(va)144
+177.6 S .131(lues will be in the range from \255180 to 180 de).25 F .131
+(grees. If)-.15 F F2(lon\215ip)2.631 E F0 .131(=1 then the longitude v)B
+.132(alues will be)-.25 F(in the range from 0 to 360 de)144 189.6 Q 2.5
+(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
+E F1<ad4e>108 206.4 Q F2(cpt\214le)23.08 E F0(Normally)144 218.4 Q 2.924
+(,s)-.65 G .424(hading of bath)-2.924 F .424(ymetry with amplitudes \()
+-.05 F F2(mode)A F0 2.924(=3a)2.924 G 2.924(ss)-2.924 G .424
+(et with the)-2.924 F F1<ad5a>2.923 E F0 .423(option\) is accom-)2.923 F
+.707(plished by linearly mapping the amplitudes to shade v)144 230.4 R
+.707(alues. This option speci\214es a grayscale cpt)-.25 F
+(\214le used to map amplitude v)144 242.4 Q(alues to grayscale shade v)
+-.25 E(alues.)-.25 E F1<ad4f>108 259.2 Q F0(Selects Ov)22.52 E
 (erlay plot mode [Def)-.15 E(ault initializes a ne)-.1 E 2.5(wp)-.25 G
-(lot system].)-2.5 E F2<ad50>108 182.4 Q F0
+(lot system].)-2.5 E F1<ad50>108 276 Q F0
 (Selects Portrait plotting mode [GMT Def)24.19 E
-(ault is Landscape, see gmtdef)-.1 E(aults to change this].)-.1 E F2
-<ad70>108 199.2 Q F1(pings)24.74 E F0 1.22(Sets the ping a)144 211.2 R
--.15(ve)-.2 G 1.22(raging of the input data. If).15 F F1(pings)3.719 E
+(ault is Landscape, see gmtdef)-.1 E(aults to change this].)-.1 E F1
+<ad70>108 292.8 Q F2(pings)24.74 E F0 1.22(Sets the ping a)144 304.8 R
+-.15(ve)-.2 G 1.22(raging of the input data. If).15 F F2(pings)3.719 E
 F0 3.719(=1)3.719 G 3.719(,t)-3.719 G 1.219(hen no ping a)-3.719 F -.15
-(ve)-.2 G 1.219(raging is performed. If).15 F F1(pings)144 223.2 Q F0
+(ve)-.2 G 1.219(raging is performed. If).15 F F2(pings)144 316.8 Q F0
 2.651(>0)2.651 G 2.651(,t)-2.651 G .151
 (hen that number of input pings will be a)-2.651 F -.15(ve)-.2 G .152
-(raged to produce one output ping.).15 F(If)5.152 E F1(pings)2.652 E F0
-(=)2.652 E .314(0, then the ping a)144 235.2 R -.15(ve)-.2 G .313(ragin\
+(raged to produce one output ping.).15 F(If)5.152 E F2(pings)2.652 E F0
+(=)2.652 E .314(0, then the ping a)144 328.8 R -.15(ve)-.2 G .313(ragin\
 g will automatically be done so that the along-track ping spacing is eq\
-ual).15 F(to the across-track beam spacing.)144 247.2 Q(Def)5 E(ault:)
--.1 E F1(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)-.2 G
-(raging\).).15 E F2<ad51>108 264 Q F1(dpi)22.52 E F0 .544
-(Sets the resolution of the color image output by)144 276 R F2(mbswath)
-3.044 E F0 .544(in pix)3.044 F .544(els per inch \(e)-.15 F .544
-(xcept when the)-.15 F F2<ad31>3.045 E F0(option is used to force indi)
-144 288 Q(vidual polygon color \214lls\). Def)-.25 E(ault:)-.1 E F1(dpi)
-2.5 E F0 2.5(=1)2.5 G(00.)-2.5 E F2<ad52>108 304.8 Q F1
-(west/east/south/north)23.08 E F0 1.335
-(Sets the longitude and latitude bounds within which sw)144 316.8 R
-1.334(ath sonar data will be read and plotted.)-.1 F 2.696
-(Only the data which lies within these bounds will be read.)144 328.8 R
-(Def)7.696 E(ault:)-.1 E F1(west)5.197 E F0 2.697(=\255360, east)B F1
-(=360)A F0(,)A F1(south)144 340.8 Q F0(=\25590,)A F1(north)2.5 E F0
-(=90.)A F2<ad53>108 357.6 Q F1(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 369.6 R
+ual).15 F(to the across-track beam spacing.)144 340.8 Q(Def)5 E(ault:)
+-.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)-.2 G
+(raging\).).15 E F1<ad51>108 357.6 Q F2(dpi)22.52 E F0 .544
+(Sets the resolution of the color image output by)144 369.6 R F1
+(mbswath)3.044 E F0 .544(in pix)3.044 F .544(els per inch \(e)-.15 F
+.544(xcept when the)-.15 F F1<ad31>3.045 E F0
+(option is used to force indi)144 381.6 Q
+(vidual polygon color \214lls\). Def)-.25 E(ault:)-.1 E F2(dpi)2.5 E F0
+2.5(=1)2.5 G(00.)-2.5 E F1<ad52>108 398.4 Q F2(west/east/south/north)
+23.08 E F0 1.335(Sets the longitude and latitude bounds within which sw)
+144 410.4 R 1.334(ath sonar data will be read and plotted.)-.1 F 2.696
+(Only the data which lies within these bounds will be read.)144 422.4 R
+(Def)7.696 E(ault:)-.1 E F2(west)5.197 E F0 2.697(=\255360, east)B F2
+(=360)A F0(,)A F2(south)144 434.4 Q F0(=\25590,)A F2(north)2.5 E F0
+(=90.)A F1<ad53>108 451.2 Q F2(speed)24.74 E F0 .532
+(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 463.2 R
 .531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be processed. Def)144 381.6 Q(ault:)
--.1 E F1(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F2<ad54>108 398.4 Q F1
-(time)23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 410.4 R .479
+(with a smaller ship speed will not be processed. Def)144 475.2 Q(ault:)
+-.1 E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 492 Q F2(time)
+23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 504 R .479
 (ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 422.4 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F1(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F2<ad55>108 439.2 Q F0(Dra)23.08 E 2.625(wU)-.15 G
+(wed before the data is consid-)-.25 F(ered to ha)144 516 Q .3 -.15
+(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
+(=1)2.5 G(.)-2.5 E F1<ad55>108 532.8 Q F0(Dra)23.08 E 2.625(wU)-.15 G
 .124(nix System time stamp on plot.)-2.625 F(Optionally)5.124 E 2.624
 (,a)-.65 G .124(ppend a label, or 'c' which will plot the com-)-2.624 F
-(mand string.)144 451.2 Q F2<ad56>108 468 Q F0(Selects v)23.08 E
+(mand string.)144 544.8 Q F1<ad56>108 561.6 Q F0(Selects v)23.08 E
 (erbose mode, which will send progress reports to stderr [Def)-.15 E
-(ault runs "silently"].)-.1 E F2<ad57>108 484.8 Q F0(Normally)20.3 E(,)
--.65 E F2(mbswath)4.77 E F0 -.1(wo)4.77 G 2.27(rks with bath).1 F 2.27
-(ymetry v)-.05 F 2.27(alues in meters.)-.25 F 2.27(If the)7.27 F F2
+(ault runs "silently"].)-.1 E F1<ad57>108 578.4 Q F0(Normally)20.3 E(,)
+-.65 E F1(mbswath)4.77 E F0 -.1(wo)4.77 G 2.27(rks with bath).1 F 2.27
+(ymetry v)-.05 F 2.27(alues in meters.)-.25 F 2.27(If the)7.27 F F1
 <ad57>4.77 E F0 2.27(\215ag is gi)4.77 F -.15(ve)-.25 G 2.27(n, then).15
-F F2(mbswath)144 496.8 Q F0 .004(will w)2.504 F .003(ork with bath)-.1 F
+F F1(mbswath)144 590.4 Q F0 .004(will w)2.504 F .003(ork with bath)-.1 F
 .003(ymetry v)-.05 F .003
 (alues in feet. The color palette \214le used must conform to the)-.25 F
-(range of bath)144 508.8 Q(ymetry v)-.05 E(alues in feet.)-.25 E F2
-<ad5820ad59>108 525.6 Q F0(Shift origin of plot by \()7.66 E F1
+(range of bath)144 602.4 Q(ymetry v)-.05 E(alues in feet.)-.25 E F1
+<ad5820ad59>108 619.2 Q F0(Shift origin of plot by \()7.66 E F2
 (x-shift,y-shift)A F0 2.5(\)i)C 2.5(nches [Def)-2.5 F
 (ault is \(1,1\) for ne)-.1 E 2.5(wp)-.25 G(lots, \(0,0\) for o)-2.5 E
--.15(ve)-.15 G(rlays].).15 E F2<ad5a>108 542.4 Q F1(mode[F])23.63 E F0
-(Sets the style of the plot.)144 554.4 Q F1(mode)180 566.4 Q F0 2.5(=1)
-2.5 G 31.92(:C)-2.5 G(olor \214ll of bath)-31.92 E(ymetry data.)-.05 E
-F1(mode)180 578.4 Q F0 2.5(=2)2.5 G 31.92(:C)-2.5 G
-(olor shaded relief bath)-31.92 E(ymetry)-.05 E(.)-.65 E F1(mode)180
-590.4 Q F0 2.5(=3)2.5 G 31.92(:B)-2.5 G(ath)-31.92 E
-(ymetry shaded using amplitude data.)-.05 E F1(mode)180 602.4 Q F0 2.5
-(=4)2.5 G 31.92(:C)-2.5 G(olor \214ll of amplitude data.)-31.92 E F1
-(mode)180 614.4 Q F0 2.5(=5)2.5 G 31.92(:C)-2.5 G
-(olor \214ll of sidescan data.)-31.92 E 1.238(If "F" is appended to)144
-626.4 R F1(mode)3.738 E F0 3.738(,t)C(hen)-3.738 E F2(mbswath)3.738 E F0
-1.238(will attempt to plot amplitude or sidescan data that)3.738 F(ha)
-144 638.4 Q .462 -.15(ve b)-.2 H .162(een \214ltered with).15 F F2
-(mb\214lter)2.662 E F0 5.162(.I)C 2.662(ft)-5.162 G .162
-(he desired \214ltered data \214les do not e)-2.662 F .161
-(xist, plotting will f)-.15 F .161(ail and)-.1 F F2(mbswath)144 650.4 Q
-F0 .117(will e)2.617 F .117(xit with an error message. Filtered amplitu\
-de data are stored in ancilliary \214les end-)-.15 F 1.308(ing with ".f)
-144 662.4 R -.1(fa)-.25 G 1.308
-(", and \214ltered sidescan \214les end in ".f).1 F 1.307
-(fs". Filtering of bath)-.25 F 1.307(ymetry data is not sup-)-.05 F
-(ported, and so appending "F" to)144 674.4 Q F1(mode)2.5 E F0 -.25(va)
-2.5 G(lues of 1 or 2 will ha).25 E .3 -.15(ve n)-.2 H 2.5(oe).15 G -.25
-(ff)-2.5 G 2.5(ect. Def).25 F(ault:)-.1 E F1(mode)2.5 E F0 2.5(=1)2.5 G
-(;)-2.5 E F2<ad30>108 691.2 Q F0(Create the image using the Adobe)25.3 E
-F1 -.8(Po)2.5 G(stScript).8 E F0(colorimage operator)2.5 E 5(.T)-.55 G
-(his is the def)-5 E(ault.)-.1 E F2<ad31>108 708 Q F0
-(Create the image by plotting indi)25.3 E(vidual color polygons.)-.25 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
+-.15(ve)-.15 G(rlays].).15 E F1<ad5a>108 636 Q F2(mode[F])23.63 E F0
+(Sets the style of the plot.)144 648 Q F2(mode)180 660 Q F0 2.5(=1)2.5 G
+31.92(:C)-2.5 G(olor \214ll of bath)-31.92 E(ymetry data.)-.05 E F2
+(mode)180 672 Q F0 2.5(=2)2.5 G 31.92(:C)-2.5 G(olor shaded relief bath)
+-31.92 E(ymetry)-.05 E(.)-.65 E F2(mode)180 684 Q F0 2.5(=3)2.5 G 31.92
+(:B)-2.5 G(ath)-31.92 E(ymetry shaded using amplitude data.)-.05 E F2
+(mode)180 696 Q F0 2.5(=4)2.5 G 31.92(:C)-2.5 G
+(olor \214ll of amplitude data.)-31.92 E F2(mode)180 708 Q F0 2.5(=5)2.5
+G 31.92(:C)-2.5 G(olor \214ll of sidescan data.)-31.92 E 1.238
+(If "F" is appended to)144 720 R F2(mode)3.738 E F0 3.738(,t)C(hen)
+-3.738 E F1(mbswath)3.738 E F0 1.238
+(will attempt to plot amplitude or sidescan data that)3.738 F
+(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(4)195.95 E 0
 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E/F1 10/Times-Bold at 0 SF<ad32>108 84 Q
-F0(Create the image by color separation using three calls to image for \
-later processing by)25.3 E F1(psto24)2.5 E F0(.)A/F2 10.95/Times-Bold at 0
-SF(EXAMPLES)72 100.8 Q F0 .792(Suppose the user has a Hydrosweep data \
-\214le in the L-DEO in-house binary format \()108 112.8 R F1(MBIO)A F0
-.792(format id 24\))3.292 F 1.022(called hs_e)108 124.8 R 1.021
+152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E(ha)144 84 Q .462 -.15(ve b)-.2 H
+.162(een \214ltered with).15 F/F1 10/Times-Bold at 0 SF(mb\214lter)2.662 E
+F0 5.162(.I)C 2.662(ft)-5.162 G .162
+(he desired \214ltered data \214les do not e)-2.662 F .161
+(xist, plotting will f)-.15 F .161(ail and)-.1 F F1(mbswath)144 96 Q F0
+.117(will e)2.617 F .117(xit with an error message. Filtered amplitude \
+data are stored in ancilliary \214les end-)-.15 F 1.308(ing with ".f)144
+108 R -.1(fa)-.25 G 1.308(", and \214ltered sidescan \214les end in ".f)
+.1 F 1.307(fs". Filtering of bath)-.25 F 1.307(ymetry data is not sup-)
+-.05 F(ported, and so appending "F" to)144 120 Q/F2 10/Times-Italic at 0 SF
+(mode)2.5 E F0 -.25(va)2.5 G(lues of 1 or 2 will ha).25 E .3 -.15(ve n)
+-.2 H 2.5(oe).15 G -.25(ff)-2.5 G 2.5(ect. Def).25 F(ault:)-.1 E F2
+(mode)2.5 E F0 2.5(=1)2.5 G(;)-2.5 E F1<ad30>108 136.8 Q F0
+(Create the image using the Adobe)25.3 E F2 -.8(Po)2.5 G(stScript).8 E
+F0(colorimage operator)2.5 E 5(.T)-.55 G(his is the def)-5 E(ault.)-.1 E
+F1<ad31>108 153.6 Q F0(Create the image by plotting indi)25.3 E
+(vidual color polygons.)-.25 E F1<ad32>108 170.4 Q F0(Create the image \
+by color separation using three calls to image for later processing by)
+25.3 E F1(psto24)2.5 E F0(.)A/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 187.2
+Q F0 .792(Suppose the user has a Hydrosweep data \214le in the L-DEO in\
+-house binary format \()108 199.2 R F1(MBIO)A F0 .792(format id 24\))
+3.292 F 1.022(called hs_e)108 211.2 R 1.021
 (w9302_157_mn.mb24 which lies in the re)-.25 F 1.021
 (gion w/s/e/n = \25532.1874/-26.6236/54.6349/56.7536.)-.15 F(The follo)
-108 136.8 Q(wing will suf)-.25 E
-(\214ce to generate a color \214ll plot:)-.25 E(mbsw)144 148.8 Q
+108 223.2 Q(wing will suf)-.25 E
+(\214ce to generate a color \214ll plot:)-.25 E(gmt mbsw)144 235.2 Q
 (ath \255Idatalist \255Jm1.46578 \255R-32.1874/-26.6236/54.6349/56.7536)
--.1 E(-B1/1 \255Ccolor)180 160.8 Q(.cpt \255p1 \255A1 \255Q100 \255Z2)
--.55 E(-X1 \255Y1.75 \255V > mbsw)180 172.8 Q(ath.ps)-.1 E
-(where the \214le datalist contains:)108 184.8 Q(hs_e)144 196.8 Q
-(w9302_157_mn.mb24 24)-.25 E 3.274(Am)108 208.8 S .774
+-.1 E(-B1/1 \255Ccolor)180 247.2 Q(.cpt \255p1 \255A1 \255Q100 \255Z2)
+-.55 E(-X1 \255Y1.75 \255V > mbsw)180 259.2 Q(ath.ps)-.1 E
+(where the \214le datalist contains:)108 271.2 Q(hs_e)144 283.2 Q
+(w9302_157_mn.mb24 24)-.25 E 3.274(Am)108 295.2 S .774
 (ore complicated plot including a na)-3.274 F(vig)-.2 E .774
 (ation track and a color scale can be created using)-.05 F F1(mbswath)
-3.275 E F0(in)3.275 E .915(conjunction with other GMT and GMT)108 220.8
+3.275 E F0(in)3.275 E .915(conjunction with other GMT and GMT)108 307.2
 R .914(-compatible utilities.)-.92 F .914(The follo)5.914 F .914
-(wing is an e)-.25 F .914(xample of a shellscript)-.15 F(which generate\
-s such a plot and then displays it on the screen \(assuming you ha)108
-232.8 Q .3 -.15(ve a S)-.2 H(un w).15 E(orkstation\):)-.1 E(#)110.5
-256.8 Q 2.5(#S)110.5 268.8 S(hellscript to create Postscript plot of sw)
--2.5 E(ath sonar data)-.1 E 2.5(#C)110.5 280.8 S
-(reated by macro mbm_plot)-2.5 E(#)110.5 292.8 Q 2.5(#M)110.5 304.8 S
-(ak)-2.5 E 2.5(ed)-.1 G(atalist \214le)-2.5 E
-(echo Making datalist \214le...)110.5 316.8 Q(echo hs_e)110.5 328.8 Q
-(w9302_157_bmn.mb24 24 > datalist)-.25 E(#)110.5 340.8 Q 2.5(#M)110.5
-352.8 S(ak)-2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 364.8 Q
-(echo 2235 255 255 255 2372 255 221 171 > hs_e)110.5 376.8 Q
+(wing is an e)-.25 F .914(xample of a shellscript)-.15 F
+(which generates such a plot and then displays it on the screen:)108
+319.2 Q(#)110.5 343.2 Q 2.5(#S)110.5 355.2 S
+(hellscript to create Postscript plot of sw)-2.5 E(ath sonar data)-.1 E
+2.5(#C)110.5 367.2 S(reated by macro mbm_plot)-2.5 E(#)110.5 379.2 Q 2.5
+(#M)110.5 391.2 S(ak)-2.5 E 2.5(ed)-.1 G(atalist \214le)-2.5 E
+(echo Making datalist \214le...)110.5 403.2 Q(echo hs_e)110.5 415.2 Q
+(w9302_157_bmn.mb24 24 > datalist)-.25 E(#)110.5 427.2 Q 2.5(#M)110.5
+439.2 S(ak)-2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
+(echo Making color palette table \214le...)110.5 451.2 Q
+(echo 2235 255 255 255 2372 255 221 171 > hs_e)110.5 463.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2372 255 221 171 2509 255 186 133 >> hs_e)110.5 388.8 Q
+(echo 2372 255 221 171 2509 255 186 133 >> hs_e)110.5 475.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2509 255 186 133 2646 255 161 68 >> hs_e)110.5 400.8 Q
+(echo 2509 255 186 133 2646 255 161 68 >> hs_e)110.5 487.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2646 255 161 68 2783 255 189 87 >> hs_e)110.5 412.8 Q
+(echo 2646 255 161 68 2783 255 189 87 >> hs_e)110.5 499.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2783 255 189 87 2920 240 236 121 >> hs_e)110.5 424.8 Q
+(echo 2783 255 189 87 2920 240 236 121 >> hs_e)110.5 511.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2920 240 236 121 3057 205 255 162 >> hs_e)110.5 436.8 Q
+(echo 2920 240 236 121 3057 205 255 162 >> hs_e)110.5 523.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3057 205 255 162 3193 138 236 174 >> hs_e)110.5 448.8 Q
+(echo 3057 205 255 162 3193 138 236 174 >> hs_e)110.5 535.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3193 138 236 174 3330 106 235 255 >> hs_e)110.5 460.8 Q
+(echo 3193 138 236 174 3330 106 235 255 >> hs_e)110.5 547.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3330 106 235 255 3467 87 215 255 >> hs_e)110.5 472.8 Q
+(echo 3330 106 235 255 3467 87 215 255 >> hs_e)110.5 559.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3467 87 215 255 3604 50 190 255 >> hs_e)110.5 484.8 Q
+(echo 3467 87 215 255 3604 50 190 255 >> hs_e)110.5 571.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3604 50 190 255 3741 0 160 255 >> hs_e)110.5 496.8 Q
+(echo 3604 50 190 255 3741 0 160 255 >> hs_e)110.5 583.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3741 0 160 255 3878 40 127 251 >> hs_e)110.5 508.8 Q
+(echo 3741 0 160 255 3878 40 127 251 >> hs_e)110.5 595.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3878 40 127 251 4015 21 92 236 >> hs_e)110.5 520.8 Q
+(echo 3878 40 127 251 4015 21 92 236 >> hs_e)110.5 607.2 Q
 (w9302_157_bmn.mb24.cpt)-.25 E
-(echo 4015 21 92 236 4152 37 57 175 >> hs_e)110.5 532.8 Q
-(w9302_157_bmn.mb24.cpt)-.25 E(#)110.5 544.8 Q 2.5(#R)110.5 556.8 S
-(un mbsw)-2.5 E(ath)-.1 E(echo Running mbsw)110.5 568.8 Q(ath...)-.1 E
-(mbsw)110.5 580.8 Q 2.995
+(echo 4015 21 92 236 4152 37 57 175 >> hs_e)110.5 619.2 Q
+(w9302_157_bmn.mb24.cpt)-.25 E(#)110.5 631.2 Q 2.5(#R)110.5 643.2 S
+(un mbsw)-2.5 E(ath)-.1 E(echo Running mbsw)110.5 655.2 Q(ath...)-.1 E
+2.396(gmt mbsw)110.5 667.2 R 2.396
 (ath \255Idatalist \255Jm1.46578 \255R-32.1874/-26.6236/54.6349/56.7536)
--.1 F(-B1.1128/1.1128":.Data)36.005 E 1.664(File hs_e)108 592.8 R 4.884
+-.1 F(-B1.1128/1.1128":.Data)17.346 E 1.664(File hs_e)108 679.2 R 4.884
 (w9302_157_bmn.mb24:" -Chs_e)-.25 F 1.664
 (w9302_157_bmn.mb24.cpt \255p1 \255A1 \255Q100 \255G5/0 \255Z2 \255X1)
--.25 F(-Y1.75 \255K \255V > hs_e)116.31 604.8 Q(w9302_157_bmn.mb24.ps)
--.25 E(#)110.5 616.8 Q 2.5(#R)110.5 628.8 S(un mblist)-2.5 E
-(echo Running mblist...)110.5 640.8 Q(mblist \255F24 \255Ihs_e)110.5
-652.8 Q(w9302_157_bmn.mb24 \255O)-.25 E(XYU > hs_e)-.4 E
-(w9302_157_bmn.mb24.na)-.25 E(v)-.2 E(#)110.5 664.8 Q 2.5(#R)110.5 676.8
-S(un pstrack)-2.5 E(echo Running pstrack...)110.5 688.8 Q 8.333
-(pstrack hs_e)110.5 700.8 R(w9302_157_bmn.mb24.na)-.25 E 10.833<76ad>-.2
-G 41.544(Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536)-10.833 F 6.239
-(\255B1.1128/1.1128":.Data File)108 712.8 R(hs_e)33.849 E 6.238
-(w9302_157_bmn.mb24:" \255W1p \255Mt15ma1h \255O \255K >>)-.25 F(hs_e)
-108 724.8 Q(w9302_157_bmn.mb24.ps)-.25 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(5)204.835 E 0 Cg EP
+-.25 F(-Y1.75 \255K \255V > hs_e)116.31 691.2 Q(w9302_157_bmn.mb24.ps)
+-.25 E(#)110.5 703.2 Q 2.5(#R)110.5 715.2 S(un mblist)-2.5 E
+(echo Running mblist...)110.5 727.2 Q(MB-System 5.0)72 768 Q 2.5(5F)
+137.61 G(ebruary 2015)-2.5 E(5)195.95 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E(#)110.5 84 Q 2.5(#R)110.5 96 S
-(un psscale)-2.5 E(echo Running psscale...)110.5 108 Q 2.5
-(psscale \255Chs_e)110.5 120 R
+152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E(mblist \255F24 \255Ihs_e)110.5 84 Q
+(w9302_157_bmn.mb24 \255O)-.25 E(XYU > hs_e)-.4 E(w9302_157_bmn.mb24.na)
+-.25 E(v)-.2 E(#)110.5 96 Q 2.5(#R)110.5 108 S(un pstrack)-2.5 E
+(echo Running pstrack...)110.5 120 Q 6.25(gmt pstrack hs_e)110.5 132 R
+(w9302_157_bmn.mb24.na)-.25 E 8.75<76ad>-.2 G 21.4
+(Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536)-8.75 F 6.239
+(\255B1.1128/1.1128":.Data File)108 144 R(hs_e)33.849 E 6.238
+(w9302_157_bmn.mb24:" \255W1p \255Mt15ma1h \255O \255K >>)-.25 F(hs_e)
+108 156 Q(w9302_157_bmn.mb24.ps)-.25 E(#)110.5 168 Q 2.5(#R)110.5 180 S
+(un psscale)-2.5 E(echo Running psscale...)110.5 192 Q(gmt psscale)110.5
+204 Q(\255Chs_e)5 E
 (w9302_157_bmn.mb24.cpt \255D4.0777/-0.5000/6.5242/0.1500h)-.25 E
-(-B":.Depth \(meters\):" \255O \255V >> hs_e)144 132 Q
-(w9302_157_bmn.mb24.ps)-.25 E(#)110.5 144 Q 2.5(#D)110.5 156 S
-(elete surplus \214les)-2.5 E(echo Deleting surplus \214les...)110.5 168
-Q(rm \255f hs_e)110.5 180 Q(w9302_157_bmn.mb24.cpt datalist hs_e)-.25 E
-(w9302_157_bmn.mb24.na)-.25 E(v)-.2 E(#)110.5 192 Q 2.5(#R)110.5 204 S
-(un page)-2.5 E(vie)-.25 E(w)-.25 E(echo Running page)110.5 216 Q(vie)
--.25 E 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(page)110.5 228 Q
-(vie)-.25 E 2.5(wh)-.25 G(s_e)-2.5 E(w9302_157_bmn.mb24.ps &)-.25 E(#)
-110.5 240 Q 2.5(#A)110.5 252 S(ll done!)-2.5 E(echo All done!)110.5 264
-Q/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 292.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 304.8 Q F0(\(1\),)A F2(mbm_plot)2.5 E F0(\(1\),)A F2
+(-B":.Depth \(meters\):" \255O \255V >> hs_e)144 216 Q
+(w9302_157_bmn.mb24.ps)-.25 E(#)110.5 228 Q 2.5(#D)110.5 240 S
+(elete surplus \214les)-2.5 E(echo Deleting surplus \214les...)110.5 252
+Q(rm \255f hs_e)110.5 264 Q(w9302_157_bmn.mb24.cpt datalist hs_e)-.25 E
+(w9302_157_bmn.mb24.na)-.25 E(v)-.2 E(#)110.5 276 Q 2.5(#R)110.5 288 S
+(un page)-2.5 E(vie)-.25 E(w)-.25 E(echo Running gv in background...)
+110.5 300 Q(gv hs_e)110.5 312 Q(w9302_157_bmn.mb24.ps &)-.25 E(#)110.5
+324 Q 2.5(#A)110.5 336 S(ll done!)-2.5 E(echo All done!)110.5 348 Q/F1
+10.95/Times-Bold at 0 SF(SEE ALSO)72 376.8 Q/F2 10/Times-Bold at 0 SF
+(mbsystem)108 388.8 Q F0(\(1\),)A F2(mbm_plot)2.5 E F0(\(1\),)A F2
 (mbcontour)2.5 E F0(\(1\),)A F2(mb\214lter)5 E F0(\(1\),)A F2(gmtsystem)
 2.5 E F0(\(1\),)A F2(psbasemap)2.5 E F0(\(1\),)A F2(psto24)2.5 E F0
-(\(1\))A F1 -.11(BU)72 333.6 S(GS).11 E F0(Let us kno)108 345.6 Q -.65
-(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)
-204.835 E 0 Cg EP
+(\(1\))A F1 -.11(BU)72 417.6 S(GS).11 E F0(Let us kno)108 429.6 Q -.65
+(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(6)
+195.95 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbswplspreprocess.ps b/src/ps/mbswplspreprocess.ps
index 58cdcda..75dd919 100644
--- a/src/ps/mbswplspreprocess.ps
+++ b/src/ps/mbswplspreprocess.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbsystem.ps b/src/ps/mbsystem.ps
index 6fa033a..9d635bb 100644
--- a/src/ps/mbsystem.ps
+++ b/src/ps/mbsystem.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
@@ -230,12 +230,12 @@ def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
+(5.5 mbsystem\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
 .219 E/F2 10/Times-Bold at 0 SF(mbsystem)108 96 Q F0 4.007(\255As)4.007 G
 1.506(et of utilities for manipulating and processing sw)-4.007 F 1.506
 (ath sonar bath)-.1 F(ymetry)-.05 E 4.006(,a)-.65 G 1.506(mplitude, and)
 -4.006 F(sidescan data.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108
-148.8 S(rsion 5.3)1.11 E F1 -.548(AU)72 177.6 S(THORSHIP).548 E F0(Da)
+148.8 S(rsion 5.5)1.11 E F1 -.548(AU)72 177.6 S(THORSHIP).548 E F0(Da)
 108 189.6 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
 (g\))-.18 E(Montere)113 201.6 Q 2.5(yB)-.15 G
 (ay Aquarium Research Institute)-2.5 E
@@ -294,7 +294,7 @@ he international oceanographic community and in the marine technology)
 (are packages \(e.g.)-.1 F .21(GMT and netCDF\),)5.21 F
 (all of which are freely a)108 554.4 Q -.25(va)-.2 G
 (ilable as source code.).25 E F1(COPYRIGHT AND LICENSING)72 583.2 Q F2
-(MB-System)108 595.2 Q F0(Cop)2.5 E(yright \(C\) 1993-2012 by)-.1 E(Da)
+(MB-System)108 595.2 Q F0(Cop)2.5 E(yright \(C\) 1993-2015 by)-.1 E(Da)
 108 607.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
 (g\))-.18 E(Montere)118 619.2 Q 2.5(yB)-.15 G
 (ay Aquarium Research Institute)-2.5 E(Moss Landing, CA 95039)118 631.2
@@ -307,14 +307,14 @@ Q(The)108 715.2 Q F2(MB-System)3.522 E F0 1.022(source code is distrib)
 (uted under the GNU General Public License as formulated by the)-.2 F
 .73(GNU Project. Early)108 727.2 R F2(MB-System)3.23 E F0(distrib)3.23 E
 .73(utions were described as "public domain", which meant there w)-.2 F
-(as)-.1 E(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(1)
-204.835 E 0 Cg EP
+(as)-.1 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(1)195.95 E 0
+Cg EP
 %%Page: 2 2
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 1.131(no restrictions whatsoe)108 84 R -.15(ve)
+(5.5 mbsystem\(1\))2.5 F 1.131(no restrictions whatsoe)108 84 R -.15(ve)
 -.25 G 3.631(ro).15 G 3.631(nt)-3.631 G 1.132(he use of the code. W)
 -3.631 F 3.632(ea)-.8 G 1.132(dopted the more restricti)-3.632 F 1.432
 -.15(ve G)-.25 H 1.132(NU GPL license in).15 F 1.276
@@ -435,14 +435,14 @@ R .836(ARI. The v)-.35 F .836
 .923(ent of 5.0, o)-.15 F -.15(ve)-.15 G 3.423(rs).15 G .922
 (ixty "beta" and "of)-3.423 F .922(\214cial" distrib)-.25 F .922
 (utions of)-.2 F F1(MB-System)3.422 E F0(ha)3.422 E 1.222 -.15(ve b)-.2
-H(een).15 E(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
+H(een).15 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(2)195.95 E 0
+Cg EP
 %%Page: 3 3
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 1.122(released. Be)108 84 R 1.122
+(5.5 mbsystem\(1\))2.5 F 1.122(released. Be)108 84 R 1.122
 (ginning with 5.2.1880 on December 30, 2010,)-.15 F/F1 10/Times-Bold at 0
 SF(MB-System)3.622 E F0(distrib)3.622 E 1.122(utions are tied to the re)
 -.2 F(vi-)-.25 E(sions in the source code archi)108 96 Q .3 -.15(ve \()
@@ -545,14 +545,14 @@ dify the parameter \214les used to control the opera-)-.25 F
 .727(grouped according to these bins. Once all of)128 700.8 R 3.227
 (data are)5.727 F .727
 (read, statistical tests are applied to the sound-)3.227 F
-(ings within each bin.)128 712.8 Q(MB-System 5.3)72 768 Q 2.5(7J)146.495
-G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
+(ings within each bin.)128 712.8 Q(MB-System 5.5)72 768 Q
+(26 January 2015)137.61 E(3)195.95 E 0 Cg EP
 %%Page: 4 4
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F/F1 10/Times-Bold at 0 SF(Support f)87 84 Q(or Pr)
+(5.5 mbsystem\(1\))2.5 F/F1 10/Times-Bold at 0 SF(Support f)87 84 Q(or Pr)
 -.25 E(ojected Coordinate Systems.)-.18 E F0<83>108 96 Q F1(MB-System)
 16.5 E F0(no)3.476 E 3.476(wi)-.25 G .976
 (ncorporates the source code for the PR)-3.476 F .976
@@ -662,14 +662,13 @@ the)128 708 R(rele)128 720 Q -.25(va)-.25 G .057(nt programs).25 F F1
 <ad46>2.557 E/F2 10/Times-Italic at 0 SF(format)A F0 2.557(option. The)
 2.557 F .056(controls for ping a)2.557 F -.15(ve)-.2 G .056
 (raging and windo).15 F .056(wing in time and space)-.25 F
-(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
+(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(4)195.95 E 0 Cg EP
 %%Page: 5 5
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(are rarely used, and must no)128 84 Q 2.5(wb)
+(5.5 mbsystem\(1\))2.5 F(are rarely used, and must no)128 84 Q 2.5(wb)
 -.25 G 2.5(ee)-2.5 G(xplicitly set in command line ar)-2.65 E(guments.)
 -.18 E/F1 10/Times-Bold at 0 SF(New Data F)87 112.8 Q(ormats.)-.25 E F0
 16.5<8346>108 124.8 S(uruno HS10 multibeam bath)-16.5 E
@@ -745,14 +744,13 @@ F1(mbedit)2.5 E F0(to interacti)2.5 E -.15(ve)-.25 G(ly \215ag).15 E
 (appropriate sound v)128 686.4 Q(elocity pro\214le \(SVP\) for)-.15 E
 (recalculating the bath)128 698.4 Q(ymetry)-.05 E(.)-.65 E 2.5
 (Input: mbari_1998_524_cen.mb57)138 710.4 R(Output: good.svp)138 722.4 Q
-(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(5)204.835 E 0
-Cg EP
+(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(5)195.95 E 0 Cg EP
 %%Page: 6 6
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(5\) Run)120.5 84 Q/F1 10/Times-Bold at 0 SF(mb)2.5
+(5.5 mbsystem\(1\))2.5 F(5\) Run)120.5 84 Q/F1 10/Times-Bold at 0 SF(mb)2.5
 E(bath)-.1 E F0(to recalculate the)2.5 E(bath)128 96 Q
 (ymetry using the SVP \214le generated)-.05 E(using)128 108 Q F1(mb)2.5
 E -.1(ve)-.15 G(locitytool).1 E F0(.)A 2.5
@@ -827,14 +825,14 @@ F .446(modify parameter \214les in addition to generating parallel \214\
 les used by)108 698.4 R F1(mbpr)2.946 E(ocess)-.18 E F0 2.946(.T)C .446
 (he program)-2.946 F F1(mbset)2.946 E F0(can)2.946 E
 (also be used to create and modify)108 710.4 Q F1(mbpr)2.5 E(ocess)-.18
-E F0(parameter \214les.)2.5 E(MB-System 5.3)72 768 Q 2.5(7J)146.495 G
-(une 2013)-2.5 E(6)204.835 E 0 Cg EP
+E F0(parameter \214les.)2.5 E(MB-System 5.5)72 768 Q(26 January 2015)
+137.61 E(6)195.95 E 0 Cg EP
 %%Page: 7 7
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 1.216(The same processing steps described abo)
+(5.5 mbsystem\(1\))2.5 F 1.216(The same processing steps described abo)
 108 84 R 1.515 -.15(ve a)-.15 H 3.715(sas).15 G 1.215
 (erial processing scheme can be accomplished with the)-3.715 F(ne)108 96
 Q 2.5(wp)-.25 G(arallel processing scheme as follo)-2.5 E(ws:)-.25 E
@@ -875,14 +873,14 @@ G(le.)-2.5 E(The parameter \214le is updated and)128 588 Q(set to mer)
 (ve)-.15 G(locitytool).1 E F0(to generate an)2.5 E
 (an appropriate sound v)128 696 Q(elocity pro\214le)-.15 E
 (\(SVP\) for recalculating the bath)128 708 Q(ymetry)-.05 E(.)-.65 E
-(The SVP is output to the ".svp" \214le.)128 720 Q(MB-System 5.3)72 768
-Q 2.5(7J)146.495 G(une 2013)-2.5 E(7)204.835 E 0 Cg EP
+(The SVP is output to the ".svp" \214le.)128 720 Q(MB-System 5.5)72 768
+Q(26 January 2015)137.61 E(7)195.95 E 0 Cg EP
 %%Page: 8 8
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(The parameter \214le is updated and)128 84 Q
+(5.5 mbsystem\(1\))2.5 F(The parameter \214le is updated and)128 84 Q
 (set to recalculate the bath)128 96 Q(ymetry by)-.05 E
 (raytracing through the SVP model from)128 108 Q(the ".svp" \214le.)128
 120 Q 2.5(Input: mbari_1998_524.mb57)138 132 R(mbari_1998_524.mb57.par)
@@ -925,14 +923,14 @@ Q(mbari_1998_524p.mb57.inf)158 660 Q(mbari_1998_524p.mb57.fbt)158 672 Q
 (he processed output can be easily).4 F .665(updated if, for e)108 720 R
 .665(xample, additional bath)-.15 F .665
 (ymetry editing is required. If the)-.05 F F1(mbedit)3.165 E F0 .665
-(program is used ag)3.165 F .665(ain, it)-.05 F(MB-System 5.3)72 768 Q
-2.5(7J)146.495 G(une 2013)-2.5 E(8)204.835 E 0 Cg EP
+(program is used ag)3.165 F .665(ain, it)-.05 F(MB-System 5.5)72 768 Q
+(26 January 2015)137.61 E(8)195.95 E 0 Cg EP
 %%Page: 9 9
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 1.52(will load the e)108 84 R 1.52
+(5.5 mbsystem\(1\))2.5 F 1.52(will load the e)108 84 R 1.52
 (xisting edit e)-.15 F -.15(ve)-.25 G 1.52
 (nts from the ".esf" \214le and then update the ".esf" \214le. T).15 F
 4.02(oi)-.8 G 1.52(ncorporate the)-4.02 F .803(updated bath)108 96 R
@@ -1064,14 +1062,13 @@ E(\214x, lik)-.25 E(e:)-.1 E(0053_20020518_205816_ra)144 645.6 Q -.65
 (will automatically replace the)2.971 F -.15(ve)108 705.6 S(ndor suf).15
 E(\214x with the)-.25 E F1(MB-System)2.5 E F0(con)2.5 E -.15(ve)-.4 G
 (ntion suf).15 E(\214x when it creates a processed output \214le.)-.25 E
-(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(9)204.835 E 0
-Cg EP
+(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(9)195.95 E 0 Cg EP
 %%Page: 10 10
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(LIST OF MB-SYSTEM PR)
+(5.5 mbsystem\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(LIST OF MB-SYSTEM PR)
 72 84 Q(OGRAMS AND MA)-.329 E(CR)-.602 E(OS)-.329 E F0 .174
 (See the indi)108 96 R .173(vidual manual pages for detailed informatio\
 n about speci\214c programs.)-.25 F .173(See the manual page for)5.173 F
@@ -1135,14 +1132,14 @@ F0(library)2.5 E(.)-.65 E F2(mbgetesf)110.5 576 Q F0 2.5(*: Extract)B
 (*: Obtain)B(histogram of bath)2.5 E(ymetry)-.05 E(,)-.65 E
 (amplitude, or sidescan data from)180 696 Q(sw)180 708 Q
 (ath sonar data \214les.)-.1 E F2(mbinf)110.5 720 Q(o)-.25 E F0 2.5
-(*: Output)B(some basic statistics of)2.5 E(MB-System 5.3)72 768 Q 2.5
-(7J)146.495 G(une 2013)-2.5 E(10)199.835 E 0 Cg EP
+(*: Output)B(some basic statistics of)2.5 E(MB-System 5.5)72 768 Q
+(26 January 2015)137.61 E(10)190.95 E 0 Cg EP
 %%Page: 11 11
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(sw)180 84 Q(ath sonar data \214les.)-.1 E/F1 10
+(5.5 mbsystem\(1\))2.5 F(sw)180 84 Q(ath sonar data \214les.)-.1 E/F1 10
 /Times-Bold at 0 SF(mble)110.5 96 Q(vitus)-.15 E F0 2.5(*: Create)B 2.5(aw)
 2.5 G(ater v)-2.6 E(elocity pro\214le)-.15 E(which is representati)180
 108 Q .3 -.15(ve o)-.25 H 2.5(ft).15 G(he mean)-2.5 E(annual w)180 120 Q
@@ -1201,14 +1198,14 @@ E(bath)180 612 Q(ymetry calculations.)-.05 E 1.091(The follo)108 636 R
 (pply a grazing angle correction)-5 E
 (to beam amplitude or sidescan data.)180 708 Q F1(mb)110.5 720 Q
 (backangle)-.1 E F0 5(:G)C(enerates a table of the a)-5 E -.15(ve)-.2 G
-(rage).15 E(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(11)
-199.835 E 0 Cg EP
+(rage).15 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(11)190.95 E
+0 Cg EP
 %%Page: 12 12
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(amplitude or sidescan v)180 84 Q(alues as a)
+(5.5 mbsystem\(1\))2.5 F(amplitude or sidescan v)180 84 Q(alues as a)
 -.25 E(function of the grazing angle with)180 96 Q(the sea\215oor)180
 108 Q(.)-.55 E/F1 10/Times-Bold at 0 SF(mb)110.5 120 Q(bath)-.1 E F0 5(:G)C
 (enerates bath)-5 E(ymetry from tra)-.05 E -.15(ve)-.2 G 2.5(lt).15 G
@@ -1263,14 +1260,14 @@ Q(v\214x)-.25 E F0 5(:R)C(eads a WHOI DSL AMS-120 processed)-5 E(na)180
 -.1 E -.1(wa)180 696 S(ter v).1 E(elocity v)-.15 E(alues used in)-.25 E
 (processing that data.)180 708 Q F1(mbm_grd2ar)110.5 720 Q(c)-.18 E F0 5
 (:C)C(on)-5 E -.15(ve)-.4 G(rts a GMT grid \214le to an ESRI ArcV).15 E
-(ie)-.6 E(w)-.25 E(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5
-E(12)199.835 E 0 Cg EP
+(ie)-.6 E(w)-.25 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(12)
+190.95 E 0 Cg EP
 %%Page: 13 13
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(ASCII grid \214le.)180 84 Q/F1 10/Times-Bold at 0
+(5.5 mbsystem\(1\))2.5 F(ASCII grid \214le.)180 84 Q/F1 10/Times-Bold at 0
 SF(mbm_grd2geo)110.5 96 Q(vrml)-.1 E F0 5(:C)C(reate and e)-5 E -.15(xe)
 -.15 G(cute commands which).15 E(generate a T)180 108 Q(erraV)-.7 E
 (ision tileset and GeoVRML)-.6 E 2.5(set of \214les that)180 120 R 2.5
@@ -1329,14 +1326,13 @@ Q(can be applied to the data.)180 468 Q F1(mbm_r)110.5 480 Q
 uld actually con-)108 712.8 R .643(tinue with the te)108 724.8 R .643
 (xt on the ne)-.15 F .643(xt line. Refer to indi)-.15 F .643
 (vidual program manual pages for detailed information on)-.25 F
-(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(13)199.835 E 0
-Cg EP
+(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(13)190.95 E 0 Cg EP
 %%Page: 14 14
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(the command ar)108 84 Q
+(5.5 mbsystem\(1\))2.5 F(the command ar)108 84 Q
 (guments and functionality of the v)-.18 E(arious programs.)-.25 E/F1
 10.95/Times-Bold at 0 SF(PR)72 112.8 Q(OCESSING SEABEAM 2100 D)-.329 E
 -1.644 -1.04(AT A)-.383 H F0 .563(The follo)108 124.8 R .562(wing data \
@@ -1407,14 +1403,14 @@ E F0(include:)2.5 E 2.5<ad63>120.5 700.8 S(olor \214ll bath)-2.5 E
 (ymetry with contours)-.05 E 2.5<ad73>120.5 712.8 S
 (haded relief color \214ll bath)-2.5 E(ymetry)-.05 E 2.5<ad63>120.5
 724.8 S(olor \214ll bath)-2.5 E(ymetry o)-.05 E -.15(ve)-.15 G
-(rlaid with amplitude).15 E(MB-System 5.3)72 768 Q 2.5(7J)146.495 G
-(une 2013)-2.5 E(14)199.835 E 0 Cg EP
+(rlaid with amplitude).15 E(MB-System 5.5)72 768 Q(26 January 2015)
+137.61 E(14)190.95 E 0 Cg EP
 %%Page: 15 15
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 2.5<ad67>120.5 84 S(rayscale amplitude)-2.5 E
+(5.5 mbsystem\(1\))2.5 F 2.5<ad67>120.5 84 S(rayscale amplitude)-2.5 E
 2.5<ad67>120.5 96 S(rayscale sidescan)-2.5 E 1.6 -.8(We h)108 120 T
 -2.25 -.2(av e).8 H(already generated the \214rst type of plot. W)2.7 E
 2.5(en)-.8 G .5 -.25(ow g)-2.5 H(enerate the other four as well:).25 E
@@ -1497,14 +1493,14 @@ used by)108 672 R F1(mbpr)108 684 Q(ocess)-.18 E F0 .193
 (ify it so that the bath)108 696 Q(ymetry edits w)-.05 E
 (ould be applied when)-.1 E F1(mbpr)2.5 E(ocess)-.18 E F0(is run.)2.5 E
 F1(Analysis Option B)108 720 Q F0 2.5(:I)C(nteracti)-2.5 E .3 -.15(ve B)
--.25 H(ath).15 E(ymetry Editing.)-.05 E(MB-System 5.3)72 768 Q 2.5(7J)
-146.495 G(une 2013)-2.5 E(15)199.835 E 0 Cg EP
+-.25 H(ath).15 E(ymetry Editing.)-.05 E(MB-System 5.5)72 768 Q
+(26 January 2015)137.61 E(15)190.95 E 0 Cg EP
 %%Page: 16 16
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 2.098 -.8(We u)108 84 T .498(se the interacti)
+(5.5 mbsystem\(1\))2.5 F 2.098 -.8(We u)108 84 T .498(se the interacti)
 .8 F .799 -.15(ve g)-.25 H .499(raphical tool).15 F/F1 10/Times-Bold at 0
 SF(mbedit)2.999 E F0 .499(to check the quality of the bath)2.999 F .499
 (ymetry and to \215ag artif)-.05 F .499(acts as)-.1 F(necessary)108 96 Q
@@ -1616,14 +1612,14 @@ E(ocess)-.18 E F0(pro)3.88 E 1.38
 -.25(va)-.2 G 3.014(ilable. Since).25 F .514
 (the amplitude vs grazing angle function v)3.014 F .513
 (aries with the type of sea\215oor)-.25 F 3.013(,w)-.4 G 3.013(en)-3.013
-G(eed)-3.013 E(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E
-(16)199.835 E 0 Cg EP
+G(eed)-3.013 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(16)190.95
+E 0 Cg EP
 %%Page: 17 17
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F .939(to construct separate amplitude vs grazin\
+(5.5 mbsystem\(1\))2.5 F .939(to construct separate amplitude vs grazin\
 g angle correction tables at re)108 84 R .94(gular interv)-.15 F .94
 (als through each sw)-.25 F(ath)-.1 E(data \214le.)108 96 Q 1.6 -.8
 (We u)5 H(se the program).8 E/F1 10/Times-Bold at 0 SF(mb)2.5 E(backangle)
@@ -1705,14 +1701,13 @@ ude grid cell)-.05 F .139
 (mbmosaic)2.673 E F0 .173(operates in a f)2.673 F .173
 (ashion similar to)-.1 F F1(mbgrid)2.673 E F0 2.673(,b)C .174
 (ut has special capabilities allo)-2.873 F .174(wing users)-.25 F
-(MB-System 5.3)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(17)199.835 E 0
-Cg EP
+(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(17)190.95 E 0 Cg EP
 %%Page: 18 18
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F .019(to prioritize which parts of the sw)108 84
+(5.5 mbsystem\(1\))2.5 F .019(to prioritize which parts of the sw)108 84
 R .018(ath are used in the mosaic that are useful for sidescan data. In\
  particular)-.1 F 2.518(,i)-.4 G(t)-2.518 E .596
 (is possible to create mosaics which do not use the nadir re)108 96 R
@@ -1796,14 +1791,14 @@ cale label for the plot. Here is the command:)108 612 Q
 H .337(ant the colors for the bath).7 F .337(ymetry to)-.05 F 1.341
 (be chosen without histogram equalization, b)108 720 R 1.341
 (ut we also w)-.2 F 1.342
-(ant histogram equalization to be applied to the)-.1 F(MB-System 5.3)72
-768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(18)199.835 E 0 Cg EP
+(ant histogram equalization to be applied to the)-.1 F(MB-System 5.5)72
+768 Q(26 January 2015)137.61 E(18)190.95 E 0 Cg EP
 %%Page: 19 19
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F .293(sidescan data used for shading. T)108 84 R
+(5.5 mbsystem\(1\))2.5 F .293(sidescan data used for shading. T)108 84 R
 2.793(od)-.8 G 2.793(ot)-2.793 G .293(his, we use \255S0/1, where the \
 \214rst number \(0\) speci\214es no histogram)-2.793 F 1.417(equalizati\
 on of the color scale and the second number \(1\) causes histogram equa\
@@ -1894,14 +1889,14 @@ F .831(els with pix)-.15 F .831(el sizes that v)-.15 F .831
 -.25 E F0 3.016(.T)C(he)-3.016 E(ra)108 700.8 Q 2.525(wf)-.15 G .025
 (ormat has no space to store the rebinned sidescan, so an)-2.525 F 2.525
 (yc)-.15 G .025(orrections or other processing applied to the)-2.525 F
-(sidescan in formats 58 is lost.)108 712.8 Q(MB-System 5.3)72 768 Q 2.5
-(7J)146.495 G(une 2013)-2.5 E(19)199.835 E 0 Cg EP
+(sidescan in formats 58 is lost.)108 712.8 Q(MB-System 5.5)72 768 Q
+(26 January 2015)137.61 E(19)190.95 E 0 Cg EP
 %%Page: 20 20
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 2.722 -.8(We h)108 84 T -2.25 -.2(av e).8 H
+(5.5 mbsystem\(1\))2.5 F 2.722 -.8(We h)108 84 T -2.25 -.2(av e).8 H
 1.122(de\214ned a processing format \(59\) for K)3.822 F(ongsber)-.35 E
 3.621(gm)-.18 G 1.121(ultibeam that stores beam \215ags and rebinned)
 -3.621 F .737(sidescan in addition to all of the information in the ra)
@@ -2003,14 +1998,14 @@ ation that is important to processing. In).4 F(particular)108 688.8 Q
 (imrad formats do not store beam \215ags, so the only to apply bath)
 -2.975 F .474(ymetry edits is to null)-.05 F .526(the \215agged beams. \
 This is not recommended, as it precludes un\215agging \215agged beams l\
-ater determined to)108 700.8 R(be good.)108 712.8 Q(MB-System 5.3)72 768
-Q 2.5(7J)146.495 G(une 2013)-2.5 E(20)199.835 E 0 Cg EP
+ater determined to)108 700.8 R(be good.)108 712.8 Q(MB-System 5.5)72 768
+Q(26 January 2015)137.61 E(20)190.95 E 0 Cg EP
 %%Page: 21 21
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F 1.99(Also, the ra)108 84 R 4.49(wS)-.15 G 1.99
+(5.5 mbsystem\(1\))2.5 F 1.99(Also, the ra)108 84 R 4.49(wS)-.15 G 1.99
 (imrad formats store the initial sidescan samples deri)-4.49 F -.15(ve)
 -.25 G 4.49(df).15 G 1.99(rom subsampling the bottom)-4.49 F .764(retur\
 ns in each of the formed beams. The locations of these samples on the s\
@@ -2113,14 +2108,14 @@ ations with a correct SVP).1 E(.)-1.11 E .324
 E(backangle)-.1 E F0 .825(with the)3.325 F F1<ad41>3.325 E/F3 10
 /Times-Italic at 0 SF(1)A F0 .825(option to)3.325 F
 (operate on the amplitude data:)108 712.8 Q
-(mbbackangle \255I sb199411211212.mb41 \\)144 724.8 Q(MB-System 5.3)72
-768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(21)199.835 E 0 Cg EP
+(mbbackangle \255I sb199411211212.mb41 \\)144 724.8 Q(MB-System 5.5)72
+768 Q(26 January 2015)137.61 E(21)190.95 E 0 Cg EP
 %%Page: 22 22
 %%BeginPageSetup
 BP
 %%EndPageSetup
 /F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.3 mbsystem\(1\))2.5 F(-A1 \255P25 \255N161/80 \255V)180 84 Q
+(5.5 mbsystem\(1\))2.5 F(-A1 \255P25 \255N161/80 \255V)180 84 Q
 (and then run)108 96 Q/F1 10/Times-Bold at 0 SF(mbpr)2.5 E(ocess)-.18 E F0
 (as usual.)2.5 E/F2 10.95/Times-Bold at 0 SF(PR)72 124.8 Q(OCESSING HYDR)
 -.329 E(OSWEEP MD D)-.329 E -1.644 -1.04(AT A)-.383 H F0 .383(Processin\
@@ -2163,8 +2158,8 @@ E(backangle)-.1 E F0 .825(with the)3.325 F F1<ad41>3.325 E/F3 10
 G .224(rything we w).15 F .224(ant it to yet, it doesn')-.1 F 2.725(tw)
 -.18 G .225(ork with e)-2.825 F -.15(ve)-.25 G .225(ry kind of sw).15 F
 .225(ath data e)-.1 F -.15(ve)-.25 G 2.725(rc).15 G .225(ollected, and)
--2.725 F(sometimes it breaks.)108 422.4 Q(MB-System 5.3)72 768 Q 2.5(7J)
-146.495 G(une 2013)-2.5 E(22)199.835 E 0 Cg EP
+-2.725 F(sometimes it breaks.)108 422.4 Q(MB-System 5.5)72 768 Q
+(26 January 2015)137.61 E(22)190.95 E 0 Cg EP
 %%Trailer
 end
 %%EOF
diff --git a/src/ps/mbtime.ps b/src/ps/mbtime.ps
index c981c03..c9dfb34 100644
--- a/src/ps/mbtime.ps
+++ b/src/ps/mbtime.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/ps/mbvelocitytool.ps b/src/ps/mbvelocitytool.ps
index a661694..d266510 100644
--- a/src/ps/mbvelocitytool.ps
+++ b/src/ps/mbvelocitytool.ps
@@ -1,6 +1,6 @@
 %!PS-Adobe-3.0
 %%Creator: groff version 1.19.2
-%%CreationDate: Thu Dec 11 13:21:20 2014
+%%CreationDate: Wed Jul  1 12:29:31 2015
 %%DocumentNeededResources: font Times-Roman
 %%+ font Times-Bold
 %%+ font Times-Italic
diff --git a/src/share/Makefile.in b/src/share/Makefile.in
index 50bbfa2..a05cbb6 100644
--- a/src/share/Makefile.in
+++ b/src/share/Makefile.in
@@ -170,8 +170,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -188,6 +186,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -251,19 +250,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -276,8 +282,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/share/Makefile.template b/src/share/Makefile.template
deleted file mode 100644
index 485f99a..0000000
--- a/src/share/Makefile.template
+++ /dev/null
@@ -1,39 +0,0 @@
-#     The MB-system:	Makefile.template  5/21/2013
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2013-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the share directory level
-# Author:	D. W. Caress
-# Date:		May 21, 2013
-#
-# $Log: Makefile.template,v $
-#
-#
-
-### sets locations of vital objects
-DATADIR = ../../share/mbsystem
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all copies the html files to the share/mbsystem file directory
-all: $(DATADIR)
-	cp *.dat $(DATADIR)
-	chmod 664 $(DATADIR)/*.dat
-$(DATADIR):
-	mkdir $(DATADIR)
-
-### make clean removes the object files
-clean:
-	rm -r -f $(DATADIR)
diff --git a/src/surf/Makefile.in b/src/surf/Makefile.in
index 3e4293a..b867af6 100644
--- a/src/surf/Makefile.in
+++ b/src/surf/Makefile.in
@@ -225,8 +225,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -243,6 +241,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -306,19 +305,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -331,8 +337,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
diff --git a/src/surf/Makefile.template b/src/surf/Makefile.template
deleted file mode 100644
index a0c9715..0000000
--- a/src/surf/Makefile.template
+++ /dev/null
@@ -1,110 +0,0 @@
-#     The MB-system:	Makefile.template  6/1/2002
-#	$Id: Makefile.template 2175 2014-03-18 23:03:39Z caress $
-#
-#     Copyright (c) 2002-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/surf directory level
-# Author:	D. W. Caress
-# Date:		June 1, 2002
-#
-# $Log: Makefile.template,v $
-# Revision 5.3  2009/03/13 07:05:58  caress
-# Release 5.1.2beta02
-#
-# Revision 5.2  2003/07/27 20:50:25  caress
-# Release 5.0.0
-#
-# Revision 5.1  2002/07/20 20:56:37  caress
-# Release 5.0.beta20
-#
-# Revision 5.0  2002/06/02 01:35:51  caress
-# Initial revision.
-#
-#
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-# 
-# Compilers 
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -g -DIRIX
-ARCHIVE = ar rcv
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the sapi library, man page, and associated include files
-all:	$(LIBDIR)/libsapi.a \
-	$(INCDIR)/mb_sapi.h
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### put together the library
-$(LIBDIR)/libsapi.a:	mem_surf.o pb_math.o sapi_build.o \
-		sapi_data.o sapi_files.o sapi_globals.o \
-		sapi_simple.o util_surf.o xdr_surf.o
-	$(ARCHIVE) $(LIBDIR)/libsapi.a \
-		mem_surf.o pb_math.o sapi_build.o \
-		sapi_data.o sapi_files.o sapi_globals.o \
-		sapi_simple.o util_surf.o xdr_surf.o
-	ranlib $(LIBDIR)/libsapi.a
-
-
-### compile the source files
-mem_surf.o:      mem_surf.c \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) mem_surf.c
-pb_math.o:      pb_math.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) pb_math.c
-sapi_build.o:      sapi_build.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) sapi_build.c
-sapi_data.o:      sapi_data.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) sapi_data.c
-sapi_files.o:      sapi_files.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) sapi_files.c
-sapi_globals.o:      sapi_globals.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) sapi_globals.c
-sapi_simple.o:      sapi_simple.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) sapi_simple.c
-util_surf.o:      util_surf.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) util_surf.c
-xdr_surf.o:      xdr_surf.c  \
-		mem_surf.h mb_sapi.h xdr_surf.h \
-		pb_math.h surf.h util_surf.h
-	$(CC) -c $(CFLAGS) xdr_surf.c
-
-### copy the include files to the include file directory
-$(INCDIR)/mb_sapi.h:	mb_sapi.h
-	cp mb_sapi.h $(INCDIR)/mb_sapi.h
-	chmod 664 $(INCDIR)/mb_sapi.h
diff --git a/src/utilities/Makefile.am b/src/utilities/Makefile.am
index 18913e0..ec642a3 100644
--- a/src/utilities/Makefile.am
+++ b/src/utilities/Makefile.am
@@ -2,67 +2,65 @@ if BUILD_FFTW
  FFTW_PROG = mbsegypsd
 endif
 
-bin_PROGRAMS = mbhsdump \
-        mbformat \
-        mbdefaults \
-        mbdatalist \
-        mbinfo \
-        mbset \
-        mbprocess \
-        mbcopy \
-        mblist \
-        mbnavlist \
-        mbsvplist \
+bin_PROGRAMS = mb7k2jstar \
+        mb7k2ss \
+        mb7kpreprocess \
+        mbabsorption \
+        mbareaclean \
+        mbauvloglist \
+        mbauvnavusbl \
         mbbackangle \
         mbclean \
-        mbareaclean \
-        mbhistogram \
-        mbgrid \
-        mbmosaic \
-        mblevitus \
+        mbcopy \
+        mbctdlist \
+        mbdatalist \
+        mbdefaults \
+        mbdumpesf \
         mbextractsegy \
-        mbsegylist \
-        mbsegyinfo \
-        mbsegygrid \
-        mbauvnavusbl \
+        mbfilter \
+        mbformat \
         mbgetesf \
+        mbgrid \
+        mbhistogram \
+        mbhsdump \
+        mbhysweeppreprocess \
+        mbinfo \
+        mbinsreprocess \
+        mbkongsbergpreprocess \
+        mblevitus \
+        mblist \
+        mbmosaic \
+        mbnavlist \
         mbneptune2esf \
-        mbps \
-        mbstripnan \
+        mbpreprocess \
+        mbprocess \
         mbrollbias \
-        mbrphsbias \
-        mb7k2jstar \
-        mb7kpreprocess \
         mbrolltimelag \
-        mbauvloglist \
-        mb7k2ss \
-	mbsslayout \
-        mbabsorption \
-        mbdumpesf \
-        mbtime \
-        mbctdlist \
-        mbfilter \
         mbroutetime \
-        mbhysweeppreprocess \
-        mbkongsbergpreprocess \
+        mbrphsbias \
+        mbsegygrid \
+        mbsegyinfo \
+        mbsegylist \
+        mbset \
+        mbsslayout \
+        mbstripnan \
+        mbsvplist \
+        mbsvpselect \
         mbswplspreprocess \
-        mbpreprocess \
-	mbsvpselect \
-	mbinsreprocess \
+        mbtime \
         $(FFTW_PROG)
 
+
 include_HEADERS = levitus.h
 
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
 
 AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
 	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
 	      ${libgmt_CPPFLAGS} \
 	      ${libnetcdf_CPPFLAGS} \
 	      ${libfftw_CPPFLAGS}
-if BUILD_GSF
-  AM_CPPFLAGS += -I${top_srcdir}/src/gsf
-endif
 
 AM_LDFLAGS =
 
@@ -70,129 +68,73 @@ LIBS =  ${top_builddir}/src/mbio/libmbio.la \
        	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
         $(LIBM)
 
-mbhsdump_SOURCES = mbhsdump.c
-
-mbformat_SOURCES = mbformat.c
-
-mbdefaults_SOURCES = mbdefaults.c
-
-mbdatalist_SOURCES = mbdatalist.c
-
-mbinfo_SOURCES = mbinfo.c
-
-mbset_SOURCES = mbset.c
-
-mbprocess_SOURCES = mbprocess.c
-if BUILD_GSF
-  mbprocess_LDADD = ${top_builddir}/src/gsf/libmbgsf.la ${top_builddir}/src/mbaux/libmbaux.la
-else
-  mbprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-endif
-
-mbcopy_SOURCES = mbcopy.c
-if BUILD_GSF
-  mbcopy_LDADD = ${top_builddir}/src/gsf/libmbgsf.la
-endif
-
-mblist_SOURCES = mblist.c
-
-mbnavlist_SOURCES = mbnavlist.c
-
-mbsvplist_SOURCES = mbsvplist.c
-
-mbbackangle_SOURCES = mbbackangle.c
-mbbackangle_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbclean_SOURCES = mbclean.c
-
-mbareaclean_SOURCES = mbareaclean.c
-
-mbhistogram_SOURCES = mbhistogram.c
-
-mbgrid_SOURCES = mbgrid.c
-mbgrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbmosaic_SOURCES = mbmosaic.c
-mbmosaic_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mblevitus_SOURCES = mblevitus.c
-
-mbrphsbias_SOURCES = mbrphsbias.c
-
-mbrollbias_SOURCES = mbrollbias.c
-
-mbextractsegy_SOURCES = mbextractsegy.c
-
-mbsegylist_SOURCES = mbsegylist.c
-
-mbsegyinfo_SOURCES = mbsegyinfo.c
-
-mbsegygrid_SOURCES = mbsegygrid.c
-mbsegygrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbauvnavusbl_SOURCES = mbauvnavusbl.c
-mbauvnavusbl_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbgetesf_SOURCES = mbgetesf.c
-
-mbneptune2esf_SOURCES = mbneptune2esf.c
-
-mbps_SOURCES = mbps.c
-mbps_LDADD = ${top_builddir}/src/mbaux/libmbps.la ${libgmt_LIBS} -lpsl -lgmtps
-
-mbstripnan_SOURCES = mbstripnan.c
-
 mb7k2jstar_SOURCES = mb7k2jstar.c
-
-mb7kpreprocess_SOURCES = mb7kpreprocess.c
-mb7kpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbrolltimelag_SOURCES = mbrolltimelag.c
-
-mbauvloglist_SOURCES = mbauvloglist.c
-mbauvloglist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mb7k2ss_SOURCES = mb7k2ss.c
 mb7k2ss_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbsslayout_SOURCES = mbsslayout.c
-mbsslayout_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
+mb7k2ss_SOURCES = mb7k2ss.c
+mb7kpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mb7kpreprocess_SOURCES = mb7kpreprocess.c
 mbabsorption_SOURCES = mbabsorption.c
-
-mbdumpesf_SOURCES = mbdumpesf.c
-
-mbtime_SOURCES = mbtime.c
-
-mbctdlist_SOURCES = mbctdlist.c
+mbareaclean_SOURCES = mbareaclean.c
+mbauvloglist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbauvloglist_SOURCES = mbauvloglist.c
+mbauvnavusbl_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbauvnavusbl_SOURCES = mbauvnavusbl.c
+mbbackangle_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbbackangle_SOURCES = mbbackangle.c
+mbclean_SOURCES = mbclean.c
+mbcopy_LDADD = ${top_builddir}/src/gsf/libmbgsf.la
+mbcopy_SOURCES = mbcopy.c
 mbctdlist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
+mbctdlist_SOURCES = mbctdlist.c
+mbdatalist_SOURCES = mbdatalist.c
+mbdefaults_SOURCES = mbdefaults.c
+mbdumpesf_SOURCES = mbdumpesf.c
+mbextractsegy_SOURCES = mbextractsegy.c
 mbfilter_SOURCES = mbfilter.c
-
-mbroutetime_SOURCES = mbroutetime.c
-
-mbhysweeppreprocess_SOURCES = mbhysweeppreprocess.c
+mbformat_SOURCES = mbformat.c
+mbgetesf_SOURCES = mbgetesf.c
+mbgrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbgrid_SOURCES = mbgrid.c
+mbhistogram_SOURCES = mbhistogram.c
+mbhsdump_SOURCES = mbhsdump.c
 mbhysweeppreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbkongsbergpreprocess_SOURCES = mbkongsbergpreprocess.c
+mbhysweeppreprocess_SOURCES = mbhysweeppreprocess.c
+mbinfo_SOURCES = mbinfo.c
+mbinsreprocess_SOURCES = mbinsreprocess.c
 mbkongsbergpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbswplspreprocess_SOURCES = mbswplspreprocess.c
-mbswplspreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
-mbpreprocess_SOURCES = mbpreprocess.c
+mbkongsbergpreprocess_SOURCES = mbkongsbergpreprocess.c
+mblevitus_SOURCES = mblevitus.c
+mblist_SOURCES = mblist.c
+mbmosaic_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbmosaic_SOURCES = mbmosaic.c
+mbnavlist_SOURCES = mbnavlist.c
+mbneptune2esf_SOURCES = mbneptune2esf.c
 mbpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-
+mbpreprocess_SOURCES = mbpreprocess.c
+mbprocess_LDADD = ${top_builddir}/src/gsf/libmbgsf.la ${top_builddir}/src/mbaux/libmbaux.la
+mbprocess_SOURCES = mbprocess.c
+mbrollbias_SOURCES = mbrollbias.c
+mbrolltimelag_SOURCES = mbrolltimelag.c
+mbroutetime_SOURCES = mbroutetime.c
+mbrphsbias_SOURCES = mbrphsbias.c
+mbsegygrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbsegygrid_SOURCES = mbsegygrid.c
+mbsegyinfo_SOURCES = mbsegyinfo.c
+mbsegylist_SOURCES = mbsegylist.c
+mbset_SOURCES = mbset.c
+mbsslayout_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbsslayout_SOURCES = mbsslayout.c
+mbstripnan_SOURCES = mbstripnan.c
+mbsvplist_SOURCES = mbsvplist.c
 mbsvpselect_SOURCES = mbsvpselect.c geodesic.c
-
-mbinsreprocess_SOURCES = mbinsreprocess.c
-
+mbswplspreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbswplspreprocess_SOURCES = mbswplspreprocess.c
+mbtime_SOURCES = mbtime.c
 if BUILD_FFTW
-mbsegypsd_SOURCES = mbsegypsd.c
-mbsegypsd_LDFLAGS =
-
 mbsegypsd_LDADD = ${top_builddir}/src/mbaux/libmbaux.la \
                   ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${libfftw_LIBS}
+mbsegypsd_SOURCES = mbsegypsd.c
+mbsegypsd_LDFLAGS =
 endif
 
 BUILT_SOURCES = levitus.h
diff --git a/src/utilities/Makefile.in b/src/utilities/Makefile.in
index 78eed4a..8021d5e 100644
--- a/src/utilities/Makefile.in
+++ b/src/utilities/Makefile.in
@@ -79,24 +79,24 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-bin_PROGRAMS = mbhsdump$(EXEEXT) mbformat$(EXEEXT) mbdefaults$(EXEEXT) \
-	mbdatalist$(EXEEXT) mbinfo$(EXEEXT) mbset$(EXEEXT) \
-	mbprocess$(EXEEXT) mbcopy$(EXEEXT) mblist$(EXEEXT) \
-	mbnavlist$(EXEEXT) mbsvplist$(EXEEXT) mbbackangle$(EXEEXT) \
-	mbclean$(EXEEXT) mbareaclean$(EXEEXT) mbhistogram$(EXEEXT) \
-	mbgrid$(EXEEXT) mbmosaic$(EXEEXT) mblevitus$(EXEEXT) \
-	mbextractsegy$(EXEEXT) mbsegylist$(EXEEXT) mbsegyinfo$(EXEEXT) \
-	mbsegygrid$(EXEEXT) mbauvnavusbl$(EXEEXT) mbgetesf$(EXEEXT) \
-	mbneptune2esf$(EXEEXT) mbps$(EXEEXT) mbstripnan$(EXEEXT) \
-	mbrollbias$(EXEEXT) mbrphsbias$(EXEEXT) mb7k2jstar$(EXEEXT) \
-	mb7kpreprocess$(EXEEXT) mbrolltimelag$(EXEEXT) \
-	mbauvloglist$(EXEEXT) mb7k2ss$(EXEEXT) mbsslayout$(EXEEXT) \
-	mbabsorption$(EXEEXT) mbdumpesf$(EXEEXT) mbtime$(EXEEXT) \
-	mbctdlist$(EXEEXT) mbfilter$(EXEEXT) mbroutetime$(EXEEXT) \
-	mbhysweeppreprocess$(EXEEXT) mbkongsbergpreprocess$(EXEEXT) \
-	mbswplspreprocess$(EXEEXT) mbpreprocess$(EXEEXT) \
-	mbsvpselect$(EXEEXT) mbinsreprocess$(EXEEXT) $(am__EXEEXT_1)
- at BUILD_GSF_TRUE@am__append_1 = -I${top_srcdir}/src/gsf
+bin_PROGRAMS = mb7k2jstar$(EXEEXT) mb7k2ss$(EXEEXT) \
+	mb7kpreprocess$(EXEEXT) mbabsorption$(EXEEXT) \
+	mbareaclean$(EXEEXT) mbauvloglist$(EXEEXT) \
+	mbauvnavusbl$(EXEEXT) mbbackangle$(EXEEXT) mbclean$(EXEEXT) \
+	mbcopy$(EXEEXT) mbctdlist$(EXEEXT) mbdatalist$(EXEEXT) \
+	mbdefaults$(EXEEXT) mbdumpesf$(EXEEXT) mbextractsegy$(EXEEXT) \
+	mbfilter$(EXEEXT) mbformat$(EXEEXT) mbgetesf$(EXEEXT) \
+	mbgrid$(EXEEXT) mbhistogram$(EXEEXT) mbhsdump$(EXEEXT) \
+	mbhysweeppreprocess$(EXEEXT) mbinfo$(EXEEXT) \
+	mbinsreprocess$(EXEEXT) mbkongsbergpreprocess$(EXEEXT) \
+	mblevitus$(EXEEXT) mblist$(EXEEXT) mbmosaic$(EXEEXT) \
+	mbnavlist$(EXEEXT) mbneptune2esf$(EXEEXT) \
+	mbpreprocess$(EXEEXT) mbprocess$(EXEEXT) mbrollbias$(EXEEXT) \
+	mbrolltimelag$(EXEEXT) mbroutetime$(EXEEXT) \
+	mbrphsbias$(EXEEXT) mbsegygrid$(EXEEXT) mbsegyinfo$(EXEEXT) \
+	mbsegylist$(EXEEXT) mbset$(EXEEXT) mbsslayout$(EXEEXT) \
+	mbstripnan$(EXEEXT) mbsvplist$(EXEEXT) mbsvpselect$(EXEEXT) \
+	mbswplspreprocess$(EXEEXT) mbtime$(EXEEXT) $(am__EXEEXT_1)
 subdir = src/utilities
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp $(include_HEADERS)
@@ -147,8 +147,7 @@ mbclean_OBJECTS = $(am_mbclean_OBJECTS)
 mbclean_LDADD = $(LDADD)
 am_mbcopy_OBJECTS = mbcopy.$(OBJEXT)
 mbcopy_OBJECTS = $(am_mbcopy_OBJECTS)
- at BUILD_GSF_TRUE@mbcopy_DEPENDENCIES =  \
- at BUILD_GSF_TRUE@	${top_builddir}/src/gsf/libmbgsf.la
+mbcopy_DEPENDENCIES = ${top_builddir}/src/gsf/libmbgsf.la
 am_mbctdlist_OBJECTS = mbctdlist.$(OBJEXT)
 mbctdlist_OBJECTS = $(am_mbctdlist_OBJECTS)
 mbctdlist_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
@@ -216,16 +215,8 @@ mbpreprocess_OBJECTS = $(am_mbpreprocess_OBJECTS)
 mbpreprocess_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
 am_mbprocess_OBJECTS = mbprocess.$(OBJEXT)
 mbprocess_OBJECTS = $(am_mbprocess_OBJECTS)
- at BUILD_GSF_FALSE@mbprocess_DEPENDENCIES =  \
- at BUILD_GSF_FALSE@	${top_builddir}/src/mbaux/libmbaux.la
- at BUILD_GSF_TRUE@mbprocess_DEPENDENCIES =  \
- at BUILD_GSF_TRUE@	${top_builddir}/src/gsf/libmbgsf.la \
- at BUILD_GSF_TRUE@	${top_builddir}/src/mbaux/libmbaux.la
-am_mbps_OBJECTS = mbps.$(OBJEXT)
-mbps_OBJECTS = $(am_mbps_OBJECTS)
-am__DEPENDENCIES_1 =
-mbps_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbps.la \
-	$(am__DEPENDENCIES_1)
+mbprocess_DEPENDENCIES = ${top_builddir}/src/gsf/libmbgsf.la \
+	${top_builddir}/src/mbaux/libmbaux.la
 am_mbrollbias_OBJECTS = mbrollbias.$(OBJEXT)
 mbrollbias_OBJECTS = $(am_mbrollbias_OBJECTS)
 mbrollbias_LDADD = $(LDADD)
@@ -250,6 +241,7 @@ mbsegylist_LDADD = $(LDADD)
 am__mbsegypsd_SOURCES_DIST = mbsegypsd.c
 @BUILD_FFTW_TRUE at am_mbsegypsd_OBJECTS = mbsegypsd.$(OBJEXT)
 mbsegypsd_OBJECTS = $(am_mbsegypsd_OBJECTS)
+am__DEPENDENCIES_1 =
 @BUILD_FFTW_TRUE at mbsegypsd_DEPENDENCIES =  \
 @BUILD_FFTW_TRUE@	${top_builddir}/src/mbaux/libmbaux.la \
 @BUILD_FFTW_TRUE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
@@ -326,7 +318,7 @@ SOURCES = $(mb7k2jstar_SOURCES) $(mb7k2ss_SOURCES) \
 	$(mbinsreprocess_SOURCES) $(mbkongsbergpreprocess_SOURCES) \
 	$(mblevitus_SOURCES) $(mblist_SOURCES) $(mbmosaic_SOURCES) \
 	$(mbnavlist_SOURCES) $(mbneptune2esf_SOURCES) \
-	$(mbpreprocess_SOURCES) $(mbprocess_SOURCES) $(mbps_SOURCES) \
+	$(mbpreprocess_SOURCES) $(mbprocess_SOURCES) \
 	$(mbrollbias_SOURCES) $(mbrolltimelag_SOURCES) \
 	$(mbroutetime_SOURCES) $(mbrphsbias_SOURCES) \
 	$(mbsegygrid_SOURCES) $(mbsegyinfo_SOURCES) \
@@ -347,7 +339,7 @@ DIST_SOURCES = $(mb7k2jstar_SOURCES) $(mb7k2ss_SOURCES) \
 	$(mbinsreprocess_SOURCES) $(mbkongsbergpreprocess_SOURCES) \
 	$(mblevitus_SOURCES) $(mblist_SOURCES) $(mbmosaic_SOURCES) \
 	$(mbnavlist_SOURCES) $(mbneptune2esf_SOURCES) \
-	$(mbpreprocess_SOURCES) $(mbprocess_SOURCES) $(mbps_SOURCES) \
+	$(mbpreprocess_SOURCES) $(mbprocess_SOURCES) \
 	$(mbrollbias_SOURCES) $(mbrolltimelag_SOURCES) \
 	$(mbroutetime_SOURCES) $(mbrphsbias_SOURCES) \
 	$(mbsegygrid_SOURCES) $(mbsegyinfo_SOURCES) \
@@ -436,8 +428,6 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
-GL_CPPFLAGS = @GL_CPPFLAGS@
-GL_LIBS = @GL_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -457,6 +447,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -520,19 +511,26 @@ htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
+libGLU_CFLAGS = @libGLU_CFLAGS@
+libGLU_LIBS = @libGLU_LIBS@
+libXm_CFLAGS = @libXm_CFLAGS@
+libXm_LIBS = @libXm_LIBS@
 libdir = @libdir@
 libexecdir = @libexecdir@
-libfftw_CFLAGS = @libfftw_CFLAGS@
+libfftw3_CFLAGS = @libfftw3_CFLAGS@
+libfftw3_LIBS = @libfftw3_LIBS@
 libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
 libfftw_LIBS = @libfftw_LIBS@
 libgmt_CFLAGS = @libgmt_CFLAGS@
 libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
 libgmt_LIBS = @libgmt_LIBS@
-libgmtps_CFLAGS = @libgmtps_CFLAGS@
-libgmtps_LIBS = @libgmtps_LIBS@
+libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
+libmotif_LIBS = @libmotif_LIBS@
 libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
 libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
 libnetcdf_LIBS = @libnetcdf_LIBS@
+libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
+libopengl_LIBS = @libopengl_LIBS@
 libproj_CFLAGS = @libproj_CFLAGS@
 libproj_CPPFLAGS = @libproj_CPPFLAGS@
 libproj_LIBS = @libproj_LIBS@
@@ -545,8 +543,6 @@ mbsystemdatadir = @mbsystemdatadir@
 mbsystemhtmldir = @mbsystemhtmldir@
 mbsystempsdir = @mbsystempsdir@
 mkdir_p = @mkdir_p@
-motif_CPPFLAGS = @motif_CPPFLAGS@
-motif_LIBS = @motif_LIBS@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -563,80 +559,81 @@ top_srcdir = @top_srcdir@
 @BUILD_FFTW_TRUE at FFTW_PROG = mbsegypsd
 include_HEADERS = levitus.h
 AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -I${top_srcdir}/src/mbaux \
-	${libgmt_CPPFLAGS} ${libnetcdf_CPPFLAGS} ${libfftw_CPPFLAGS} \
-	$(am__append_1)
+AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
+	      -I${top_srcdir}/src/mbaux \
+	      -I${top_srcdir}/src/gsf \
+	      ${libgmt_CPPFLAGS} \
+	      ${libnetcdf_CPPFLAGS} \
+	      ${libfftw_CPPFLAGS}
+
 AM_LDFLAGS = 
-mbhsdump_SOURCES = mbhsdump.c
-mbformat_SOURCES = mbformat.c
-mbdefaults_SOURCES = mbdefaults.c
-mbdatalist_SOURCES = mbdatalist.c
-mbinfo_SOURCES = mbinfo.c
-mbset_SOURCES = mbset.c
-mbprocess_SOURCES = mbprocess.c
- at BUILD_GSF_FALSE@mbprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
- at BUILD_GSF_TRUE@mbprocess_LDADD = ${top_builddir}/src/gsf/libmbgsf.la ${top_builddir}/src/mbaux/libmbaux.la
-mbcopy_SOURCES = mbcopy.c
- at BUILD_GSF_TRUE@mbcopy_LDADD = ${top_builddir}/src/gsf/libmbgsf.la
-mblist_SOURCES = mblist.c
-mbnavlist_SOURCES = mbnavlist.c
-mbsvplist_SOURCES = mbsvplist.c
-mbbackangle_SOURCES = mbbackangle.c
-mbbackangle_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbclean_SOURCES = mbclean.c
-mbareaclean_SOURCES = mbareaclean.c
-mbhistogram_SOURCES = mbhistogram.c
-mbgrid_SOURCES = mbgrid.c
-mbgrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbmosaic_SOURCES = mbmosaic.c
-mbmosaic_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mblevitus_SOURCES = mblevitus.c
-mbrphsbias_SOURCES = mbrphsbias.c
-mbrollbias_SOURCES = mbrollbias.c
-mbextractsegy_SOURCES = mbextractsegy.c
-mbsegylist_SOURCES = mbsegylist.c
-mbsegyinfo_SOURCES = mbsegyinfo.c
-mbsegygrid_SOURCES = mbsegygrid.c
-mbsegygrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbauvnavusbl_SOURCES = mbauvnavusbl.c
-mbauvnavusbl_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbgetesf_SOURCES = mbgetesf.c
-mbneptune2esf_SOURCES = mbneptune2esf.c
-mbps_SOURCES = mbps.c
-mbps_LDADD = ${top_builddir}/src/mbaux/libmbps.la ${libgmt_LIBS} -lpsl -lgmtps
-mbstripnan_SOURCES = mbstripnan.c
 mb7k2jstar_SOURCES = mb7k2jstar.c
-mb7kpreprocess_SOURCES = mb7kpreprocess.c
-mb7kpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbrolltimelag_SOURCES = mbrolltimelag.c
-mbauvloglist_SOURCES = mbauvloglist.c
-mbauvloglist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mb7k2ss_SOURCES = mb7k2ss.c
 mb7k2ss_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbsslayout_SOURCES = mbsslayout.c
-mbsslayout_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mb7k2ss_SOURCES = mb7k2ss.c
+mb7kpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mb7kpreprocess_SOURCES = mb7kpreprocess.c
 mbabsorption_SOURCES = mbabsorption.c
-mbdumpesf_SOURCES = mbdumpesf.c
-mbtime_SOURCES = mbtime.c
-mbctdlist_SOURCES = mbctdlist.c
+mbareaclean_SOURCES = mbareaclean.c
+mbauvloglist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbauvloglist_SOURCES = mbauvloglist.c
+mbauvnavusbl_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbauvnavusbl_SOURCES = mbauvnavusbl.c
+mbbackangle_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbbackangle_SOURCES = mbbackangle.c
+mbclean_SOURCES = mbclean.c
+mbcopy_LDADD = ${top_builddir}/src/gsf/libmbgsf.la
+mbcopy_SOURCES = mbcopy.c
 mbctdlist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbctdlist_SOURCES = mbctdlist.c
+mbdatalist_SOURCES = mbdatalist.c
+mbdefaults_SOURCES = mbdefaults.c
+mbdumpesf_SOURCES = mbdumpesf.c
+mbextractsegy_SOURCES = mbextractsegy.c
 mbfilter_SOURCES = mbfilter.c
-mbroutetime_SOURCES = mbroutetime.c
-mbhysweeppreprocess_SOURCES = mbhysweeppreprocess.c
+mbformat_SOURCES = mbformat.c
+mbgetesf_SOURCES = mbgetesf.c
+mbgrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbgrid_SOURCES = mbgrid.c
+mbhistogram_SOURCES = mbhistogram.c
+mbhsdump_SOURCES = mbhsdump.c
 mbhysweeppreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbkongsbergpreprocess_SOURCES = mbkongsbergpreprocess.c
+mbhysweeppreprocess_SOURCES = mbhysweeppreprocess.c
+mbinfo_SOURCES = mbinfo.c
+mbinsreprocess_SOURCES = mbinsreprocess.c
 mbkongsbergpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbswplspreprocess_SOURCES = mbswplspreprocess.c
-mbswplspreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbpreprocess_SOURCES = mbpreprocess.c
+mbkongsbergpreprocess_SOURCES = mbkongsbergpreprocess.c
+mblevitus_SOURCES = mblevitus.c
+mblist_SOURCES = mblist.c
+mbmosaic_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbmosaic_SOURCES = mbmosaic.c
+mbnavlist_SOURCES = mbnavlist.c
+mbneptune2esf_SOURCES = mbneptune2esf.c
 mbpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbpreprocess_SOURCES = mbpreprocess.c
+mbprocess_LDADD = ${top_builddir}/src/gsf/libmbgsf.la ${top_builddir}/src/mbaux/libmbaux.la
+mbprocess_SOURCES = mbprocess.c
+mbrollbias_SOURCES = mbrollbias.c
+mbrolltimelag_SOURCES = mbrolltimelag.c
+mbroutetime_SOURCES = mbroutetime.c
+mbrphsbias_SOURCES = mbrphsbias.c
+mbsegygrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbsegygrid_SOURCES = mbsegygrid.c
+mbsegyinfo_SOURCES = mbsegyinfo.c
+mbsegylist_SOURCES = mbsegylist.c
+mbset_SOURCES = mbset.c
+mbsslayout_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbsslayout_SOURCES = mbsslayout.c
+mbstripnan_SOURCES = mbstripnan.c
+mbsvplist_SOURCES = mbsvplist.c
 mbsvpselect_SOURCES = mbsvpselect.c geodesic.c
-mbinsreprocess_SOURCES = mbinsreprocess.c
- at BUILD_FFTW_TRUE@mbsegypsd_SOURCES = mbsegypsd.c
- at BUILD_FFTW_TRUE@mbsegypsd_LDFLAGS = 
+mbswplspreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
+mbswplspreprocess_SOURCES = mbswplspreprocess.c
+mbtime_SOURCES = mbtime.c
 @BUILD_FFTW_TRUE at mbsegypsd_LDADD = ${top_builddir}/src/mbaux/libmbaux.la \
 @BUILD_FFTW_TRUE@                  ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${libfftw_LIBS}
 
+ at BUILD_FFTW_TRUE@mbsegypsd_SOURCES = mbsegypsd.c
+ at BUILD_FFTW_TRUE@mbsegypsd_LDFLAGS = 
 BUILT_SOURCES = levitus.h
 CLEANFILES = levitus.h
 DISTCLEANFILES = levitus.h
@@ -853,10 +850,6 @@ mbprocess$(EXEEXT): $(mbprocess_OBJECTS) $(mbprocess_DEPENDENCIES) $(EXTRA_mbpro
 	@rm -f mbprocess$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(mbprocess_OBJECTS) $(mbprocess_LDADD) $(LIBS)
 
-mbps$(EXEEXT): $(mbps_OBJECTS) $(mbps_DEPENDENCIES) $(EXTRA_mbps_DEPENDENCIES) 
-	@rm -f mbps$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbps_OBJECTS) $(mbps_LDADD) $(LIBS)
-
 mbrollbias$(EXEEXT): $(mbrollbias_OBJECTS) $(mbrollbias_DEPENDENCIES) $(EXTRA_mbrollbias_DEPENDENCIES) 
 	@rm -f mbrollbias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(mbrollbias_OBJECTS) $(mbrollbias_LDADD) $(LIBS)
@@ -956,7 +949,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbneptune2esf.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbpreprocess.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbps.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbrollbias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbrolltimelag.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbroutetime.Po at am__quote@
diff --git a/src/utilities/Makefile.template b/src/utilities/Makefile.template
deleted file mode 100644
index 41a5d68..0000000
--- a/src/utilities/Makefile.template
+++ /dev/null
@@ -1,364 +0,0 @@
-#     The MB-system:	Makefile.template  5/23/94
-#	$Id: Makefile.template 2198 2014-07-20 05:16:48Z caress $
-#
-#     Copyright (c) 1993-2014 by
-#     David W. Caress (caress at mbari.org)
-#       Monterey Bay Aquarium Research Institute
-#       Moss Landing, CA 95039
-#     and Dale N. Chayes (dale at ldeo.columbia.edu)
-#       Lamont-Doherty Earth Observatory
-#       Palisades, NY  10964
-#
-#     See README file for copying and redistribution conditions.
-#
-# Makefile template for MB-system at the src/utilities directory level
-# Author:	D. W. Caress
-# Date:		May 23, 1994
-#
-# $Log: Makefile.template,v $
-#
-
-### sets locations of vital objects
-BINDIR = ../../bin
-LIBDIR = ../../lib
-INCDIR = ../../include
-
-# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
-#
-# Locations of GMT libraries, binaries, and include files:
-GMTLIBDIR = /usr/local/mbsystem/lib
-GMTINCDIR = /usr/local/gmt/src
-NETCDFINCDIR = /usr/local/netcdf/include
-#
-# Locations of FFTW libraries, binaries, and include files:
-FFTWLIBDIR = /usr/local/fftw/lib
-FFTWINCDIR = /usr/local/fftw/include
-#
-# Location of Levitus annual database file
-LEVITUS = /usr/local/mbsystem/share/mbsystem/Levitus82.dat
-#
-# Compilers
-CC = cc
-#
-# Compile and load flags:
-CFLAGS = -O2
-LFLAGS = -lm
-BIGFLAG = -Olimit 2000
-
-### set gsflib - could be version supplied with MB-System or other installation
-GSFLIB  = $(LIBDIR)/libmbgsf.a
-GSFINCDIR  = $(INCDIR)
-
-### set projlib - could be version supplied with MB-System or other installation
-PROJLIB  = $(LIBDIR)/libproj.a
-#
-# *** LEAVE EVERYTHING ELSE BELOW ALONE ***
-
-### make all makes the MB-system utilites and man pages
-all:	$(BINDIR)/mb7k2jstar \
-	$(BINDIR)/mb7k2ss \
-	$(BINDIR)/mb7kpreprocess \
-	$(BINDIR)/mbabsorption \
-	$(BINDIR)/mbareaclean \
-	$(BINDIR)/mbauvloglist \
-	$(BINDIR)/mbauvnavusbl \
-	$(BINDIR)/mbbackangle \
-	$(BINDIR)/mbclean \
-	$(BINDIR)/mbcopy \
-	$(BINDIR)/mbctdlist \
-	$(BINDIR)/mbdatalist \
-	$(BINDIR)/mbdefaults \
-	$(BINDIR)/mbdumpesf \
-	$(BINDIR)/mbextractsegy \
-	$(BINDIR)/mbfilter \
-	$(BINDIR)/mbformat \
-	$(BINDIR)/mbgetesf \
-	$(BINDIR)/mbgrid \
-	$(BINDIR)/mbhistogram \
-	$(BINDIR)/mbhsdump \
-	$(BINDIR)/mbhysweeppreprocess \
-	$(BINDIR)/mbinfo \
-	$(BINDIR)/mbinsreprocess \
-	$(BINDIR)/mbkongsbergpreprocess \
-	$(BINDIR)/mblevitus \
-	$(BINDIR)/mblist \
-	$(BINDIR)/mbmosaic \
-	$(BINDIR)/mbnavlist \
-	$(BINDIR)/mbneptune2esf \
-	$(BINDIR)/mbprocess \
-	$(BINDIR)/mbps \
-	$(BINDIR)/mbrollbias \
-	$(BINDIR)/mbrolltimelag \
-	$(BINDIR)/mbroutetime \
-	$(BINDIR)/mbrphsbias \
-	$(BINDIR)/mbsegygrid \
-	$(BINDIR)/mbsegyinfo \
-	$(BINDIR)/mbsegylist \
-	$(BINDIR)/mbsegypsd \
-	$(BINDIR)/mbset \
-	$(BINDIR)/mbsslayout \
-	$(BINDIR)/mbstripnan \
-	$(BINDIR)/mbsvplist \
-	$(BINDIR)/mbtime \
-	$(BINDIR)/mbswplspreprocess \
-	$(BINDIR)/mbpreprocess \
-	$(BINDIR)/mbsvpselect
-
-### make clean removes the object files
-clean:
-	rm -f *.o
-
-### link the executables
-$(BINDIR)/mbhsdump:	mbhsdump.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbhsdump.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbhsdump
-$(BINDIR)/mbformat:	mbformat.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbformat.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbformat
-$(BINDIR)/mbdefaults:	mbdefaults.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbdefaults.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbdefaults
-$(BINDIR)/mbdatalist:	mbdatalist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbdatalist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbdatalist
-$(BINDIR)/mbinfo:	mbinfo.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbinfo.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbinfo
-$(BINDIR)/mbcopy:	mbcopy.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbcopy.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbcopy
-$(BINDIR)/mblist:	mblist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mblist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mblist
-$(BINDIR)/mbclean:	mbclean.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbclean.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbclean
-$(BINDIR)/mbareaclean:	mbareaclean.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbareaclean.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbareaclean
-$(BINDIR)/mbgrid:	mbgrid.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbgrid.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a \
-		$(LFLAGS) -o $(BINDIR)/mbgrid
-$(BINDIR)/mbmosaic:	mbmosaic.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbmosaic.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a \
-		$(LFLAGS) -o $(BINDIR)/mbmosaic
-$(BINDIR)/mblevitus:	mblevitus.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mblevitus.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mblevitus
-$(BINDIR)/mbrollbias:	mbrollbias.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbrollbias.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbrollbias
-$(BINDIR)/mbrphsbias:	mbrphsbias.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbrphsbias.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbrphsbias
-$(BINDIR)/mbgetesf:	mbgetesf.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbgetesf.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbgetesf
-$(BINDIR)/mbneptune2esf:	mbneptune2esf.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbneptune2esf.o $(LIBDIR)/libmbio.a $(LFLAGS) $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a $(LFLAGS) \
-		-o $(BINDIR)/mbneptune2esf
-$(BINDIR)/mbps:	mbps.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbps.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a $(GMTLIBDIR)/libgmtps.a \
-		$(LFLAGS) -o $(BINDIR)/mbps
-$(BINDIR)/mbstripnan:	mbstripnan.o
-	$(CC) $(CFLAGS) mbstripnan.o $(LFLAGS) -o $(BINDIR)/mbstripnan
-$(BINDIR)/mbhistogram:	mbhistogram.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbhistogram.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbhistogram
-$(BINDIR)/mbbackangle:	mbbackangle.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbbackangle.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a \
-		$(LFLAGS) -o $(BINDIR)/mbbackangle
-$(BINDIR)/mbnavlist:	mbnavlist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbnavlist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbnavlist
-$(BINDIR)/mbsvplist:	mbsvplist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbsvplist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbsvplist
-$(BINDIR)/mbset:	mbset.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbset.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbset
-$(BINDIR)/mbsslayout:	mbsslayout.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbsslayout.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a \
-		$(LFLAGS) -o $(BINDIR)/mbsslayout
-$(BINDIR)/mbprocess:	mbprocess.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbprocess.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a \
-		$(LFLAGS) -o $(BINDIR)/mbprocess
-$(BINDIR)/mbextractsegy:	mbextractsegy.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbextractsegy.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbextractsegy
-$(BINDIR)/mbsegylist:	mbsegylist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbsegylist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbsegylist
-$(BINDIR)/mbsegyinfo:	mbsegyinfo.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbsegyinfo.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbsegyinfo
-$(BINDIR)/mbsegygrid:	mbsegygrid.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbsegygrid.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a \
-		$(LFLAGS) -o $(BINDIR)/mbsegygrid
-$(BINDIR)/mbauvnavusbl:	mbauvnavusbl.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbauvnavusbl.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mbauvnavusbl
-$(BINDIR)/mb7k2jstar:	mb7k2jstar.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mb7k2jstar.o $(LIBDIR)/libmbio.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a $(LIBDIR)/libmbaux.a \
-		$(LFLAGS) -o $(BINDIR)/mb7k2jstar
-$(BINDIR)/mb7kpreprocess:	mb7kpreprocess.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mb7kpreprocess.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mb7kpreprocess
-$(BINDIR)/mbrolltimelag:	mbrolltimelag.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbrolltimelag.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbrolltimelag
-$(BINDIR)/mbauvloglist:	mbauvloglist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbauvloglist.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbauvloglist
-$(BINDIR)/mb7k2ss:	mb7k2ss.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mb7k2ss.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(GMTLIBDIR)/libgmt.a \
-		$(LFLAGS) -o $(BINDIR)/mb7k2ss
-$(BINDIR)/mbabsorption:	mbabsorption.o $(LIBDIR)/libmbio.a
-	$(CC) $(CFLAGS) mbabsorption.o $(LIBDIR)/libmbio.a \
-		$(LFLAGS) -o $(BINDIR)/mbabsorption
-$(BINDIR)/mbdumpesf:	mbdumpesf.o $(LIBDIR)/libmbio.a
-	$(CC) $(CFLAGS) mbdumpesf.o $(LIBDIR)/libmbio.a \
-		$(LFLAGS) -o $(BINDIR)/mbdumpesf
-$(BINDIR)/mbtime:	mbtime.o $(LIBDIR)/libmbio.a
-	$(CC) $(CFLAGS) mbtime.o $(LIBDIR)/libmbio.a \
-		$(LFLAGS) -o $(BINDIR)/mbtime
-$(BINDIR)/mbctdlist:	mbctdlist.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbctdlist.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbctdlist
-$(BINDIR)/mbfilter:	mbfilter.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbfilter.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbfilter
-$(BINDIR)/mbroutetime:	mbroutetime.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbroutetime.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbroutetime
-$(BINDIR)/mbsegypsd:	mbsegypsd.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a
-	$(CC) $(CFLAGS) mbsegypsd.o $(LIBDIR)/libmbio.a $(PROJLIB) $(LIBDIR)/libmbaux.a \
-		$(GMTLIBDIR)/libgmt.a $(GMTLIBDIR)/libpsl.a $(FFTWLIBDIR)/libfftw3.a \
-		$(LFLAGS) -o $(BINDIR)/mbsegypsd
-$(BINDIR)/mbhysweeppreprocess:	mbhysweeppreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbhysweeppreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbhysweeppreprocess
-$(BINDIR)/mbkongsbergpreprocess:	mbkongsbergpreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbkongsbergpreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbkongsbergpreprocess
-$(BINDIR)/mbswplspreprocess:	mbswplspreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbswplspreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbswplspreprocess
-$(BINDIR)/mbpreprocess:	mbpreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbpreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbpreprocess
-$(BINDIR)/mbsvpselect:	mbsvpselect.o geodesic.o
-	$(CC) $(CFLAGS) mbsvpselect.o geodesic.o \
-		$(LFLAGS) -o $(BINDIR)/mbsvpselect
-$(BINDIR)/mbinsreprocess:	mbinsreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a
-	$(CC) $(CFLAGS) mbinsreprocess.o $(LIBDIR)/libmbio.a $(LIBDIR)/libmbaux.a $(PROJLIB) $(GSFLIB) $(LIBDIR)/libmbbsio.a $(LIBDIR)/libsapi.a \
-		$(LFLAGS) -o $(BINDIR)/mbinsreprocess
-
-### compile the source files
-mbhsdump.o:	mbhsdump.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbhsdump.c
-mbformat.o:	mbformat.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbformat.c
-mbdefaults.o:	mbdefaults.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbdefaults.c
-mbdatalist.o:	mbdatalist.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbdatalist.c
-mbinfo.o:	mbinfo.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbinfo.c
-mbcopy.o:	mbcopy.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GSFINCDIR) mbcopy.c
-mblist.o:	mblist.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mbsys_simrad2.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) mblist.c
-mbclean.o:	mbclean.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbclean.c
-mbareaclean.o:	mbareaclean.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbareaclean.c
-mbgrid.o:	mbgrid.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux $(BIGFLAG) -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbgrid.c
-mbmosaic.o:	mbmosaic.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux $(BIGFLAG) -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbmosaic.c
-mblevitus.o:	mblevitus.c ../mbio/mb_status.h ../mbio/mb_define.h Makefile
-	echo "	char *ifile = "'"$(LEVITUS)"'";" > levitus.h
-	$(CC) -c $(CFLAGS) -I../mbio mblevitus.c
-mbrphsbias.o:	mbrphsbias.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbrphsbias.c
-mbrollbias.o:	mbrollbias.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbrollbias.c
-mbgetesf.o:	mbgetesf.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbgetesf.c
-mbneptune2esf.o:	mbneptune2esf.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbneptune2esf.c
-mbps.o:	mbps.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbps.c
-mbstripnan.o:	mbstripnan.c
-	$(CC) -c $(CFLAGS) -I../mbio mbstripnan.c
-mbhistogram.o:	mbhistogram.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) mbhistogram.c
-mbbackangle.o:	mbbackangle.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbbackangle.c
-mbnavlist.o:	mbnavlist.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbnavlist.c
-mbsvplist.o:	mbsvplist.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbsvplist.c
-mbset.o:	mbset.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbset.c
-mbsslayout.o:	mbsslayout.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbsslayout.c
-mbprocess.o:	mbprocess.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux -I$(GSFINCDIR) -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbprocess.c
-mbextractsegy.o:	mbextractsegy.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mb_segy.h
-	$(CC) -c $(CFLAGS) -I../mbio mbextractsegy.c
-mbsegylist.o:	mbsegylist.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mb_segy.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) mbsegylist.c
-mbsegyinfo.o:	mbsegyinfo.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mb_segy.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) mbsegyinfo.c
-mbsegygrid.o:	mbsegygrid.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mb_segy.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) -I$(NETCDFINCDIR) mbsegygrid.c
-mbauvnavusbl.o:	mbauvnavusbl.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbauvnavusbl.c
-mb7k2jstar.o:	mb7k2jstar.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mbsys_reson7k.h ../mbio/mbsys_jstar.h
-	$(CC) -c $(CFLAGS) -I../mbio mb7k2jstar.c
-mb7kpreprocess.o:	mb7kpreprocess.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mbsys_reson7k.h ../mbio/mbsys_jstar.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mb7kpreprocess.c
-mbrolltimelag.o:	mbrolltimelag.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbrolltimelag.c
-mbauvloglist.o:	mbauvloglist.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbaux/mb_aux.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbauvloglist.c
-mb7k2ss.o:	mb7k2ss.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mbsys_reson7k.h ../mbio/mbsys_ldeoih.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux -I$(GMTINCDIR) -I$(NETCDFINCDIR) mb7k2ss.c
-mbabsorption.o:	mbabsorption.c ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbabsorption.c
-mbdumpesf.o:	mbdumpesf.c ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbdumpesf.c
-mbtime.o:	mbtime.c ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbtime.c
-mbctdlist.o:	mbctdlist.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbctdlist.c
-mbfilter.o:	mbfilter.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbfilter.c
-mbroutetime.o:	mbroutetime.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbroutetime.c
-mbsegypsd.o:	mbsegypsd.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h ../mbio/mb_segy.h
-	$(CC) -c $(CFLAGS) -I../mbio -I$(GMTINCDIR) -I$(NETCDFINCDIR) -I$(FFTWINCDIR) mbsegypsd.c
-mbhysweeppreprocess.o:	mbhysweeppreprocess.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbhysweeppreprocess.c
-mbkongsbergpreprocess.o:	mbkongsbergpreprocess.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbkongsbergpreprocess.c
-mbswplspreprocess.o:	mbswplspreprocess.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbswplspreprocess.c
-mbpreprocess.o:	mbpreprocess.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbpreprocess.c
-mbsvpselect.o:	mbsvpselect.c ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio mbsvpselect.c
-geodesic.o:	geodesic.c geodesic.h
-	$(CC) -c $(CFLAGS) geodesic.c
-mbinsreprocess.o:	mbinsreprocess.c ../mbio/mb_format.h ../mbio/mb_status.h ../mbio/mb_define.h
-	$(CC) -c $(CFLAGS) -I../mbio -I../mbaux mbinsreprocess.c
diff --git a/src/utilities/mb7k2jstar.c b/src/utilities/mb7k2jstar.c
index 284efb0..e5efa19 100644
--- a/src/utilities/mb7k2jstar.c
+++ b/src/utilities/mb7k2jstar.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb7k2jstar.c	5/19/2005
- *    $Id: mb7k2jstar.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mb7k2jstar.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2005-2014 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -90,7 +90,7 @@
 #define MBES_ONLINE_THRESHOLD		15.0
 #define MBES_ONLINE_COUNT		30
 
-static char rcs_id[] = "$Id: mb7k2jstar.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mb7k2jstar.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mb7k2ss.c b/src/utilities/mb7k2ss.c
index 55aa19b..e4126e9 100644
--- a/src/utilities/mb7k2ss.c
+++ b/src/utilities/mb7k2ss.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb7k2ss.c		8/15/2007
- *    $Id: mb7k2ss.c 2196 2014-07-14 05:52:06Z caress $
+ *    $Id: mb7k2ss.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2007-2014 by
+ *    Copyright (c) 2007-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -21,26 +21,6 @@
  * Date:	August 15, 2007
  *              R/V Atlantis, Axial Seamount
  *
- * $Log: mb7k2ss.c,v $
- * Revision 5.4  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.3  2008/09/27 03:27:11  caress
- * Working towards release 5.1.1beta24
- *
- * Revision 5.2  2008/09/11 20:20:14  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.1  2008/05/16 22:44:37  caress
- * Release 5.1.1beta18
- *
- * Revision 5.0  2007/10/08 17:04:13  caress
- * Update version number.
- *
- * Revision 1.1  2007/10/08 16:51:01  caress
- * Initial version of a program to extract Edgetech sidescan from MBARI Mapping AUV data into format 71.
- *
- *
  *
  */
 
@@ -96,7 +76,7 @@ int mb7k2ss_get_flatbottom_table(int verbose, int nangle, double angle_min, doub
 					double *table_altitude, double *table_range,
 					int *error);
 
-static char rcs_id[] = "$Id: mb7k2ss.c 2196 2014-07-14 05:52:06Z caress $";
+static char rcs_id[] = "$Id: mb7k2ss.c 2227 2015-02-05 21:12:31Z caress $";
 char program_name[] = "mb7k2ss";
 
 /*--------------------------------------------------------------------*/
diff --git a/src/utilities/mb7kpreprocess.c b/src/utilities/mb7kpreprocess.c
index 3c452ed..f518ac2 100644
--- a/src/utilities/mb7kpreprocess.c
+++ b/src/utilities/mb7kpreprocess.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb7kpreprocess.c	10/12/2005
- *    $Id: mb7kpreprocess.c 2219 2014-12-11 21:22:25Z caress $
+ *    $Id: mb7kpreprocess.c 2250 2015-06-30 02:12:26Z caress $
  *
- *    Copyright (c) 2005-2014 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -60,7 +60,7 @@
 #define	MB7KPREPROCESS_KLUGE_ZEROATTITUDECORRECTION	3
 #define	MB7KPREPROCESS_KLUGE_KEARFOTTROVNOISE		4
 #define	MB7KPREPROCESS_KLUGE_BEAMPATTERNTWEAK		5
-static char rcs_id[] = "$Id: mb7kpreprocess.c 2219 2014-12-11 21:22:25Z caress $";
+static char rcs_id[] = "$Id: mb7kpreprocess.c 2250 2015-06-30 02:12:26Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -107,6 +107,16 @@ int main (int argc, char **argv)
 	int	obeams_bath;
 	int	obeams_amp;
 	int	opixels_ss;
+	
+	/* platform definition file */
+	char	platform_file[MB_PATH_MAXLINE];
+	int	use_platform_file = MB_NO;
+	struct mb_platform_struct *platform = NULL;
+	struct mb_sensor_struct *sensor_swathbathymetry = NULL;
+	struct mb_sensor_struct *sensor_rollpitch = NULL;
+	struct mb_sensor_struct *sensor_heading = NULL;
+	struct mb_sensor_struct *sensor_position = NULL;
+	struct mb_sensor_struct *sensor_depth = NULL;
 
 	/* MBIO read values */
 	void	*imbio_ptr = NULL;
@@ -121,10 +131,10 @@ int main (int argc, char **argv)
 	double	navlon;
 	double	navlat;
 	double	speed;
-	double	heading;
 	double	distance;
 	double	altitude;
 	double	sonardepth;
+	double	heading, beamheading, beamheadingr;
 	double	roll, rollr, beamroll, beamrollr;
 	double	pitch, pitchr, beampitch, beampitchr;
 	double	heave, beamheave;
@@ -186,6 +196,7 @@ int main (int argc, char **argv)
 	s7kr_processedsidescan	*processedsidescan;
 	s7kr_image		*image;
 	s7kr_fileheader		*fileheader;
+	s7kr_installation	*installation;
 	s7kr_remotecontrolsettings	*remotecontrolsettings;
 
 	/* counting variables */
@@ -230,7 +241,7 @@ int main (int argc, char **argv)
 	int	nrec_v2detection = 0;
 	int	nrec_v2rawdetection = 0;
 	int	nrec_v2snippet = 0;
-	int nrec_calibratedsnippet = 0;
+	int 	nrec_calibratedsnippet = 0;
 	int	nrec_processedsidescan = 0;
 	int	nrec_installation = 0;
 	int	nrec_systemeventmessage = 0;
@@ -358,7 +369,6 @@ int main (int argc, char **argv)
 	int	ndat_sonardepth_alloc = 0;
 	double	*dat_sonardepth_time_d = NULL;
 	double	*dat_sonardepth_sonardepth = NULL;
-	double	*dat_sonardepth_sonardepthrate = NULL;
 	double	*dat_sonardepth_sonardepthfilter = NULL;
 
 	int	ndat_heading = 0;
@@ -434,6 +444,7 @@ int main (int argc, char **argv)
 	double	sonardepthoffset = 0.0;
 
 	/* depth sensor lever arm parameter */
+	int	use_depthsensoroff = MB_NO;
 	double	depthsensoroffx = 0.0;
 	double	depthsensoroffy = 0.0;
 	double	depthsensoroffz = 0.0;
@@ -461,17 +472,9 @@ int main (int argc, char **argv)
 	double	navigation_offset_heading = 0.0;
 	double	navigation_offset_roll = 0.0;
 	double	navigation_offset_pitch = 0.0;
-
-	/* depth sensor time lag parameters */
-	int	sonardepthlagfix = MB_NO;
-	double	sonardepthlagmax = 3.0 /* sec */;
-	double	sonardepthratemax = 0.64; /* m/sec */
-	double	sonardepthlag = 0.0;
-	double	sonardepthrate;
-
-	/* roll and pitch bias parameters */
-	double	rollbias = 0.0;
-	double	pitchbias = 0.0;
+	double	position_offset_x = 0.0;
+	double	position_offset_y = 0.0;
+	double	position_offset_z = 0.0;
 
 	/* multibeam sidescan parameters */
 	int	ss_source = R7KRECID_None;
@@ -498,6 +501,19 @@ int main (int argc, char **argv)
 
 	/* MBARI data flag */
 	int	MBARIdata = MB_NO;
+	
+	/* variables for beam angle calculation */
+	mb_3D_orientation tx_align;
+	mb_3D_orientation tx_orientation;
+	double tx_steer;
+	mb_3D_orientation rx_align;
+	mb_3D_orientation rx_orientation;
+	double rx_steer;
+	double reference_heading;
+	double beamAzimuth;
+	double beamDepression;
+	double rollbias = 0.0;
+	double pitchbias = 0.0;
 
 	int	jtimedelay = 0;
 	int	jtimelag = 0;
@@ -579,7 +595,7 @@ int main (int argc, char **argv)
 	strcpy (read_file, "datalist.mb-1");
 
 	/* process argument list */
-	while ((c = getopt(argc, argv, "AaB:b:C:c:D:d:F:f:I:i:K:k:LlM:m:N:n:O:o:P:p:R:r:S:s:T:t:W:w:Z:z:VvHh")) != -1)
+	while ((c = getopt(argc, argv, "AaB:b:C:c:D:d:F:f:G:g:I:i:K:k:LlM:m:N:n:O:o:P:p:R:r:S:s:T:t:W:w:Z:z:VvHh")) != -1)
 	  switch (c)
 		{
 		case 'H':
@@ -601,7 +617,9 @@ int main (int argc, char **argv)
 			break;
 		case 'C':
 		case 'c':
-			sscanf (optarg,"%lf/%lf", &rollbias,&pitchbias);
+			nscan = sscanf (optarg,"%lf/%lf", &sonar_offset_roll,&sonar_offset_pitch);
+			if (nscan == 2)
+				sonar_offset_mode = MB_YES;
 			break;
 		case 'D':
 		case 'd':
@@ -630,6 +648,8 @@ int main (int argc, char **argv)
 					depthsensoroffx = 0.0;
 					}
 				}
+			if (nscan > 0)
+				use_depthsensoroff = MB_YES;
 			flag++;
 			break;
 		case 'F':
@@ -637,6 +657,12 @@ int main (int argc, char **argv)
 			sscanf (optarg,"%d", &format);
 			flag++;
 			break;
+		case 'G':
+		case 'g':
+			sscanf (optarg,"%s", platform_file);
+			use_platform_file = MB_YES;
+			flag++;
+			break;
 		case 'I':
 		case 'i':
 			sscanf (optarg,"%s", read_file);
@@ -711,18 +737,6 @@ int main (int argc, char **argv)
 				else
 					sonardepthfilter = MB_NO;
 				}
-			else
-				{
-				nscan = sscanf (optarg,"%lf/%lf", &sonardepthlagmax, &sonardepthratemax);
-				if (nscan > 0)
-					sonardepthlagfix = MB_YES;
-				if (nscan == 1)
-					{
-					sonardepthratemax = 0.0;
-					sonardepthlag = sonardepthlagmax;
-					}
-				}
-
 			flag++;
 			break;
 		case 'R':
@@ -867,6 +881,8 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
 		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
 		fprintf(stderr,"dbg2       read_file:           %s\n",read_file);
+		fprintf(stderr,"dbg2       use_platform_file:   %d\n",use_platform_file);
+		fprintf(stderr,"dbg2       platform_file:       %s\n",platform_file);
 		fprintf(stderr,"dbg2       ofile:               %s\n",ofile);
 		fprintf(stderr,"dbg2       ofile_set:           %d\n",ofile_set);
 		fprintf(stderr,"dbg2       ss_source:           %d\n",ss_source);
@@ -894,7 +910,7 @@ int main (int argc, char **argv)
 			}
 		else
 			{
-			fprintf(stderr,"dbg2       timelag:             %f\n",timelag);
+			fprintf(stderr,"dbg2       timelagconstant:     %f\n",timelagconstant);
 			}
 		fprintf(stderr,"dbg2       timelag:                %f\n",timelag);
 		fprintf(stderr,"dbg2       sonardepthfilter:       %d\n",sonardepthfilter);
@@ -902,9 +918,6 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       sonardepthfilterdepth:  %f\n",sonardepthfilterdepth);
 		fprintf(stderr,"dbg2       sonardepthfile:         %s\n",sonardepthfile);
 		fprintf(stderr,"dbg2       sonardepthdata:         %d\n",sonardepthdata);
-		fprintf(stderr,"dbg2       sonardepthlagfix:       %d\n",sonardepthlagfix);
-		fprintf(stderr,"dbg2       sonardepthlagmax:       %f\n",sonardepthlagmax);
-		fprintf(stderr,"dbg2       sonardepthratemax:      %f\n",sonardepthratemax);
 		fprintf(stderr,"dbg2       sonardepthoffset:       %f\n",sonardepthoffset);
 		fprintf(stderr,"dbg2       depthsensoroffx:        %f\n",depthsensoroffx);
 		fprintf(stderr,"dbg2       depthsensoroffy:        %f\n",depthsensoroffy);
@@ -930,8 +943,6 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       navigation_offset_heading:  %f\n",navigation_offset_heading);
 		fprintf(stderr,"dbg2       navigation_offset_roll:     %f\n",navigation_offset_roll);
 		fprintf(stderr,"dbg2       navigation_offset_pitch:    %f\n",navigation_offset_pitch);
-		fprintf(stderr,"dbg2       rollbias:               %f\n",rollbias);
-		fprintf(stderr,"dbg2       pitchbias:              %f\n",pitchbias);
 		for (i=0;i<nrangeoffset;i++)
 			fprintf(stderr,"dbg2       rangeoffset[%d]:         %d %d %f\n",
 				i,rangeoffsetstart[i], rangeoffsetend[i], rangeoffset[i]);
@@ -1311,9 +1322,9 @@ rock_heading[nrock]);*/
 			    		&year, &month, &day, &hour, &minute, &second,
 					sensor, &dsl_lat[ndsl], &dsl_lon[ndsl], &dsl_sonardepth[ndsl],
 					&dsl_heading[ndsl], &dsl_pitch[ndsl], &dsl_roll[ndsl], &id);
-/*fprintf(stderr,"nscan:%d year:%d month:%d day:%d hour:%d minute:%d second:%f sensor:%s %f %f %f %f %f %f %f\n",
+/* fprintf(stderr,"nscan:%d year:%d month:%d day:%d hour:%d minute:%d second:%f sensor:%s %f %f %f %f %f %f %f\n",
 nscan,year,month,day,hour,minute,second,sensor,dsl_lat[ndsl], dsl_lon[ndsl], dsl_sonardepth[ndsl],
-dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id);*/
+dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id); */
 			    if (nscan == 14)
 			    	{
 				time_i[0] = year;
@@ -1324,7 +1335,7 @@ dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id);*/
 				time_i[5] = (int)second;
 				time_i[6] = (int)((second - time_i[5]) * 1000000);
 				mb_get_time(verbose, time_i, &dsl_time_d[ndsl]);
-/*fprintf(stderr,"dsl DATA: %f %f %f %f %f %f\n",
+/* fprintf(stderr,"dsl DATA: %f %f %f %f %f %f %f %f\n",
 dsl_time_d[ndsl],
 dsl_lon[ndsl],
 dsl_lat[ndsl],
@@ -1332,7 +1343,7 @@ dsl_sonardepth[ndsl],
 dsl_heading[ndsl],
 dsl_roll[ndsl],
 dsl_pitch[ndsl],
-dsl_heading[ndsl]);*/
+dsl_heading[ndsl]); */
 			    	ndsl++;
 				}
 			    }
@@ -1528,6 +1539,146 @@ sonardepth_sonardepth[nsonardepth]);*/
 	/* null tfp - allows detection of whether time delay file was opened, which only happens for MBARI AUV
 		data with navigation and attitude in "bluefin" records */
 	tfp = NULL;
+	
+	/* load platform definition if specified or if offsets otherwise specified create a platform structure */
+	if (use_platform_file == MB_YES)
+		{
+		status = mb_platform_read(verbose, platform_file, (void **)&platform, &error);
+		if (status == MB_FAILURE)
+			{
+			error = MB_ERROR_OPEN_FAIL;
+			fprintf(stderr,"\nUnable to open and parse platform file: %s\n", platform_file);
+			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+			exit(error);				
+			}
+		}
+	else if (use_depthsensoroff == MB_YES || sonar_offset_mode == MB_YES)
+		{
+		status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
+						0, 1, 2, 3, 3, 3, 
+						(void **)&platform, &error);
+			
+		/* set sensor 0 (multibeam) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_SONAR_MULTIBEAM,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, 0,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					0, 0,
+					MB7KPREPROCESS_TIMELAG_OFF,
+					0.0,
+					0,
+					NULL,
+					NULL,
+					sonar_offset_mode,
+					sonar_offset_x,
+					sonar_offset_y,
+					sonar_offset_z,   
+					sonar_offset_mode,
+					sonar_offset_heading,
+					sonar_offset_roll,
+					sonar_offset_pitch,
+					&error);
+			
+		/* set sensor 1 (position) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_POSITION,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, ntimelag,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					1, 0,
+					timelagmode,
+					timelagconstant,
+					ntimelag,
+					timelag_time_d,
+					timelag_model,
+					navigation_offset_mode,
+					navigation_offset_x,
+					navigation_offset_y,
+					navigation_offset_z,   
+					navigation_offset_mode,
+					navigation_offset_heading,
+					navigation_offset_roll,
+					navigation_offset_pitch,
+					&error);
+			
+		/* set sensor 2 (sensor depth) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_POSITION,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, ntimelag,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					2, 0,
+					timelagmode,
+					timelagconstant,
+					ntimelag,
+					timelag_time_d,
+					timelag_model,
+					use_depthsensoroff,
+					depthsensoroffx,
+					depthsensoroffy,
+					depthsensoroffz,   
+					0,
+					0.0,
+					0.0,
+					0.0,
+					&error);
+			
+		/* set sensor 3 (attitude) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_VRU,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, ntimelag,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					3, 0,
+					timelagmode,
+					timelagconstant,
+					ntimelag,
+					timelag_time_d,
+					timelag_model,
+					vru_offset_mode,
+					vru_offset_x,
+					vru_offset_y,
+					vru_offset_z,   
+					vru_offset_mode,
+					vru_offset_heading,
+					vru_offset_roll,
+					vru_offset_pitch,
+					&error);
+		
+		/* deal with error */
+		if (status == MB_FAILURE)
+			{
+			error = MB_ERROR_OPEN_FAIL;
+			fprintf(stderr,"\nUnable to initialize platform offset structure\n");
+			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+			exit(error);				
+			}
+		}
 
 	/* get format if required */
 	if (format == 0)
@@ -2364,7 +2515,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 				ndat_sonardepth_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthrate,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
 				if (error != MB_ERROR_NO_ERROR)
 					{
@@ -2381,7 +2531,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 				{
 				dat_sonardepth_time_d[ndat_sonardepth] = time_d;
 				dat_sonardepth_sonardepth[ndat_sonardepth] = depth->depth;
-				dat_sonardepth_sonardepthrate[ndat_sonardepth] = 0.0;
 				dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
 				ndat_sonardepth++;
 				}
@@ -2718,6 +2867,186 @@ sonardepth_sonardepth[nsonardepth]);*/
 				header->RecordNumber);
 			}
 
+	   	/* handle installation data */
+		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
+			{
+			nrec_installation++;
+
+			installation = &(istore->installation);
+			header = &(installation->header);
+			time_j[0] = header->s7kTime.Year;
+			time_j[1] = header->s7kTime.Day;
+			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
+			time_j[3] = (int) header->s7kTime.Seconds;
+			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
+			mb_get_itime(verbose, time_j, time_i);
+			mb_get_time(verbose, time_i, &time_d);
+			if (verbose > 0)
+				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
+				time_i[0],time_i[1],time_i[2],
+				time_i[3],time_i[4],time_i[5],time_i[6],
+				header->RecordNumber);
+
+			if (platform == NULL)
+				{
+				status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
+								0, 1, 1, 2, 2, 2, 
+								(void **)&platform, &error);
+					
+				/* set sensor 0 (multibeam) */
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor(verbose, (void **)&platform,
+							MB_SENSOR_TYPE_SONAR_MULTIBEAM,
+							NULL,
+							NULL,
+							NULL,
+							0, 0,
+							2, 0,
+							&error);
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+							0, 0,
+							MB7KPREPROCESS_TIMELAG_OFF,
+							0.0,
+							0,
+							NULL,
+							NULL,
+							MB_SENSOR_POSITION_OFFSET_STATIC,
+							(double) installation->transmit_x,
+							(double) installation->transmit_y,
+							(double) installation->transmit_z,   
+							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+							(double) installation->transmit_heading,
+							(double) installation->transmit_roll,
+							(double) installation->transmit_pitch,   
+							&error);
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+							0, 1,
+							MB7KPREPROCESS_TIMELAG_OFF,
+							0.0,
+							0,
+							NULL,
+							NULL,
+							MB_SENSOR_POSITION_OFFSET_STATIC,
+							(double) installation->receive_x,
+							(double) installation->receive_y,
+							(double) installation->receive_z,   
+							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+							(double) installation->receive_heading,
+							(double) installation->receive_roll,
+							(double) installation->receive_pitch,   
+							&error);
+					
+				/* set sensor 1 (position) */
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor(verbose, (void **)&platform,
+							MB_SENSOR_TYPE_POSITION,
+							NULL,
+							NULL,
+							NULL,
+							0, 0,
+							1, ntimelag,
+							&error);
+				if (status == MB_SUCCESS)
+					{
+					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
+						&& installation->position_time_delay != 0)
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								1, 0,
+								MB7KPREPROCESS_TIMELAG_CONSTANT,
+								(double)(0.001 * installation->position_time_delay),
+								0,
+								NULL,
+								NULL,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->position_x,
+								(double) installation->position_y,
+								(double) installation->position_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_NONE,
+								(double) 0.0,
+								(double) 0.0,
+								(double) 0.0,   
+								&error);
+					else
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								1, 0,
+								timelagmode,
+								timelagconstant,
+								ntimelag,
+								timelag_time_d,
+								timelag_model,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->position_x,
+								(double) installation->position_y,
+								(double) installation->position_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_NONE,
+								(double) 0.0,
+								(double) 0.0,
+								(double) 0.0,   
+								&error);
+					}
+					
+				/* set sensor 2 (motion sensor) */
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor(verbose, (void **)&platform,
+							MB_SENSOR_TYPE_VRU,
+							NULL,
+							NULL,
+							NULL,
+							0, 0,
+							1, ntimelag,
+							&error);
+				if (status == MB_SUCCESS)
+					{
+					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
+						&& installation->motion_time_delay != 0)
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								2, 0,
+								MB7KPREPROCESS_TIMELAG_CONSTANT,
+								(double)(0.001 * installation->motion_time_delay),
+								0,
+								NULL,
+								NULL,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->motion_x,
+								(double) installation->motion_y,
+								(double) installation->motion_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+								(double) installation->motion_heading,
+								(double) installation->motion_roll,
+								(double) installation->motion_pitch,   
+								&error);
+					else
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								2, 0,
+								timelagmode,
+								timelagconstant,
+								ntimelag,
+								timelag_time_d,
+								timelag_model,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->motion_x,
+								(double) installation->motion_y,
+								(double) installation->motion_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+								(double) installation->motion_heading,
+								(double) installation->motion_roll,
+								(double) installation->motion_pitch,   
+								&error);
+					}
+				
+				/* deal with error */
+				if (status == MB_FAILURE)
+					{
+					error = MB_ERROR_OPEN_FAIL;
+					fprintf(stderr,"\nUnable to initialize platform offset structure\n");
+					fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+					exit(error);				
+					}
+				}
+			}
+
 	   	/* handle bluefin ctd data */
 		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
 			{
@@ -2900,7 +3229,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 				ndat_sonardepth_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthrate,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
 				if (error != MB_ERROR_NO_ERROR)
 					{
@@ -2956,7 +3284,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 					{
 					dat_sonardepth_time_d[ndat_sonardepth] = bluefin->nav[i].depth_time;
 					dat_sonardepth_sonardepth[ndat_sonardepth] = bluefin->nav[i].depth;
-					dat_sonardepth_sonardepthrate[ndat_sonardepth] = 0.0;
 					dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
 					ndat_sonardepth++;
 					}
@@ -3281,7 +3608,10 @@ sonardepth_sonardepth[nsonardepth]);*/
 
 	/* close time delay file */
 	if (tfp != NULL)
+		{
 		fclose(tfp);
+		tfp = NULL;
+		}
 
 	/* apply time lag to all relevant data
 		timelag value calculated either from model imported from file (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
@@ -3758,31 +4088,6 @@ fprintf(stderr,"Applying filtering to %d Rock nav data\n", nrock);
 			}
 		}
 
-	/* calculate sonardepth change rate for variable lag correction - asynchronous data only */
-	if (sonardepthlagfix == MB_YES && ndat_sonardepth > 1)
-		{
-fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", ndat_sonardepth);
-		for (i=0;i<ndat_sonardepth;i++)
-			{
-			if (i == 0)
-				{
-				dat_sonardepth_sonardepthrate[i] = (dat_sonardepth_sonardepth[i+1] - dat_sonardepth_sonardepth[i])
-								/ (dat_sonardepth_time_d[i+1] - dat_sonardepth_time_d[i]);
-				}
-			else if (i == ndat_sonardepth - 1)
-				{
-				dat_sonardepth_sonardepthrate[i] = (dat_sonardepth_sonardepth[i] - dat_sonardepth_sonardepth[i-1])
-								/ (dat_sonardepth_time_d[i] - dat_sonardepth_time_d[i-1]);
-				}
-			else
-				{
-				dat_sonardepth_sonardepthrate[i] = (dat_sonardepth_sonardepth[i+1] - dat_sonardepth_sonardepth[i-1])
-								/ (dat_sonardepth_time_d[i+1] - dat_sonardepth_time_d[i-1]);
-				}
-			dat_sonardepth_sonardepthrate[i] = fabs(dat_sonardepth_sonardepthrate[i]);
-			}
-		}
-
 	/* fix problems with batht timestamp arrays */
 	for (i=0;i<nbatht;i++)
 		{
@@ -3946,8 +4251,8 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 		fprintf(stdout, "\nTotal sonardepth data read: %d\n", ndat_sonardepth);
 		for (i=0;i<ndat_sonardepth;i++)
 			{
-			fprintf(stdout, "  DEP: %5d %17.6f %8.3f %8.3f\n",
-				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i], dat_sonardepth_sonardepthrate[i]);
+			fprintf(stdout, "  DEP: %5d %17.6f %8.3f\n",
+				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i]);
 			}
 		fprintf(stdout, "\nTotal altitude data read: %d\n", ndat_altitude);
 		for (i=0;i<ndat_altitude;i++)
@@ -4600,21 +4905,21 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						{
 						for (i=0;i<bathymetry->number_beams;i++)
 							{
-/* fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]); */
+//fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]);
 							bathymetry->quality[i] = bathymetry->quality[i] & 15;
 
 							/* phase or amplitude picks */
 							if (bathymetry->quality[i] & 8)
 								{
-/* fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]); */
+//fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);
 								bathymetry->quality[i] += 32;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
+//fprintf(stderr," %d\n",bathymetry->quality[i]);
 								}
 							else if (bathymetry->quality[i] & 4)
 								{
-/* fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]); */
+//fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);
 								bathymetry->quality[i] += 16;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
+//fprintf(stderr," %d\n",bathymetry->quality[i]);
 								}
 
 							/* flagged by sonar */
@@ -4629,7 +4934,7 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 								{
 								bathymetry->quality[i] += 64;
 								}
-/* fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]); */
+//fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]);
 							}
 						}
 
@@ -4675,15 +4980,15 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 									rock_time_d-1, rock_lat-1,
 									nrock, time_d, &navlat, &jrock,
 									&error);
-						if (j > 1)
+						if (jrock > 1)
 							{
-							j1 = j - 2;
-							j2 = j - 1;
+							j1 = jrock - 2;
+							j2 = jrock - 1;
 							}
 						else
 							{
-							j1 = j - 1;
-							j2 = j;
+							j1 = jrock - 1;
+							j2 = jrock;
 							}
 						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
 						dx = (rock_lon[j2] - rock_lon[j1])/mtodeglon;
@@ -4704,15 +5009,15 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 									dsl_time_d-1, dsl_lat-1,
 									ndsl, time_d, &navlat, &jdsl,
 									&error);
-						if (j > 1)
+						if (jdsl > 1)
 							{
-							j1 = j - 2;
-							j2 = j - 1;
+							j1 = jdsl - 2;
+							j2 = jdsl - 1;
 							}
 						else
 							{
-							j1 = j - 1;
-							j2 = j;
+							j1 = jdsl - 1;
+							j2 = jdsl;
 							}
 						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
 						dx = (dsl_lon[j2] - dsl_lon[j1])/mtodeglon;
@@ -4917,94 +5222,31 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						}
 					else if (ndat_sonardepth > 0)
 						{
-						sonardepthlag = 0.0;
-						if (sonardepthlagfix == MB_YES && ndat_sonardepth > 1
-							&& sonardepthratemax > 0.0
-							&& interp_status == MB_SUCCESS)
-							{
-							interp_status = mb_linear_interp(verbose,
-									dat_sonardepth_time_d-1, dat_sonardepth_sonardepthrate-1,
-									ndat_sonardepth, time_d, &sonardepthrate, &jdsonardepth,
-									&error);
-							sonardepthlag = sonardepthrate * sonardepthlagmax / sonardepthratemax;
-							if (sonardepthrate >= sonardepthratemax)
-								sonardepthlag = sonardepthlagmax;
-							}
-						if (interp_status == MB_SUCCESS)
 						interp_status = mb_linear_interp(verbose,
 									dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-									ndat_sonardepth, time_d + sonardepthlag, &sonardepth, &jdsonardepth,
+									ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
 									&error);
 						}
 					else
 						{
 						sonardepth = 0.0;
 						}
+//fprintf(stderr,"\nStarting sonardepth:%f\n",sonardepth);
 
-					/* apply offset between depth sensor and sonar */
-					sonardepth += sonardepthoffset
-							+ depthsensoroffx * sin(DTR * roll)
-							+ depthsensoroffy * sin(DTR * pitch)
-							+ depthsensoroffz * cos(DTR * pitch);
-					
-					/* if sensor offsets have been defined, apply lever arm correction */
-					if (sonar_offset_mode == MB_YES
-						|| vru_offset_mode == MB_YES
-						|| navigation_offset_mode == MB_YES)
-						{
-						/* do lever arm calculation with sensor offsets */
-						mb_lever(verbose, sonar_offset_x, sonar_offset_y, sonar_offset_z,
-								vru_offset_x, vru_offset_y, vru_offset_z,
-								navigation_offset_x, navigation_offset_y, navigation_offset_z,
-								pitch, roll,
-								&lever_x, &lever_y, &lever_z, &error);
-//fprintf(stderr,"LEVER:  roll:%f pitch:%f   lever: %f %f %f\n", roll, pitch, lever_x, lever_y, lever_z);
-						
-						/* get local translation between lon lat degrees and meters */
-						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-						headingx = sin(DTR*heading);
-						headingy = cos(DTR*heading);	
-	
-						/* apply position offsets */
-						if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0)
-							{
-							navlon += headingy * sonar_offset_x * mtodeglon
-									+ headingx * sonar_offset_y * mtodeglon;
-							navlat+= -headingx * sonar_offset_x * mtodeglat
-									+ headingy * sonar_offset_y * mtodeglat;
-//fprintf(stderr,"HEADING: %f  %f %f POSITION OFFSET: meters: %f %f   lonlat: %f %f ",
-//heading, headingx, headingy,
-//sonar_offset_x, sonar_offset_y,
-//headingy * sonar_offset_x * mtodeglon + headingx * sonar_offset_y * mtodeglon,
-//-headingx * sonar_offset_x * mtodeglat + headingy * sonar_offset_y * mtodeglat);
-							}
-						if (sonar_offset_z != 0.0)
-							{
-							sonardepth -= sonar_offset_z;
-//fprintf(stderr,"SONARDEPTH OFFSET: %f ",-sonar_offset_z);
-							}
+					/* get local translation between lon lat degrees and meters */
+					mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
+					headingx = sin(DTR*heading);
+					headingy = cos(DTR*heading);	
 
-						/* apply lever arm calculation */
-						if (lever_x != 0.0 || lever_y != 0.0)
-							{
-							navlon += headingy * lever_x * mtodeglon
-									+ headingx * lever_y * mtodeglon;
-							navlat+= -headingx * lever_x * mtodeglat
-									+ headingy * lever_y * mtodeglat;
-//fprintf(stderr,"LEVER ARM XY OFFSET: meters: %f %f   lonlat: %f %f ",
-//lever_x, lever_y,
-//headingy * lever_x * mtodeglon + headingx * lever_y * mtodeglon,
-//-headingx * lever_x * mtodeglat + headingy * lever_y * mtodeglat);
-							}
-						if (lever_z != 0.0)
-							{
-							sonardepth -= lever_z;
-//fprintf(stderr,"LEVER ARM Z OFFSET: %f ",-lever_z);
-							}						
-//if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0 || sonar_offset_z != 0.0
-//|| lever_x != 0.0 || lever_y != 0.0 || lever_z != 0.0)
-//fprintf(stderr,"\n");
-						}
+					if (platform != NULL)
+						{
+						status = mb_platform_position(verbose, (void **)&platform,
+										platform->source_swathbathymetry, 0,
+										navlon, navlat, sonardepth,
+										heading, roll, pitch,
+										&navlon, &navlat, &sonardepth,
+										&error);
+						}			
 
 					/* if the optional data are not all available, this ping
 						is not useful, and is discarded by setting
@@ -5019,7 +5261,22 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 
 				/* if the optional data are available, then proceed */
 				if (status == MB_SUCCESS)
-					{
+					{		
+					/* initialize all of the beams */
+					for (i=0;i<bathymetry->number_beams;i++)
+						{
+						if (istore->read_v2rawdetection == MB_YES
+						    || (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES))
+							bathymetry->quality[i] = 0;
+						bathymetry->depth[i] = 0.0;
+						bathymetry->acrosstrack[i] = 0.0;
+						bathymetry->alongtrack[i] = 0.0;
+						bathymetry->pointing_angle[i] = 0.0;
+						bathymetry->azimuth_angle[i] = 0.0;
+						}
+//fprintf(stderr,"sonardepth:%f heave:%f\n",sonardepth,heave);
+
+					/* set ping values */
 					bathymetry->longitude = DTR * navlon;
 					bathymetry->latitude = DTR * navlat;
 					bathymetry->heading = DTR * heading;
@@ -5036,15 +5293,10 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						{								
 						bathymetry->vehicle_height = -sonardepth;
 						}
-
-					/* zero alongtrack angles if requested */
-					if (kluge_zeroalongtrackangles == MB_YES)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							beamgeometry->angle_alongtrack[i] = 0.0;
-							}
-						}
+//fprintf(stderr,"\nPing %d: %14.9f %13.9f %10.3f   %7.3f %7.3f %7.3f\n",
+//nrec_multibeam+nrec_multibeam_tot,
+//bathymetry->longitude, bathymetry->latitude, bathymetry->vehicle_height,
+//bathymetry->heading, bathymetry->roll, bathymetry->pitch);
 
 					/* get ready to calculate bathymetry */
 					if (volatilesettings->sound_velocity > 0.0)
@@ -5055,6 +5307,7 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						soundspeed = 1500.0;
 					rollr = DTR * roll;
 					pitchr = DTR * pitch;
+					
 					/* zero atttitude correction if requested */
 					if (kluge_zeroattitudecorrection == MB_YES)
 						{
@@ -5062,81 +5315,342 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						pitchr = 0.0;
 						}
 
-					/* loop over detections as available - the 7k format has used several
-					   different records over the years, so there are several different
-					   cases that must be handled */
+					/* zero alongtrack angles if requested */
+					if (kluge_zeroalongtrackangles == MB_YES)
+						{
+						for (i=0;i<bathymetry->number_beams;i++)
+							{
+							beamgeometry->angle_alongtrack[i] = 0.0;
+							}
+						}
 
-					/* case of v2rawdetection record */
-					if (istore->read_v2rawdetection == MB_YES)
+					/* if requested apply kluge scaling of rx beam angles */
+					if (kluge_beampatterntweak == MB_YES)
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
+						/* case of v2rawdetection record */
+						if (istore->read_v2rawdetection == MB_YES)
 							{
-							for (j=0;j<v2rawdetection->number_beams;j++)
+							for (i=0;i<v2rawdetection->number_beams;i++)
 								{
-								v2rawdetection->rx_angle[j] *= kluge_beampatternfactor;
+								v2rawdetection->rx_angle[i] *= kluge_beampatternfactor;
 								}
 							}
-							
-						/* initialize all of the beams */
-						for (i=0;i<bathymetry->number_beams;i++)
+						
+						/* case of v2detection record with or without v2detectionsetup */
+						else if (istore->read_v2detection == MB_YES)
 							{
-							bathymetry->quality[i] = 0;
-							bathymetry->depth[i] = 0.0;
-							bathymetry->acrosstrack[i] = 0.0;
-							bathymetry->alongtrack[i] = 0.0;
-							bathymetry->pointing_angle[i] = 0.0;
-							bathymetry->azimuth_angle[i] = 0.0;
+							for (i=0;i<v2detection->number_beams;i++)
+								{
+								v2detection->angle_x[i] *= kluge_beampatternfactor;
+								}
 							}
 
-						/* now loop over the detects */
+
+						/* else default case of beamgeometry record */
+						else
+							{
+							for (i=0;i<bathymetry->number_beams;i++)
+								{
+								beamgeometry->angle_acrosstrack[i] *= kluge_beampatternfactor;
+								}
+							}
+						}
+
+					/* get transducer angular offsets */
+					tx_align.roll = 0.0;
+					tx_align.pitch = 0.0;
+					tx_align.heading = 0.0;
+					rx_align.roll = 0.0;
+					rx_align.pitch = 0.0;
+					rx_align.heading = 0.0;
+					if (platform != NULL)
+						{
+						sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
+						sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
+						sensor_heading = &platform->sensors[platform->source_heading];
+						
+						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
+							&& sensor_rollpitch->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+							{
+							tx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
+									- sensor_rollpitch->offsets[0].attitude_offset_roll;
+							tx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
+									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
+							rx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
+									- sensor_rollpitch->offsets[0].attitude_offset_roll;
+							rx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
+									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
+							}
+						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
+							&& sensor_heading->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+							{
+							tx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
+									- sensor_heading->offsets[0].attitude_offset_azimuth;
+							rx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
+									- sensor_heading->offsets[0].attitude_offset_azimuth;
+							}
+						}			
+
+					/* loop over detections as available - the 7k format has used several
+					   different records over the years, so there are several different
+					   cases that must be handled */
+
+					/* case of v2rawdetection record */
+					if (istore->read_v2rawdetection == MB_YES)
+						{
 						for (j=0;j<v2rawdetection->number_beams;j++)
 							{
+							/* beam id */
 							i = v2rawdetection->beam_descriptor[j];
+							
+							/* get range and quality */
 							bathymetry->range[i] = v2rawdetection->detection_point[j]
 										/ v2rawdetection->sampling_rate;
 							bathymetry->quality[i] = v2rawdetection->quality[j];
-							alpha = RTD * (pitchr + v2rawdetection->tx_angle) + pitchbias;
-							beta = 90.0 - RTD * (v2rawdetection->rx_angle[j] - rollr) + rollbias;
+							
+							/* get roll at bottom return time for this beam */
+							if (nins > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											ins_time_d-1, ins_roll-1,
+											nins, time_d + bathymetry->range[i], &beamroll, &jins,
+											&error);
+								}
+							else if (nrock > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											rock_time_d-1, rock_roll-1,
+											nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
+											&error);
+								}
+							else if (ndsl > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dsl_time_d-1, dsl_roll-1,
+											ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
+											&error);
+								}
+							else if (ndat_rph > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dat_rph_time_d-1, dat_rph_roll-1,
+											ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
+											&error);
+								}
+							else
+								{
+								beamroll = roll;
+								}
+							beamrollr = DTR * beamroll;
+							
+							/* get pitch at bottom return time for this beam */
+							if (nins > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											ins_time_d-1, ins_pitch-1,
+											nins, time_d + bathymetry->range[i], &beampitch, &jins,
+											&error);
+								}
+							else if (nrock > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											rock_time_d-1, rock_pitch-1,
+											nrock, time_d + bathymetry->range[i], &beampitch, &jrock,
+											&error);
+								}
+							else if (ndsl > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dsl_time_d-1, dsl_pitch-1,
+											ndsl, time_d + bathymetry->range[i], &beampitch, &jdsl,
+											&error);
+								}
+							else if (ndat_rph > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dat_rph_time_d-1, dat_rph_pitch-1,
+											ndat_rph, time_d + bathymetry->range[i], &beampitch, &jdattitude,
+											&error);
+								}
+							else
+								{
+								beampitch = pitch;
+								}
+							beampitchr = DTR * beampitch;
+							
+							/* get heading at bottom return time for this beam */
+							if (nins > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											ins_time_d-1, ins_heading-1,
+											nins, time_d + bathymetry->range[i], &beamheading, &jins,
+											&error);
+								}
+							else if (nrock > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											rock_time_d-1, rock_heading-1,
+											nrock, time_d + bathymetry->range[i], &beamheading, &jrock,
+											&error);
+								}
+							else if (ndsl > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dsl_time_d-1, dsl_heading-1,
+											ndsl, time_d + bathymetry->range[i], &beamheading, &jdsl,
+											&error);
+								}
+							else if (ndat_heading > 0)
+								{
+								interp_status = mb_linear_interp_heading(verbose,
+											dat_heading_time_d-1, dat_heading_heading-1,
+											ndat_heading, time_d + bathymetry->range[i], &beamheading, &jdheading,
+											&error);
+								}
+							else
+								{
+								beamheading = heading;
+								}
+							beamheadingr = DTR * beamheading;
+							
+							/* calculate beam angles for raytracing using Jon Beaudoin's code based on:
+								Beaudoin, J., Hughes Clarke, J., and Bartlett, J. Application of
+								Surface Sound Speed Measurements in Post-Processing for Multi-Sector
+								Multibeam Echosounders : International Hydrographic Review, v.5, no.3,
+								p.26-31.
+								(http://www.omg.unb.ca/omg/papers/beaudoin_IHR_nov2004.pdf).
+							   note complexity if transducer arrays are reverse mounted, as determined
+							   by a mount heading angle of about 180 degrees rather than about 0 degrees.
+							   If a receive array or a transmit array are reverse mounted then:
+								1) subtract 180 from the heading mount angle of the array
+								2) flip the sign of the pitch and roll mount offsets of the array
+								3) flip the sign of the beam steering angle from that array
+									(reverse TX means flip sign of TX steer, reverse RX
+									means flip sign of RX steer) */
+							tx_steer = RTD * v2rawdetection->tx_angle;
+							tx_orientation.roll = roll;
+							tx_orientation.pitch = pitch;
+							tx_orientation.heading = heading;
+							rx_steer = -RTD * v2rawdetection->rx_angle[j];
+							rx_orientation.roll = beamroll;
+							rx_orientation.pitch = beampitch;
+							rx_orientation.heading = beamheading;
+							reference_heading = heading;
+			
+							status = mb_beaudoin(verbose,
+										tx_align,
+										tx_orientation,
+										tx_steer,
+										rx_align,
+										rx_orientation,
+										rx_steer,
+										reference_heading,
+										&beamAzimuth,
+										&beamDepression,
+										&error);
+							theta = 90.0 - beamDepression;
+							phi = 90.0 - beamAzimuth;
+							if (phi < 0.0)
+								phi += 360.0;
+//fprintf(stderr,"Beam:%5d:%3.3d tx: %f %f %f %f  rx: %f %f %f %f  refh:%f",
+//nrec_multibeam+nrec_multibeam_tot, i, tx_orientation.roll, tx_orientation.pitch, tx_orientation.heading, tx_steer,
+//rx_orientation.roll, rx_orientation.pitch, rx_orientation.heading, rx_steer, reference_heading);
+
+// BD    -90   0    +90
+// MB    180  90     0
+// MB = -BD + X
+// 180 = 90 + X ==> X = 90
+// 90 = -0 + X ==> X = 90
+// 0 = -90 + X ==> X = 90
+ 														
+							/* calculate beam angles the old way */
+							/*alpha = RTD * (beampitchr + v2rawdetection->tx_angle) + pitchbias;
+							beta = 90.0 - RTD * (v2rawdetection->rx_angle[j] - beamrollr) + rollbias;
 							mb_rollpitch_to_takeoff(
 								verbose,
 								alpha, beta,
 								&theta, &phi,
-								&error);
+								&error);*/
+ 
+							/* calculate bathymetry */
 							rr = 0.5 * soundspeed * bathymetry->range[i];
 							xx = rr * sin(DTR * theta);
 							zz = rr * cos(DTR * theta);
 							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
 							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
 							bathymetry->depth[i] = zz + sonardepth - heave;
-/* if (i==128)fprintf(stderr,"range:%f zz:%f sonardepth:%f depth:%f\n",rr,zz,sonardepth,bathymetry->depth[i]); */
 							bathymetry->pointing_angle[i] = DTR * theta;
 							bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
+//fprintf(stderr," beamAzimuth:%f beamDepression:%f theta:%f phi:%f  bath: %f %f %f\n",
+//beamAzimuth, beamDepression, theta, phi, bathymetry->acrosstrack[i], bathymetry->alongtrack[i], zz);
 							}
 						}
-			
+
 					/* case of v2detection record with v2detectionsetup */
 					else if (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES)
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
-							{
-							for (j=0;j<v2detection->number_beams;j++)
-								{
-								v2detection->angle_x[j] *= kluge_beampatternfactor;
-								}
-							}
-
-						/* now loop over the detects */
 						for (j=0;j<v2detection->number_beams;j++)
 							{
 							i = v2detectionsetup->beam_descriptor[j];
 			
 							bathymetry->range[i] = v2detection->range[j];
+							bathymetry->quality[i] = v2detectionsetup->quality[j];
+							
+							/* compensate for pitch if not already compensated */
+							if ((volatilesettings->transmit_flags & 0xF) != 0)
+								{
+								beampitch = 0.0;
+								}
+							else
+								{
+								beampitch = pitch;
+								}
+							beampitchr = DTR * beampitch;
+							
+							/* compensate for roll if not already compensated */
+							if ((volatilesettings->receive_flags & 0x1) != 0)
+								{
+								beamroll = 0.0;
+								}
+							else
+								{								
+								/* get roll at bottom return time for this beam */
+								if (nins > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												ins_time_d-1, ins_roll-1,
+												nins, time_d + bathymetry->range[i], &beamroll, &jins,
+												&error);
+									}
+								else if (nrock > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												rock_time_d-1, rock_roll-1,
+												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
+												&error);
+									}
+								else if (ndsl > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dsl_time_d-1, dsl_roll-1,
+												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
+												&error);
+									}
+								else if (ndat_rph > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dat_rph_time_d-1, dat_rph_roll-1,
+												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
+												&error);
+									}
+								else
+									{
+									beamroll = roll;
+									}
+								}
+							beamrollr = DTR * beamroll;
+								
+							/* calculate bathymetry */
 							alpha = RTD * (v2detection->angle_y[j] + pitchr
 									+ volatilesettings->steering_vertical) + pitchbias;
 							beta = 90.0 - RTD * (v2detection->angle_x[j] - rollr) + rollbias;
@@ -5153,32 +5667,76 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							bathymetry->depth[i] = zz + sonardepth - heave;
 							bathymetry->pointing_angle[i] = DTR * theta;
 							bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, rollr, pitchr, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							}
 						}
 
 					/* case of v2detection record */
 					else if (istore->read_v2detection == MB_YES)
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
-							{
-							for (i=0;i<v2detection->number_beams;i++)
-								{
-								v2detection->angle_x[i] *= kluge_beampatternfactor;
-								}
-							}
-
 						/* now loop over the detects */
 						for (i=0;i<v2detection->number_beams;i++)
 							{
 							bathymetry->range[i] = v2detection->range[i];
-							alpha = RTD * (v2detection->angle_y[i] + pitchr
+							/* bathymetry->quality[i] set in bathymetry record */
+							
+							/* compensate for pitch if not already compensated */
+							if ((volatilesettings->transmit_flags & 0xF) != 0)
+								{
+								beampitch = 0.0;
+								}
+							else
+								{
+								beampitch = pitch;
+								}
+							beampitchr = DTR * beampitch;
+							
+							/* compensate for roll if not already compensated */
+							if ((volatilesettings->receive_flags & 0x1) != 0)
+								{
+								beamroll = 0.0;
+								}
+							else
+								{								
+								/* get roll at bottom return time for this beam */
+								if (nins > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												ins_time_d-1, ins_roll-1,
+												nins, time_d + bathymetry->range[i], &beamroll, &jins,
+												&error);
+									}
+								else if (nrock > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												rock_time_d-1, rock_roll-1,
+												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
+												&error);
+									}
+								else if (ndsl > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dsl_time_d-1, dsl_roll-1,
+												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
+												&error);
+									}
+								else if (ndat_rph > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dat_rph_time_d-1, dat_rph_roll-1,
+												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
+												&error);
+									}
+								else
+									{
+									beamroll = roll;
+									}
+								}
+							beamrollr = DTR * beamroll;
+								
+							/* calculate bathymetry */
+							alpha = RTD * (v2detection->angle_y[i] + beampitchr
 									+ volatilesettings->steering_vertical) + pitchbias;
-							beta = 90.0 - RTD * (v2detection->angle_x[i] - rollr) + rollbias;
+							beta = 90.0 - RTD * (v2detection->angle_x[i] - beamrollr) + rollbias;
 							mb_rollpitch_to_takeoff(
 								verbose,
 								alpha, beta,
@@ -5192,28 +5750,17 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							bathymetry->depth[i] = zz + sonardepth - heave;
 							bathymetry->pointing_angle[i] = DTR * theta;
 							bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							}
 						}
 
 					/* else default case of beamgeometry record */
 					else
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
-							{
-							for (i=0;i<bathymetry->number_beams;i++)
-								{
-								beamgeometry->angle_acrosstrack[i] *= kluge_beampatternfactor;
-								}
-							}
-
 						/* loop over all beams */
 						for (i=0;i<bathymetry->number_beams;i++)
 							{
+							/* bathymetry->range[i] set */
+							/* bathymetry->quality[i] set */
 							if ((bathymetry->quality[i] & 15) > 0)
 								{
 								/* compensate for pitch if not already compensated */
@@ -5225,7 +5772,7 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 									{
 									beampitch = pitch;
 									}
-								beampitchr = RTD * beampitch;
+								beampitchr = DTR * beampitch;
 								
 								/* compensate for roll if not already compensated */
 								if ((volatilesettings->receive_flags & 0x1) != 0)
@@ -5268,9 +5815,7 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 										beamroll = roll;
 										}
 									}
-								beamrollr = RTD * beamroll;
-/* fprintf(stderr,"i:%d roll: %f beamroll: %f diff:%f",i,roll,beamroll,beamroll-roll);
-fprintf(stderr,"  pitch:%f beampitch:%f diff:%f\n",pitch,beampitch,beampitch-pitch);*/
+								beamrollr = DTR * beamroll;
 								
 								/* compensate for heave if not already compensated */
 								if ((volatilesettings->receive_flags & 0x2) != 0)
@@ -5310,19 +5855,6 @@ fprintf(stderr,"  pitch:%f beampitch:%f diff:%f\n",pitch,beampitch,beampitch-pit
 								bathymetry->depth[i] = zz + sonardepth - beamheave;
 								bathymetry->pointing_angle[i] = DTR * theta;
 								bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  zz:%f sonardepth:%f heave:%f   depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,zz,sonardepth,heave,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
-								}
-							else
-								{
-								bathymetry->quality[i] = 0;
-								bathymetry->depth[i] = 0.0;
-								bathymetry->acrosstrack[i] = 0.0;
-								bathymetry->alongtrack[i] = 0.0;
-								bathymetry->pointing_angle[i] = 0.0;
-								bathymetry->azimuth_angle[i] = 0.0;
 								}
 							}
 						}
@@ -6145,6 +6677,27 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 				header->RecordNumber);
 			}
 
+	   	/* handle installation data */
+		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
+			{
+			nrec_installation++;
+
+			installation = &(istore->installation);
+			header = &(installation->header);
+			time_j[0] = header->s7kTime.Year;
+			time_j[1] = header->s7kTime.Day;
+			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
+			time_j[3] = (int) header->s7kTime.Seconds;
+			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
+			mb_get_itime(verbose, time_j, time_i);
+			mb_get_time(verbose, time_i, &time_d);
+			if (verbose > 0)
+				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
+				time_i[0],time_i[1],time_i[2],
+				time_i[3],time_i[4],time_i[5],time_i[6],
+				header->RecordNumber);
+			}
+
 	   	/* handle bluefin ctd data */
 		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
 			{
@@ -6317,23 +6870,9 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 					}
 				else if (ndat_sonardepth > 0)
 					{
-					sonardepthlag = 0.0;
-					if (sonardepthlagfix == MB_YES && ndat_sonardepth > 1
-						&& sonardepthratemax > 0.0
-						&& interp_status == MB_SUCCESS)
-						{
-						interp_status = mb_linear_interp(verbose,
-								dat_sonardepth_time_d-1, dat_sonardepth_sonardepthrate-1,
-								ndat_sonardepth, time_d, &sonardepthrate, &jdsonardepth,
-								&error);
-						sonardepthlag = sonardepthrate * sonardepthlagmax / sonardepthratemax;
-						if (sonardepthrate >= sonardepthratemax)
-							sonardepthlag = sonardepthlagmax;
-						}
-					if (interp_status == MB_SUCCESS)
 					interp_status = mb_linear_interp(verbose,
 								dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-								ndat_sonardepth, time_d + sonardepthlag, &sonardepth, &jdsonardepth,
+								ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
 								&error);
 					}
 				else if (ndat_rph > 0)
@@ -7069,7 +7608,6 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
 	}
 
-
 	/* deallocate navigation arrays */
 	if (ndat_nav > 0)
 		{
@@ -7082,7 +7620,6 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 	if (ndat_sonardepth > 0)
 		{
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepthrate,&error);
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepthfilter,&error);
 		}
 	if (ndat_heading > 0)
@@ -7172,6 +7709,12 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepth,&error);
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepthfilter,&error);
 		}
+		
+	/* deallocate platform structure */
+	if (platform != NULL)
+		{
+		status = mb_platform_deall(verbose, (void **)&platform, &error);
+		}
 
 	/* check memory */
 	if (verbose >= 4)
diff --git a/src/utilities/mb7kpreprocess.c b/src/utilities/mb7kpreprocess.c.new
similarity index 90%
copy from src/utilities/mb7kpreprocess.c
copy to src/utilities/mb7kpreprocess.c.new
index 3c452ed..12f8824 100644
--- a/src/utilities/mb7kpreprocess.c
+++ b/src/utilities/mb7kpreprocess.c.new
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mb7kpreprocess.c	10/12/2005
- *    $Id: mb7kpreprocess.c 2219 2014-12-11 21:22:25Z caress $
+ *    $Id: mb7kpreprocess.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2005-2014 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -60,7 +60,7 @@
 #define	MB7KPREPROCESS_KLUGE_ZEROATTITUDECORRECTION	3
 #define	MB7KPREPROCESS_KLUGE_KEARFOTTROVNOISE		4
 #define	MB7KPREPROCESS_KLUGE_BEAMPATTERNTWEAK		5
-static char rcs_id[] = "$Id: mb7kpreprocess.c 2219 2014-12-11 21:22:25Z caress $";
+static char rcs_id[] = "$Id: mb7kpreprocess.c 2239 2015-05-07 00:51:42Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -107,6 +107,16 @@ int main (int argc, char **argv)
 	int	obeams_bath;
 	int	obeams_amp;
 	int	opixels_ss;
+	
+	/* platform definition file */
+	char	platform_file[MB_PATH_MAXLINE];
+	int	use_platform_file = MB_NO;
+	struct mb_platform_struct *platform = NULL;
+	struct mb_sensor_struct *sensor_swathbathymetry = NULL;
+	struct mb_sensor_struct *sensor_rollpitch = NULL;
+	struct mb_sensor_struct *sensor_heading = NULL;
+	struct mb_sensor_struct *sensor_position = NULL;
+	struct mb_sensor_struct *sensor_depth = NULL;
 
 	/* MBIO read values */
 	void	*imbio_ptr = NULL;
@@ -121,10 +131,10 @@ int main (int argc, char **argv)
 	double	navlon;
 	double	navlat;
 	double	speed;
-	double	heading;
 	double	distance;
 	double	altitude;
 	double	sonardepth;
+	double	heading, beamheading, beamheadingr;
 	double	roll, rollr, beamroll, beamrollr;
 	double	pitch, pitchr, beampitch, beampitchr;
 	double	heave, beamheave;
@@ -186,6 +196,7 @@ int main (int argc, char **argv)
 	s7kr_processedsidescan	*processedsidescan;
 	s7kr_image		*image;
 	s7kr_fileheader		*fileheader;
+	s7kr_installation	*installation;
 	s7kr_remotecontrolsettings	*remotecontrolsettings;
 
 	/* counting variables */
@@ -230,7 +241,7 @@ int main (int argc, char **argv)
 	int	nrec_v2detection = 0;
 	int	nrec_v2rawdetection = 0;
 	int	nrec_v2snippet = 0;
-	int nrec_calibratedsnippet = 0;
+	int 	nrec_calibratedsnippet = 0;
 	int	nrec_processedsidescan = 0;
 	int	nrec_installation = 0;
 	int	nrec_systemeventmessage = 0;
@@ -358,7 +369,6 @@ int main (int argc, char **argv)
 	int	ndat_sonardepth_alloc = 0;
 	double	*dat_sonardepth_time_d = NULL;
 	double	*dat_sonardepth_sonardepth = NULL;
-	double	*dat_sonardepth_sonardepthrate = NULL;
 	double	*dat_sonardepth_sonardepthfilter = NULL;
 
 	int	ndat_heading = 0;
@@ -434,6 +444,7 @@ int main (int argc, char **argv)
 	double	sonardepthoffset = 0.0;
 
 	/* depth sensor lever arm parameter */
+	int	use_depthsensoroff = MB_NO;
 	double	depthsensoroffx = 0.0;
 	double	depthsensoroffy = 0.0;
 	double	depthsensoroffz = 0.0;
@@ -461,17 +472,9 @@ int main (int argc, char **argv)
 	double	navigation_offset_heading = 0.0;
 	double	navigation_offset_roll = 0.0;
 	double	navigation_offset_pitch = 0.0;
-
-	/* depth sensor time lag parameters */
-	int	sonardepthlagfix = MB_NO;
-	double	sonardepthlagmax = 3.0 /* sec */;
-	double	sonardepthratemax = 0.64; /* m/sec */
-	double	sonardepthlag = 0.0;
-	double	sonardepthrate;
-
-	/* roll and pitch bias parameters */
-	double	rollbias = 0.0;
-	double	pitchbias = 0.0;
+	double	position_offset_x = 0.0;
+	double	position_offset_y = 0.0;
+	double	position_offset_z = 0.0;
 
 	/* multibeam sidescan parameters */
 	int	ss_source = R7KRECID_None;
@@ -498,6 +501,19 @@ int main (int argc, char **argv)
 
 	/* MBARI data flag */
 	int	MBARIdata = MB_NO;
+	
+	/* variables for beam angle calculation */
+	mb_3D_orientation tx_align;
+	mb_3D_orientation tx_orientation;
+	double tx_steer;
+	mb_3D_orientation rx_align;
+	mb_3D_orientation rx_orientation;
+	double rx_steer;
+	double reference_heading;
+	double beamAzimuth;
+	double beamDepression;
+	double rollbias = 0.0;
+	double pitchbias = 0.0;
 
 	int	jtimedelay = 0;
 	int	jtimelag = 0;
@@ -579,7 +595,7 @@ int main (int argc, char **argv)
 	strcpy (read_file, "datalist.mb-1");
 
 	/* process argument list */
-	while ((c = getopt(argc, argv, "AaB:b:C:c:D:d:F:f:I:i:K:k:LlM:m:N:n:O:o:P:p:R:r:S:s:T:t:W:w:Z:z:VvHh")) != -1)
+	while ((c = getopt(argc, argv, "AaB:b:C:c:D:d:F:f:G:g:I:i:K:k:LlM:m:N:n:O:o:P:p:R:r:S:s:T:t:W:w:Z:z:VvHh")) != -1)
 	  switch (c)
 		{
 		case 'H':
@@ -601,7 +617,9 @@ int main (int argc, char **argv)
 			break;
 		case 'C':
 		case 'c':
-			sscanf (optarg,"%lf/%lf", &rollbias,&pitchbias);
+			nscan = sscanf (optarg,"%lf/%lf", &sonar_offset_roll,&sonar_offset_pitch);
+			if (nscan == 2)
+				sonar_offset_mode = MB_YES;
 			break;
 		case 'D':
 		case 'd':
@@ -630,6 +648,8 @@ int main (int argc, char **argv)
 					depthsensoroffx = 0.0;
 					}
 				}
+			if (nscan > 0)
+				use_depthsensoroff = MB_YES;
 			flag++;
 			break;
 		case 'F':
@@ -637,6 +657,12 @@ int main (int argc, char **argv)
 			sscanf (optarg,"%d", &format);
 			flag++;
 			break;
+		case 'G':
+		case 'g':
+			sscanf (optarg,"%s", platform_file);
+			use_platform_file = MB_YES;
+			flag++;
+			break;
 		case 'I':
 		case 'i':
 			sscanf (optarg,"%s", read_file);
@@ -711,18 +737,6 @@ int main (int argc, char **argv)
 				else
 					sonardepthfilter = MB_NO;
 				}
-			else
-				{
-				nscan = sscanf (optarg,"%lf/%lf", &sonardepthlagmax, &sonardepthratemax);
-				if (nscan > 0)
-					sonardepthlagfix = MB_YES;
-				if (nscan == 1)
-					{
-					sonardepthratemax = 0.0;
-					sonardepthlag = sonardepthlagmax;
-					}
-				}
-
 			flag++;
 			break;
 		case 'R':
@@ -867,6 +881,8 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
 		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
 		fprintf(stderr,"dbg2       read_file:           %s\n",read_file);
+		fprintf(stderr,"dbg2       use_platform_file:   %d\n",use_platform_file);
+		fprintf(stderr,"dbg2       platform_file:       %s\n",platform_file);
 		fprintf(stderr,"dbg2       ofile:               %s\n",ofile);
 		fprintf(stderr,"dbg2       ofile_set:           %d\n",ofile_set);
 		fprintf(stderr,"dbg2       ss_source:           %d\n",ss_source);
@@ -894,7 +910,7 @@ int main (int argc, char **argv)
 			}
 		else
 			{
-			fprintf(stderr,"dbg2       timelag:             %f\n",timelag);
+			fprintf(stderr,"dbg2       timelagconstant:     %f\n",timelagconstant);
 			}
 		fprintf(stderr,"dbg2       timelag:                %f\n",timelag);
 		fprintf(stderr,"dbg2       sonardepthfilter:       %d\n",sonardepthfilter);
@@ -902,9 +918,6 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       sonardepthfilterdepth:  %f\n",sonardepthfilterdepth);
 		fprintf(stderr,"dbg2       sonardepthfile:         %s\n",sonardepthfile);
 		fprintf(stderr,"dbg2       sonardepthdata:         %d\n",sonardepthdata);
-		fprintf(stderr,"dbg2       sonardepthlagfix:       %d\n",sonardepthlagfix);
-		fprintf(stderr,"dbg2       sonardepthlagmax:       %f\n",sonardepthlagmax);
-		fprintf(stderr,"dbg2       sonardepthratemax:      %f\n",sonardepthratemax);
 		fprintf(stderr,"dbg2       sonardepthoffset:       %f\n",sonardepthoffset);
 		fprintf(stderr,"dbg2       depthsensoroffx:        %f\n",depthsensoroffx);
 		fprintf(stderr,"dbg2       depthsensoroffy:        %f\n",depthsensoroffy);
@@ -930,8 +943,6 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       navigation_offset_heading:  %f\n",navigation_offset_heading);
 		fprintf(stderr,"dbg2       navigation_offset_roll:     %f\n",navigation_offset_roll);
 		fprintf(stderr,"dbg2       navigation_offset_pitch:    %f\n",navigation_offset_pitch);
-		fprintf(stderr,"dbg2       rollbias:               %f\n",rollbias);
-		fprintf(stderr,"dbg2       pitchbias:              %f\n",pitchbias);
 		for (i=0;i<nrangeoffset;i++)
 			fprintf(stderr,"dbg2       rangeoffset[%d]:         %d %d %f\n",
 				i,rangeoffsetstart[i], rangeoffsetend[i], rangeoffset[i]);
@@ -1311,9 +1322,9 @@ rock_heading[nrock]);*/
 			    		&year, &month, &day, &hour, &minute, &second,
 					sensor, &dsl_lat[ndsl], &dsl_lon[ndsl], &dsl_sonardepth[ndsl],
 					&dsl_heading[ndsl], &dsl_pitch[ndsl], &dsl_roll[ndsl], &id);
-/*fprintf(stderr,"nscan:%d year:%d month:%d day:%d hour:%d minute:%d second:%f sensor:%s %f %f %f %f %f %f %f\n",
+/* fprintf(stderr,"nscan:%d year:%d month:%d day:%d hour:%d minute:%d second:%f sensor:%s %f %f %f %f %f %f %f\n",
 nscan,year,month,day,hour,minute,second,sensor,dsl_lat[ndsl], dsl_lon[ndsl], dsl_sonardepth[ndsl],
-dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id);*/
+dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id); */
 			    if (nscan == 14)
 			    	{
 				time_i[0] = year;
@@ -1324,7 +1335,7 @@ dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id);*/
 				time_i[5] = (int)second;
 				time_i[6] = (int)((second - time_i[5]) * 1000000);
 				mb_get_time(verbose, time_i, &dsl_time_d[ndsl]);
-/*fprintf(stderr,"dsl DATA: %f %f %f %f %f %f\n",
+/* fprintf(stderr,"dsl DATA: %f %f %f %f %f %f %f %f\n",
 dsl_time_d[ndsl],
 dsl_lon[ndsl],
 dsl_lat[ndsl],
@@ -1332,7 +1343,7 @@ dsl_sonardepth[ndsl],
 dsl_heading[ndsl],
 dsl_roll[ndsl],
 dsl_pitch[ndsl],
-dsl_heading[ndsl]);*/
+dsl_heading[ndsl]); */
 			    	ndsl++;
 				}
 			    }
@@ -1528,6 +1539,146 @@ sonardepth_sonardepth[nsonardepth]);*/
 	/* null tfp - allows detection of whether time delay file was opened, which only happens for MBARI AUV
 		data with navigation and attitude in "bluefin" records */
 	tfp = NULL;
+	
+	/* load platform definition if specified or if offsets otherwise specified create a platform structure */
+	if (use_platform_file == MB_YES)
+		{
+		status = mb_platform_read(verbose, platform_file, (void **)&platform, &error);
+		if (status == MB_FAILURE)
+			{
+			error = MB_ERROR_OPEN_FAIL;
+			fprintf(stderr,"\nUnable to open and parse platform file: %s\n", platform_file);
+			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+			exit(error);				
+			}
+		}
+	else if (use_depthsensoroff == MB_YES || sonar_offset_mode == MB_YES)
+		{
+		status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
+						0, 1, 2, 3, 3, 3, 
+						(void **)&platform, &error);
+			
+		/* set sensor 0 (multibeam) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_SONAR_MULTIBEAM,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, 0,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					0, 0,
+					MB7KPREPROCESS_TIMELAG_OFF,
+					0.0,
+					0,
+					NULL,
+					NULL,
+					sonar_offset_mode,
+					sonar_offset_x,
+					sonar_offset_y,
+					sonar_offset_z,   
+					sonar_offset_mode,
+					sonar_offset_heading,
+					sonar_offset_roll,
+					sonar_offset_pitch,
+					&error);
+			
+		/* set sensor 1 (position) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_POSITION,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, ntimelag,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					1, 0,
+					timelagmode,
+					timelagconstant,
+					ntimelag,
+					timelag_time_d,
+					timelag_model,
+					navigation_offset_mode,
+					navigation_offset_x,
+					navigation_offset_y,
+					navigation_offset_z,   
+					navigation_offset_mode,
+					navigation_offset_heading,
+					navigation_offset_roll,
+					navigation_offset_pitch,
+					&error);
+			
+		/* set sensor 2 (sensor depth) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_POSITION,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, ntimelag,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					2, 0,
+					timelagmode,
+					timelagconstant,
+					ntimelag,
+					timelag_time_d,
+					timelag_model,
+					use_depthsensoroff,
+					depthsensoroffx,
+					depthsensoroffy,
+					depthsensoroffz,   
+					0,
+					0.0,
+					0.0,
+					0.0,
+					&error);
+			
+		/* set sensor 3 (attitude) */
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor(verbose, (void **)&platform,
+					MB_SENSOR_TYPE_VRU,
+					NULL,
+					NULL,
+					NULL,
+					0, 0,
+					1, ntimelag,
+					&error);
+		if (status == MB_SUCCESS)
+			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+					3, 0,
+					timelagmode,
+					timelagconstant,
+					ntimelag,
+					timelag_time_d,
+					timelag_model,
+					vru_offset_mode,
+					vru_offset_x,
+					vru_offset_y,
+					vru_offset_z,   
+					vru_offset_mode,
+					vru_offset_heading,
+					vru_offset_roll,
+					vru_offset_pitch,
+					&error);
+		
+		/* deal with error */
+		if (status == MB_FAILURE)
+			{
+			error = MB_ERROR_OPEN_FAIL;
+			fprintf(stderr,"\nUnable to initialize platform offset structure\n");
+			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+			exit(error);				
+			}
+		}
 
 	/* get format if required */
 	if (format == 0)
@@ -2364,7 +2515,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 				ndat_sonardepth_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthrate,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
 				if (error != MB_ERROR_NO_ERROR)
 					{
@@ -2381,7 +2531,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 				{
 				dat_sonardepth_time_d[ndat_sonardepth] = time_d;
 				dat_sonardepth_sonardepth[ndat_sonardepth] = depth->depth;
-				dat_sonardepth_sonardepthrate[ndat_sonardepth] = 0.0;
 				dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
 				ndat_sonardepth++;
 				}
@@ -2718,6 +2867,186 @@ sonardepth_sonardepth[nsonardepth]);*/
 				header->RecordNumber);
 			}
 
+	   	/* handle installation data */
+		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
+			{
+			nrec_installation++;
+
+			installation = &(istore->installation);
+			header = &(installation->header);
+			time_j[0] = header->s7kTime.Year;
+			time_j[1] = header->s7kTime.Day;
+			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
+			time_j[3] = (int) header->s7kTime.Seconds;
+			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
+			mb_get_itime(verbose, time_j, time_i);
+			mb_get_time(verbose, time_i, &time_d);
+			if (verbose > 0)
+				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
+				time_i[0],time_i[1],time_i[2],
+				time_i[3],time_i[4],time_i[5],time_i[6],
+				header->RecordNumber);
+
+			if (platform == NULL)
+				{
+				status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
+								0, 1, 1, 2, 2, 2, 
+								(void **)&platform, &error);
+					
+				/* set sensor 0 (multibeam) */
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor(verbose, (void **)&platform,
+							MB_SENSOR_TYPE_SONAR_MULTIBEAM,
+							NULL,
+							NULL,
+							NULL,
+							0, 0,
+							2, 0,
+							&error);
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+							0, 0,
+							MB7KPREPROCESS_TIMELAG_OFF,
+							0.0,
+							0,
+							NULL,
+							NULL,
+							MB_SENSOR_POSITION_OFFSET_STATIC,
+							(double) installation->transmit_x,
+							(double) installation->transmit_y,
+							(double) installation->transmit_z,   
+							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+							(double) installation->transmit_heading,
+							(double) installation->transmit_roll,
+							(double) installation->transmit_pitch,   
+							&error);
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+							0, 1,
+							MB7KPREPROCESS_TIMELAG_OFF,
+							0.0,
+							0,
+							NULL,
+							NULL,
+							MB_SENSOR_POSITION_OFFSET_STATIC,
+							(double) installation->receive_x,
+							(double) installation->receive_y,
+							(double) installation->receive_z,   
+							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+							(double) installation->receive_heading,
+							(double) installation->receive_roll,
+							(double) installation->receive_pitch,   
+							&error);
+					
+				/* set sensor 1 (position) */
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor(verbose, (void **)&platform,
+							MB_SENSOR_TYPE_POSITION,
+							NULL,
+							NULL,
+							NULL,
+							0, 0,
+							1, ntimelag,
+							&error);
+				if (status == MB_SUCCESS)
+					{
+					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
+						&& installation->position_time_delay != 0)
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								1, 0,
+								MB7KPREPROCESS_TIMELAG_CONSTANT,
+								(double)(0.001 * installation->position_time_delay),
+								0,
+								NULL,
+								NULL,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->position_x,
+								(double) installation->position_y,
+								(double) installation->position_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_NONE,
+								(double) 0.0,
+								(double) 0.0,
+								(double) 0.0,   
+								&error);
+					else
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								1, 0,
+								timelagmode,
+								timelagconstant,
+								ntimelag,
+								timelag_time_d,
+								timelag_model,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->position_x,
+								(double) installation->position_y,
+								(double) installation->position_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_NONE,
+								(double) 0.0,
+								(double) 0.0,
+								(double) 0.0,   
+								&error);
+					}
+					
+				/* set sensor 2 (motion sensor) */
+				if (status == MB_SUCCESS)
+					status = mb_platform_add_sensor(verbose, (void **)&platform,
+							MB_SENSOR_TYPE_VRU,
+							NULL,
+							NULL,
+							NULL,
+							0, 0,
+							1, ntimelag,
+							&error);
+				if (status == MB_SUCCESS)
+					{
+					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
+						&& installation->motion_time_delay != 0)
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								2, 0,
+								MB7KPREPROCESS_TIMELAG_CONSTANT,
+								(double)(0.001 * installation->motion_time_delay),
+								0,
+								NULL,
+								NULL,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->motion_x,
+								(double) installation->motion_y,
+								(double) installation->motion_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+								(double) installation->motion_heading,
+								(double) installation->motion_roll,
+								(double) installation->motion_pitch,   
+								&error);
+					else
+						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
+								2, 0,
+								timelagmode,
+								timelagconstant,
+								ntimelag,
+								timelag_time_d,
+								timelag_model,
+								MB_SENSOR_POSITION_OFFSET_STATIC,
+								(double) installation->motion_x,
+								(double) installation->motion_y,
+								(double) installation->motion_z,   
+								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
+								(double) installation->motion_heading,
+								(double) installation->motion_roll,
+								(double) installation->motion_pitch,   
+								&error);
+					}
+				
+				/* deal with error */
+				if (status == MB_FAILURE)
+					{
+					error = MB_ERROR_OPEN_FAIL;
+					fprintf(stderr,"\nUnable to initialize platform offset structure\n");
+					fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
+					exit(error);				
+					}
+				}
+			}
+
 	   	/* handle bluefin ctd data */
 		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
 			{
@@ -2900,7 +3229,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 				ndat_sonardepth_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthrate,&error);
 				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
 				if (error != MB_ERROR_NO_ERROR)
 					{
@@ -2956,7 +3284,6 @@ sonardepth_sonardepth[nsonardepth]);*/
 					{
 					dat_sonardepth_time_d[ndat_sonardepth] = bluefin->nav[i].depth_time;
 					dat_sonardepth_sonardepth[ndat_sonardepth] = bluefin->nav[i].depth;
-					dat_sonardepth_sonardepthrate[ndat_sonardepth] = 0.0;
 					dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
 					ndat_sonardepth++;
 					}
@@ -3281,7 +3608,10 @@ sonardepth_sonardepth[nsonardepth]);*/
 
 	/* close time delay file */
 	if (tfp != NULL)
+		{
 		fclose(tfp);
+		tfp = NULL;
+		}
 
 	/* apply time lag to all relevant data
 		timelag value calculated either from model imported from file (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
@@ -3758,31 +4088,6 @@ fprintf(stderr,"Applying filtering to %d Rock nav data\n", nrock);
 			}
 		}
 
-	/* calculate sonardepth change rate for variable lag correction - asynchronous data only */
-	if (sonardepthlagfix == MB_YES && ndat_sonardepth > 1)
-		{
-fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", ndat_sonardepth);
-		for (i=0;i<ndat_sonardepth;i++)
-			{
-			if (i == 0)
-				{
-				dat_sonardepth_sonardepthrate[i] = (dat_sonardepth_sonardepth[i+1] - dat_sonardepth_sonardepth[i])
-								/ (dat_sonardepth_time_d[i+1] - dat_sonardepth_time_d[i]);
-				}
-			else if (i == ndat_sonardepth - 1)
-				{
-				dat_sonardepth_sonardepthrate[i] = (dat_sonardepth_sonardepth[i] - dat_sonardepth_sonardepth[i-1])
-								/ (dat_sonardepth_time_d[i] - dat_sonardepth_time_d[i-1]);
-				}
-			else
-				{
-				dat_sonardepth_sonardepthrate[i] = (dat_sonardepth_sonardepth[i+1] - dat_sonardepth_sonardepth[i-1])
-								/ (dat_sonardepth_time_d[i+1] - dat_sonardepth_time_d[i-1]);
-				}
-			dat_sonardepth_sonardepthrate[i] = fabs(dat_sonardepth_sonardepthrate[i]);
-			}
-		}
-
 	/* fix problems with batht timestamp arrays */
 	for (i=0;i<nbatht;i++)
 		{
@@ -3946,8 +4251,8 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 		fprintf(stdout, "\nTotal sonardepth data read: %d\n", ndat_sonardepth);
 		for (i=0;i<ndat_sonardepth;i++)
 			{
-			fprintf(stdout, "  DEP: %5d %17.6f %8.3f %8.3f\n",
-				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i], dat_sonardepth_sonardepthrate[i]);
+			fprintf(stdout, "  DEP: %5d %17.6f %8.3f\n",
+				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i]);
 			}
 		fprintf(stdout, "\nTotal altitude data read: %d\n", ndat_altitude);
 		for (i=0;i<ndat_altitude;i++)
@@ -4600,21 +4905,21 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						{
 						for (i=0;i<bathymetry->number_beams;i++)
 							{
-/* fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]); */
+//fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]);
 							bathymetry->quality[i] = bathymetry->quality[i] & 15;
 
 							/* phase or amplitude picks */
 							if (bathymetry->quality[i] & 8)
 								{
-/* fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]); */
+//fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);
 								bathymetry->quality[i] += 32;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
+//fprintf(stderr," %d\n",bathymetry->quality[i]);
 								}
 							else if (bathymetry->quality[i] & 4)
 								{
-/* fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]); */
+//fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);
 								bathymetry->quality[i] += 16;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
+//fprintf(stderr," %d\n",bathymetry->quality[i]);
 								}
 
 							/* flagged by sonar */
@@ -4629,7 +4934,7 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 								{
 								bathymetry->quality[i] += 64;
 								}
-/* fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]); */
+//fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]);
 							}
 						}
 
@@ -4675,15 +4980,15 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 									rock_time_d-1, rock_lat-1,
 									nrock, time_d, &navlat, &jrock,
 									&error);
-						if (j > 1)
+						if (jrock > 1)
 							{
-							j1 = j - 2;
-							j2 = j - 1;
+							j1 = jrock - 2;
+							j2 = jrock - 1;
 							}
 						else
 							{
-							j1 = j - 1;
-							j2 = j;
+							j1 = jrock - 1;
+							j2 = jrock;
 							}
 						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
 						dx = (rock_lon[j2] - rock_lon[j1])/mtodeglon;
@@ -4704,15 +5009,15 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 									dsl_time_d-1, dsl_lat-1,
 									ndsl, time_d, &navlat, &jdsl,
 									&error);
-						if (j > 1)
+						if (jdsl > 1)
 							{
-							j1 = j - 2;
-							j2 = j - 1;
+							j1 = jdsl - 2;
+							j2 = jdsl - 1;
 							}
 						else
 							{
-							j1 = j - 1;
-							j2 = j;
+							j1 = jdsl - 1;
+							j2 = jdsl;
 							}
 						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
 						dx = (dsl_lon[j2] - dsl_lon[j1])/mtodeglon;
@@ -4917,94 +5222,83 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						}
 					else if (ndat_sonardepth > 0)
 						{
-						sonardepthlag = 0.0;
-						if (sonardepthlagfix == MB_YES && ndat_sonardepth > 1
-							&& sonardepthratemax > 0.0
-							&& interp_status == MB_SUCCESS)
-							{
-							interp_status = mb_linear_interp(verbose,
-									dat_sonardepth_time_d-1, dat_sonardepth_sonardepthrate-1,
-									ndat_sonardepth, time_d, &sonardepthrate, &jdsonardepth,
-									&error);
-							sonardepthlag = sonardepthrate * sonardepthlagmax / sonardepthratemax;
-							if (sonardepthrate >= sonardepthratemax)
-								sonardepthlag = sonardepthlagmax;
-							}
-						if (interp_status == MB_SUCCESS)
 						interp_status = mb_linear_interp(verbose,
 									dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-									ndat_sonardepth, time_d + sonardepthlag, &sonardepth, &jdsonardepth,
+									ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
 									&error);
 						}
 					else
 						{
 						sonardepth = 0.0;
 						}
+fprintf(stderr,"\nStarting sonardepth:%f\n",sonardepth);
 
-					/* apply offset between depth sensor and sonar */
-					sonardepth += sonardepthoffset
-							+ depthsensoroffx * sin(DTR * roll)
-							+ depthsensoroffy * sin(DTR * pitch)
-							+ depthsensoroffz * cos(DTR * pitch);
-					
-					/* if sensor offsets have been defined, apply lever arm correction */
-					if (sonar_offset_mode == MB_YES
-						|| vru_offset_mode == MB_YES
-						|| navigation_offset_mode == MB_YES)
+					/* get local translation between lon lat degrees and meters */
+					mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
+					headingx = sin(DTR*heading);
+					headingy = cos(DTR*heading);	
+
+					if (platform != NULL)
 						{
-						/* do lever arm calculation with sensor offsets */
-						mb_lever(verbose, sonar_offset_x, sonar_offset_y, sonar_offset_z,
-								vru_offset_x, vru_offset_y, vru_offset_z,
-								navigation_offset_x, navigation_offset_y, navigation_offset_z,
-								pitch, roll,
-								&lever_x, &lever_y, &lever_z, &error);
-//fprintf(stderr,"LEVER:  roll:%f pitch:%f   lever: %f %f %f\n", roll, pitch, lever_x, lever_y, lever_z);
+						sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
+						sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
+						sensor_heading = &platform->sensors[platform->source_heading];
+						sensor_position = &platform->sensors[platform->source_position];
+						sensor_depth = &platform->sensors[platform->source_depth];
 						
-						/* get local translation between lon lat degrees and meters */
-						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-						headingx = sin(DTR*heading);
-						headingy = cos(DTR*heading);	
-	
-						/* apply position offsets */
-						if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0)
+						position_offset_x = 0.0;
+						position_offset_y = 0.0;
+						position_offset_z = 0.0;
+						if (sensor_swathbathymetry->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
 							{
-							navlon += headingy * sonar_offset_x * mtodeglon
-									+ headingx * sonar_offset_y * mtodeglon;
-							navlat+= -headingx * sonar_offset_x * mtodeglat
-									+ headingy * sonar_offset_y * mtodeglat;
-//fprintf(stderr,"HEADING: %f  %f %f POSITION OFFSET: meters: %f %f   lonlat: %f %f ",
-//heading, headingx, headingy,
-//sonar_offset_x, sonar_offset_y,
-//headingy * sonar_offset_x * mtodeglon + headingx * sonar_offset_y * mtodeglon,
-//-headingx * sonar_offset_x * mtodeglat + headingy * sonar_offset_y * mtodeglat);
+							position_offset_x = sensor_swathbathymetry->offsets[0].position_offset_x;
+							position_offset_y = sensor_swathbathymetry->offsets[0].position_offset_y;
+							position_offset_z = sensor_swathbathymetry->offsets[0].position_offset_z;
 							}
-						if (sonar_offset_z != 0.0)
+						if (sensor_depth->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
 							{
-							sonardepth -= sonar_offset_z;
-//fprintf(stderr,"SONARDEPTH OFFSET: %f ",-sonar_offset_z);
+							position_offset_x -= sensor_depth->offsets[0].position_offset_x;
+							position_offset_y -= sensor_depth->offsets[0].position_offset_y;
+							position_offset_z -= sensor_depth->offsets[0].position_offset_z;
 							}
+						sonardepth += sonardepthoffset
+								+ sin(DTR * roll) * position_offset_x
+								- sin(DTR * pitch) * position_offset_y
+								+ cos(DTR * pitch) * position_offset_z;
+fprintf(stderr,"Positionoffset applied 1: sonardepthoffset:%f position_offset:%f %f %f sonardepth:%f\n",
+sonardepthoffset,position_offset_x,position_offset_y,position_offset_z,sonardepth);
+							
+						/* do lever arm calculation with sensor offsets */
+						mb_lever(verbose,
+								sensor_swathbathymetry->offsets[0].position_offset_x,
+								sensor_swathbathymetry->offsets[0].position_offset_y,
+								sensor_swathbathymetry->offsets[0].position_offset_z,
+								sensor_rollpitch->offsets[0].position_offset_x,
+								sensor_rollpitch->offsets[0].position_offset_y,
+								sensor_rollpitch->offsets[0].position_offset_z,
+								sensor_position->offsets[0].position_offset_x,
+								sensor_position->offsets[0].position_offset_y,
+								sensor_position->offsets[0].position_offset_z,
+								pitch, roll,
+								&lever_x, &lever_y, &lever_z, &error);
+
+	
+						/* apply position offsets */
+						navlon += headingy * position_offset_x * mtodeglon
+								+ headingx * position_offset_y * mtodeglon;
+						navlat+= -headingx * position_offset_x * mtodeglat
+								+ headingy * position_offset_y * mtodeglat;
+						sonardepth -= position_offset_z;
+fprintf(stderr,"Positionoffset applied 2: position_offset_z:%f sonardepth:%f\n",
+position_offset_z,sonardepth);
 
 						/* apply lever arm calculation */
-						if (lever_x != 0.0 || lever_y != 0.0)
-							{
-							navlon += headingy * lever_x * mtodeglon
-									+ headingx * lever_y * mtodeglon;
-							navlat+= -headingx * lever_x * mtodeglat
-									+ headingy * lever_y * mtodeglat;
-//fprintf(stderr,"LEVER ARM XY OFFSET: meters: %f %f   lonlat: %f %f ",
-//lever_x, lever_y,
-//headingy * lever_x * mtodeglon + headingx * lever_y * mtodeglon,
-//-headingx * lever_x * mtodeglat + headingy * lever_y * mtodeglat);
-							}
-						if (lever_z != 0.0)
-							{
-							sonardepth -= lever_z;
-//fprintf(stderr,"LEVER ARM Z OFFSET: %f ",-lever_z);
-							}						
-//if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0 || sonar_offset_z != 0.0
-//|| lever_x != 0.0 || lever_y != 0.0 || lever_z != 0.0)
-//fprintf(stderr,"\n");
-						}
+						navlon += headingy * lever_x * mtodeglon + headingx * lever_y * mtodeglon;
+						navlat+= -headingx * lever_x * mtodeglat + headingy * lever_y * mtodeglat;
+						sonardepth -= lever_z;
+fprintf(stderr,"Lever applied: lever_z:%f sonardepth:%f\n",
+lever_z,sonardepth);
+						}			
 
 					/* if the optional data are not all available, this ping
 						is not useful, and is discarded by setting
@@ -5019,7 +5313,22 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 
 				/* if the optional data are available, then proceed */
 				if (status == MB_SUCCESS)
-					{
+					{		
+					/* initialize all of the beams */
+					for (i=0;i<bathymetry->number_beams;i++)
+						{
+						if (istore->read_v2rawdetection == MB_YES
+						    || (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES))
+							bathymetry->quality[i] = 0;
+						bathymetry->depth[i] = 0.0;
+						bathymetry->acrosstrack[i] = 0.0;
+						bathymetry->alongtrack[i] = 0.0;
+						bathymetry->pointing_angle[i] = 0.0;
+						bathymetry->azimuth_angle[i] = 0.0;
+						}
+fprintf(stderr,"sonardepth:%f heave:%f\n",sonardepth,heave);
+
+					/* set ping values */
 					bathymetry->longitude = DTR * navlon;
 					bathymetry->latitude = DTR * navlat;
 					bathymetry->heading = DTR * heading;
@@ -5036,15 +5345,10 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						{								
 						bathymetry->vehicle_height = -sonardepth;
 						}
-
-					/* zero alongtrack angles if requested */
-					if (kluge_zeroalongtrackangles == MB_YES)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							beamgeometry->angle_alongtrack[i] = 0.0;
-							}
-						}
+fprintf(stderr,"\nPing %d: %14.9f %13.9f %10.3f   %7.3f %7.3f %7.3f\n",
+nrec_multibeam+nrec_multibeam_tot,
+bathymetry->longitude, bathymetry->latitude, bathymetry->vehicle_height,
+bathymetry->heading, bathymetry->roll, bathymetry->pitch);
 
 					/* get ready to calculate bathymetry */
 					if (volatilesettings->sound_velocity > 0.0)
@@ -5055,6 +5359,7 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						soundspeed = 1500.0;
 					rollr = DTR * roll;
 					pitchr = DTR * pitch;
+					
 					/* zero atttitude correction if requested */
 					if (kluge_zeroattitudecorrection == MB_YES)
 						{
@@ -5062,81 +5367,342 @@ fprintf(stderr,"Calculating sonardepth change rate for %d sonardepth data\n", nd
 						pitchr = 0.0;
 						}
 
-					/* loop over detections as available - the 7k format has used several
-					   different records over the years, so there are several different
-					   cases that must be handled */
+					/* zero alongtrack angles if requested */
+					if (kluge_zeroalongtrackangles == MB_YES)
+						{
+						for (i=0;i<bathymetry->number_beams;i++)
+							{
+							beamgeometry->angle_alongtrack[i] = 0.0;
+							}
+						}
 
-					/* case of v2rawdetection record */
-					if (istore->read_v2rawdetection == MB_YES)
+					/* if requested apply kluge scaling of rx beam angles */
+					if (kluge_beampatterntweak == MB_YES)
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
+						/* case of v2rawdetection record */
+						if (istore->read_v2rawdetection == MB_YES)
 							{
-							for (j=0;j<v2rawdetection->number_beams;j++)
+							for (i=0;i<v2rawdetection->number_beams;i++)
 								{
-								v2rawdetection->rx_angle[j] *= kluge_beampatternfactor;
+								v2rawdetection->rx_angle[i] *= kluge_beampatternfactor;
 								}
 							}
-							
-						/* initialize all of the beams */
-						for (i=0;i<bathymetry->number_beams;i++)
+						
+						/* case of v2detection record with or without v2detectionsetup */
+						else if (istore->read_v2detection == MB_YES)
 							{
-							bathymetry->quality[i] = 0;
-							bathymetry->depth[i] = 0.0;
-							bathymetry->acrosstrack[i] = 0.0;
-							bathymetry->alongtrack[i] = 0.0;
-							bathymetry->pointing_angle[i] = 0.0;
-							bathymetry->azimuth_angle[i] = 0.0;
+							for (i=0;i<v2detection->number_beams;i++)
+								{
+								v2detection->angle_x[i] *= kluge_beampatternfactor;
+								}
 							}
 
-						/* now loop over the detects */
+
+						/* else default case of beamgeometry record */
+						else
+							{
+							for (i=0;i<bathymetry->number_beams;i++)
+								{
+								beamgeometry->angle_acrosstrack[i] *= kluge_beampatternfactor;
+								}
+							}
+						}
+
+					/* get transducer angular offsets */
+					tx_align.roll = 0.0;
+					tx_align.pitch = 0.0;
+					tx_align.heading = 0.0;
+					rx_align.roll = 0.0;
+					rx_align.pitch = 0.0;
+					rx_align.heading = 0.0;
+					if (platform != NULL)
+						{
+						sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
+						sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
+						sensor_heading = &platform->sensors[platform->source_heading];
+						
+						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
+							&& sensor_rollpitch->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+							{
+							tx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
+									- sensor_rollpitch->offsets[0].attitude_offset_roll;
+							tx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
+									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
+							rx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
+									- sensor_rollpitch->offsets[0].attitude_offset_roll;
+							rx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
+									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
+							}
+						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
+							&& sensor_heading->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
+							{
+							tx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
+									- sensor_heading->offsets[0].attitude_offset_azimuth;
+							rx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
+									- sensor_heading->offsets[0].attitude_offset_azimuth;
+							}
+						}			
+
+					/* loop over detections as available - the 7k format has used several
+					   different records over the years, so there are several different
+					   cases that must be handled */
+
+					/* case of v2rawdetection record */
+					if (istore->read_v2rawdetection == MB_YES)
+						{
 						for (j=0;j<v2rawdetection->number_beams;j++)
 							{
+							/* beam id */
 							i = v2rawdetection->beam_descriptor[j];
+							
+							/* get range and quality */
 							bathymetry->range[i] = v2rawdetection->detection_point[j]
 										/ v2rawdetection->sampling_rate;
 							bathymetry->quality[i] = v2rawdetection->quality[j];
-							alpha = RTD * (pitchr + v2rawdetection->tx_angle) + pitchbias;
-							beta = 90.0 - RTD * (v2rawdetection->rx_angle[j] - rollr) + rollbias;
+							
+							/* get roll at bottom return time for this beam */
+							if (nins > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											ins_time_d-1, ins_roll-1,
+											nins, time_d + bathymetry->range[i], &beamroll, &jins,
+											&error);
+								}
+							else if (nrock > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											rock_time_d-1, rock_roll-1,
+											nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
+											&error);
+								}
+							else if (ndsl > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dsl_time_d-1, dsl_roll-1,
+											ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
+											&error);
+								}
+							else if (ndat_rph > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dat_rph_time_d-1, dat_rph_roll-1,
+											ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
+											&error);
+								}
+							else
+								{
+								beamroll = roll;
+								}
+							beamrollr = DTR * beamroll;
+							
+							/* get pitch at bottom return time for this beam */
+							if (nins > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											ins_time_d-1, ins_pitch-1,
+											nins, time_d + bathymetry->range[i], &beampitch, &jins,
+											&error);
+								}
+							else if (nrock > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											rock_time_d-1, rock_pitch-1,
+											nrock, time_d + bathymetry->range[i], &beampitch, &jrock,
+											&error);
+								}
+							else if (ndsl > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dsl_time_d-1, dsl_pitch-1,
+											ndsl, time_d + bathymetry->range[i], &beampitch, &jdsl,
+											&error);
+								}
+							else if (ndat_rph > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dat_rph_time_d-1, dat_rph_pitch-1,
+											ndat_rph, time_d + bathymetry->range[i], &beampitch, &jdattitude,
+											&error);
+								}
+							else
+								{
+								beampitch = pitch;
+								}
+							beampitchr = DTR * beampitch;
+							
+							/* get heading at bottom return time for this beam */
+							if (nins > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											ins_time_d-1, ins_heading-1,
+											nins, time_d + bathymetry->range[i], &beamheading, &jins,
+											&error);
+								}
+							else if (nrock > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											rock_time_d-1, rock_heading-1,
+											nrock, time_d + bathymetry->range[i], &beamheading, &jrock,
+											&error);
+								}
+							else if (ndsl > 0)
+								{
+								interp_status = mb_linear_interp(verbose,
+											dsl_time_d-1, dsl_heading-1,
+											ndsl, time_d + bathymetry->range[i], &beamheading, &jdsl,
+											&error);
+								}
+							else if (ndat_heading > 0)
+								{
+								interp_status = mb_linear_interp_heading(verbose,
+											dat_heading_time_d-1, dat_heading_heading-1,
+											ndat_heading, time_d + bathymetry->range[i], &beamheading, &jdheading,
+											&error);
+								}
+							else
+								{
+								beamheading = heading;
+								}
+							beamheadingr = DTR * beamheading;
+							
+							/* calculate beam angles for raytracing using Jon Beaudoin's code based on:
+								Beaudoin, J., Hughes Clarke, J., and Bartlett, J. Application of
+								Surface Sound Speed Measurements in Post-Processing for Multi-Sector
+								Multibeam Echosounders : International Hydrographic Review, v.5, no.3,
+								p.26-31.
+								(http://www.omg.unb.ca/omg/papers/beaudoin_IHR_nov2004.pdf).
+							   note complexity if transducer arrays are reverse mounted, as determined
+							   by a mount heading angle of about 180 degrees rather than about 0 degrees.
+							   If a receive array or a transmit array are reverse mounted then:
+								1) subtract 180 from the heading mount angle of the array
+								2) flip the sign of the pitch and roll mount offsets of the array
+								3) flip the sign of the beam steering angle from that array
+									(reverse TX means flip sign of TX steer, reverse RX
+									means flip sign of RX steer) */
+							tx_steer = RTD * v2rawdetection->tx_angle;
+							tx_orientation.roll = roll;
+							tx_orientation.pitch = pitch;
+							tx_orientation.heading = heading;
+							rx_steer = -RTD * v2rawdetection->rx_angle[j];
+							rx_orientation.roll = beamroll;
+							rx_orientation.pitch = beampitch;
+							rx_orientation.heading = beamheading;
+							reference_heading = heading;
+			
+							status = mb_beaudoin(verbose,
+										tx_align,
+										tx_orientation,
+										tx_steer,
+										rx_align,
+										rx_orientation,
+										rx_steer,
+										reference_heading,
+										&beamAzimuth,
+										&beamDepression,
+										&error);
+							theta = 90.0 - beamDepression;
+							phi = 90.0 - beamAzimuth;
+							if (phi < 0.0)
+								phi += 360.0;
+fprintf(stderr,"Beam:%5d:%3.3d tx: %f %f %f %f  rx: %f %f %f %f  refh:%f",
+nrec_multibeam+nrec_multibeam_tot, i, tx_orientation.roll, tx_orientation.pitch, tx_orientation.heading, tx_steer,
+rx_orientation.roll, rx_orientation.pitch, rx_orientation.heading, rx_steer, reference_heading);
+
+// BD    -90   0    +90
+// MB    180  90     0
+// MB = -BD + X
+// 180 = 90 + X ==> X = 90
+// 90 = -0 + X ==> X = 90
+// 0 = -90 + X ==> X = 90
+ 														
+							/* calculate beam angles the old way */
+							/*alpha = RTD * (beampitchr + v2rawdetection->tx_angle) + pitchbias;
+							beta = 90.0 - RTD * (v2rawdetection->rx_angle[j] - beamrollr) + rollbias;
 							mb_rollpitch_to_takeoff(
 								verbose,
 								alpha, beta,
 								&theta, &phi,
-								&error);
+								&error);*/
+ 
+							/* calculate bathymetry */
 							rr = 0.5 * soundspeed * bathymetry->range[i];
 							xx = rr * sin(DTR * theta);
 							zz = rr * cos(DTR * theta);
 							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
 							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
 							bathymetry->depth[i] = zz + sonardepth - heave;
-/* if (i==128)fprintf(stderr,"range:%f zz:%f sonardepth:%f depth:%f\n",rr,zz,sonardepth,bathymetry->depth[i]); */
 							bathymetry->pointing_angle[i] = DTR * theta;
 							bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
+fprintf(stderr," beamAzimuth:%f beamDepression:%f theta:%f phi:%f  bath: %f %f %f\n",
+beamAzimuth, beamDepression, theta, phi, bathymetry->acrosstrack[i], bathymetry->alongtrack[i], zz);
 							}
 						}
-			
+
 					/* case of v2detection record with v2detectionsetup */
 					else if (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES)
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
-							{
-							for (j=0;j<v2detection->number_beams;j++)
-								{
-								v2detection->angle_x[j] *= kluge_beampatternfactor;
-								}
-							}
-
-						/* now loop over the detects */
 						for (j=0;j<v2detection->number_beams;j++)
 							{
 							i = v2detectionsetup->beam_descriptor[j];
 			
 							bathymetry->range[i] = v2detection->range[j];
+							bathymetry->quality[i] = v2detectionsetup->quality[j];
+							
+							/* compensate for pitch if not already compensated */
+							if ((volatilesettings->transmit_flags & 0xF) != 0)
+								{
+								beampitch = 0.0;
+								}
+							else
+								{
+								beampitch = pitch;
+								}
+							beampitchr = DTR * beampitch;
+							
+							/* compensate for roll if not already compensated */
+							if ((volatilesettings->receive_flags & 0x1) != 0)
+								{
+								beamroll = 0.0;
+								}
+							else
+								{								
+								/* get roll at bottom return time for this beam */
+								if (nins > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												ins_time_d-1, ins_roll-1,
+												nins, time_d + bathymetry->range[i], &beamroll, &jins,
+												&error);
+									}
+								else if (nrock > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												rock_time_d-1, rock_roll-1,
+												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
+												&error);
+									}
+								else if (ndsl > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dsl_time_d-1, dsl_roll-1,
+												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
+												&error);
+									}
+								else if (ndat_rph > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dat_rph_time_d-1, dat_rph_roll-1,
+												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
+												&error);
+									}
+								else
+									{
+									beamroll = roll;
+									}
+								}
+							beamrollr = DTR * beamroll;
+								
+							/* calculate bathymetry */
 							alpha = RTD * (v2detection->angle_y[j] + pitchr
 									+ volatilesettings->steering_vertical) + pitchbias;
 							beta = 90.0 - RTD * (v2detection->angle_x[j] - rollr) + rollbias;
@@ -5153,32 +5719,76 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							bathymetry->depth[i] = zz + sonardepth - heave;
 							bathymetry->pointing_angle[i] = DTR * theta;
 							bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, rollr, pitchr, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							}
 						}
 
 					/* case of v2detection record */
 					else if (istore->read_v2detection == MB_YES)
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
-							{
-							for (i=0;i<v2detection->number_beams;i++)
-								{
-								v2detection->angle_x[i] *= kluge_beampatternfactor;
-								}
-							}
-
 						/* now loop over the detects */
 						for (i=0;i<v2detection->number_beams;i++)
 							{
 							bathymetry->range[i] = v2detection->range[i];
-							alpha = RTD * (v2detection->angle_y[i] + pitchr
+							/* bathymetry->quality[i] set in bathymetry record */
+							
+							/* compensate for pitch if not already compensated */
+							if ((volatilesettings->transmit_flags & 0xF) != 0)
+								{
+								beampitch = 0.0;
+								}
+							else
+								{
+								beampitch = pitch;
+								}
+							beampitchr = DTR * beampitch;
+							
+							/* compensate for roll if not already compensated */
+							if ((volatilesettings->receive_flags & 0x1) != 0)
+								{
+								beamroll = 0.0;
+								}
+							else
+								{								
+								/* get roll at bottom return time for this beam */
+								if (nins > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												ins_time_d-1, ins_roll-1,
+												nins, time_d + bathymetry->range[i], &beamroll, &jins,
+												&error);
+									}
+								else if (nrock > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												rock_time_d-1, rock_roll-1,
+												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
+												&error);
+									}
+								else if (ndsl > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dsl_time_d-1, dsl_roll-1,
+												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
+												&error);
+									}
+								else if (ndat_rph > 0)
+									{
+									interp_status = mb_linear_interp(verbose,
+												dat_rph_time_d-1, dat_rph_roll-1,
+												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
+												&error);
+									}
+								else
+									{
+									beamroll = roll;
+									}
+								}
+							beamrollr = DTR * beamroll;
+								
+							/* calculate bathymetry */
+							alpha = RTD * (v2detection->angle_y[i] + beampitchr
 									+ volatilesettings->steering_vertical) + pitchbias;
-							beta = 90.0 - RTD * (v2detection->angle_x[i] - rollr) + rollbias;
+							beta = 90.0 - RTD * (v2detection->angle_x[i] - beamrollr) + rollbias;
 							mb_rollpitch_to_takeoff(
 								verbose,
 								alpha, beta,
@@ -5192,28 +5802,17 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							bathymetry->depth[i] = zz + sonardepth - heave;
 							bathymetry->pointing_angle[i] = DTR * theta;
 							bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 							}
 						}
 
 					/* else default case of beamgeometry record */
 					else
 						{
-						/* if requested apply kluge scaling of rx beam angles */
-						if (kluge_beampatterntweak == MB_YES)
-							{
-							for (i=0;i<bathymetry->number_beams;i++)
-								{
-								beamgeometry->angle_acrosstrack[i] *= kluge_beampatternfactor;
-								}
-							}
-
 						/* loop over all beams */
 						for (i=0;i<bathymetry->number_beams;i++)
 							{
+							/* bathymetry->range[i] set */
+							/* bathymetry->quality[i] set */
 							if ((bathymetry->quality[i] & 15) > 0)
 								{
 								/* compensate for pitch if not already compensated */
@@ -5225,7 +5824,7 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 									{
 									beampitch = pitch;
 									}
-								beampitchr = RTD * beampitch;
+								beampitchr = DTR * beampitch;
 								
 								/* compensate for roll if not already compensated */
 								if ((volatilesettings->receive_flags & 0x1) != 0)
@@ -5268,9 +5867,7 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
 										beamroll = roll;
 										}
 									}
-								beamrollr = RTD * beamroll;
-/* fprintf(stderr,"i:%d roll: %f beamroll: %f diff:%f",i,roll,beamroll,beamroll-roll);
-fprintf(stderr,"  pitch:%f beampitch:%f diff:%f\n",pitch,beampitch,beampitch-pitch);*/
+								beamrollr = DTR * beamroll;
 								
 								/* compensate for heave if not already compensated */
 								if ((volatilesettings->receive_flags & 0x2) != 0)
@@ -5310,19 +5907,6 @@ fprintf(stderr,"  pitch:%f beampitch:%f diff:%f\n",pitch,beampitch,beampitch-pit
 								bathymetry->depth[i] = zz + sonardepth - beamheave;
 								bathymetry->pointing_angle[i] = DTR * theta;
 								bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  zz:%f sonardepth:%f heave:%f   depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,zz,sonardepth,heave,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
-								}
-							else
-								{
-								bathymetry->quality[i] = 0;
-								bathymetry->depth[i] = 0.0;
-								bathymetry->acrosstrack[i] = 0.0;
-								bathymetry->alongtrack[i] = 0.0;
-								bathymetry->pointing_angle[i] = 0.0;
-								bathymetry->azimuth_angle[i] = 0.0;
 								}
 							}
 						}
@@ -6145,6 +6729,27 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 				header->RecordNumber);
 			}
 
+	   	/* handle installation data */
+		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
+			{
+			nrec_installation++;
+
+			installation = &(istore->installation);
+			header = &(installation->header);
+			time_j[0] = header->s7kTime.Year;
+			time_j[1] = header->s7kTime.Day;
+			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
+			time_j[3] = (int) header->s7kTime.Seconds;
+			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
+			mb_get_itime(verbose, time_j, time_i);
+			mb_get_time(verbose, time_i, &time_d);
+			if (verbose > 0)
+				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
+				time_i[0],time_i[1],time_i[2],
+				time_i[3],time_i[4],time_i[5],time_i[6],
+				header->RecordNumber);
+			}
+
 	   	/* handle bluefin ctd data */
 		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
 			{
@@ -6317,23 +6922,9 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 					}
 				else if (ndat_sonardepth > 0)
 					{
-					sonardepthlag = 0.0;
-					if (sonardepthlagfix == MB_YES && ndat_sonardepth > 1
-						&& sonardepthratemax > 0.0
-						&& interp_status == MB_SUCCESS)
-						{
-						interp_status = mb_linear_interp(verbose,
-								dat_sonardepth_time_d-1, dat_sonardepth_sonardepthrate-1,
-								ndat_sonardepth, time_d, &sonardepthrate, &jdsonardepth,
-								&error);
-						sonardepthlag = sonardepthrate * sonardepthlagmax / sonardepthratemax;
-						if (sonardepthrate >= sonardepthratemax)
-							sonardepthlag = sonardepthlagmax;
-						}
-					if (interp_status == MB_SUCCESS)
 					interp_status = mb_linear_interp(verbose,
 								dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-								ndat_sonardepth, time_d + sonardepthlag, &sonardepth, &jdsonardepth,
+								ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
 								&error);
 					}
 				else if (ndat_rph > 0)
@@ -7069,7 +7660,6 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
 	}
 
-
 	/* deallocate navigation arrays */
 	if (ndat_nav > 0)
 		{
@@ -7082,7 +7672,6 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 	if (ndat_sonardepth > 0)
 		{
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepthrate,&error);
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepthfilter,&error);
 		}
 	if (ndat_heading > 0)
@@ -7172,6 +7761,12 @@ bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepth,&error);
 		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepthfilter,&error);
 		}
+		
+	/* deallocate platform structure */
+	if (platform != NULL)
+		{
+		status = mb_platform_deall(verbose, (void **)&platform, &error);
+		}
 
 	/* check memory */
 	if (verbose >= 4)
diff --git a/src/utilities/mbabsorption.c b/src/utilities/mbabsorption.c
index 52e31b0..b185b98 100644
--- a/src/utilities/mbabsorption.c
+++ b/src/utilities/mbabsorption.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbabsorption.c	2/10/2008
- *    $Id: mbabsorption.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbabsorption.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -108,7 +108,7 @@
 #include "mb_status.h"
 #include "mb_define.h"
 
-static char rcs_id[] = "$Id: mbabsorption.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbabsorption.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbareaclean.c b/src/utilities/mbareaclean.c
index df7ac8e..cdda395 100644
--- a/src/utilities/mbareaclean.c
+++ b/src/utilities/mbareaclean.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbareaclean.c	2/27/2003
- *    $Id: mbareaclean.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbareaclean.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2003-2014 by
+ *    Copyright (c) 2003-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -153,7 +153,7 @@ int getsoundingptr(int verbose, int soundingid,
 int flag_sounding(int verbose, int flag, int output_bad, int output_good,
 		  struct mbareaclean_sndg_struct *sndg, int *error);
 
-static char rcs_id[] = "$Id: mbareaclean.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbareaclean.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbauvloglist.c b/src/utilities/mbauvloglist.c
index 7440bf7..26ec4d0 100644
--- a/src/utilities/mbauvloglist.c
+++ b/src/utilities/mbauvloglist.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbauvloglist.c	8/14/2006
- *    $Id: mbauvloglist.c 2180 2014-04-02 20:58:34Z caress $
+ *    $Id: mbauvloglist.c 2231 2015-02-21 01:46:02Z caress $
  *
- *    Copyright (c) 2006-2014 by
+ *    Copyright (c) 2006-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -22,13 +22,6 @@
  * Date:	August 14, 2006
  * Location:	R/V Western Flyer hove to in a gale offshore British Columbia
  *
- * $Log: mbauvloglist.c,v $
- * Revision 5.1  2006/11/26 09:42:01  caress
- * Making distribution 5.1.0.
- *
- * Revision 5.0  2006/11/20 19:59:21  caress
- * Added program to CVS.
- *
  *
  */
 
@@ -64,7 +57,11 @@
 #define INDEX_MERGE_PITCH	-8
 #define INDEX_MERGE_HEAVE	-9
 
-static char rcs_id[] = "$Id: mbauvloglist.c 2180 2014-04-02 20:58:34Z caress $";
+#define OUTPUT_MODE_TAB		0
+#define OUTPUT_MODE_CSV		1
+#define OUTPUT_MODE_BINARY	2
+
+static char rcs_id[] = "$Id: mbauvloglist.c 2231 2015-02-21 01:46:02Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -139,6 +136,9 @@ int main (int argc, char **argv)
 	double	*nav_roll = NULL;
 	double	*nav_pitch = NULL;
 	double	*nav_heave = NULL;
+	
+	/* output control */
+	int	output_mode = OUTPUT_MODE_TAB;
 
 	double	time_d = 0.0;
 	int	time_i[7];
@@ -169,7 +169,7 @@ int main (int argc, char **argv)
 	strcpy(printformat, "default");
 
 	/* process argument list */
-	while ((c = getopt(argc, argv, "F:f:I:i:L:l:N:n:O:o:PpSsVvWwHh")) != -1)
+	while ((c = getopt(argc, argv, "F:f:I:i:L:l:M:m:N:n:O:o:PpSsVvWwHh")) != -1)
 	  switch (c)
 		{
 		case 'H':
@@ -195,6 +195,11 @@ int main (int argc, char **argv)
 			sscanf (optarg,"%d", &lonflip);
 			flag++;
 			break;
+		case 'M':
+		case 'm':
+			sscanf (optarg,"%d", &output_mode);
+			flag++;
+			break;
 		case 'N':
 		case 'n':
 			sscanf (optarg,"%s", nav_file);
@@ -282,6 +287,7 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
 		fprintf(stderr,"dbg2       file:           %s\n",file);
 		fprintf(stderr,"dbg2       nav_file:       %s\n",nav_file);
+		fprintf(stderr,"dbg2       output_mode:    %d\n",output_mode);
 		fprintf(stderr,"dbg2       printheader:    %d\n",printheader);
 		fprintf(stderr,"dbg2       angles_in_degrees:%d\n",angles_in_degrees);
 		fprintf(stderr,"dbg2       nprintfields:   %d\n",nprintfields);
@@ -616,7 +622,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 			if (index == INDEX_ZERO)
 				{
 				dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_LON)
 				{
@@ -626,7 +635,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_LAT)
 				{
@@ -636,7 +648,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_HEADING)
 				{
@@ -646,7 +661,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_SPEED)
 				{
@@ -656,7 +674,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_SENSORDEPTH)
 				{
@@ -666,7 +687,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_ROLL)
 				{
@@ -676,7 +700,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_PITCH)
 				{
@@ -686,7 +713,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (index == INDEX_MERGE_HEAVE)
 				{
@@ -696,7 +726,10 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 							&error);
 				if (jinterp < 2 || jinterp > nav_num-2)
 					dvalue = 0.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (fields[index].type == TYPE_DOUBLE)
 				{
@@ -707,12 +740,18 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 					&& angles_in_degrees == MB_YES
 					&& dvalue < 0.0)
 					dvalue += 360.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
 				}
 			else if (fields[index].type == TYPE_INTEGER)
 				{
 				mb_get_binary_int(MB_YES, &buffer[fields[index].index], &ivalue);
-				fprintf(stdout, printfields[i].format, ivalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&ivalue, sizeof(int), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, ivalue);
 				}
 			else if (fields[index].type == TYPE_TIMETAG)
 				{
@@ -721,18 +760,42 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 				if (strcmp(printfields[i].format, "time_i") == 0)
 					{
 					mb_get_date(verbose,time_d,time_i);
-					fprintf(stdout,"%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d",
-						time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6]);
+					if (output_mode == OUTPUT_MODE_BINARY)
+						{
+						fwrite(time_i, sizeof(int), 7, stdout);
+						}
+					else
+						{
+						fprintf(stdout,"%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d",
+							time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6]);
+						}
 					}
 				else if (strcmp(printfields[i].format, "time_j") == 0)
 					{
 					mb_get_date(verbose,time_d,time_i);
 					mb_get_jtime(verbose,time_i,time_j);
-					fprintf(stdout,"%4.4d %3.3d %2.2d %2.2d %2.2d.%6.6d",
-						time_i[0],time_j[1],time_i[3],time_i[4],time_i[5],time_i[6]);
+					if (output_mode == OUTPUT_MODE_BINARY)
+						{
+						fwrite(&time_i[0], sizeof(int), 1, stdout);
+						fwrite(&time_j[1], sizeof(int), 1, stdout);
+						fwrite(&time_i[3], sizeof(int), 1, stdout);
+						fwrite(&time_i[4], sizeof(int), 1, stdout);
+						fwrite(&time_i[5], sizeof(int), 1, stdout);
+						fwrite(&time_i[6], sizeof(int), 1, stdout);
+						}
+					else
+						{
+						fprintf(stdout,"%4.4d %3.3d %2.2d %2.2d %2.2d.%6.6d",
+							time_i[0],time_j[1],time_i[3],time_i[4],time_i[5],time_i[6]);
+						}
 					}
 				else
-					fprintf(stdout, printfields[i].format, time_d);
+					{
+					if (output_mode == OUTPUT_MODE_BINARY)
+						fwrite(&dvalue, sizeof(double), 1, stdout);
+					else
+						fprintf(stdout, printfields[i].format, time_d);
+					}
 				}
 			else if (fields[index].type == TYPE_ANGLE)
 				{
@@ -742,12 +805,25 @@ fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_fil
 					&& angles_in_degrees == MB_YES
 					&& dvalue < 0.0)
 					dvalue += 360.0;
-				fprintf(stdout, printfields[i].format, dvalue);
+				if (output_mode == OUTPUT_MODE_BINARY)
+					fwrite(&dvalue, sizeof(double), 1, stdout);
+				else
+					fprintf(stdout, printfields[i].format, dvalue);
+				}
+			if (output_mode == OUTPUT_MODE_TAB)
+				{
+				if (i < nprintfields - 1)
+					fprintf(stdout, "\t");
+				else
+					fprintf(stdout, "\n");
+				}
+			else if (output_mode == OUTPUT_MODE_CSV)
+				{
+				if (i < nprintfields - 1)
+					fprintf(stdout, ",");
+				else
+					fprintf(stdout, "\n");
 				}
-			if (i < nprintfields - 1)
-				fprintf(stdout, "\t");
-			else
-				fprintf(stdout, "\n");
 			}
 		nrecord++;
 		}
diff --git a/src/utilities/mbauvnavusbl.c b/src/utilities/mbauvnavusbl.c
index 5c3c55f..2689ae6 100644
--- a/src/utilities/mbauvnavusbl.c
+++ b/src/utilities/mbauvnavusbl.c
@@ -1,9 +1,9 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbauvnavusbl.c	11/21/2004
  *
- *    $Id: mbauvnavusbl.c 2183 2014-04-16 19:54:45Z caress $
+ *    $Id: mbauvnavusbl.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -58,7 +58,7 @@
 /* local defines */
 #define	NCHARMAX	256
 
-static char rcs_id[] = "$Id: mbauvnavusbl.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[] = "$Id: mbauvnavusbl.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbbackangle.c b/src/utilities/mbbackangle.c
index 5928744..f08b378 100644
--- a/src/utilities/mbbackangle.c
+++ b/src/utilities/mbbackangle.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbbackangle.c	1/6/95
- *    $Id: mbbackangle.c 2185 2014-05-11 06:34:36Z caress $
+ *    $Id: mbbackangle.c 2238 2015-04-15 06:00:52Z caress $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -24,118 +24,6 @@
  * Author:	D. W. Caress
  * Date:	January 6, 1995
  *
- * $Log: mbbackangle.c,v $
- * Revision 5.22  2008/07/10 18:16:33  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.20  2008/01/14 18:25:52  caress
- * Fixed bug in handling pixel acrosstrack distances.
- *
- * Revision 5.19  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.18  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.17  2006/04/26 22:05:26  caress
- * Changes to handle MBARI Mapping AUV data better.
- *
- * Revision 5.16  2006/04/19 18:29:04  caress
- * Added output of global correction table.
- *
- * Revision 5.15  2006/03/14 02:35:45  caress
- * Altered mbbackangle so that it outputs at least one table, even if there are no survey pings in a file.
- *
- * Revision 5.14  2006/03/14 01:59:24  caress
- * A minor change to mbbackangle to output the status of slope correction (-Q)
- * in the coments in the output file.
- *
- * Revision 5.13  2006/02/01 07:31:06  caress
- * Modifications suggested by Gordon Keith
- *
- * Revision 5.12  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.11  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.10  2005/08/17 17:28:54  caress
- * Improved how the best altitude value is obtained for sidescan and amplitude data correction.
- *
- * Revision 5.9  2005/03/25 04:43:00  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.8  2004/10/06 19:10:52  caress
- * Release 5.0.5 update.
- *
- * Revision 5.7  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/19 00:28:12  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/09/07 04:49:23  caress
- * Added slope mode option to mb_process.
- *
- * Revision 5.4  2002/07/25 19:07:17  caress
- * Release 5.0.beta21
- *
- * Revision 5.3  2002/07/20 20:56:55  caress
- * Release 5.0.beta20
- *
- * Revision 5.2  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 21:14:16  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  2000/09/11  20:10:02  caress
- * Linked to new datalist parsing functions. Now supports recursive datalists
- * and comments in datalists.
- *
- * Revision 4.9  2000/06/06  20:32:46  caress
- * Now handles amplitude flagging using beamflags.
- *
- * Revision 4.8  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/07/25  14:28:10  caress
- * Version 4.5beta2
- *
- * Revision 4.6  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.3  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1995/03/02  13:49:21  caress
- * Fixed bug related to error messages.
- *
- * Revision 4.1  1995/02/27  14:43:18  caress
- * Fixed bug regarding closing a text input file.
- *
- * Revision 4.0  1995/02/14  21:17:15  caress
- * Version 4.2
- *
  */
 
 /* standard include files */
@@ -147,9 +35,6 @@
 #include <sys/stat.h>
 #include <time.h>
 
-/* GMT include files */
-#include "gmt.h"
-
 /* MBIO include files */
 #include "mb_status.h"
 #include "mb_define.h"
@@ -157,22 +42,6 @@
 #include "mb_process.h"
 #include "mb_aux.h"
 
-/* get NaN detector */
-#if defined(isnanf)
-#define check_fnan(x) isnanf((x))
-#elif defined(isnan)
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNANF == 1
-#define check_fnan(x) isnanf(x)
-extern int isnanf(float x);
-#elif HAVE_ISNAN == 1
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNAND == 1
-#define check_fnan(x) isnand((double)(x))
-#else
-#define check_fnan(x) ((x) != (x))
-#endif
-
 /* mode defines */
 #define	MBBACKANGLE_AMP	1
 #define	MBBACKANGLE_SS	2
@@ -213,15 +82,8 @@ int output_model(int verbose, FILE *tfp,
 	int nangles, double angle_max, double dangle, int symmetry,
 	int *nmean, double *mean, double *sigma,
 	int *error);
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error);
-
-static char rcs_id[] = "$Id: mbbackangle.c 2185 2014-05-11 06:34:36Z caress $";
+
+static char rcs_id[] = "$Id: mbbackangle.c 2238 2015-04-15 06:00:52Z caress $";
 char program_name[] = "mbbackangle";
 
 /*--------------------------------------------------------------------*/
@@ -791,7 +653,7 @@ by MBprocess.";
 	if (corr_topogrid == MB_YES)
 		{
 		grid.data = NULL;
-		status = mb_readgrd(verbose, grid.file, &grid.projection_mode, grid.projection_id, &grid.nodatavalue,
+		status = mb_read_gmt_grd(verbose, grid.file, &grid.projection_mode, grid.projection_id, &grid.nodatavalue,
 					&grid.nxy, &grid.nx, &grid.ny, &grid.min, &grid.max,
 					&grid.xmin, &grid.xmax, &grid.ymin, &grid.ymax,
 					&grid.dx, &grid.dy, &grid.data, NULL, NULL, &error);
@@ -1692,7 +1554,8 @@ r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
 		strcpy(title, "Beam Amplitude vs. Grazing Angle PDF");
 
 		/* output the grid */
-		write_cdfgrd(verbose, gridfile, gridamphist,
+		mb_write_gmt_grd(verbose, gridfile, gridamphist,
+				MB_DEFAULT_GRID_NODATA, 
 				gridampnx, gridampny,
 				(double)(-gridampangle), gridampangle,
 				gridampmin, gridampmax,
@@ -1702,7 +1565,7 @@ r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
 				argc, argv, &error);
 
 		/* run mbm_grdplot */
-		sprintf(plot_cmd, "mbm_grdplot -I%s -JX9/5 -G1 -S -MGQ100 -MXM# -MXI%s -V -L\"File %s - %s:%s\"",
+		sprintf(plot_cmd, "mbm_grdplot -I%s -JX9/5 -G1 -MGQ100 -MXI%s -V -L\"File %s - %s:%s\"",
 				gridfile, amptablefile, gridfile, title, zlabel);
 		if (verbose)
 			{
@@ -1746,7 +1609,8 @@ r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
 		strcpy(title, "Sidescan Amplitude vs. Grazing Angle PDF");
 
 		/* output the grid */
-		write_cdfgrd(verbose, gridfile, gridsshist,
+		mb_write_gmt_grd(verbose, gridfile, gridsshist,
+				MB_DEFAULT_GRID_NODATA, 
 				gridssnx, gridssny,
 				(double)(-gridssangle), gridssangle,
 				gridssmin, gridssmax,
@@ -1756,7 +1620,7 @@ r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
 				argc, argv, &error);
 
 		/* run mbm_grdplot */
-		sprintf(plot_cmd, "mbm_grdplot -I%s -JX9/5 -G1 -S -MGQ100 -MXM# -MXI%s -V -L\"File %s - %s:%s\"",
+		sprintf(plot_cmd, "mbm_grdplot -I%s -JX9/5 -G1 -S -MGQ100 -MXI%s -V -L\"File %s - %s:%s\"",
 				gridfile, sstablefile, gridfile, title, zlabel);
 		if (verbose)
 			{
@@ -2196,161 +2060,3 @@ int output_model(int verbose, FILE *tfp,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-/*
- * function write_cdfgrd writes output grid to a
- * GMT version 2 netCDF grd file
- */
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error)
-{
-	char	*function_name = "write_cdfgrd";
-	int	status = MB_SUCCESS;
-	struct GRD_HEADER grd;
-	double	w, e, s, n;
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
-#else
-	int	pad[4];
-#endif
-	float	*a;
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	char	remark[MB_PATH_MAXLINE];
-	int	i, j, kg, ka;
-	char	*message;
-	char	*ctime();
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       outfile:    %s\n",outfile);
-		fprintf(stderr,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(stderr,"dbg2       nx:         %d\n",nx);
-		fprintf(stderr,"dbg2       ny:         %d\n",ny);
-		fprintf(stderr,"dbg2       xmin:       %f\n",xmin);
-		fprintf(stderr,"dbg2       xmax:       %f\n",xmax);
-		fprintf(stderr,"dbg2       ymin:       %f\n",ymin);
-		fprintf(stderr,"dbg2       ymax:       %f\n",ymax);
-		fprintf(stderr,"dbg2       zmin:       %f\n",zmin);
-		fprintf(stderr,"dbg2       zmax:       %f\n",zmax);
-		fprintf(stderr,"dbg2       dx:         %f\n",dx);
-		fprintf(stderr,"dbg2       dy:         %f\n",dy);
-		fprintf(stderr,"dbg2       xlab:       %s\n",xlab);
-		fprintf(stderr,"dbg2       ylab:       %s\n",ylab);
-		fprintf(stderr,"dbg2       zlab:       %s\n",zlab);
-		fprintf(stderr,"dbg2       titl:       %s\n",titl);
-		fprintf(stderr,"dbg2       argc:       %d\n",argc);
-		fprintf(stderr,"dbg2       *argv:      %p\n",(void *)*argv);
-		}
-
-	/* inititialize grd header */
-	GMT_program = program_name;
-	GMT_grd_init (&grd, 1, argv, FALSE);
-	GMT_io_init ();
-	GMT_grdio_init ();
-	GMT_make_fnan (GMT_f_NaN);
-	GMT_make_dnan (GMT_d_NaN);
-
-	/* copy values to grd header */
-	grd.nx = nx;
-	grd.ny = ny;
-	grd.node_offset = 0;
-	grd.x_min = xmin;
-	grd.x_max = xmax;
-	grd.y_min = ymin;
-	grd.y_max = ymax;
-	grd.z_min = zmin;
-	grd.z_max = zmax;
-	grd.x_inc = dx;
-	grd.y_inc = dy;
-	grd.z_scale_factor = 1.0;
-	grd.z_add_offset = 0.0;
-	strcpy(grd.x_units,xlab);
-	strcpy(grd.y_units,ylab);
-	strcpy(grd.z_units,zlab);
-	strcpy(grd.title,titl);
-	strcpy(grd.command,"\0");
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,MB_PATH_MAXLINE);
-	sprintf(remark,"\n\tProjection: %s\n\tGrid created by %s\n\tMB-system Version %s\n\tRun by <%s> on <%s> at <%s>",
-		projection,program_name,MB_VERSION,user,host,date);
-	strncpy(grd.remark, remark, 159);
-
-	/* set extract wesn,pad and complex */
-	w = 0.0;
-	e = 0.0;
-	s = 0.0;
-	n = 0.0;
-	for (i=0;i<4;i++)
-		pad[i] = 0;
-
-	/* allocate memory for output array */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,grd.nx*grd.ny*sizeof(float),(void **)&a,error);
-	if (*error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-		fprintf(stderr,"\nMBIO Error allocating output arrays.\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, error);
-		exit(status);
-		}
-
-	/* copy grid to new array and write it to GMT netCDF grd file */
-	if (status == MB_SUCCESS)
-		{
-		/* copy grid to new array */
-		for (i=0;i<grd.nx;i++)
-			for (j=0;j<grd.ny;j++)
-				{
-				kg = i*grd.ny+j;
-				ka = (grd.ny-1-j)*grd.nx+i;
-				a[ka] = grid[kg];
-				}
-
-		/* write the GMT netCDF grd file */
-		GMT_write_grd(outfile, &grd, a, w, e, s, n, pad, FALSE);
-
-		/* free memory for output array */
-		mb_freed(verbose,__FILE__, __LINE__, (void **) &a, error);
-		}
-
-	/* free GMT memory */
-	GMT_free ((void *)GMT_io.skip_if_NaN);
-	GMT_free ((void *)GMT_io.in_col_type);
-	GMT_free ((void *)GMT_io.out_col_type);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbclean.c b/src/utilities/mbclean.c
index 7968ed1..2ca6e2b 100644
--- a/src/utilities/mbclean.c
+++ b/src/utilities/mbclean.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbclean.c	2/26/93
- *    $Id: mbclean.c 2217 2014-12-02 02:39:28Z caress $
+ *    $Id: mbclean.c 2240 2015-05-08 22:52:11Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -75,8 +75,6 @@
 /* local defines */
 #define	MBCLEAN_FLAG_ONE	1
 #define	MBCLEAN_FLAG_BOTH	2
-#define	MBCLEAN_ZERO_ONE	3
-#define	MBCLEAN_ZERO_BOTH	4
 
 /* MBIO buffer size default */
 #define	MBCLEAN_BUFFER_DEFAULT	500
@@ -117,7 +115,7 @@ struct bad_struct
 int mbclean_save_edit(int verbose, FILE *sofp, double time_d, int beam,
 			int action, int *error);
 
-static char rcs_id[] = "$Id: mbclean.c 2217 2014-12-02 02:39:28Z caress $";
+static char rcs_id[] = "$Id: mbclean.c 2240 2015-05-08 22:52:11Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -211,7 +209,6 @@ int main (int argc, char **argv)
 	int	nspiketot = 0;
 	int	nflagtot = 0;
 	int	nunflagtot = 0;
-	int	nzerotot = 0;
 	int	nflagesftot = 0;
 	int	nunflagesftot = 0;
 	int	nzeroesftot = 0;
@@ -234,7 +231,6 @@ int main (int argc, char **argv)
 	int	nspike = 0;
 	int	nflag = 0;
 	int	nunflag = 0;
-	int	nzero = 0;
 	int	nflagesf = 0;
 	int	nunflagesf = 0;
 	int	nzeroesf = 0;
@@ -672,15 +668,12 @@ int main (int argc, char **argv)
 			error = MB_ERROR_NO_ERROR;
 			}
 
-		/* check that clean mode is allowed
-			for the specified data format */
-		if (beam_flagging == MB_NO && mode <= 2)
+		/* warn if beam flagging not supported for the current data format */
+		if (beam_flagging == MB_NO)
 			{
-			fprintf(stderr,"\nMBIO format %d does not allow flagging of bad data \nas negative numbers (specified by cleaning mode %d).\n",format,mode);
-			fprintf(stderr,"\nCopy the data to another format or set the cleaning mode to zero \nbad data values (-M3 or -M4).\n");
-			fprintf(stderr,"\nFile <%s> skipped by program <%s>\n",
-				swathfile,program_name);
-			oktoprocess = MB_NO;
+			fprintf(stderr,"\nWarning:\nMBIO format %d does not allow flagging of bad bathymetry data.\n",format);
+			fprintf(stderr,"\nWhen mbprocess applies edits to file:\n\t%s\nthe soundings will be nulled (zeroed) rather than flagged.\n",
+				swathfile);
 			}
 
 		/* try to lock file */
@@ -774,7 +767,6 @@ int main (int argc, char **argv)
 			nspike = 0;
 			nflag = 0;
 			nunflag = 0;
-			nzero = 0;
 			nflagesf = 0;
 			nunflagesf = 0;
 			nzeroesf = 0;
@@ -926,7 +918,6 @@ int main (int argc, char **argv)
 				fprintf(stderr,"dbg2    npike;          %d\n",nspike);
 				fprintf(stderr,"dbg2    nflag:          %d\n",nflag);
 				fprintf(stderr,"dbg2    nunflag:        %d\n",nunflag);
-				fprintf(stderr,"dbg2    nzero:          %d\n",nzero);
 				}
 			    if (status == MB_SUCCESS && kind == MB_DATA_DATA)
 				{
@@ -951,24 +942,27 @@ int main (int argc, char **argv)
 						    &mtodeglon,&mtodeglat);
 				headingx = sin(ping[nrec].heading*DTR);
 				headingy = cos(ping[nrec].heading*DTR);
-				for (i=0;i<ping[nrec].beams_bath;i++)
+				for (j=0;j<=nrec;j++)
 					{
-					ping[nrec].bathx[i] = (ping[nrec].navlon
-							    - ping[nrec].navlon) / mtodeglon
-							+ headingy * ping[nrec].bathacrosstrack[i];
-					ping[nrec].bathy[i] = (ping[nrec].navlat
-							    - ping[nrec].navlat) / mtodeglat
-							- headingx * ping[nrec].bathacrosstrack[i];
+					for (i=0;i<ping[j].beams_bath;i++)
+						{
+						ping[j].bathx[i] = (ping[j].navlon - ping[0].navlon) / mtodeglon
+							+ headingy * ping[j].bathacrosstrack[i]
+							+ headingx * ping[j].bathalongtrack[i];
+						ping[j].bathy[i] = (ping[j].navlat - ping[0].navlat) / mtodeglat
+							- headingx * ping[j].bathacrosstrack[i]
+							+ headingy * ping[j].bathalongtrack[i];
+						}
 					}
 				if (verbose >= 2)
 					{
-					fprintf(stderr,"\ndbg2  center beam locations:\n");
-					for (j=0;j<nrec;j++)
-						{
-						fprintf(stderr,"dbg2    ping[%d] x:%f    y:%f\n",
-								j,ping[j].bathx[ping[j].beams_bath/2],
-								ping[j].bathy[ping[j].beams_bath/2]);
-						}
+					fprintf(stderr,"\ndbg2  beam locations (ping:beam xxx.xxx yyy.yyy)\n");
+					for (j=0;j<=nrec;j++)
+						for (i=0;i<ping[j].beams_bath;i++)
+							{
+							fprintf(stderr,"dbg2    %d:%3.3d %10.3f %10.3f\n",
+									j, i, ping[j].bathx[i], ping[j].bathy[i]);
+							}
 					}
 
 				/* if requested set all edit timestamps within tolerance of
@@ -1030,25 +1024,13 @@ int main (int argc, char **argv)
 									ping[irec].time_i[5],
 									ping[irec].time_i[6],
 									i,ping[irec].bath[i]);
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[i]
-									    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nouterbeams++;
-								nflag++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[i] = MB_FLAG_NULL;
-								nouterbeams++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
+							ping[irec].beamflag[i]
+								    = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nouterbeams++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					for (i=0;i<MIN(zap_beams_right, center);i++)
@@ -1067,25 +1049,13 @@ int main (int argc, char **argv)
 									ping[irec].time_i[5],
 									ping[irec].time_i[6],
 									j,ping[irec].bath[j]);
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[j]
-								    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nouterbeams++;
-								nflag++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[j] = MB_FLAG_NULL;
-								nouterbeams++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
+							ping[irec].beamflag[j]
+							    = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nouterbeams++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					}
@@ -1110,25 +1080,13 @@ int main (int argc, char **argv)
 									ping[irec].time_i[5],
 									ping[irec].time_i[6],
 									i,ping[irec].bath[i]);
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[i]
-									    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nouterdistance++;
-								nflag++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[i] = MB_FLAG_NULL;
-								nouterdistance++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
+							ping[irec].beamflag[i]
+								    = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nouterdistance++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					}
@@ -1151,24 +1109,12 @@ int main (int argc, char **argv)
 						for (i=0;i<ping[irec].beams_bath;i++)
 							{
 							find_bad = MB_YES;
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nspeed++;
-								nflag++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d, 
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR, 
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[i] = MB_FLAG_NULL;
-								nspeed++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d, 
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR, 
-										MBP_EDIT_ZERO, &error);
-								}
+							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nspeed++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d, 
+									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR, 
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					}
@@ -1249,25 +1195,13 @@ int main (int argc, char **argv)
 								ping[irec].time_i[6],
 								i,ping[irec].bath[i]);
 							find_bad = MB_YES;
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								ndepthrange++;
-								nflag++;
-	    
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[i] = MB_FLAG_NULL;
-								ndepthrange++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
+							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							ndepthrange++;
+							nflag++;
+    
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					}
@@ -1295,25 +1229,12 @@ int main (int argc, char **argv)
 								ping[irec].time_i[6],
 								i,ping[irec].bath[i]);
 							find_bad = MB_YES;
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nminrange++;
-								nflag++;
-	    
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[i] = MB_FLAG_NULL;
-								nminrange++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
+							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nminrange++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					}
@@ -1345,25 +1266,12 @@ int main (int argc, char **argv)
 								ping[irec].time_i[6],
 								i,ping[irec].bath[i]);
 							find_bad = MB_YES;
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nmax_heading_rate++;
-								nflag++;
-  
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[i] = MB_FLAG_NULL;
-								nmax_heading_rate++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
+							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nmax_heading_rate++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					}
@@ -1391,25 +1299,12 @@ int main (int argc, char **argv)
 								ping[irec].time_i[6],
 								i,ping[irec].bath[i]);
 							find_bad = MB_YES;
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[j] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nrail++;
-								nflag++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[j] = MB_FLAG_NULL;
-								nrail++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
-
+							ping[irec].beamflag[j] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nrail++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						else
 							highdist = ping[irec].bathacrosstrack[j];
@@ -1429,26 +1324,12 @@ int main (int argc, char **argv)
 								ping[irec].time_i[5],
 								ping[irec].time_i[6],
 								i,ping[irec].bath[i]);
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[k] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nrail++;
-								nflag++;
-
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										k + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[k] = MB_FLAG_NULL;
-								nrail++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										k + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
-
+							ping[irec].beamflag[k] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nrail++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									k + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						else
 							lowdist = ping[irec].bathacrosstrack[k];
@@ -1477,25 +1358,12 @@ int main (int argc, char **argv)
 								ping[irec].time_i[5],
 								ping[irec].time_i[6],
 								i,ping[irec].bath[i]);
-							if (mode <= 2)
-								{
-								ping[irec].beamflag[j] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nlong_across++;
-								nflag++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							else
-								{
-								ping[irec].beamflag[j] = MB_FLAG_NULL;
-								nlong_across++;
-								nzero++;
-								mb_ess_save(verbose, &esf, ping[irec].time_d,
-										j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
-
+							ping[irec].beamflag[j] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+							nlong_across++;
+							nflag++;
+							mb_ess_save(verbose, &esf, ping[irec].time_d,
+									j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+									MBP_EDIT_FILTER, &error);
 							}
 						}
 					}
@@ -1553,37 +1421,25 @@ int main (int argc, char **argv)
 						{
 						if (ping[irec].bath[i]/median < fraction_low
 						    || ping[irec].bath[i]/median > fraction_high)
-						    {
-						    if (verbose >= 1)
-							fprintf(stderr,"f: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f\n",
-							    ping[irec].time_i[0],
-							    ping[irec].time_i[1],
-							    ping[irec].time_i[2],
-							    ping[irec].time_i[3],
-							    ping[irec].time_i[4],
-							    ping[irec].time_i[5],
-							    ping[irec].time_i[6],
-							    i,ping[irec].bath[i],median);
-						    find_bad = MB_YES;
-						    if (mode <= 2)
 							{
+							if (verbose >= 1)
+							    fprintf(stderr,"f: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f\n",
+								ping[irec].time_i[0],
+								ping[irec].time_i[1],
+								ping[irec].time_i[2],
+								ping[irec].time_i[3],
+								ping[irec].time_i[4],
+								ping[irec].time_i[5],
+								ping[irec].time_i[6],
+								i,ping[irec].bath[i],median);
+							find_bad = MB_YES;
 							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
 							nfraction++;
 							nflag++;
 							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
+								    i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
+								    MBP_EDIT_FILTER, &error);
 							}
-						    else
-							{
-							ping[irec].beamflag[i] = MB_FLAG_NULL;
-							nfraction++;
-							nzero++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_ZERO, &error);
-							}
-						    }
 						}
 
 					    /* check absolute deviation from median if desired */
@@ -1591,20 +1447,18 @@ int main (int argc, char **argv)
 						&& median > 0.0)
 						{
 						if (fabs(ping[irec].bath[i] - median) > deviation_max)
-						    {
-						    if (verbose >= 1)
-						    fprintf(stderr,"a: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f\n",
-							ping[irec].time_i[0],
-							ping[irec].time_i[1],
-							ping[irec].time_i[2],
-							ping[irec].time_i[3],
-							ping[irec].time_i[4],
-							ping[irec].time_i[5],
-							ping[irec].time_i[6],
-							i,ping[irec].bath[i],median);
-						    find_bad = MB_YES;
-						    if (mode <= 2)
 							{
+							if (verbose >= 1)
+							fprintf(stderr,"a: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f\n",
+							    ping[irec].time_i[0],
+							    ping[irec].time_i[1],
+							    ping[irec].time_i[2],
+							    ping[irec].time_i[3],
+							    ping[irec].time_i[4],
+							    ping[irec].time_i[5],
+							    ping[irec].time_i[6],
+							    i,ping[irec].bath[i],median);
+							find_bad = MB_YES;
 							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
 							ndeviation++;
 							nflag++;
@@ -1612,16 +1466,6 @@ int main (int argc, char **argv)
 									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
 									MBP_EDIT_FILTER, &error);
 							}
-						    else
-							{
-							ping[irec].beamflag[i] = MB_FLAG_NULL;
-							ndeviation++;
-							nzero++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_ZERO, &error);
-							}
-						    }
 						}
 
 					    /* check spikes - acrosstrack */
@@ -1662,23 +1506,10 @@ int main (int argc, char **argv)
 								  {
 								    nspike++;
 								    nflag++;
-								    if (mode == MBCLEAN_FLAG_ONE
-									|| mode == MBCLEAN_FLAG_BOTH)
-								      {
-									ping[irec].beamflag[i]
-									  = MB_FLAG_FLAG + MB_FLAG_FILTER;
-									mb_ess_save(verbose, &esf, ping[irec].time_d,
+								    ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+								    mb_ess_save(verbose, &esf, ping[irec].time_d,
 											i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
 											MBP_EDIT_FILTER, &error);
-								      }
-								    else if (mode == MBCLEAN_ZERO_ONE
-									|| mode == MBCLEAN_ZERO_BOTH)
-								      {
-									ping[irec].beamflag[i] = MB_FLAG_NULL;
-									mb_ess_save(verbose, &esf, ping[irec].time_d,
-											i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-											MBP_EDIT_ZERO, &error);
-								      }
 								    if (verbose >= 1)
 								      {
 									if (verbose >= 2)
@@ -1735,23 +1566,10 @@ int main (int argc, char **argv)
 								  {
 								    nspike++;
 								    nflag++;
-								    if (mode == MBCLEAN_FLAG_ONE
-									|| mode == MBCLEAN_FLAG_BOTH)
-								      {
-									ping[1].beamflag[i]
-									  = MB_FLAG_FLAG + MB_FLAG_FILTER;
-									mb_ess_save(verbose, &esf, ping[1].time_d,
+								    ping[1].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
+								    mb_ess_save(verbose, &esf, ping[1].time_d,
 											i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
 											MBP_EDIT_FILTER, &error);
-								      }
-								    else if (mode == MBCLEAN_ZERO_ONE
-									|| mode == MBCLEAN_ZERO_BOTH)
-								      {
-									ping[1].beamflag[i] = MB_FLAG_NULL;
-									mb_ess_save(verbose, &esf, ping[1].time_d,
-											i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-											MBP_EDIT_ZERO, &error);
-								      }
 								    if (verbose >= 1)
 								      {
 									if (verbose >= 2)
@@ -1825,7 +1643,7 @@ int main (int argc, char **argv)
 										i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
 										MBP_EDIT_FILTER, &error);
 								}
-							    else if (mode == MBCLEAN_FLAG_ONE)
+							    else
 								{
 								if (fabs((double)ping[j].bath[k]-median)
 								> fabs((double)ping[1].bath[i]-median))
@@ -1857,58 +1675,6 @@ int main (int argc, char **argv)
 								nbad++;
 								nflag++;
 								}
-							    else if (mode == MBCLEAN_ZERO_BOTH)
-								{
-								bad[0].flag = MB_YES;
-								bad[0].ping = j;
-								bad[0].beam = k;
-								bad[0].bath = ping[j].bath[k];
-								bad[1].flag = MB_YES;
-								bad[1].ping = 1;
-								bad[1].beam = i;
-								bad[1].bath = ping[1].bath[i];
-								ping[j].beamflag[k] = MB_FLAG_NULL;
-								ping[1].beamflag[i] = MB_FLAG_NULL;
-								nbad++;
-								nzero = nzero + 2;
-								mb_ess_save(verbose, &esf, ping[j].time_d,
-										k + ping[j].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								mb_ess_save(verbose, &esf, ping[1].time_d,
-										i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								}
-							    else if (mode == MBCLEAN_ZERO_ONE)
-								{
-								if (fabs((double)ping[j].bath[k]-median)
-								> fabs((double)ping[1].bath[i]-median))
-								    {
-								    bad[0].flag = MB_YES;
-								    bad[0].ping = j;
-								    bad[0].beam = k;
-								    bad[0].bath = ping[j].bath[k];
-								    bad[1].flag = MB_NO;
-								    ping[j].beamflag[k] = MB_FLAG_NULL;
-								    mb_ess_save(verbose, &esf, ping[j].time_d,
-						    				k + ping[j].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								    }
-								else
-								    {
-								    bad[0].flag = MB_YES;
-								    bad[0].ping = 1;
-								    bad[0].beam = i;
-								    bad[0].bath = ping[1].bath[i];
-								    bad[1].flag = MB_NO;
-
-								    ping[1].beamflag[i] = MB_FLAG_NULL;
-								    mb_ess_save(verbose, &esf, ping[1].time_d,
-						    				i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_ZERO, &error);
-								    }
-								nbad++;
-								nzero++;
-								}
 							    }
 							if (verbose >= 1 && slope > slopemax
 								&& dd > distancemin * median
@@ -1970,7 +1736,7 @@ int main (int argc, char **argv)
 					find_bad = MB_YES;
 					for (i=0;i<center;i++)
 					    {
-					    if (mb_beam_ok(ping[irec].beamflag[i]) && mode <= 2)
+					    if (mb_beam_ok(ping[irec].beamflag[i]))
 						{
 						if (verbose >= 1)
 						fprintf(stderr,"n: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %3d %3d\n",
@@ -1991,26 +1757,6 @@ int main (int argc, char **argv)
 								i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
 								MBP_EDIT_FILTER, &error);
 						}
-					    else if (mb_beam_ok(ping[irec].beamflag[i]))
-						{
-						if (verbose >= 1)
-						fprintf(stderr,"n: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %3d %3d\n",
-						    ping[irec].time_i[0],
-						    ping[irec].time_i[1],
-						    ping[irec].time_i[2],
-						    ping[irec].time_i[3],
-						    ping[irec].time_i[4],
-						    ping[irec].time_i[5],
-						    ping[irec].time_i[6],
-						    i,ping[irec].bath[i],
-						    num_good, num_good_min);
-						ping[irec].beamflag[i] = MB_FLAG_NULL;
-						nmin++;
-						nzero++;
-						mb_ess_save(verbose, &esf, ping[irec].time_d,
-								i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-								MBP_EDIT_ZERO, &error);
-						}
 					    }
 					}
 
@@ -2026,7 +1772,7 @@ int main (int argc, char **argv)
 					find_bad = MB_YES;
 					for (i=center+1;i<ping[irec].beams_bath;i++)
 					    {
-					    if (mb_beam_ok(ping[irec].beamflag[i]) && mode <= 2)
+					    if (mb_beam_ok(ping[irec].beamflag[i]))
 						{
 						if (verbose >= 1)
 						fprintf(stderr,"n: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %3d %3d\n",
@@ -2047,26 +1793,6 @@ int main (int argc, char **argv)
 								i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
 								MBP_EDIT_FILTER, &error);
 						}
-					    else if (mb_beam_ok(ping[irec].beamflag[i]))
-						{
-						if (verbose >= 1)
-						fprintf(stderr,"n: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %3d %3d\n",
-						    ping[irec].time_i[0],
-						    ping[irec].time_i[1],
-						    ping[irec].time_i[2],
-						    ping[irec].time_i[3],
-						    ping[irec].time_i[4],
-						    ping[irec].time_i[5],
-						    ping[irec].time_i[6],
-						    i,ping[irec].bath[i],
-						    num_good, num_good_min);
-						ping[irec].beamflag[i] = MB_FLAG_NULL;
-						nmin++;
-						nzero++;
-						mb_ess_save(verbose, &esf, ping[irec].time_d,
-								i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-								MBP_EDIT_ZERO, &error);
-						}
 					    }
 					}
 				    }
@@ -2126,16 +1852,13 @@ int main (int argc, char **argv)
 				    ping[j].beams_bath = ping[j+1].beams_bath;
 				    for (i=0;i<ping[j].beams_bath;i++)
 					{
-					ping[j].beamflag[i] =
-						ping[j+1].beamflag[i];
-					ping[j].beamflagorg[i] =
-						ping[j+1].beamflagorg[i];
-					ping[j].bath[i] =
-						ping[j+1].bath[i];
-					ping[j].bathacrosstrack[i] =
-						ping[j+1].bathacrosstrack[i];
-					ping[j].bathalongtrack[i] =
-						ping[j+1].bathalongtrack[i];
+					ping[j].beamflag[i] = ping[j+1].beamflag[i];
+					ping[j].beamflagorg[i] = ping[j+1].beamflagorg[i];
+					ping[j].bath[i] = ping[j+1].bath[i];
+					ping[j].bathacrosstrack[i] = ping[j+1].bathacrosstrack[i];
+					ping[j].bathalongtrack[i] = ping[j+1].bathalongtrack[i];
+					ping[j].bathx[i] = ping[j+1].bathx[i];
+					ping[j].bathy[i] = ping[j+1].bathy[i];
 					}
 				    }
 				}
@@ -2204,7 +1927,6 @@ i,esf.edit_time_d[i],esf.edit_beam[i],esf.edit_action[i],esf.edit_use[i]);
 			nspiketot += nspike;
 			nflagtot += nflag;
 			nunflagtot += nunflag;
-			nzerotot += nzero;
 
 			/* give the statistics */
 			if (verbose >= 0)
@@ -2232,7 +1954,6 @@ i,esf.edit_time_d[i],esf.edit_beam[i],esf.edit_action[i],esf.edit_use[i]);
 				fprintf(stderr,"%d excessive spikes identified\n",nspike);
 				fprintf(stderr,"%d beams flagged\n",nflag);
 				fprintf(stderr,"%d beams unflagged\n",nunflag);
-				fprintf(stderr,"%d beams zeroed\n",nzero);
 				}
 			}
 
@@ -2282,7 +2003,6 @@ i,esf.edit_time_d[i],esf.edit_beam[i],esf.edit_action[i],esf.edit_use[i]);
 		fprintf(stderr,"%d total excessive slopes identified\n",nbadtot);
 		fprintf(stderr,"%d total beams flagged\n",nflagtot);
 		fprintf(stderr,"%d total beams unflagged\n",nunflagtot);
-		fprintf(stderr,"%d total beams zeroed\n",nzerotot);
 		}
 
 	/* set program status */
diff --git a/src/utilities/mbcopy.c b/src/utilities/mbcopy.c
index e2f7cd9..f01fd1e 100644
--- a/src/utilities/mbcopy.c
+++ b/src/utilities/mbcopy.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbcopy.c	2/4/93
- *    $Id: mbcopy.c 2192 2014-07-07 14:32:05Z caress $
+ *    $Id: mbcopy.c 2224 2015-02-04 19:14:05Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,166 +23,6 @@
  * Author:	D. W. Caress
  * Date:	February 4, 1993
  *
- * $Log: mbcopy.c,v $
- * Revision 5.28  2009/03/02 18:54:40  caress
- * Fixed pixel size problems with mbmosaic, resurrected program mbfilter, and also updated copyright dates in several source files.
- *
- * Revision 5.27  2008/12/05 17:32:52  caress
- * Check-in mods 5 December 2008 including contributions from Gordon Keith.
- *
- * Revision 5.26  2008/07/10 18:16:33  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.24  2007/11/16 17:53:02  caress
- * Fixes applied.
- *
- * Revision 5.23  2007/10/31 18:41:42  caress
- * Fixed handling of null sidescan values.
- *
- * Revision 5.22  2007/10/17 20:32:26  caress
- * Release 5.1.1beta11
- * Added Gordon Keith mods to merge bathy from third file.
- *
- * Revision 5.21  2007/05/21 16:15:11  caress
- * Fixed translation to and from XSE format.
- *
- * Revision 5.20  2006/09/11 18:55:53  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.19  2006/03/06 21:47:02  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.18  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.17  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.16  2005/03/25 04:42:59  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.15  2004/09/16 01:00:01  caress
- * Fixed copyright.
- *
- * Revision 5.14  2003/12/10 02:18:04  caress
- * Fixed bug in which pings could not be found inbounds when a timegap error occurred.
- *
- * Revision 5.13  2003/11/24 22:56:20  caress
- * Added inbounds check so that ancillary data records are only output when the last survey record was within the specified or default time and space bounds. This should allow time and space windowing for data formats containing large numbers of ancillary records.
- *
- * Revision 5.12  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.11  2002/07/20 20:56:55  caress
- * Release 5.0.beta20
- *
- * Revision 5.10  2002/05/29 23:43:09  caress
- * Release 5.0.beta18
- *
- * Revision 5.9  2002/05/02 04:01:37  caress
- * Release 5.0.beta17
- *
- * Revision 5.8  2002/04/06 02:53:45  caress
- * Release 5.0.beta16
- *
- * Revision 5.7  2001/08/25 00:58:08  caress
- * Fixed problem with simrad to simrad2 function.
- *
- * Revision 5.6  2001/07/20  00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.5  2001/06/30  17:42:04  caress
- * Release 5.0.beta02
- *
- * Revision 5.4  2001/06/29  22:50:23  caress
- * Atlas Hydrosweep DS2 raw data and SURF data formats.
- *
- * Revision 5.3  2001/06/08  21:45:46  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/06/03  07:07:34  caress
- * Release 5.0.beta01.
- *
- * Revision 5.1  2001/03/22 21:14:16  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.15  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.14  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.13  1999/08/16  23:13:42  caress
- * Fixed pointer casting bug in elac data copying.
- *
- * Revision 4.12  1999/08/08  04:17:40  caress
- * Added ability to copy between old and new Elac formats.
- *
- * Revision 4.11  1999/04/21 05:44:42  caress
- * Fixed error printing.
- *
- * Revision 4.10  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1997/04/17  15:14:38  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.8  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/01/26  21:25:58  caress
- * Version 4.3 distribution
- *
- * Revision 4.6  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.5  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/03/02  13:49:21  caress
- * Fixed bug related to error messages.
- *
- * Revision 4.3  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  19:02:56  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * using unix second time base.
- *
- * Revision 4.1  1994/03/12  01:44:37  caress
- * Added declarations of ctime and/or getenv for compatability
- * with SGI compilers.
- *
- * Revision 4.1  1994/03/12  01:44:37  caress
- * Added declarations of ctime and/or getenv for compatability
- * with SGI compilers.
- *
- * Revision 4.0  1994/03/06  00:13:22  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/05  22:49:18  caress
- * Fixed significant bug - output arrays were allocated to
- * size of input arrays.  Also added zeroing of beam/pixel
- * values not set in copying from one system to another.
- *
- * Revision 4.0  1994/03/01  18:59:27  caress
- * First cut at new version. Any changes are associated with
- * support of three data types (beam bathymetry, beam amplitude,
- * and sidescan) instead of two (bathymetry and backscatter).
- *
- * Revision 3.1  1993/06/14  17:53:29  caress
- * Fixed stripcomments option so it does what the man page says.
- *
- * Revision 3.0  1993/05/04  22:25:09  dale
- * Initial version.
  *
  */
 
@@ -204,9 +44,7 @@
 #include "mbsys_simrad.h"
 #include "mbsys_simrad2.h"
 #include "mbsys_ldeoih.h"
-#ifdef WITH_GSF
-#  include "mbsys_gsf.h"
-#endif
+#include "mbsys_gsf.h"
 #include "mbsys_hsds.h"
 #include "mbsys_reson8k.h"
 
@@ -217,9 +55,7 @@
 #define	MBCOPY_XSE_TO_ELACMK2		3
 #define	MBCOPY_SIMRAD_TO_SIMRAD2	4
 #define	MBCOPY_ANY_TO_MBLDEOIH		5
-#ifdef WITH_GSF
-#  define	MBCOPY_RESON8K_TO_GSF		6
-#endif
+#define	MBCOPY_RESON8K_TO_GSF		6
 
 /* function prototypes */
 int setup_transfer_rules(int verbose, int ibeams, int obeams,
@@ -256,14 +92,12 @@ int mbcopy_any_to_mbldeoih(int verbose,
 		char *comment,
 		void *ombio_ptr, void *ostore_ptr,
 		int *error);
-#ifdef WITH_GSF
 int mbcopy_reson8k_to_gsf(int verbose,
 		void *imbio_ptr,
 		void *ombio_ptr,
 		int *error);
-#endif
 
-static char rcs_id[] = "$Id: mbcopy.c 2192 2014-07-07 14:32:05Z caress $";
+static char rcs_id[] = "$Id: mbcopy.c 2224 2015-02-04 19:14:05Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -739,16 +573,13 @@ int main (int argc, char **argv)
 	else if (pings == 1
 		&& omb_io_ptr->format == MBF_MBLDEOIH)
 		copymode = MBCOPY_ANY_TO_MBLDEOIH;
-#ifdef WITH_GSF
 	else if (pings == 1
 		&& imb_io_ptr->format == MBF_XTFR8101
 		&& omb_io_ptr->format ==  MBF_GSFGENMB )
 		copymode = MBCOPY_RESON8K_TO_GSF;
-#endif
 	else
 		copymode = MBCOPY_PARTIAL;
 
-#ifdef WITH_GSF
 	/* quit if an unsupported copy to GSF is requested */
 	if (omb_io_ptr->format == MBF_GSFGENMB && copymode == MBCOPY_PARTIAL)
 		{
@@ -758,7 +589,6 @@ int main (int argc, char **argv)
 		fprintf(stderr,"\tand contributing it to the MB-System community\n");
 		exit(error);
 		}
-#endif
 
 	/* print debug statements */
 	if (verbose >= 2)
@@ -1320,7 +1150,6 @@ int main (int argc, char **argv)
 			status = mbcopy_simrad_to_simrad2(verbose,
 				    istore_ptr, ostore_ptr, &error);
 			}
-#ifdef WITH_GSF
 		else if (copymode == MBCOPY_RESON8K_TO_GSF
 			&& error == MB_ERROR_NO_ERROR)
 			{
@@ -1329,7 +1158,6 @@ int main (int argc, char **argv)
 			status = mbcopy_reson8k_to_gsf(verbose,
 				    imbio_ptr, ombio_ptr, &error);
 			}
-#endif
 		else if (copymode == MBCOPY_ANY_TO_MBLDEOIH
 			&& error == MB_ERROR_NO_ERROR)
 			{
@@ -1426,9 +1254,7 @@ int main (int argc, char **argv)
 		    case MBCOPY_SIMRAD_TO_SIMRAD2:
 		    case MBCOPY_ELACMK2_TO_XSE:
 		    case MBCOPY_XSE_TO_ELACMK2:
-#ifdef WITH_GSF
 		    case MBCOPY_RESON8K_TO_GSF:
-#endif
 		      status = mb_insert(verbose, ombio_ptr, ostore_ptr,
 						kind, time_i, time_d,
 						navlon, navlat, speed, heading,
@@ -3086,7 +2912,6 @@ int mbcopy_any_to_mbldeoih(int verbose,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-#ifdef WITH_GSF
 int mbcopy_reson8k_to_gsf(int verbose,
 		void *imbio_ptr,
 		void *ombio_ptr,
@@ -3448,5 +3273,4 @@ int mbcopy_reson8k_to_gsf(int verbose,
 	/* return status */
 	return(status);
 }
-#endif
 /*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbctdlist.c b/src/utilities/mbctdlist.c
index e757e59..e7c9daf 100644
--- a/src/utilities/mbctdlist.c
+++ b/src/utilities/mbctdlist.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbctdlist.c	9/14/2008
- *    $Id: mbctdlist.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbctdlist.c 2251 2015-07-01 01:02:06Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -61,7 +61,7 @@ int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error);
 /* NaN value */
 double	NaN;
 
-static char rcs_id[] = "$Id: mbctdlist.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbctdlist.c 2251 2015-07-01 01:02:06Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -188,6 +188,7 @@ int main (int argc, char **argv)
 	int	first_u = MB_YES;
 	time_t	time_u;
 	time_t	time_u_ref;
+	double	seconds;
 
 	/* course calculation variables */
 	double	dlon, dlat, minutes;
@@ -895,12 +896,13 @@ int main (int argc, char **argv)
 									break;
 								case 'J': /* time string */
 									mb_get_jtime(verbose,time_i,time_j);
+									seconds = time_i[5] + 0.000001 * time_i[6];
 									if (ascii == MB_YES)
 									    {
-									    printf("%.4d %.3d %.2d %.2d %.2d.%6.6d",
+									    printf("%.4d %.3d %.2d %.2d %9.6f",
 										time_j[0],time_j[1],
 										time_i[3],time_i[4],
-										time_i[5],time_i[6]);
+										seconds);
 									    }
 									else
 									    {
@@ -920,11 +922,12 @@ int main (int argc, char **argv)
 									break;
 								case 'j': /* time string */
 									mb_get_jtime(verbose,time_i,time_j);
+									seconds = time_i[5] + 0.000001 * time_i[6];
 									if (ascii == MB_YES)
 									    {
-									    printf("%.4d %.3d %.4d %.2d.%6.6d",
+									    printf("%.4d %.3d %.4d %9.6f",
 										time_j[0],time_j[1],
-										time_j[2],time_j[3],time_j[4]);
+										time_j[2],seconds);
 									    }
 									else
 									    {
@@ -1005,11 +1008,11 @@ int main (int argc, char **argv)
 										}
 									break;
 								case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
+									seconds = time_i[5] + 1e-6 * time_i[6];
 									if (ascii == MB_YES)
-									    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%.2d.%.6d",
+									    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
 										time_i[0],time_i[1],time_i[2],
-										time_i[3],time_i[4],time_i[5],
-										time_i[6]);
+										time_i[3],time_i[4],seconds);
 									else
 									    {
 									    b = time_i[0];
@@ -1022,16 +1025,16 @@ int main (int argc, char **argv)
 									    fwrite(&b, sizeof(double), 1, stdout);
 									    b = time_i[4];
 									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[5] + 1e-6 * time_i[6];
+									    b = seconds;
 									    fwrite(&b, sizeof(double), 1, stdout);
 									    }
 									break;
 								case 't': /* yyyy mm dd hh mm ss time string */
+									seconds = time_i[5] + 1e-6 * time_i[6];
 									if (ascii == MB_YES)
-									    printf("%.4d %.2d %.2d %.2d %.2d %.2d.%.6d",
+									    printf("%.4d %.2d %.2d %.2d %.2d %9.6f",
 										time_i[0],time_i[1],time_i[2],
-										time_i[3],time_i[4],time_i[5],
-										time_i[6]);
+										time_i[3],time_i[4],seconds);
 									else
 									    {
 									    b = time_i[0];
@@ -1044,7 +1047,7 @@ int main (int argc, char **argv)
 									    fwrite(&b, sizeof(double), 1, stdout);
 									    b = time_i[4];
 									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[5] + 1e-6 * time_i[6];
+									    b = seconds;
 									    fwrite(&b, sizeof(double), 1, stdout);
 									    }
 									break;
diff --git a/src/utilities/mbdatalist.c b/src/utilities/mbdatalist.c
index bccecb5..923dd94 100644
--- a/src/utilities/mbdatalist.c
+++ b/src/utilities/mbdatalist.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbdatalist.c	10/10/2001
- *    $Id: mbdatalist.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbdatalist.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -74,7 +74,7 @@
 #include "mb_status.h"
 #include "mb_process.h"
 
-static char rcs_id[] = "$Id: mbdatalist.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbdatalist.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbdefaults.c b/src/utilities/mbdefaults.c
index 70419be..0b1680f 100644
--- a/src/utilities/mbdefaults.c
+++ b/src/utilities/mbdefaults.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbdefaults.c	1/23/93
- *	$Id: mbdefaults.c 2204 2014-09-06 02:34:58Z caress $
+ *	$Id: mbdefaults.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -53,7 +53,7 @@
 #define	MBV_SHADE_VIEW_SLOPE		2
 #define	MBV_SHADE_VIEW_OVERLAY		3
 
-static char rcs_id[]="$Id: mbdefaults.c 2204 2014-09-06 02:34:58Z caress $";
+static char rcs_id[]="$Id: mbdefaults.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbdumpesf.c b/src/utilities/mbdumpesf.c
index 7b598c4..6bac55e 100644
--- a/src/utilities/mbdumpesf.c
+++ b/src/utilities/mbdumpesf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbdumpesf.c	3/20/2008
- *    $Id: mbdumpesf.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbdumpesf.c 2239 2015-05-07 00:51:42Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -20,17 +20,12 @@
  * Author:	D. W. Caress
  * Date:	March 20, 2008
  *
- * $Log: mbdumpesf.c,v $
- * Revision 5.0  2008/05/26 03:27:31  caress
- * Program for dumping edit events from edit save files.
- *
- *
- *
  */
 
 /* standard include files */
 #include <stdio.h>
 #include <stdlib.h>
+#include <getopt.h>
 #include <unistd.h>
 #include <math.h>
 #include <string.h>
@@ -44,7 +39,10 @@
 #include "mb_process.h"
 #include "mb_swap.h"
 
-static char rcs_id[] = "$Id: mbdumpesf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbdumpesf.c 2239 2015-05-07 00:51:42Z caress $";
+
+#define OUTPUT_TEXT	0
+#define OUTPUT_ESF	1
 
 /*--------------------------------------------------------------------*/
 
@@ -53,10 +51,15 @@ int main (int argc, char **argv)
 	/* id variables */
 	char program_name[] = "mbdumpesf";
 	char help_message[] =  "mbdumpesf reads an MB-System edit save file and dumps the \ncontents as an ascii table to stdout.";
-	char usage_message[] = "mbdumpesf [-Iesffile -V -H]";
+	//char usage_message[] = "mbdumpesf [-Iesffile -V -H]";
+	char usage_message[] = "mbdumpesf --input=esffile\n"
+				"\t[--output=esffile --ignore-unflag --ignore-flag \n"
+				"\t--ignore-filter --ignore-zero \n"
+				"\t--verbose --help]";
 
 	/* parsing variables */
 	extern char *optarg;
+	int	option_index;
 	int	errflg = 0;
 	int	c;
 	int	help = 0;
@@ -67,9 +70,30 @@ int main (int argc, char **argv)
 	int	verbose = 0;
 	int	error = MB_ERROR_NO_ERROR;
 
-	/* MBIO read control parameters */
-	char	esffile[MB_PATH_MAXLINE];
-	FILE	*esffp = NULL;
+	/* command line option definitions */
+	/* mbdumpesf --input=esffile
+	 *		[--output=esffile --ignore-unflag --ignore-flag
+	 *		--ignore-filter --ignore-zero
+	 *		--verbose --help] */
+	static struct option options[] =
+		{
+		{"verbose",			no_argument, 		NULL, 		0},
+		{"help",			no_argument, 		NULL, 		0},
+		{"input",			required_argument, 	NULL, 		0},
+		{"output",			required_argument, 	NULL, 		0},
+		{"ignore-unflag",		no_argument, 		NULL, 		0},
+		{"ignore-flag",			no_argument, 		NULL, 		0},
+		{"ignore-filter",		no_argument, 		NULL, 		0},
+		{"ignore-zero",			no_argument, 		NULL, 		0},
+		{NULL,				0, 			NULL, 		0}
+		};
+
+	/* MBIO read and write control parameters */
+	char	iesffile[MB_PATH_MAXLINE];
+	char	oesffile[MB_PATH_MAXLINE];
+	int	omode = OUTPUT_TEXT;
+	FILE	*iesffp = NULL;
+	FILE	*oesffp = NULL;
 	struct stat file_status;
 	int	fstat;
 	int 	byteswapped;
@@ -78,10 +102,21 @@ int main (int argc, char **argv)
 	int	time_i[7];
 	int	beam;
 	int	action;
+	
+	int	ignore;
+	int	ignore_unflag = MB_NO;
+	int	ignore_flag = MB_NO;
+	int	ignore_filter = MB_NO;
+	int	ignore_zero = MB_NO;
+	
 	int	beam_flag = 0;
 	int	beam_unflag = 0;
 	int	beam_zero = 0;
 	int	beam_filter = 0;
+	int	beam_flag_ignore = 0;
+	int	beam_unflag_ignore = 0;
+	int	beam_zero_ignore = 0;
+	int	beam_filter_ignore = 0;
 
 	int	i;
 
@@ -89,9 +124,68 @@ int main (int argc, char **argv)
 	byteswapped = mb_swap_check();
 
 	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhI:i:")) != -1)
+	while ((c = getopt_long(argc, argv, "VvHhI:i:", options, &option_index)) != -1)
 	  switch (c)
 		{
+		/* long options all return c=0 */
+		case 0:
+			/* verbose */
+			if (strcmp("verbose", options[option_index].name) == 0)
+				{
+				verbose++;
+				}
+			
+			/* help */
+			else if (strcmp("help", options[option_index].name) == 0)
+				{
+				help++;
+				}
+				
+			/*-------------------------------------------------------
+			 * Define input and optional output esf file */
+			
+			/* input */
+			else if (strcmp("input", options[option_index].name) == 0)
+				{
+				strcpy(iesffile, optarg);
+				}
+			
+			/* output */
+			else if (strcmp("output", options[option_index].name) == 0)
+				{
+				strcpy(oesffile, optarg);
+				omode = OUTPUT_ESF;
+				}
+				
+			/*-------------------------------------------------------
+			 * Set special modes to ignore types of edit events,
+			 * thereby removing them from the output stream */
+			
+			/* ignore-unflag */
+			else if (strcmp("ignore-unflag", options[option_index].name) == 0)
+				{
+				ignore_unflag = MB_YES;
+				}
+			
+			/* ignore-flag */
+			else if (strcmp("ignore-flag", options[option_index].name) == 0)
+				{
+				ignore_flag = MB_YES;
+				}
+			
+			/* ignore-unflag */
+			else if (strcmp("ignore-filter", options[option_index].name) == 0)
+				{
+				ignore_filter = MB_YES;
+				}
+			
+			/* ignore-unflag */
+			else if (strcmp("ignore-zero", options[option_index].name) == 0)
+				{
+				ignore_zero = MB_YES;
+				}
+				
+			break;
 		case 'H':
 		case 'h':
 			help++;
@@ -102,7 +196,7 @@ int main (int argc, char **argv)
 			break;
 		case 'I':
 		case 'i':
-			sscanf (optarg,"%s", esffile);
+			sscanf (optarg,"%s", iesffile);
 			flag++;
 			break;
 		case '?':
@@ -142,23 +236,41 @@ int main (int argc, char **argv)
 		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
 		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
 		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       esf file:       %s\n",esffile);
+		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
+		fprintf(stderr,"dbg2       help:             %d\n",help);
+		fprintf(stderr,"dbg2       input esf file:   %s\n",iesffile);
+		fprintf(stderr,"dbg2       omode:            %d\n",omode);
+		if (omode == OUTPUT_ESF)
+			fprintf(stderr,"dbg2       output esf file:  %s\n",oesffile);
+		fprintf(stderr,"dbg2       ignore_unflag:    %d\n",ignore_unflag);
+		fprintf(stderr,"dbg2       ignore_flag:      %d\n",ignore_flag);
+		fprintf(stderr,"dbg2       ignore_filter:    %d\n",ignore_filter);
+		fprintf(stderr,"dbg2       ignore_zero:      %d\n",ignore_zero);
 		}
 
 	/* check that esf file exists */
-	fstat = stat(esffile, &file_status);
+	fstat = stat(iesffile, &file_status);
 	if (fstat == 0 && (file_status.st_mode & S_IFMT) != S_IFDIR)
 	    	{
 		/* get number of edits */
 		nedit = file_status.st_size / (sizeof(double) + 2 * sizeof(int));
 
-		/* open the esf file */
-		if ((esffp = fopen(esffile, "r")) == NULL)
+		/* open the input esf file */
+		if ((iesffp = fopen(iesffile, "r")) == NULL)
 			{
 			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to edit save file <%s> for reading\n",esffile);
+			fprintf(stderr,"\nUnable to edit save file <%s> for reading\n",iesffile);
+			fprintf(stderr,"\nProgram <%s> Terminated\n",
+			    program_name);
+			exit(error);
+			}
+
+		/* open the output esf file */
+		if (omode == OUTPUT_ESF
+			&& (oesffp = fopen(oesffile, "w")) == NULL)
+			{
+			error = MB_ERROR_OPEN_FAIL;
+			fprintf(stderr,"\nUnable to edit save file <%s> for reading\n",iesffile);
 			fprintf(stderr,"\nProgram <%s> Terminated\n",
 			    program_name);
 			exit(error);
@@ -167,9 +279,9 @@ int main (int argc, char **argv)
 		/* loop over reading edit events and printing them out */
 		for (i=0;i<nedit && error == MB_ERROR_NO_ERROR;i++)
 			{
-			if (fread(&(time_d), sizeof(double), 1, esffp) != 1
-				|| fread(&(beam), sizeof(int), 1, esffp) != 1
-				|| fread(&(action), sizeof(int), 1, esffp) != 1)
+			if (fread(&(time_d), sizeof(double), 1, iesffp) != 1
+				|| fread(&(beam), sizeof(int), 1, iesffp) != 1
+				|| fread(&(action), sizeof(int), 1, iesffp) != 1)
 				{
 				status = MB_FAILURE;
 				error = MB_ERROR_EOF;
@@ -180,32 +292,89 @@ int main (int argc, char **argv)
 				beam = mb_swap_int(beam);
 				action = mb_swap_int(action);
 				}
+			ignore = MB_NO;
 			if (action == MBP_EDIT_FLAG)
 				{
 				beam_flag++;
+				if (ignore_flag == MB_YES)
+					{
+					ignore = MB_YES;
+					beam_flag_ignore++;
+					}
 				}
 			else if (action == MBP_EDIT_UNFLAG)
 				{
 				beam_unflag++;
+				if (ignore_flag == MB_YES)
+					{
+					ignore = MB_YES;
+					beam_unflag_ignore++;
+					}
 				}
 			else if (action == MBP_EDIT_ZERO)
 				{
 				beam_zero++;
+				if (ignore_flag == MB_YES)
+					{
+					ignore = MB_YES;
+					beam_zero_ignore++;
+					}
 				}
 			else if (action == MBP_EDIT_FILTER)
 				{
 				beam_filter++;
+				if (ignore_flag == MB_YES)
+					{
+					ignore = MB_YES;
+					beam_filter_ignore++;
+					}
 				}
 
-			mb_get_date(verbose,time_d,time_i);
-			fprintf(stdout,"EDITS READ: i:%d time: %f %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d beam:%d action:%d\n",
-				i,time_d,time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				beam,action);
+			
+			/* write out the edit if not ignored */
+			if (ignore == MB_NO)
+				{
+				if (omode == OUTPUT_TEXT)
+					{
+					mb_get_date(verbose,time_d,time_i);
+					fprintf(stdout,"EDITS READ: i:%d time: %f %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d beam:%d action:%d\n",
+						i,time_d,time_i[0],time_i[1],time_i[2],
+						time_i[3],time_i[4],time_i[5],time_i[6],
+						beam,action);
+					}
+				else
+					{
+					if (byteswapped == MB_YES)
+						{
+						mb_swap_double(&time_d);
+						beam = mb_swap_int(beam);
+						action = mb_swap_int(action);
+						}
+					if (fwrite(&time_d, sizeof(double), 1, oesffp) != 1)
+						{
+						status = MB_FAILURE;
+						error = MB_ERROR_WRITE_FAIL;
+						}
+					if (status == MB_SUCCESS
+					    && fwrite(&beam, sizeof(int), 1, oesffp) != 1)
+						{
+						status = MB_FAILURE;
+						error = MB_ERROR_WRITE_FAIL;
+						}
+					if (status == MB_SUCCESS
+					    && fwrite(&action, sizeof(int), 1, oesffp) != 1)
+						{
+						status = MB_FAILURE;
+						error = MB_ERROR_WRITE_FAIL;
+						}
+					}
+				}
 			}
 
 		/* close the edit save file */
-		fclose(esffp);
+		fclose(iesffp);
+		if (omode == OUTPUT_ESF)
+			fclose(oesffp);
 		}
 
 
@@ -217,6 +386,15 @@ int main (int argc, char **argv)
 		fprintf(stderr,"\t%d beams unflagged\n",beam_unflag);
 		fprintf(stderr,"\t%d beams zeroed\n",beam_zero);
 		fprintf(stderr,"\t%d beams flagged by filter\n",beam_filter);
+		if (ignore_flag == MB_YES || ignore_unflag == MB_YES
+		    || ignore_zero == MB_YES || ignore_filter == MB_YES)
+			{
+			fprintf(stderr,"\nBeam flag ignore totals:\n");
+			fprintf(stderr,"\t%d beams flagged manually (ignored in output)\n",beam_flag_ignore);
+			fprintf(stderr,"\t%d beams unflagged (ignored in output)\n",beam_unflag_ignore);
+			fprintf(stderr,"\t%d beams zeroed (ignored in output)\n",beam_zero_ignore);
+			fprintf(stderr,"\t%d beams flagged by filter (ignored in output)\n",beam_filter_ignore);
+			}
 		}
 
 	/* end it all */
diff --git a/src/utilities/mbextractsegy.c b/src/utilities/mbextractsegy.c
index ddb7307..547ab4e 100644
--- a/src/utilities/mbextractsegy.c
+++ b/src/utilities/mbextractsegy.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbextractsegy.c	4/18/2004
- *    $Id: mbextractsegy.c 2196 2014-07-14 05:52:06Z caress $
+ *    $Id: mbextractsegy.c 2234 2015-03-05 07:41:54Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -20,70 +20,6 @@
  * Author:	D. W. Caress
  * Date:	April 18, 2004
  *
- * $Log: mbextractsegy.c,v $
- * Revision 5.20  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.19  2009/03/02 18:54:40  caress
- * Fixed pixel size problems with mbmosaic, resurrected program mbfilter, and also updated copyright dates in several source files.
- *
- * Revision 5.18  2008/05/16 22:44:37  caress
- * Release 5.1.1beta18
- *
- * Revision 5.17  2007/11/16 17:53:03  caress
- * Fixes applied.
- *
- * Revision 5.16  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.15  2007/03/02 18:22:54  caress
- * When extracting lines using a route file, now omits data between where a waypoint is crossed and the sonar comes onto the next line, thus eliminating data during turns.
- *
- * Revision 5.14  2006/12/15 21:42:49  caress
- * Incremental CVS update.
- *
- * Revision 5.13  2006/11/26 09:42:01  caress
- * Making distribution 5.1.0.
- *
- * Revision 5.12  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.11  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.10  2006/06/22 04:45:43  caress
- * Working towards 5.1.0
- *
- * Revision 5.9  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.8  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.7  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2005/06/04 06:07:02  caress
- * Fixed output of a single segy file deriving from a list
- * of input swath files.
- *
- * Revision 5.5  2004/10/06 19:10:52  caress
- * Release 5.0.5 update.
- *
- * Revision 5.4  2004/09/16 01:01:12  caress
- * Fixed many things.
- *
- * Revision 5.3  2004/07/27 19:48:35  caress
- * Working on handling subbottom data.
- *
- * Revision 5.2  2004/07/15 19:33:57  caress
- * Improvements to support for Reson 7k data.
- *
- * Revision 5.1  2004/06/18 05:20:05  caress
- * Working on adding support for segy i/o and for Reson 7k format 88.
- *
- * Revision 5.0  2004/05/21 23:50:44  caress
- * Progress supporting Reson 7k data, including support for extracing subbottom profiler data.
  *
  */
 
@@ -112,7 +48,7 @@
 #define MBES_NUM_PLOT_MAX		50
 #define MBES_MAX_SWEEP			1.0
 
-static char rcs_id[] = "$Id: mbextractsegy.c 2196 2014-07-14 05:52:06Z caress $";
+static char rcs_id[] = "$Id: mbextractsegy.c 2234 2015-03-05 07:41:54Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -242,7 +178,7 @@ int main (int argc, char **argv)
 	double	linebearing;
 	int	nshot;
 	int	nshotmax;
-	int	nplot;
+	int	nplot = 0;
 	double	xscale = 0.01;
 	double	yscale = 50.0;
 	double	maxwidth = 30.0;
@@ -933,7 +869,7 @@ dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
 				    nplot = nwrite / nshotmax;
 				    if (nwrite % nshotmax > 0)
 		    			nplot++;
-
+//fprintf(stderr,"nwrite:%d nshotmax:%d nplot:%d\n",nwrite,nshotmax,nplot);
 				    /* calculate sweep needed for all of the data in the line - if this is more than 1.0 seconds,
 				      then make section plots using only the sweep needed for each section alone */
 				    delay = seafloordepthmin / 750.0;
@@ -1000,12 +936,12 @@ dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
 					fprintf(stderr, "%s", command);
 					fprintf(sfp, "%s", command);
 
-					sprintf(command, "%s_%4.4d_%2.2d_sectionplot.cmd\n\n",
+					sprintf(command, "%s_%4.4d_%2.2d_sectionplot.cmd $1\n\n",
 							lineroot, linenumber, i + 1);
 					fprintf(stderr, "%s", command);
 					fprintf(sfp, "%s", command);
 
-					sprintf(command, "convert -density 100 %s_%4.4d_%2.2d_sectionplot.ps -quality 75 %s_%4.4d_%2.2d_sectionplot.jpg\n\n",
+					sprintf(command, "convert -density 100 %s_%4.4d_%2.2d_sectionplot.ps -trim -quality 75 %s_%4.4d_%2.2d_sectionplot.jpg\n\n",
 							lineroot, linenumber, i + 1, lineroot, linenumber, i + 1);
 					fprintf(stderr, "%s", command);
 					fprintf(sfp, "%s", command);
@@ -1038,7 +974,7 @@ dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
 				}
 			else
 				rangelast = range;
-			if (verbose > 0)
+			if (verbose > 0 && nroutepoint > 0)
 				fprintf(stderr,"> activewaypoint:%d linenumber:%d time_d:%f range:%f   lon: %f %f   lat: %f %f oktowrite:%d rangeok:%d kind:%d\n",
 					activewaypoint, linenumber, time_d, range, navlon,
 					routelon[activewaypoint], navlat, routelat[activewaypoint],
@@ -1248,6 +1184,7 @@ routelon[activewaypoint], navlat, routelat[activewaypoint], oktowrite);*/
 					seafloordepthmaxplot[nplot] = MAX(seafloordepthmaxplot[nplot], 0.01 * ((double) segytraceheader.src_wbd));
 					}
 				}
+
 			/* output info */
 			nread++;
 			if (nread % 10 == 0 && verbose > 0)
@@ -1327,6 +1264,7 @@ routelon[activewaypoint], navlat, routelat[activewaypoint], oktowrite);*/
 					    error = MB_ERROR_WRITE_FAIL;
 					    }
 				    }
+//fprintf(stderr,"J\n");
 
 				/* insert segy header data into output buffer */
 				index = 0;
@@ -1587,12 +1525,12 @@ routelon[activewaypoint], navlat, routelat[activewaypoint], oktowrite);*/
 			fprintf(stderr, "%s", command);
 			fprintf(sfp, "%s", command);
 
-			sprintf(command, "%s_%4.4d_%2.2d_sectionplot.cmd\n\n",
+			sprintf(command, "%s_%4.4d_%2.2d_sectionplot.cmd $1\n\n",
 					lineroot, linenumber, i + 1);
 			fprintf(stderr, "%s", command);
 			fprintf(sfp, "%s", command);
 
-			sprintf(command, "convert -density 100 %s_%4.4d_%2.2d_sectionplot.ps -quality 75 %s_%4.4d_%2.2d_sectionplot.jpg\n\n",
+			sprintf(command, "convert -density 100 %s_%4.4d_%2.2d_sectionplot.ps -trim -quality 75 %s_%4.4d_%2.2d_sectionplot.jpg\n\n",
 					lineroot, linenumber, i + 1, lineroot, linenumber, i + 1);
 			fprintf(stderr, "%s", command);
 			fprintf(sfp, "%s", command);
diff --git a/src/utilities/mbfilter.c b/src/utilities/mbfilter.c
index f48078c..729d6a0 100644
--- a/src/utilities/mbfilter.c
+++ b/src/utilities/mbfilter.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbfilter.c	1/16/95
- *    $Id: mbfilter.c 2183 2014-04-16 19:54:45Z caress $
+ *    $Id: mbfilter.c 2229 2015-02-14 23:04:41Z caress $
  *
- *    Copyright (c) 1995-2014 by
+ *    Copyright (c) 1995-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -31,100 +31,6 @@
  * Author:	D. W. Caress
  * Date:	January 16, 1995
  *
- * $Log: mbfilter.c,v $
- * Revision 5.9  2009/03/02 18:54:40  caress
- * Fixed pixel size problems with mbmosaic, resurrected program mbfilter, and also updated copyright dates in several source files.
- *
- * Revision 5.8  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.7  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.6  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.5  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.4  2005/03/25 04:43:00  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.3  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 21:14:16  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.18  2000/10/28  00:40:19  caress
- * Applied fix from Gordon Keith to calculation of pings to be
- * updated and dumped.
- *
- * Revision 4.17  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.16  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.15  1999/12/28  00:28:40  caress
- * Fixed bug in calculating data records to hold in buffer.
- *
- * Revision 4.14  1999/12/28  00:23:32  caress
- * Fixed bug in calculating data records to hold in buffer.
- *
- * Revision 4.13  1999/02/04  23:55:08  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.12  1998/12/18  19:44:23  caress
- * MB-System version 4.6beta5
- *
- * Revision 4.11  1998/12/17  22:50:20  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.10  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/10/03  18:59:04  caress
- * Fixed problem with sort call.
- *
- * Revision 4.8  1997/07/25  14:28:10  caress
- * Version 4.5beta2
- *
- * Revision 4.7  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1997/04/17  15:14:38  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.6  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1995/11/17  22:33:12  caress
- * Fixed bug using bath data when no amp present.
- * Bug fix provided by Dan Scheirer.
- *
- * Revision 4.4  1995/08/17  15:04:52  caress
- * Revision for release 4.3.
- *
- * Revision 4.3  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.2  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1995/03/02  13:49:21  caress
- * Fixed bug related to error messages.
- *
- * Revision 4.0  1995/02/14  21:17:15  caress
- * Version 4.2
- *
  *
  */
 
@@ -259,7 +165,7 @@ int mbcopy_any_to_mbldeoih(int verbose, int system,
 		char *ombio_ptr, char *ostore_ptr,
 		int *error);
 
-static char rcs_id[] = "$Id: mbfilter.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[] = "$Id: mbfilter.c 2229 2015-02-14 23:04:41Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -757,7 +663,7 @@ The default input and output streams are stdin and stdout.\n";
 	status = mb_format_system(verbose,&format,&system,&error);
 	status = mb_format_dimensions(verbose,&format,
 			&beams_bath,&beams_amp,&pixels_ss,&error);
-	if (datakind == MBFILTER_BATH
+	/* if (datakind == MBFILTER_BATH
 		&& beams_bath <= 0)
 		{
 		fprintf(stderr,"\nProgram <%s> is in bathymetry mode.\n",program_name);
@@ -786,7 +692,7 @@ The default input and output streams are stdin and stdout.\n";
 			program_name);
 		error = MB_ERROR_BAD_FORMAT;
 		exit(error);
-		}
+		}*/
 
 	/* initialize reading the input swath sonar file */
 	if ((status = mb_read_init(
diff --git a/src/utilities/mbformat.c b/src/utilities/mbformat.c
index 4a4a387..e4f4918 100644
--- a/src/utilities/mbformat.c
+++ b/src/utilities/mbformat.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbformat.c	1/22/93
- *    $Id: mbformat.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbformat.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -118,7 +118,7 @@
 #define MBFORMAT_LIST_SIMPLE	1
 #define MBFORMAT_LIST_ROOT	2
 
-static char rcs_id[] = "$Id: mbformat.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbformat.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbgetesf.c b/src/utilities/mbgetesf.c
index d94c09e..e2f22ea 100644
--- a/src/utilities/mbgetesf.c
+++ b/src/utilities/mbgetesf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbgetesf.c	6/15/93
- *    $Id: mbgetesf.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbgetesf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -72,7 +72,7 @@
 
 int mbgetesf_save_edit(int verbose, FILE *sofp, double time_d, int beam, int action, int *error);
 
-static char rcs_id[] = "$Id: mbgetesf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbgetesf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbgrid.c b/src/utilities/mbgrid.c
index 6cc6c31..f170e38 100644
--- a/src/utilities/mbgrid.c
+++ b/src/utilities/mbgrid.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbgrid.c	5/2/94
- *    $Id: mbgrid.c 2215 2014-11-29 22:21:19Z caress $
+ *    $Id: mbgrid.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -48,9 +48,6 @@
 #include <string.h>
 #include <time.h>
 
-/* GMT include files */
-#include "gmt.h"
-
 /* mbio include files */
 #include "mb_status.h"
 #include "mb_format.h"
@@ -113,8 +110,8 @@
 /* #define USESURFACE */
 
 /* approximate complementary error function */
-double erfcc();
-double mbgrid_erf();
+double erfcc(double x);
+double mbgrid_erf(double x);
 
 int write_ascii(int verbose, char *outfile, float *grid,
 		int nx, int ny,
@@ -128,13 +125,6 @@ int write_oldgrd(int verbose, char *outfile, float *grid,
 		int nx, int ny,
 		double xmin, double xmax, double ymin, double ymax,
 		double dx, double dy, int *error);
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error);
 int mbgrid_weight(int verbose, double foot_a, double foot_b,
 		    double pcx, double pcy, double dx, double dy,
 		    double *px, double *py,
@@ -145,7 +135,7 @@ int mbgrid_weight(int verbose, double foot_a, double foot_b,
 FILE	*outfp;
 
 /* program identifiers */
-static char rcs_id[] = "$Id: mbgrid.c 2215 2014-11-29 22:21:19Z caress $";
+static char rcs_id[] = "$Id: mbgrid.c 2247 2015-05-29 21:28:28Z caress $";
 char program_name[] = "mbgrid";
 char help_message[] =  "mbgrid is an utility used to grid bathymetry, amplitude, or \nsidescan data contained in a set of swath sonar data files.  \nThis program uses one of four algorithms (gaussian weighted mean, \nmedian filter, minimum filter, maximum filter) to grid regions \ncovered swaths and then fills in gaps between \nthe swaths (to the degree specified by the user) using a minimum\ncurvature algorithm.";
 char usage_message[] = "mbgrid -Ifilelist -Oroot \
@@ -737,7 +727,7 @@ int main (int argc, char **argv)
 	/* define NaN in case it's needed */
 	if (use_NaN == MB_YES)
 		{
-		GMT_make_fnan(NaN);
+		MB_MAKE_FNAN(NaN);
 		outclipvalue = NaN;
 		}
 
@@ -1463,7 +1453,7 @@ gbnd[0], gbnd[1], gbnd[2], gbnd[3]);*/
 		/* extract points with preprocessing if that will help */
 		if (use_projection == MB_NO)
 			{
-			sprintf(plot_cmd, "grd2xyz tmpgrdsample%d.grd -S -bo | blockmean -bi -bo -C -R%f/%f/%f/%f -I%.12f/%.12f",
+			sprintf(plot_cmd, "grd2xyz tmpgrdsample%d.grd -s -bo | blockmean -bi -bo -C -R%f/%f/%f/%f -I%.12f/%.12f",
 				pid, bounds[0], bounds[1], bounds[2], bounds[3], dx, dy);
 			}
 		else
@@ -1837,6 +1827,17 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
 		if (verbose > 0 || file_in_bounds == MB_YES)
 			fprintf(outfp,"%d data points processed in %s\n",
 				ndatafile,rfile);
+
+		/* add to datalist if data actually contributed */
+		if (ndatafile > 0 && dfp != NULL)
+			{
+			if (pstatus == MB_PROCESSED_USE)
+				fprintf(dfp, "P:");
+			else
+				fprintf(dfp, "R:");
+			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
+			fflush(dfp);
+			}
 		} /* end if (format > 0) */
 
 		}
@@ -1845,6 +1846,13 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
 	if (verbose > 0)
 		fprintf(outfp,"\n%d total data points processed\n",ndata);
 
+	/* close datalist if necessary */
+	if (dfp != NULL)
+		{
+		fclose(dfp);
+		dfp = NULL;
+		}
+
 	/* now loop over all points in the low resolution grid */
 	if (verbose >= 1)
 		fprintf(outfp,"\nMaking low resolution slope grid...\n");
@@ -2060,7 +2068,7 @@ status = write_cdfgrd(verbose,ofile,output,sxdim,sydim,
 	fprintf(outfp,"\nDoing second pass to generate final grid...\n");
 	ndata = 0;
 	if ((status = mb_datalist_open(verbose,&datalist,
-					filelist,look_processed,&error)) != MB_SUCCESS)
+					dfile,look_processed,&error)) != MB_SUCCESS)
 		{
 		error = MB_ERROR_OPEN_FAIL;
 		fprintf(outfp,"\nUnable to open data list file: %s\n",
@@ -2519,17 +2527,6 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
 		if (verbose > 0 || file_in_bounds == MB_YES)
 			fprintf(outfp,"%d data points processed in %s\n",
 				ndatafile,rfile);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
 		} /* end if (format > 0) */
 
 		}
@@ -2592,7 +2589,7 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
 			}
 
 	/* read in data */
-	fprintf(outfp,"\nDoing second pass to generate final grid...\n");
+	fprintf(outfp,"\nDoing single pass to generate grid...\n");
 	ndata = 0;
 	if ((status = mb_datalist_open(verbose,&datalist,
 					filelist,look_processed,&error)) != MB_SUCCESS)
@@ -3026,6 +3023,13 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
 	if (verbose > 0)
 		fprintf(outfp,"\n%d total data points processed\n",ndata);
 
+	/* close datalist if necessary */
+	if (dfp != NULL)
+		{
+		fclose(dfp);
+		dfp = NULL;
+		}
+
 	/* now loop over all points in the output grid */
 	if (verbose >= 1)
 		fprintf(outfp,"\nMaking raw grid...\n");
@@ -3751,6 +3755,13 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], dx, dy, wbnd[0], wbnd[1]); */
 	if (verbose > 0)
 		fprintf(outfp,"\n%d total data points processed\n",ndata);
 
+	/* close datalist if necessary */
+	if (dfp != NULL)
+		{
+		fclose(dfp);
+		dfp = NULL;
+		}
+
 	/* now loop over all points in the output grid */
 	if (verbose >= 1)
 		fprintf(outfp,"\nMaking raw grid...\n");
@@ -4348,6 +4359,13 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], dx, dy, wbnd[0], wbnd[1]); */
 	if (verbose > 0)
 		fprintf(outfp,"\n%d total data points processed\n",ndata);
 
+	/* close datalist if necessary */
+	if (dfp != NULL)
+		{
+		fclose(dfp);
+		dfp = NULL;
+		}
+
 	/* now loop over all points in the output grid */
 	if (verbose >= 1)
 		fprintf(outfp,"\nMaking raw grid...\n");
@@ -4408,10 +4426,6 @@ ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], dx, dy, wbnd[0], wbnd[1]); */
 	/***** end of median filter gridding *****/
 	}
 
-	/* close datalist if necessary */
-	if (dfp != NULL)
-		fclose(dfp);
-
 	/* if clip set do smooth interpolation */
 	if (clipmode != MBGRID_INTERP_NONE && clip > 0 && nbinset > 0)
 		{
@@ -5076,22 +5090,36 @@ fprintf(stderr,"%d %f\n",i,sdata[3*i+2]);
 		{
 		strcpy(ofile,fileroot);
 		strcat(ofile,".grd");
-		status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			zmin,zmax,dx,dy,
-			xlabel,ylabel,zlabel,title,projection_id,
-			argc,argv,&error);
+		status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 		}
 	else if (gridkind == MBGRID_GMTGRD)
 		{
 		strcpy(ofile,fileroot);
 		strcat(ofile,".grd");
 		sprintf(ofile,"%s.grd%s", fileroot, gridkindstring);
-		status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			zmin,zmax,dx,dy,
-			xlabel,ylabel,zlabel,title,projection_id,
-			argc,argv,&error);
+		status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 		}
 	if (status != MB_SUCCESS)
 		{
@@ -5148,20 +5176,34 @@ fprintf(stderr,"%d %f\n",i,sdata[3*i+2]);
 			{
 			strcpy(ofile,fileroot);
 			strcat(ofile,"_num.grd");
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,nlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		else if (gridkind == MBGRID_GMTGRD)
 			{
 			sprintf(ofile,"%s_num.grd%s", fileroot, gridkindstring);
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,zlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		if (status != MB_SUCCESS)
 			{
@@ -5216,20 +5258,34 @@ fprintf(stderr,"%d %f\n",i,sdata[3*i+2]);
 			{
 			strcpy(ofile,fileroot);
 			strcat(ofile,"_sd.grd");
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,sdlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		else if (gridkind == MBGRID_GMTGRD)
 			{
 			sprintf(ofile,"%s_sd.grd%s", fileroot, gridkindstring);
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,zlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		if (status != MB_SUCCESS)
 			{
@@ -5581,162 +5637,6 @@ int write_oldgrd(int verbose, char *outfile, float *grid,
 }
 /*--------------------------------------------------------------------*/
 /*
- * function write_cdfgrd writes output grid to a
- * GMT version 2 netCDF grd file
- */
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error)
-{
-	char	*function_name = "write_cdfgrd";
-	int	status = MB_SUCCESS;
-	struct GRD_HEADER grd;
-	double	w, e, s, n;
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
-#else
-	int	pad[4];
-#endif
-	float	*a;
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	char	remark[MB_PATH_MAXLINE];
-	int	i, j, kg, ka;
-	char	*message;
-	char	*ctime();
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       outfile:    %s\n",outfile);
-		fprintf(outfp,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(outfp,"dbg2       nx:         %d\n",nx);
-		fprintf(outfp,"dbg2       ny:         %d\n",ny);
-		fprintf(outfp,"dbg2       xmin:       %f\n",xmin);
-		fprintf(outfp,"dbg2       xmax:       %f\n",xmax);
-		fprintf(outfp,"dbg2       ymin:       %f\n",ymin);
-		fprintf(outfp,"dbg2       ymax:       %f\n",ymax);
-		fprintf(outfp,"dbg2       dx:         %f\n",dx);
-		fprintf(outfp,"dbg2       dy:         %f\n",dy);
-		fprintf(outfp,"dbg2       xlab:       %s\n",xlab);
-		fprintf(outfp,"dbg2       ylab:       %s\n",ylab);
-		fprintf(outfp,"dbg2       zlab:       %s\n",zlab);
-		fprintf(outfp,"dbg2       titl:       %s\n",titl);
-		fprintf(outfp,"dbg2       argc:       %d\n",argc);
-		fprintf(outfp,"dbg2       *argv:      %p\n",(void *)*argv);
-		}
-
-	/* inititialize grd header */
-	GMT_program = program_name;
-	GMT_grd_init (&grd, 1, argv, FALSE);
-	GMT_io_init ();
-	GMT_grdio_init ();
-	GMT_make_fnan (GMT_f_NaN);
-	GMT_make_dnan (GMT_d_NaN);
-
-	/* copy values to grd header */
-	grd.nx = nx;
-	grd.ny = ny;
-	grd.node_offset = 0;
-	grd.x_min = xmin;
-	grd.x_max = xmax;
-	grd.y_min = ymin;
-	grd.y_max = ymax;
-	grd.z_min = zmin;
-	grd.z_max = zmax;
-	grd.x_inc = dx;
-	grd.y_inc = dy;
-	grd.z_scale_factor = 1.0;
-	grd.z_add_offset = 0.0;
-	strcpy(grd.x_units,xlab);
-	strcpy(grd.y_units,ylab);
-	strcpy(grd.z_units,zlab);
-	strcpy(grd.title,titl);
-	strcpy(grd.command,"\0");
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,MB_PATH_MAXLINE);
-	sprintf(remark,"\n\tProjection: %s\n\tGrid created by %s\n\tMB-system Version %s\n\tRun by <%s> on <%s> at <%s>",
-		projection,program_name,MB_VERSION,user,host,date);
-	strncpy(grd.remark, remark, 159);
-
-	/* set extract wesn,pad */
-	w = 0.0;
-	e = 0.0;
-	s = 0.0;
-	n = 0.0;
-	for (i=0;i<4;i++)
-		pad[i] = 0;
-
-	/* allocate memory for output array */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,grd.nx*grd.ny*sizeof(float),(void **)&a,error);
-	if (*error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-		fprintf(outfp,"\nMBIO Error allocating output arrays.\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, error);
-		exit(status);
-		}
-
-	/* copy grid to new array and write it to GMT netCDF grd file */
-	if (status == MB_SUCCESS)
-		{
-		/* copy grid to new array */
-		for (i=0;i<grd.nx;i++)
-			for (j=0;j<grd.ny;j++)
-				{
-				kg = i*grd.ny+j;
-				ka = (grd.ny-1-j)*grd.nx+i;
-				a[ka] = grid[kg];
-				}
-
-		/* write the GMT netCDF grd file */
-		GMT_write_grd(outfile, &grd, a, w, e, s, n, pad, FALSE);
-
-		/* free memory for output array */
-		mb_freed(verbose,__FILE__,__LINE__,(void **) &a, error);
-		}
-
-	/* free GMT memory */
-	GMT_free ((void *)GMT_io.skip_if_NaN);
-	GMT_free ((void *)GMT_io.in_col_type);
-	GMT_free ((void *)GMT_io.out_col_type);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
  * function mbgrid_weight calculates the integrated weight over a bin
  * given the footprint of a sounding
  */
diff --git a/src/utilities/mbhistogram.c b/src/utilities/mbhistogram.c
index 55b823e..8bf2cd0 100644
--- a/src/utilities/mbhistogram.c
+++ b/src/utilities/mbhistogram.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbhistogram.c	12/28/94
- *    $Id: mbhistogram.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbhistogram.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -22,75 +22,6 @@
  * Author:	D. W. Caress
  * Date:	December 28, 1994
  *
- * $Log: mbhistogram.c,v $
- * Revision 5.8  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.7  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.6  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.5  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2005/03/25 04:42:59  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.3  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  2000/09/11  20:10:02  caress
- * Linked to new datalist parsing functions. Now supports recursive datalists
- * and comments in datalists.
- *
- * Revision 4.9  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.8  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1995/08/11  18:51:37  caress
- * Added Gaussian distribution option.
- *
- * Revision 4.5  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.4  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1995/03/02  13:49:21  caress
- * Fixed bug related to error messages.
- *
- * Revision 4.2  1995/02/27  14:43:18  caress
- * Fixed bug regarding closing a text input file.
- *
- * Revision 4.1  1995/01/06  00:06:41  caress
- * Can now read from either single data files or from multiple
- * data files specified in a datalist.
  *
  *
  */
@@ -111,7 +42,9 @@
 #define	MBHISTOGRAM_AMP		1
 #define	MBHISTOGRAM_SS		2
 
-static char rcs_id[] = "$Id: mbhistogram.c 2175 2014-03-18 23:03:39Z caress $";
+double	qsnorm(double p);
+
+static char rcs_id[] = "$Id: mbhistogram.c 2247 2015-05-29 21:28:28Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -209,7 +142,6 @@ int main (int argc, char **argv)
 	int	nrectot = 0;
 	int	nvaluetot = 0;
 	int	i, j;
-	double	qsnorm();
 
 	/* get current default values */
 	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
diff --git a/src/utilities/mbhsdump.c b/src/utilities/mbhsdump.c
index 526e188..ea50fff 100644
--- a/src/utilities/mbhsdump.c
+++ b/src/utilities/mbhsdump.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbhsdump.c	6/16/93
- *    $Id: mbhsdump.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbhsdump.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -116,7 +116,7 @@
 #include "mb_define.h"
 #include "mbsys_hsds.h"
 
-static char rcs_id[] = "$Id: mbhsdump.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbhsdump.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbhysweeppreprocess.c b/src/utilities/mbhysweeppreprocess.c
index cbbcc1f..0f586db 100644
--- a/src/utilities/mbhysweeppreprocess.c
+++ b/src/utilities/mbhysweeppreprocess.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbhysweeppreprocess.c	1/1/2012
- *    $Id: mbhysweeppreprocess.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbhysweeppreprocess.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2013-2014 by
+ *    Copyright (c) 2013-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -60,7 +60,7 @@
 #define MBHYSWEEPPREPROCESS_NAVFORMAT_NONE	0
 #define MBHYSWEEPPREPROCESS_NAVFORMAT_OFG	1
 
-static char rcs_id[] = "$Id: mbhysweeppreprocess.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbhysweeppreprocess.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbinfo.c b/src/utilities/mbinfo.c
index 74704e1..dd41e50 100644
--- a/src/utilities/mbinfo.c
+++ b/src/utilities/mbinfo.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbinfo.c	2/1/93
- *    $Id: mbinfo.c 2218 2014-12-04 19:11:14Z caress $
+ *    $Id: mbinfo.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -59,7 +59,7 @@ struct ping
 #define XML			2
 #define MAX_OUTPUT_FORMAT 2
 
-static char rcs_id[] = "$Id: mbinfo.c 2218 2014-12-04 19:11:14Z caress $";
+static char rcs_id[] = "$Id: mbinfo.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbinsreprocess.c b/src/utilities/mbinsreprocess.c
index 9fa9d13..07259a4 100644
--- a/src/utilities/mbinsreprocess.c
+++ b/src/utilities/mbinsreprocess.c
@@ -1,9 +1,9 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbinsreprocess.c	11/21/2004
  *
- *    $Id: mbinsreprocess.c 2185 2014-05-11 06:34:36Z caress $
+ *    $Id: mbinsreprocess.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -64,7 +64,7 @@
 #define	KEARFOTT_MONITOR_GPS_PROCESSED		0x40
 #define	KEARFOTT_MONITOR_DEPTH_LOOP_OPEN	0x80
 
-static char version_id[] = "$Id: mbinsreprocess.c 2185 2014-05-11 06:34:36Z caress $";
+static char version_id[] = "$Id: mbinsreprocess.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbkongsbergpreprocess.c b/src/utilities/mbkongsbergpreprocess.c
index eb561ee..f472efb 100644
--- a/src/utilities/mbkongsbergpreprocess.c
+++ b/src/utilities/mbkongsbergpreprocess.c
@@ -2,7 +2,7 @@
  *    The MB-system:	mbkongsbergpreprocess.c	1/1/2012
  *    $Id: mbkongsbergpreprocess.c 1938 2012-02-22 20:58:08Z caress $
  *
- *    Copyright (c) 2012-2014 by
+ *    Copyright (c) 2012-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/utilities/mblevitus.c b/src/utilities/mblevitus.c
index cc3596b..41a6bb7 100644
--- a/src/utilities/mblevitus.c
+++ b/src/utilities/mblevitus.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mblevitus.c	4/15/93
- *    $Id: mblevitus.c 2183 2014-04-16 19:54:45Z caress $
+ *    $Id: mblevitus.c 2241 2015-05-12 21:00:35Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -33,86 +33,6 @@
  * Date:	April 15, 1993
  * Rewrite:	March 26, 1997
  *
- * $Log: mblevitus.c,v $
- * Revision 5.3  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.2  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.9  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1997/04/17  15:14:38  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.6  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.4  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  19:02:56  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * using unix second time base.
- *
- * Revision 4.1  1994/03/12  01:44:37  caress
- * Added declarations of ctime and/or getenv for compatability
- * with SGI compilers.
- *
- * Revision 4.0  1994/03/06  00:13:22  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/01  18:59:27  caress
- * First cut at new version. Any changes are associated with
- * support of three data types (beam bathymetry, beam amplitude,
- * and sidescan) instead of two (bathymetry and backscatter).
- *
- * Revision 3.5  1993/11/05  16:13:40  caress
- * Now the location of the Levitus annual database file is set
- * at compile time from a variable in the Makefile.  This is
- * accomplished by creating an include file each time Make is
- * run which is referenced in mblevitus.c.
- *
- * Revision 3.4  1993/06/30  21:50:13  caress
- * Set for LDEO location of Levitus annual database.
- *
- * Revision 3.3  1993/06/30  02:53:06  caress
- * *** empty log message ***
- *
- * Revision 3.2  1993/06/30  02:52:06  caress
- * Changed location of levitus database to
- * /home/hs/packages/Levitus/levitus.annual
- * This is another temporary fix.
- *
- * Revision 3.1  1993/05/16  18:18:10  caress
- * Changed location of Levitus annual file to
- * /usr/local/lib - this is a temporary fix.
- *
- * Revision 3.0  1993/05/04  22:38:44  dale
- * Inital version.
  *
  */
 
@@ -133,7 +53,17 @@
 #define	NDEPTH_MAX		46
 #define	NLEVITUS_MAX		33
 
-static char rcs_id[] = "$Id: mblevitus.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[] = "$Id: mblevitus.c 2241 2015-05-12 21:00:35Z caress $";
+
+/* Windows header file */
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+/* Windows implementation of GMT_runtime_bindir */
+#ifdef WIN32
+char *GMT_runtime_bindir_win32 (char *result);
+#endif
 
 /*--------------------------------------------------------------------*/
 
@@ -152,7 +82,12 @@ int main (int argc, char **argv)
 	int	error = MB_ERROR_NO_ERROR;
 
 	/* input file set in include file */
-#include "levitus.h"
+#ifndef WIN32
+#	include "levitus.h"
+#else
+	/* But on Windows get it from the bin dir */
+	char *pch, ifile[PATH_MAX+1];
+#endif
 
 	/* control parameters */
 	char	ofile[128];
@@ -245,6 +180,14 @@ int main (int argc, char **argv)
 	else
 		outfp = stderr;
 
+#ifdef WIN32
+	/* Find the path to the bin directory and from it, the location of the Levitus file */
+	GMT_runtime_bindir_win32 (ifile);
+	pch = strrchr(ifile, '\\');
+	pch[0] = '\0';
+	strcat(ifile, "\\share\\mbsystem\\LevitusAnnual82.dat");
+#endif
+
 	/* print starting message */
 	if (verbose == 1 || help)
 		{
@@ -277,7 +220,7 @@ int main (int argc, char **argv)
 		}
 
 	/* open the data file */
-	if ((ifp = fopen(ifile, "r")) == NULL)
+	if ((ifp = fopen(ifile, "rb")) == NULL)
 		{
 		error = MB_ERROR_OPEN_FAIL;
 		fprintf(stderr,"\nUnable to Open Levitus database file <%s> for reading\n",ifile);
@@ -529,4 +472,34 @@ int main (int argc, char **argv)
 	/* end it all */
 	exit(error);
 }
+
+/*--------------------------------------------------------------------*/
+
+/* Windows implementation of GMT_runtime_bindir */
+#ifdef WIN32
+char *GMT_runtime_bindir_win32 (char *result) {
+	TCHAR path[PATH_MAX+1];
+	char *c;
+
+	/* Get absolute path of executable */
+	if (GetModuleFileName (NULL, path, PATH_MAX) == PATH_MAX)
+		/* Path to long */
+		return NULL;
+
+	/* Convert to cstring */
+#ifdef _UNICODE
+	/* TCHAR is wchar_t* */
+	wcstombs (result, path, PATH_MAX);
+#else
+	/* TCHAR is char * */
+	strncpy (result, path, PATH_MAX);
+#endif
+
+	/* Truncate full path to dirname */
+	if ((c = strrchr (result, '\\')) && c != result)
+		*c = '\0';
+
+	return result;
+}
+#endif
 /*--------------------------------------------------------------------*/
diff --git a/src/utilities/mblist.c b/src/utilities/mblist.c
index df8f7c7..513f96b 100644
--- a/src/utilities/mblist.c
+++ b/src/utilities/mblist.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mblist.c	2/1/93
- *    $Id: mblist.c 2209 2014-11-04 08:54:21Z caress $
+ *    $Id: mblist.c 2251 2015-07-01 01:02:06Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -27,232 +27,6 @@
  *		derived from the program mbdump created by D. Caress
  *		in 1990.
  *
- * $Log: mblist.c,v $
- * Revision 5.30  2008/08/12 00:05:54  caress
- * Gordon Keith's fixes to some of his options.
- *
- * Revision 5.29  2008/07/10 18:16:33  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.27  2008/05/24 19:39:03  caress
- * Applied Gordon Keith fix to mblist.
- *
- * Revision 5.26  2008/02/12 02:49:15  caress
- * Added ability to output transmit and receive gain values.
- *
- * Revision 5.25  2007/10/17 20:34:00  caress
- * Release 5.1.1beta11
- * Added decimation option.
- *
- * Revision 5.24  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.23  2007/07/05 19:17:05  caress
- * Fixed calculation of grazing angles by adding sonar depth to calculation.
- *
- * Revision 5.22  2007/07/04 04:05:29  caress
- * Gordon Keith's mods.
- *
- * Revision 5.21  2007/05/12 19:57:21  caress
- * Fixed array pointer initialization.
- *
- * Revision 5.20  2006/10/05 18:58:29  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.19  2006/02/01 18:25:57  caress
- * Added raw Simrad value output to mblist, contributed by Gordon Keith.
- *
- * Revision 5.18  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.17  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.16  2005/06/04 06:17:38  caress
- * MBlist can now output the data in CDL and netCDF formats. This capability was contributed by Gordon Keith.
- *
- * Revision 5.15  2004/12/02 06:38:10  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.14  2004/06/18 04:11:57  caress
- * Adding support for segy i/o and working on support for Reson 7k format 88.
- *
- * Revision 5.13  2003/08/18 19:07:52  vschmidt
- * Fixed bug such that 'along track distance' now reports a cumulative distance for a list of files, rather than resetting with each file.
- *
- * Revision 5.12  2003/07/30 16:41:06  caress
- * Fixed handling of time gap errors in data .
- *
- * Revision 5.11  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.10  2002/05/29 23:43:09  caress
- * Release 5.0.beta18
- *
- * Revision 5.9  2002/04/06 02:53:45  caress
- * Release 5.0.beta16
- *
- * Revision 5.8  2002/03/26 23:21:15  caress
- * Fixed default output string.
- *
- * Revision 5.7  2001/10/29 20:12:40  caress
- * As per Bob Covill, fixed binary output of sidescan pixel number.
- *
- * Revision 5.6  2001/10/26  17:14:21  caress
- * Fixed bug in binary sidescan output. The program
- * was sticking tab characters into the binary output.
- *
- * Revision 5.5  2001/09/17  23:21:14  caress
- * Fixed calculation of lon and lat values.
- *
- * Revision 5.4  2001/07/20  00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/29  22:50:23  caress
- * Atlas Hydrosweep DS2 raw data and SURF data formats.
- *
- * Revision 5.2  2001/06/08  21:45:46  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2001/03/22  21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.26  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.25  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.24  2000/09/11  20:10:02  caress
- * Linked to new datalist parsing functions. Now supports recursive datalists
- * and comments in datalists.
- *
- * Revision 4.23  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.22  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.21  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.21  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.20  1995/11/28  21:03:36  caress
- * Fixed scaling for meters to feet.
- *
- * Revision 4.19  1995/11/22  22:21:36  caress
- * Now handles bathymetry in feet with -W option.
- *
- * Revision 4.18  1995/09/19  14:56:59  caress
- * Added output for ping interval.
- *
- * Revision 4.17  1995/08/17  15:04:52  caress
- * Revision for release 4.3.
- *
- * Revision 4.16  1995/08/10  15:39:36  caress
- * mblist now works with datalist files.
- *
- * Revision 4.15  1995/07/13  20:13:36  caress
- * Added output options x and y for longitude and latitude in
- * integer degrees + decimal minutes + EW/NS
- *
- * Revision 4.14  1995/06/06  13:31:48  caress
- * Fixed warnings under Solaris by explicit casting of strlen result.
- *
- * Revision 4.13  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.12  1995/03/22  18:33:38  caress
- * Fixed output formats for latitude and depth values.
- *
- * Revision 4.11  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.10  1995/03/02  13:49:21  caress
- * Fixed bug related to error messages.
- *
- * Revision 4.9  1995/01/18  20:20:46  caress
- * Fixed bug messing up sidescan output.
- *
- * Revision 4.8  1994/12/21  20:22:30  caress
- * Fixed bug in printing sidescan values.
- *
- * Revision 4.7  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.6  1994/07/29  19:02:56  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * using unix second time base.
- *
- * Revision 4.5  1994/06/21  22:53:08  caress
- * Changes to support PCs running Lynx OS.
- *
- * Revision 4.4  1994/06/05  22:31:22  caress
- * Major revision changing the manner in which complete
- * dumps occur.  Options added to control the range of beams
- * or pixels which are output.
- *
- * Revision 4.3  1994/06/01  21:00:55  caress
- * Added new dump modes with acrosstrack and alongtrack
- * values. Added topography dumps.
- *
- * Revision 4.2  1994/04/29  18:01:20  caress
- * Added output option "j" for time string in form: year jday daymin sec
- *
- * Revision 4.1  1994/04/12  18:50:33  caress
- * Added #ifdef IRIX statements for compatibility with
- * SGI machines.  The system routine timegm does not exist
- * on SGI's; mktime must be used instead.
- *
- * Revision 4.0  1994/03/06  00:13:22  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/01  18:59:27  caress
- * First cut at new version. Any changes are associated with
- * support of three data types (beam bathymetry, beam amplitude,
- * and sidescan) instead of two (bathymetry and backscatter).
- *
- * Revision 3.6  1993/09/11  15:44:30  caress
- * Fixed bug so that mblist no longer checks for a valid depth
- * even if it is not outputting depth.
- *
- * Revision 3.5  1993/06/13  07:47:20  caress
- * Added new time output options "m" and "u" and changed
- * old options "U" to "M" and "u" to "U
- * Now time options are:
- *   T  for a time string (yyyy/mm/dd/hh/mm/ss)
- *   t  for a time string (yyyy mm dd hh mm ss)
- *   J  for a time string (yyyy jd hh mm ss)
- *   M  for mbio time in minutes since 1/1/81 00:00:00
- *   m  for time in minutes since first record
- *   U  for unix time in seconds since 1/1/70 00:00:00
- *   u  for time in seconds since first record
- *
- * Revision 3.4  1993/06/13  03:02:18  caress
- * Added new output option "A", which outputs the apparent
- * crosstrack seafloor slope in degrees from vertical. This
- * value is calculated by fitting a line to the bathymetry
- * data for each ping. Obtaining a time series of the apparent
- * seafloor slope is useful for detecting errors in the vertical
- * reference used by the multibeam sonar.
- *
- * Revision 3.3  1993/06/09  11:47:44  caress
- * Fixed problem with unix time value output. In unix time
- * months are counted 0-11 instead of 1-12.
- *
- * Revision 3.2  1993/05/17  16:37:18  caress
- * Fixed problem where program crashed if -F was used.
- *
- * Revision 3.0  1993/05/04  22:20:17  dale
- * Initial version
- *
- *
  */
 
 /* standard include files */
@@ -271,9 +45,6 @@
 #include "mbsys_simrad2.h"
 #include "mbsys_simrad3.h"
 
-/* GMT include files */
-#include "gmt_nan.h"
-
 /* local options */
 #define	MAX_OPTIONS	25
 #define	DUMP_MODE_LIST	1
@@ -402,7 +173,7 @@ int mb_get_raw_simrad3(int verbose, void *mbio_ptr,
 /* NaN value */
 double	NaN;
 
-static char rcs_id[] = "$Id: mblist.c 2209 2014-11-04 08:54:21Z caress $";
+static char rcs_id[] = "$Id: mblist.c 2251 2015-07-01 01:02:06Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -528,6 +299,7 @@ int main (int argc, char **argv)
 	int	first_u = MB_YES;
 	time_t	time_u;
 	time_t	time_u_ref;
+	double	seconds;
 
 	/* crosstrack slope values */
 	double	avgslope;
@@ -639,7 +411,7 @@ int main (int argc, char **argv)
 	decimate = 1;
 
 	/* get NaN value */
-	GMT_make_dnan(NaN);
+	MB_MAKE_DNAN(NaN);
 
 	strcpy(output_file, "-");
 
@@ -3121,6 +2893,7 @@ int main (int argc, char **argv)
 					break;
 				case 'J': /* time string */
 					mb_get_jtime(verbose,time_i,time_j);
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES)
@@ -3129,10 +2902,10 @@ int main (int argc, char **argv)
 						time_i[3],time_i[4],
 						time_i[5],time_i[6]);
 					    else
-					    fprintf(output[i],"%.4d %.3d %.2d %.2d %.2d.%6.6d",
+					    fprintf(output[i],"%.4d %.3d %.2d %.2d %9.6f",
 						time_j[0],time_j[1],
 						time_i[3],time_i[4],
-						time_i[5],time_i[6]);
+						seconds);
 
 					    }
 					else
@@ -3153,6 +2926,7 @@ int main (int argc, char **argv)
 					break;
 				case 'j': /* time string */
 					mb_get_jtime(verbose,time_i,time_j);
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES)
@@ -3160,9 +2934,9 @@ int main (int argc, char **argv)
 						time_j[0],time_j[1],
 						time_j[2],time_j[3],time_j[4]);
 					    else
-					    fprintf(output[i],"%.4d %.3d %.4d %.2d.%6.6d",
+					    fprintf(output[i],"%.4d %.3d %.4d %9.6f",
 						time_j[0],time_j[1],
-						time_j[2],time_j[3],time_j[4]);
+						time_j[2],seconds);
 					    }
 					else
 					    {
@@ -3285,14 +3059,14 @@ int main (int argc, char **argv)
 							    &signflip_next_value, &error);
 					break;
 				case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES) fprintf(output[i], "\"");
 
-					    fprintf(output[i],"%.4d/%.2d/%.2d/%.2d/%.2d/%.2d.%.6d",
+					    fprintf(output[i],"%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
 						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],
-						time_i[6]);
+						time_i[3],time_i[4],seconds);
 					    if (netcdf == MB_YES) fprintf(output[i], "\"");
 					    }
 					else
@@ -3307,11 +3081,12 @@ int main (int argc, char **argv)
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    b = time_i[4];
 					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[5] + 1e-6 * time_i[6];
+					    b = seconds;
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    }
 					break;
 				case 't': /* yyyy mm dd hh mm ss time string */
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES)
@@ -3320,10 +3095,9 @@ int main (int argc, char **argv)
 						time_i[3],time_i[4],time_i[5],
 						time_i[6]);
 					    else
-					    fprintf(output[i],"%.4d %.2d %.2d %.2d %.2d %.2d.%.6d",
+					    fprintf(output[i],"%.4d %.2d %.2d %.2d %.2d %9.6f",
 						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],
-						time_i[6]);
+						time_i[3],time_i[4],seconds);
 					    }
 					else
 					    {
@@ -3337,7 +3111,7 @@ int main (int argc, char **argv)
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    b = time_i[4];
 					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[5] + 1e-6 * time_i[6];
+					    b = seconds;
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    }
 					break;
@@ -3983,6 +3757,7 @@ int main (int argc, char **argv)
 					break;
 				case 'J': /* time string */
 					mb_get_jtime(verbose,time_i,time_j);
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES)
@@ -3991,10 +3766,10 @@ int main (int argc, char **argv)
 						time_i[3],time_i[4],
 						time_i[5],time_i[6]);
 					    else
-					    fprintf(output[i],"%.4d %.3d %.2d %.2d %.2d.%6.6d",
+					    fprintf(output[i],"%.4d %.3d %.2d %.2d %9.6f",
 						time_j[0],time_j[1],
 						time_i[3],time_i[4],
-						time_i[5],time_i[6]);
+						seconds);
 					    }
 					else
 					    {
@@ -4014,6 +3789,7 @@ int main (int argc, char **argv)
 					break;
 				case 'j': /* time string */
 					mb_get_jtime(verbose,time_i,time_j);
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES)
@@ -4021,9 +3797,9 @@ int main (int argc, char **argv)
 						time_j[0],time_j[1],
 						time_j[2],time_j[3],time_j[4]);
 					    else
-					    fprintf(output[i],"%.4d %.3d %.4d %.2d.%6.6d",
+					    fprintf(output[i],"%.4d %.3d %.4d %9.6f",
 						time_j[0],time_j[1],
-						time_j[2],time_j[3],time_j[4]);
+						time_j[2],seconds);
 					    }
 					else
 					    {
@@ -4121,13 +3897,13 @@ int main (int argc, char **argv)
 							    &signflip_next_value, &error);
 					break;
 				case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    fprintf(output[i],"%.4d/%.2d/%.2d/%.2d/%.2d/%.2d.%.6d",
+					    fprintf(output[i],"%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
 						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],
-						time_i[6]);
+						time_i[3],time_i[4],seconds);
 					    if (netcdf == MB_YES) fprintf(output[i], "\"");
 					    }
 					else
@@ -4142,11 +3918,12 @@ int main (int argc, char **argv)
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    b = time_i[4];
 					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[5] + 1e-6 * time_i[6];
+					    b = seconds;
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    }
 					break;
 				case 't': /* yyyy mm dd hh mm ss time string */
+					seconds = time_i[5] + 1e-6 * time_i[6];
 					if (ascii == MB_YES)
 					    {
 					    if (netcdf == MB_YES)
@@ -4155,10 +3932,9 @@ int main (int argc, char **argv)
 						time_i[3],time_i[4],time_i[5],
 						time_i[6]);
 					    else
-					    fprintf(output[i],"%.4d %.2d %.2d %.2d %.2d %.2d.%.6d",
+					    fprintf(output[i],"%.4d %.2d %.2d %.2d %.2d %9.6f",
 						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],
-						time_i[6]);
+						time_i[3],time_i[4],seconds);
 					    }
 					else
 					    {
@@ -4172,7 +3948,7 @@ int main (int argc, char **argv)
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    b = time_i[4];
 					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[5] + 1e-6 * time_i[6];
+					    b = seconds;
 					    fwrite(&b, sizeof(double), 1, outfile);
 					    }
 					break;
diff --git a/src/utilities/mbmosaic.c b/src/utilities/mbmosaic.c
index 707fed5..e339d8e 100644
--- a/src/utilities/mbmosaic.c
+++ b/src/utilities/mbmosaic.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbmosaic.c	2/10/97
- *    $Id: mbmosaic.c 2183 2014-04-16 19:54:45Z caress $
+ *    $Id: mbmosaic.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 1997-2014 by
+ *    Copyright (c) 1997-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -24,148 +24,6 @@
  * Author:	D. W. Caress
  * Date:	February 10, 1997
  *
- * $Log: mbmosaic.c,v $
- * Revision 5.31  2009/03/02 18:54:40  caress
- * Fixed pixel size problems with mbmosaic, resurrected program mbfilter, and also updated copyright dates in several source files.
- *
- * Revision 5.30  2008/12/22 08:36:18  caress
- * Check in of 22 Dec 2008.
- *
- * Revision 5.29  2008/09/27 03:27:11  caress
- * Working towards release 5.1.1beta24
- *
- * Revision 5.28  2008/08/12 00:04:04  caress
- * Gordon Keith's addition of a weighting option.
- *
- * Revision 5.27  2008/05/24 19:40:07  caress
- * Applied a Gordon Keith fix.
- *
- * Revision 5.26  2008/01/14 18:35:49  caress
- * Improved handling of datalists.
- *
- * Revision 5.25  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.24  2006/09/11 18:55:54  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.23  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.22  2006/06/22 04:45:43  caress
- * Working towards 5.1.0
- *
- * Revision 5.21  2006/04/11 19:19:29  caress
- * Various fixes.
- *
- * Revision 5.20  2006/02/01 07:31:06  caress
- * Modifications suggested by Gordon Keith
- *
- * Revision 5.19  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.18  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.17  2004/12/02 06:38:50  caress
- * Fix suggested by Gordon Keith
- *
- * Revision 5.16  2003/12/12 01:39:06  caress
- * Fixed designation of the output stream to stdout or stderr.
- *
- * Revision 5.15  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.14  2002/11/14 03:52:25  caress
- * Release 5.0.beta27
- *
- * Revision 5.13  2002/11/12 07:23:58  caress
- * Added mb_memory_clear() calls.
- *
- * Revision 5.12  2002/11/04 21:26:55  caress
- * Fixed memory leak using proj.
- *
- * Revision 5.11  2002/10/04 21:22:02  caress
- * Now resets lonflip to specified bounds. Release 5.0.beta24.
- *
- * Revision 5.10  2002/10/02 23:56:06  caress
- * Release 5.0.beta24
- *
- * Revision 5.9  2002/09/25 20:12:30  caress
- * Not sure what I did....
- *
- * Revision 5.8  2002/09/20 22:30:45  caress
- * Made interpolation only fill in data gaps.
- *
- * Revision 5.7  2002/09/19 00:28:12  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2002/08/02 01:00:25  caress
- * Release 5.0.beta22
- *
- * Revision 5.5  2002/04/06 02:53:45  caress
- * Release 5.0.beta16
- *
- * Revision 5.4  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/29 22:50:23  caress
- * Atlas Hydrosweep DS2 raw data and SURF data formats.
- *
- * Revision 5.2  2001/06/03  07:07:34  caress
- * Release 5.0.beta01.
- *
- * Revision 5.1  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  2000/09/11  20:10:02  caress
- * Linked to new datalist parsing functions. Now supports recursive datalists
- * and comments in datalists.
- *
- * Revision 4.9  2000/06/20  21:00:19  caress
- * Moved execution of mbm_grdplot to after deallocation of array memory.
- *
- * Revision 4.8  1999/10/05  22:04:18  caress
- * Improved the facility for outputting ArcView grids.
- *
- * Revision 4.7  1999/09/24  23:11:07  caress
- * Altered grid interval parameter handling
- *
- * Revision 4.6  1999/08/08  04:17:40  caress
- * Unknown changes.
- *
- * Revision 4.5  1999/04/16  01:29:39  caress
- * Version 4.6 final release?
- *
- * Revision 4.4  1999/02/04  23:55:08  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.3  1998/10/07  19:33:56  caress
- * Removed ddmmss_to_degree function as it is included in gmt_init.c
- *
- * Revision 4.2  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/09/15  19:11:06  caress
- * Real Version 4.5
- *
- * Revision 4.0  1997/04/21  17:17:47  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/17  15:14:38  caress
- * MB-System 4.5 Beta Release
- *
- *
  */
 
 /* standard include files */
@@ -176,9 +34,6 @@
 #include <string.h>
 #include <time.h>
 
-/* GMT include files */
-#include "gmt.h"
-
 /* mbio include files */
 #include "mb_status.h"
 #include "mb_format.h"
@@ -278,13 +133,6 @@ int write_oldgrd(int verbose, char *outfile, float *grid,
 		int nx, int ny,
 		double xmin, double xmax, double ymin, double ymax,
 		double dx, double dy, int *error);
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error);
 int mbmosaic_get_beamangles(
 		int     verbose,
                 double  sonardepth,
@@ -388,9 +236,10 @@ int mbmosaic_get_footprint(
 		double	acrosstrack_spacing,
 		struct footprint *footprint,
 		int	*error);
+int double_compare(double *a, double *b);
 
 /* program identifiers */
-static char rcs_id[] = "$Id: mbmosaic.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[] = "$Id: mbmosaic.c 2247 2015-05-29 21:28:28Z caress $";
 char program_name[] = "mbmosaic";
 char help_message[] =  "mbmosaic is an utility used to mosaic amplitude or \nsidescan data contained in a set of swath sonar data files.  \nThis program uses one of four algorithms (gaussian weighted mean, \nmedian filter, minimum filter, maximum filter) to grid regions \ncovered by multibeam swaths and then fills in gaps between \nthe swaths (to the degree specified by the user) using a minimum\ncurvature algorithm.";
 char usage_message[] = "mbmosaic -Ifilelist -Oroot \
@@ -1063,7 +912,7 @@ int main (int argc, char **argv)
 	/* define NaN in case it's needed */
 	if (use_NaN == MB_YES)
 		{
-		GMT_make_fnan(NaN);
+		MB_MAKE_FNAN(NaN);
 		outclipvalue = NaN;
 		}
 
@@ -3579,20 +3428,34 @@ gbnd[0], gbnd[1], gbnd[2], gbnd[3]);
 		{
 		strcpy(ofile,fileroot);
 		strcat(ofile,".grd");
-		status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			zmin,zmax,dx,dy,
-			xlabel,ylabel,zlabel,title,projection_id,
-			argc,argv,&error);
+		status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 		}
 	else if (gridkind == MBMOSAIC_GMTGRD)
 		{
 		sprintf(ofile,"%s.grd%s", fileroot, gridkindstring);
-		status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			zmin,zmax,dx,dy,
-			xlabel,ylabel,zlabel,title,projection_id,
-			argc,argv,&error);
+		status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 		}
 	if (status != MB_SUCCESS)
 		{
@@ -3649,20 +3512,34 @@ gbnd[0], gbnd[1], gbnd[2], gbnd[3]);
 			{
 			strcpy(ofile,fileroot);
 			strcat(ofile,"_num.grd");
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,nlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		else if (gridkind == MBMOSAIC_GMTGRD)
 			{
 			sprintf(ofile,"%s_num.grd%s", fileroot, gridkindstring);
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,zlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		if (status != MB_SUCCESS)
 			{
@@ -3717,20 +3594,34 @@ gbnd[0], gbnd[1], gbnd[2], gbnd[3]);
 			{
 			strcpy(ofile,fileroot);
 			strcat(ofile,"_sd.grd");
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,sdlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		else if (gridkind == MBMOSAIC_GMTGRD)
 			{
 			sprintf(ofile,"%s_sd.grd%s", fileroot, gridkindstring);
-			status = write_cdfgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				zmin,zmax,dx,dy,
-				xlabel,ylabel,zlabel,title,projection_id,
-				argc,argv,&error);
+                        status = mb_write_gmt_grd(verbose,
+                                        ofile,
+                                        output,
+                                        outclipvalue,
+                                        xdim,ydim,
+                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
+                                        zmin,zmax,
+                                        dx,dy,
+                                        xlabel,ylabel,zlabel,title,
+                                        projection_id,
+                                        argc,argv,
+                                        &error);
 			}
 		if (status != MB_SUCCESS)
 			{
@@ -4078,151 +3969,6 @@ int write_oldgrd(int verbose, char *outfile, float *grid,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-/*
- * function write_cdfgrd writes output grid to a
- * GMT version 2 netCDF grd file
- */
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error)
-{
-	char	*function_name = "write_cdfgrd";
-	int	status = MB_SUCCESS;
-	struct GRD_HEADER grd;
-	double	w, e, s, n;
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
-#else
-	int	pad[4];
-#endif
-	float	*a;
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	char	remark[MB_PATH_MAXLINE];
-	int	i, j, kg, ka;
-	char	*ctime();
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       outfile:    %s\n",outfile);
-		fprintf(stderr,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(stderr,"dbg2       nx:         %d\n",nx);
-		fprintf(stderr,"dbg2       ny:         %d\n",ny);
-		fprintf(stderr,"dbg2       xmin:       %f\n",xmin);
-		fprintf(stderr,"dbg2       xmax:       %f\n",xmax);
-		fprintf(stderr,"dbg2       ymin:       %f\n",ymin);
-		fprintf(stderr,"dbg2       ymax:       %f\n",ymax);
-		fprintf(stderr,"dbg2       dx:         %f\n",dx);
-		fprintf(stderr,"dbg2       dy:         %f\n",dy);
-		fprintf(stderr,"dbg2       xlab:       %s\n",xlab);
-		fprintf(stderr,"dbg2       ylab:       %s\n",ylab);
-		fprintf(stderr,"dbg2       zlab:       %s\n",zlab);
-		fprintf(stderr,"dbg2       titl:       %s\n",titl);
-		fprintf(stderr,"dbg2       argc:       %d\n",argc);
-		fprintf(stderr,"dbg2       *argv:      %p\n",(void *)*argv);
-		}
-
-	/* inititialize grd header */
-	GMT_program = program_name;
-	GMT_grd_init (&grd, 1, argv, FALSE);
-	GMT_io_init ();
-	GMT_grdio_init ();
-	GMT_make_fnan (GMT_f_NaN);
-	GMT_make_dnan (GMT_d_NaN);
-
-	/* copy values to grd header */
-	grd.nx = nx;
-	grd.ny = ny;
-	grd.node_offset = 0;
-	grd.x_min = xmin;
-	grd.x_max = xmax;
-	grd.y_min = ymin;
-	grd.y_max = ymax;
-	grd.z_min = zmin;
-	grd.z_max = zmax;
-	grd.x_inc = dx;
-	grd.y_inc = dy;
-	grd.z_scale_factor = 1.0;
-	grd.z_add_offset = 0.0;
-	strcpy(grd.x_units,xlab);
-	strcpy(grd.y_units,ylab);
-	strcpy(grd.z_units,zlab);
-	strcpy(grd.title,titl);
-	strcpy(grd.command,"\0");
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,MB_PATH_MAXLINE);
-	sprintf(remark,"\n\tProjection: %s\n\tGrid created by %s\n\tMB-system Version %s\n\tRun by <%s> on <%s> at <%s>",
-		projection,program_name,MB_VERSION,user,host,date);
-	strncpy(grd.remark, remark, 159);
-
-	/* set extract wesn,pad */
-	w = 0.0;
-	e = 0.0;
-	s = 0.0;
-	n = 0.0;
-	for (i=0;i<4;i++)
-		pad[i] = 0;
-
-	/* allocate memory for output array */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,grd.nx*grd.ny*sizeof(float),(void **)&a,error);
-
-	/* copy grid to new array and write it to GMT netCDF grd file */
-	if (status == MB_SUCCESS)
-		{
-		/* copy grid to new array */
-		for (i=0;i<grd.nx;i++)
-			for (j=0;j<grd.ny;j++)
-				{
-				kg = i*grd.ny+j;
-				ka = (grd.ny-1-j)*grd.nx+i;
-				a[ka] = grid[kg];
-				}
-
-		/* write the GMT netCDF grd file */
-		GMT_write_grd(outfile, &grd, a, w, e, s, n, pad, FALSE);
-
-		/* free memory for output array */
-		mb_freed(verbose,__FILE__,__LINE__,(void **) &a, error);
-		}
-
-	/* free GMT memory */
-	GMT_free ((void *)GMT_io.skip_if_NaN);
-	GMT_free ((void *)GMT_io.in_col_type);
-	GMT_free ((void *)GMT_io.out_col_type);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
 int double_compare(double *a, double *b)
 {
 	if (*a > *b)
diff --git a/src/utilities/mbnavlist.c b/src/utilities/mbnavlist.c
index 1515f81..d3fbed4 100644
--- a/src/utilities/mbnavlist.c
+++ b/src/utilities/mbnavlist.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbnavlist.c	2/1/93
- *    $Id: mbnavlist.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbnavlist.c 2251 2015-07-01 01:02:06Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -22,68 +22,6 @@
  * Date:	November 11, 1999
  *
  *
- * $Log: mbnavlist.c,v $
- * Revision 5.12  2007/10/17 20:34:00  caress
- * Release 5.1.1beta11
- * Added decimation option.
- *
- * Revision 5.11  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.10  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2004/12/02 06:37:42  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.8  2003/07/30 16:41:06  caress
- * Fixed handling of time gap errors in data .
- *
- * Revision 5.7  2003/07/02 18:14:19  caress
- * Release 5.0.0
- *
- * Revision 5.6  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/05/29 23:43:09  caress
- * Release 5.0.beta18
- *
- * Revision 5.4  2001/07/24 17:40:54  caress
- * Fixed typo.
- *
- * Revision 5.3  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.1  2000/12/10  20:30:44  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  2000/09/11  20:10:02  caress
- * Linked to new datalist parsing functions. Now supports recursive datalists
- * and comments in datalists.
- *
- * Revision 4.1  2000/03/08  00:03:45  caress
- * Release 4.6.10
- *
- * Revision 4.0  1999/12/29  00:58:18  caress
- * Release 4.6.8
- *
- * Revision 1.1  1999/12/29  00:35:11  caress
- * Initial revision
- *
- *
- *
  */
 
 /* standard include files */
@@ -111,7 +49,7 @@ int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error);
 /* NaN value */
 double	NaN;
 
-static char rcs_id[] = "$Id: mbnavlist.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbnavlist.c 2251 2015-07-01 01:02:06Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -219,6 +157,7 @@ int main (int argc, char **argv)
 	int	first_u = MB_YES;
 	time_t	time_u;
 	time_t	time_u_ref;
+	double	seconds;
 
 	/* course calculation variables */
 	double	dlon, dlat, minutes;
@@ -653,10 +592,13 @@ int main (int argc, char **argv)
 				heave = aheave[inav];
 				sonardepth = draft - heave;
 
-/*fprintf(stdout, "kind:%d error:%d %d of %d: time:%4d/%2d/%2d %2.2d:%2.2d:%2.2d.%6.6d\n",
+/*
+seconds = time_i[5] + 1e-6 * time_i[6];
+fprintf(stdout, "kind:%d error:%d %d of %d: time:%4d/%2d/%2d %2.2d:%2.2d:%9.6f\n",
 kind, error, i, n,
 time_i[0],  time_i[1],  time_i[2],
-time_i[3],  time_i[4],  time_i[5],   time_i[6]);*/
+time_i[3],  time_i[4],  seconds);
+*/
 
 				/* calculate course made good and distance */
 				mb_coor_scale(verbose,navlat, &mtodeglon, &mtodeglat);
@@ -727,12 +669,13 @@ time_i[3],  time_i[4],  time_i[5],   time_i[6]);*/
 							break;
 						case 'J': /* time string */
 							mb_get_jtime(verbose,time_i,time_j);
+							seconds = time_i[5] + 0.000001 * time_i[6];
 							if (ascii == MB_YES)
 							    {
-							    printf("%.4d %.3d %.2d %.2d %.2d.%6.6d",
+							    printf("%.4d %.3d %.2d %.2d %9.6f",
 								time_j[0],time_j[1],
 								time_i[3],time_i[4],
-								time_i[5],time_i[6]);
+								seconds);
 							    }
 							else
 							    {
@@ -752,11 +695,12 @@ time_i[3],  time_i[4],  time_i[5],   time_i[6]);*/
 							break;
 						case 'j': /* time string */
 							mb_get_jtime(verbose,time_i,time_j);
+							seconds = time_i[5] + 0.000001 * time_i[6];
 							if (ascii == MB_YES)
 							    {
-							    printf("%.4d %.3d %.4d %.2d.%6.6d",
+							    printf("%.4d %.3d %.4d %9.6f",
 								time_j[0],time_j[1],
-								time_j[2],time_j[3],time_j[4]);
+								time_j[2],seconds);
 							    }
 							else
 							    {
@@ -831,11 +775,11 @@ time_i[3],  time_i[4],  time_i[5],   time_i[6]);*/
 									    &signflip_next_value, &error);
 							break;
 						case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
+							seconds = time_i[5] + 1e-6 * time_i[6];
 							if (ascii == MB_YES)
-							    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%.2d.%.6d",
+							    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
 								time_i[0],time_i[1],time_i[2],
-								time_i[3],time_i[4],time_i[5],
-								time_i[6]);
+								time_i[3],time_i[4],seconds);
 							else
 							    {
 							    b = time_i[0];
@@ -848,16 +792,16 @@ time_i[3],  time_i[4],  time_i[5],   time_i[6]);*/
 							    fwrite(&b, sizeof(double), 1, stdout);
 							    b = time_i[4];
 							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[5] + 1e-6 * time_i[6];
+							    b = seconds;
 							    fwrite(&b, sizeof(double), 1, stdout);
 							    }
 							break;
 						case 't': /* yyyy mm dd hh mm ss time string */
+							seconds = time_i[5] + 1e-6 * time_i[6];
 							if (ascii == MB_YES)
-							    printf("%.4d %.2d %.2d %.2d %.2d %.2d.%.6d",
+							    printf("%.4d %.2d %.2d %.2d %.2d %9.6f",
 								time_i[0],time_i[1],time_i[2],
-								time_i[3],time_i[4],time_i[5],
-								time_i[6]);
+								time_i[3],time_i[4],seconds);
 							else
 							    {
 							    b = time_i[0];
@@ -870,7 +814,7 @@ time_i[3],  time_i[4],  time_i[5],   time_i[6]);*/
 							    fwrite(&b, sizeof(double), 1, stdout);
 							    b = time_i[4];
 							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[5] + 1e-6 * time_i[6];
+							    b = seconds;
 							    fwrite(&b, sizeof(double), 1, stdout);
 							    }
 							break;
diff --git a/src/utilities/mbneptune2esf.c b/src/utilities/mbneptune2esf.c
index c160db7..8e7f8cd 100644
--- a/src/utilities/mbneptune2esf.c
+++ b/src/utilities/mbneptune2esf.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbneptune2esf.c	2004/11/11
- *    $Id: mbneptune2esf.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbneptune2esf.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    Gordon Keith
  *      CSIRO Marine Research
  *      Castray Esplanade
@@ -145,7 +145,7 @@ int line_array(struct neptune_line_tree *line, struct neptune_line_tree ***array
 int print_pings(FILE *output, struct neptune_ping_tree *node);
 int free_pings(int verbose, struct neptune_ping_tree **node, int *error);
 
-static char rcs_id[] = "$Id: mbneptune2esf.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbneptune2esf.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbpreprocess.c b/src/utilities/mbpreprocess.c
index bab996b..fece8ce 100644
--- a/src/utilities/mbpreprocess.c
+++ b/src/utilities/mbpreprocess.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbpreprocess.c	1/8/2014
- *    $Id: mbpreprocess.c 2219 2014-12-11 21:22:25Z caress $
+ *    $Id: mbpreprocess.c 2230 2015-02-19 00:39:00Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -26,7 +26,7 @@
  */
 
 /* source file version string */
-static char version_id[] = "$Id: mbpreprocess.c 2219 2014-12-11 21:22:25Z caress $";
+static char version_id[] = "$Id: mbpreprocess.c 2230 2015-02-19 00:39:00Z caress $";
 
 /* standard include files */
 #include <stdio.h>
@@ -1079,11 +1079,14 @@ int main (int argc, char **argv)
 					{
 					for (i=0;i<nanav;i++)
 						{
-						nav_time_d[nav_num] = atime_d[i];
-						nav_navlon[nav_num] = alon[i];
-						nav_navlat[nav_num] = alat[i];
-						nav_speed[nav_num] = aspeed[i];
-						nav_num++;
+						if (atime_d[i] > 0.0 && alon[i] != 0.0 && alat[i] != 0.0)
+							{
+							nav_time_d[nav_num] = atime_d[i];
+							nav_navlon[nav_num] = alon[i];
+							nav_navlat[nav_num] = alat[i];
+							nav_speed[nav_num] = aspeed[i];
+							nav_num++;
+							}
 						}
 					}
 				}
@@ -1466,7 +1469,11 @@ int main (int argc, char **argv)
 		}
 	
 	/*-------------------------------------------------------------------*/
-	
+
+//for (i=0;i<nav_num;i++)
+//fprintf(stderr,"NAV %d %f %f %f\n",i,nav_time_d[i],nav_navlon[i],nav_navlat[i]);
+//fprintf(stderr," \n");
+
 	/* Do second pass through the data reading everything,
 		correcting survey data, and outputting everything */
 				
@@ -1907,17 +1914,17 @@ int main (int argc, char **argv)
 							navlat+= -headingx * sonar_offset_x * mtodeglat
 									+ headingy * sonar_offset_y * mtodeglat;
 							nav_changed = MB_YES;
-fprintf(stderr,"HEADING: %f  %f %f POSITION OFFSET: meters: %f %f   lonlat: %f %f ",
-heading, headingx, headingy,
-sonar_offset_x, sonar_offset_y,
-headingy * sonar_offset_x * mtodeglon + headingx * sonar_offset_y * mtodeglon,
--headingx * sonar_offset_x * mtodeglat + headingy * sonar_offset_y * mtodeglat);
+//fprintf(stderr,"HEADING: %f  %f %f POSITION OFFSET: meters: %f %f   lonlat: %f %f ",
+//heading, headingx, headingy,
+//sonar_offset_x, sonar_offset_y,
+//headingy * sonar_offset_x * mtodeglon + headingx * sonar_offset_y * mtodeglon,
+//-headingx * sonar_offset_x * mtodeglat + headingy * sonar_offset_y * mtodeglat);
 							}
 						if (sonar_offset_z != 0.0)
 							{
 							sensordepth -= sonar_offset_z;
 							sensordepth_changed = MB_YES;
-fprintf(stderr,"SENSORDEPTH OFFSET: %f ",-sonar_offset_z);
+//fprintf(stderr,"SENSORDEPTH OFFSET: %f ",-sonar_offset_z);
 							}
 
 						/* apply lever arm calculation */
@@ -1928,25 +1935,29 @@ fprintf(stderr,"SENSORDEPTH OFFSET: %f ",-sonar_offset_z);
 							navlat+= -headingx * lever_x * mtodeglat
 									+ headingy * lever_y * mtodeglat;
 							nav_changed = MB_YES;
-fprintf(stderr,"LEVER ARM XY OFFSET: meters: %f %f   lonlat: %f %f ",
-lever_x, lever_y,
-headingy * lever_x * mtodeglon + headingx * lever_y * mtodeglon,
--headingx * lever_x * mtodeglat + headingy * lever_y * mtodeglat);
+//fprintf(stderr,"LEVER ARM XY OFFSET: meters: %f %f   lonlat: %f %f ",
+//lever_x, lever_y,
+//headingy * lever_x * mtodeglon + headingx * lever_y * mtodeglon,
+//-headingx * lever_x * mtodeglat + headingy * lever_y * mtodeglat);
 							}
 						if (lever_z != 0.0)
 							{
 							sensordepth -= lever_z;
 							sensordepth_changed = MB_YES;
-fprintf(stderr,"LEVER ARM Z OFFSET: %f ",-lever_z);
+//fprintf(stderr,"LEVER ARM Z OFFSET: %f ",-lever_z);
 							}						
-if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0 || sonar_offset_z != 0.0
-|| lever_x != 0.0 || lever_y != 0.0 || lever_z != 0.0)
-fprintf(stderr,"\n");
+//if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0 || sonar_offset_z != 0.0
+//|| lever_x != 0.0 || lever_y != 0.0 || lever_z != 0.0)
+//fprintf(stderr,"\n");
 						}
 					
 					/* if attitude changed apply rigid rotations to the bathymetry */
 					if (attitude_changed == MB_YES)
-						{
+						{				
+						/* add heave and draft */
+						depth_offset_use = heave + draft;
+						depth_offset_org = heave + draft_org;
+
 						/* loop over the beams */
 						for (i=0;i<beams_bath;i++)
 							{
@@ -1963,10 +1974,6 @@ fprintf(stderr,"\n");
 									fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
 									}
 				
-								/* add heave and draft */
-								depth_offset_use = heave + draft;
-								depth_offset_org = heave + draft_org;
-				
 								/* strip off heave + draft */
 								bath[i] -= depth_offset_org;
 				
diff --git a/src/utilities/mbprocess.c b/src/utilities/mbprocess.c
index ad12fda..fe2907f 100644
--- a/src/utilities/mbprocess.c
+++ b/src/utilities/mbprocess.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbprocess.c	3/31/93
- *    $Id: mbprocess.c 2210 2014-11-10 19:53:01Z caress $
+ *    $Id: mbprocess.c 2250 2015-06-30 02:12:26Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -35,206 +35,6 @@
  * Author:	D. W. Caress
  * Date:	January 4, 2000
  *
- * $Log: mbprocess.c,v $
- * Revision 5.61  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.60  2009/03/02 18:54:40  caress
- * Fixed pixel size problems with mbmosaic, resurrected program mbfilter, and also updated copyright dates in several source files.
- *
- * Revision 5.59  2009/01/15 17:37:28  caress
- * Update on 15 Jan 2009 - fix to mbm_grd2arc and mbm_arc2grd
- *
- * Revision 5.58  2008/12/22 08:36:18  caress
- * Check in of 22 Dec 2008.
- *
- * Revision 5.57  2008/09/11 20:20:14  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.56  2008/07/19 07:45:30  caress
- * Fix for crashes provided by Gordon Keith.
- *
- * Revision 5.55  2008/07/10 18:16:33  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.53  2008/05/24 19:41:44  caress
- * Added processing kluge (kluge006) allowing the sonar draft to be be changed without changing the calculated bathymetry.
- *
- * Revision 5.52  2008/03/01 09:22:29  caress
- * Changed verbosity behavior to only print out files skipped because processing unknown when verbose > 0.
- *
- * Revision 5.51  2008/01/14 18:37:12  caress
- * Fixed problems in comments embedded in output processed files.
- *
- * Revision 5.50  2007/10/31 18:41:42  caress
- * Fixed handling of null sidescan values.
- *
- * Revision 5.49  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.48  2007/05/12 19:44:26  caress
- * Use sonar depth adjustments generated by mbnavadjust.
- *
- * Revision 5.47  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.46  2006/03/14 01:51:53  caress
- * Fixed problem with per-beam heave values when applying rotational bathymetry correction - previously did not initialize heave values for non-null but flagged beams.
- *
- * Revision 5.45  2006/02/16 21:11:44  caress
- * Fixed problems with reading time from some navigation formats.
- *
- * Revision 5.44  2006/01/27 19:13:04  caress
- * Version 5.0.8beta2
- *
- * Revision 5.43  2006/01/20 19:34:47  caress
- * Working towards 5.0.8
- *
- * Revision 5.42  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.41  2006/01/06 18:19:59  caress
- * Working towards 5.0.8
- *
- * Revision 5.40  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.39  2005/08/17 17:31:56  caress
- * Improved how the best altitude value is obtained for sidescan and amplitude data correction.
- *
- * Revision 5.38  2005/06/04 05:17:28  caress
- * Added KLUGE005 feature to insert navigation record timestamps into processed survey records. This allows timestamp fixes made using MBnavedit to be applied during processing.
- *
- * Revision 5.37  2005/04/06 17:29:40  caress
- * Moved tide correction to end of processing tasks so that it doesn't mess up grazing angle calculations for amplitude and sidescan correction.
- *
- * Revision 5.36  2005/03/25 04:39:01  caress
- * Sonar depth merging has been added to mbprocess and mbset. This is controlled by the SONARDEPTHMODE, SONARDEPTHFILE, and SONARDEPTHFORMAT mbprocess parameters.
- *
- * Revision 5.35  2004/12/02 06:37:42  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.34  2004/10/06 19:10:52  caress
- * Release 5.0.5 update.
- *
- * Revision 5.33  2004/04/27 02:56:37  caress
- * Implemented Kluge004
- *
- * Revision 5.32  2003/11/25 01:16:58  caress
- * The LDEO processed nav format has changed slightly. The code now reads old or new LDEO nav as NAVFORMAT:5.
- *
- * Revision 5.31  2003/07/30 16:43:59  caress
- * Fixed handling of nonfatal errors in data.
- * Added KLUGE003 for fixing roll units error in Healy 2112 data.
- *
- * Revision 5.30  2003/07/26 18:01:22  caress
- * Changed beamflag handling code.
- *
- * Revision 5.29  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.28  2003/04/05 14:56:11  caress
- * Fixed bug where program bus faulted at mb_rt_init if it encountered a file not undergoing
- * raytracing after raytracing has been applied.
- *
- * Revision 5.27  2003/02/27 04:45:15  caress
- * Fixed handling of beam edits.
- *
- * Revision 5.26  2003/01/15 20:52:13  caress
- * Release 5.0.beta28
- *
- * Revision 5.25  2002/10/02 23:56:06  caress
- * Release 5.0.beta24
- *
- * Revision 5.24  2002/09/19 00:28:12  caress
- * Release 5.0.beta23
- *
- * Revision 5.23  2002/09/07 04:49:23  caress
- * Added slope mode option to mb_process.
- *
- * Revision 5.22  2002/07/25 19:07:17  caress
- * Release 5.0.beta21
- *
- * Revision 5.21  2002/07/20 20:56:55  caress
- * Release 5.0.beta20
- *
- * Revision 5.20  2002/05/29 23:43:09  caress
- * Release 5.0.beta18
- *
- * Revision 5.19  2002/04/08 21:01:04  caress
- * Release 5.0.beta17
- *
- * Revision 5.18  2002/04/06 02:53:45  caress
- * Release 5.0.beta16
- *
- * Revision 5.17  2002/03/26 07:45:14  caress
- * Release 5.0.beta15
- *
- * Revision 5.16  2001/12/18 04:29:57  caress
- * Release 5.0.beta11.
- *
- * Revision 5.15  2001/11/20  02:00:19  caress
- * Now inserts metadata tags before comments.
- *
- * Revision 5.14  2001/11/15  22:58:02  caress
- * Added datalist parsing to mbset, fixed file path handling.
- *
- * Revision 5.13  2001/11/04  00:27:29  caress
- * Fixed handling of angle modes.
- *
- * Revision 5.12  2001/11/02  01:03:08  caress
- * Now handles ray source above top of SVP even when
- * SVP begins at nonzero depth.
- *
- * Revision 5.11  2001/10/19  00:56:17  caress
- * Now tries to use relative paths.
- *
- * Revision 5.10  2001/08/10  22:42:50  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.9  2001-08-03 18:01:07-07  caress
- * Added cut by speed.
- *
- * Revision 5.8  2001/07/31  00:42:12  caress
- * Added data cutting capability.
- *
- * Revision 5.7  2001/07/27  19:09:41  caress
- * Started adding data cutting, but not done yet.
- *
- * Revision 5.6  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.5  2001/06/08 21:45:46  caress
- * Version 5.0.beta01
- *
- * Revision 5.4  2001/06/03  07:07:34  caress
- * Release 5.0.beta01.
- *
- * Revision 5.3  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.2  2001/01/22  07:54:22  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:30:44  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.2  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  2000/09/11  20:10:02  caress
- * Added suppport for merging edited sonar depth values.
- *
- * Revision 4.0  2000/03/08  00:04:28  caress
- * Release 4.6.10
- *
- *
  */
 
 /* standard include files */
@@ -307,7 +107,7 @@ int get_anglecorr(int verbose,
 	int nangle, double *angles, double *corrs,
 	double angle, double *corr, int *error);
 
-static char rcs_id[] = "$Id: mbprocess.c 2210 2014-11-10 19:53:01Z caress $";
+static char rcs_id[] = "$Id: mbprocess.c 2250 2015-06-30 02:12:26Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -727,17 +527,12 @@ and mbedit edit save files.\n";
 		exit(error);
 		}
 
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-System Version %s\n",MB_VERSION);
-		}
-
 	/* if help desired then print it and exit */
 	if (help)
 	    {
+	    fprintf(stderr,"\nProgram %s\n",program_name);
+	    fprintf(stderr,"Version %s\n",rcs_id);
+	    fprintf(stderr,"MB-System Version %s\n",MB_VERSION);
 	    fprintf(stderr,"\n%s\n",help_message);
 	    fprintf(stderr,"\nusage: %s\n", usage_message);
 	    exit(error);
@@ -843,7 +638,7 @@ and mbedit edit save files.\n";
 	    }
 
 	/* print starting info statements */
-	else
+	else if (verbose > 0)
 	    {
 	    fprintf(stderr,"\nProgram <%s>\n",program_name);
 	    fprintf(stderr,"Version %s\n",rcs_id);
@@ -884,7 +679,7 @@ and mbedit edit save files.\n";
 	/* make output file path global if needed */
 	if (status == MB_SUCCESS
 	    && mbp_ofile_specified == MB_NO
-	    && process.mbp_ofile[0] != '/'
+	    && process.mbp_ofile[0] != '/' && process.mbp_ofile[1] != ':'
 	    && strrchr(process.mbp_ifile,'/') != NULL
 	    && (len = strrchr(process.mbp_ifile,'/')
 			- process.mbp_ifile + 1) > 1)
@@ -3581,7 +3376,7 @@ and mbedit edit save files.\n";
 		{
 		grid.data = NULL;
 		strcpy(grid.file, process.mbp_ampsscorr_topofile);
-		status = mb_readgrd(verbose, grid.file, &grid.projection_mode, grid.projection_id, &grid.nodatavalue,
+		status = mb_read_gmt_grd(verbose, grid.file, &grid.projection_mode, grid.projection_id, &grid.nodatavalue,
 					&grid.nxy, &grid.nx, &grid.ny, &grid.min, &grid.max,
 					&grid.xmin, &grid.xmax, &grid.ymin, &grid.ymax,
 					&grid.dx, &grid.dy, &grid.data, NULL, NULL, &error);
@@ -5351,6 +5146,24 @@ time_d,idata-1,ntime[idata-1],process.mbp_kluge005);*/
 		    }
 
 	/*--------------------------------------------
+	  apply tide correction
+	  --------------------------------------------*/
+
+		/* apply tide corrections */
+		if (process.mbp_tide_mode == MBP_TIDE_ON
+			&& ntide > 0)
+		    {
+		    /* interpolate tide */
+		    intstat = mb_linear_interp(verbose,
+				tidetime-1, tide-1,
+				ntide, time_d, &tideval, &itime,
+				&error);
+
+		    /* apply tide to to draft / sonar depth */
+		    draft -= tideval;
+		    }
+
+	/*--------------------------------------------
 	  handle lever arm correction
 	  --------------------------------------------*/
 
@@ -5942,28 +5755,6 @@ time_i[4], time_i[5], time_i[6], draft, depth_offset_change);*/
 			    }
 
 	/*--------------------------------------------
-	  apply tide correction
-	  --------------------------------------------*/
-
-			/* apply tide corrections */
-			if (process.mbp_tide_mode == MBP_TIDE_ON
-				&& ntide > 0)
-			    {
-			    /* interpolate tide */
-			    intstat = mb_linear_interp(verbose,
-					tidetime-1, tide-1,
-					ntide, time_d, &tideval, &itime,
-					&error);
-
-			    /* apply tide to all valid beams */
-			    for (i=0;i<nbath;i++)
-				{
-				if (beamflag[i] != MB_FLAG_NULL)
-					bath[i] -= tideval;
-				}
-			    }
-
-	/*--------------------------------------------
 	  apply per-beam static offsets
 	  --------------------------------------------*/
 
diff --git a/src/utilities/mbps.c b/src/utilities/mbps.c
index 0dd33dc..0bde7bb 100644
--- a/src/utilities/mbps.c
+++ b/src/utilities/mbps.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbps.c	11/4/93
- *    $Id: mbps.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbps.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -169,7 +169,7 @@ struct ping
 int rgb_black[] = {0, 0, 0};
 int rgb_white[] = {255, 255, 255};
 
-static char rcs_id[] = "$Id: mbps.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbps.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbrollbias.c b/src/utilities/mbrollbias.c
index 6a9a98a..53ef7f1 100644
--- a/src/utilities/mbrollbias.c
+++ b/src/utilities/mbrollbias.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbrollbias.c	5/16/93
- *    $Id: mbrollbias.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbrollbias.c 2249 2015-06-26 19:26:09Z caress $
  *
- *    Copyright (c) 1993-2014 by
+ *    Copyright (c) 1993-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -33,77 +33,6 @@
  * Author:	D. W. Caress
  * Date:	May 16, 1993
  *
- * $Log: mbrollbias.c,v $
- * Revision 5.6  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.5  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.4  2005/03/25 04:43:03  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.3  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.8  1997/09/15  19:11:06  caress
- * Real Version 4.5
- *
- * Revision 4.7  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/01/17  23:02:17  caress
- * Fixed heading averaging problem.
- *
- * Revision 4.4  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.3  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  19:02:56  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * using unix second time base.
- *
- * Revision 4.0  1994/03/06  00:13:22  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/01  18:59:27  caress
- * First cut at new version. Any changes are associated with
- * support of three data types (beam bathymetry, beam amplitude,
- * and sidescan) instead of two (bathymetry and backscatter).
- *
- * Revision 1.1  1993/05/25  04:57:15  caress
- * Initial revision
- *
  *
  */
 
@@ -135,8 +64,13 @@ struct bathptr
 	struct bath *ptr;
 	};
 
+/* local prototypes */
+void gauss(double *a, double *vec,
+		int n, int nstore, double test,
+		int *ierror, int itriag);
+
 /* program identifiers */
-static char rcs_id[] = "$Id: mbrollbias.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbrollbias.c 2249 2015-06-26 19:26:09Z caress $";
 char program_name[] = "MBROLLBIAS";
 char help_message[] =  "MBROLLBIAS is an utility used to assess roll bias of swath \nsonar systems using bathymetry data from two swaths covering the \nsame seafloor in opposite directions. The program takes two input  \nfiles and calculates best fitting planes for each dataset.   \nThe roll bias is calculated by solving for a common roll bias\nfactor which explains the difference between the seafloor\nslopes observed on the two swaths.  This approach assumes that \npitch bias is not a f [...]
 char usage_message[] = "mbrollbias -Dxdim/ydim -Fformat1/format2 -Ifile1 -Jfile2 -Llonflip -Rw/e/s/n -V -H]";
@@ -232,7 +166,6 @@ int main (int argc, char **argv)
 	int	i, j, k;
 	int	ii, jj, kk;
 	int	ib, ix, iy, indx;
-	void	gauss();
 
 	/* get current default values */
 	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
@@ -973,7 +906,7 @@ int main (int argc, char **argv)
 			  }
 
 			/* solve the normal equations */
-			gauss(matrix,vector,nmatrix,nmatrix,1.0e-08,&error,1);
+			gauss((double *)matrix,vector,nmatrix,nmatrix,1.0e-08,&error,1);
 
 			/* get the solution */
 			iaa = vector[0];
@@ -1025,7 +958,7 @@ int main (int argc, char **argv)
 			  }
 
 			/* solve the normal equations */
-			gauss(matrix,vector,nmatrix,nmatrix,1.0e-08,&error,1);
+			gauss((double *)matrix,vector,nmatrix,nmatrix,1.0e-08,&error,1);
 			if (error != 0)
 				{
 				fprintf(outfp,"matrix inversion error: %d\n",error);
diff --git a/src/utilities/mbrolltimelag.c b/src/utilities/mbrolltimelag.c
index 4ab40aa..339af13 100644
--- a/src/utilities/mbrolltimelag.c
+++ b/src/utilities/mbrolltimelag.c
@@ -1,9 +1,9 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbrolltimelag.c	11/10/2005
  *
- *    $Id: mbrolltimelag.c 2186 2014-05-26 19:00:20Z caress $
+ *    $Id: mbrolltimelag.c 2230 2015-02-19 00:39:00Z caress $
  *
- *    Copyright (c) 2005-2014 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -68,7 +68,7 @@
 
 #define	MBRTL_ALLOC_CHUNK	1000
 
-static char rcs_id[] = "$Id: mbrolltimelag.c 2186 2014-05-26 19:00:20Z caress $";
+static char rcs_id[] = "$Id: mbrolltimelag.c 2230 2015-02-19 00:39:00Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -736,7 +736,7 @@ int main (int argc, char **argv)
 	/* generate plot shellscript for cross correlation file */
 	if (read_datalist == MB_YES)
 		{
-		sprintf(cmdfile, "mbm_xyplot -I%s -N", xcorfiletot);
+		sprintf(cmdfile, "mbm_xyplot -I%s -N -L\"Roll Correlation With Acrosstrack Slope:Time Lag (sec):Correlation:\"", xcorfiletot);
 		fprintf(stderr, "Running: %s...\n", cmdfile);
 		shellstatus = system(cmdfile);
 		}
diff --git a/src/utilities/mbroutetime.c b/src/utilities/mbroutetime.c
index 2658bdf..73b12b7 100644
--- a/src/utilities/mbroutetime.c
+++ b/src/utilities/mbroutetime.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbroutetime.c	5/4/2009
- *    $Id: mbroutetime.c 2180 2014-04-02 20:58:34Z caress $
+ *    $Id: mbroutetime.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2009-2014 by
+ *    Copyright (c) 2009-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -50,7 +50,7 @@
 #define MBES_ONLINE_THRESHOLD		15.0
 #define MBES_ONLINE_COUNT		30
 
-static char rcs_id[] = "$Id: mbroutetime.c 2180 2014-04-02 20:58:34Z caress $";
+static char rcs_id[] = "$Id: mbroutetime.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbrphsbias.c b/src/utilities/mbrphsbias.c
index c756e19..36645b0 100644
--- a/src/utilities/mbrphsbias.c
+++ b/src/utilities/mbrphsbias.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbrphsbias.c	9/29/2013
- *    $Id: mbrphsbias.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbrphsbias.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2013-2014 by
+ *    Copyright (c) 2013-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -99,7 +99,7 @@ struct mbrphsbias_file_struct
 	};
 
 
-static char rcs_id[] = "$Id: mbrphsbias.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbrphsbias.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbsegygrid.c b/src/utilities/mbsegygrid.c
index 90280da..2cf0a7f 100644
--- a/src/utilities/mbsegygrid.c
+++ b/src/utilities/mbsegygrid.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsegygrid.c	6/12/2004
- *    $Id: mbsegygrid.c 2185 2014-05-11 06:34:36Z caress $
+ *    $Id: mbsegygrid.c 2234 2015-03-05 07:41:54Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -20,61 +20,6 @@
  * Author:	D. W. Caress
  * Date:	June 12, 2004
  *
- * $Log: mbsegygrid.c,v $
- * Revision 5.16  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.15  2008/09/11 20:20:14  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.14  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.13  2006/12/15 21:42:49  caress
- * Incremental CVS update.
- *
- * Revision 5.12  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.11  2006/06/22 04:45:43  caress
- * Working towards 5.1.0
- *
- * Revision 5.10  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.9  2006/04/19 18:30:34  caress
- * Fixed application of gain below seafloor.
- *
- * Revision 5.8  2006/04/11 19:19:30  caress
- * Various fixes.
- *
- * Revision 5.7  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.6  2005/06/15 15:35:01  caress
- * Added capability to scale shot to distance and time to depth. Also added -MGQ100 to the mbm_grdplot arguments so that the seismic image is more nicely displayed by grdimage.
- *
- * Revision 5.5  2005/06/04 05:59:26  caress
- * Added a time-varying gain option.
- *
- * Revision 5.4  2004/11/08 05:49:17  caress
- * Fixed problem with decimation.
- *
- * Revision 5.3  2004/10/06 19:10:52  caress
- * Release 5.0.5 update.
- *
- * Revision 5.2  2004/09/16 01:01:12  caress
- * Fixed many things.
- *
- * Revision 5.1  2004/07/15 19:33:56  caress
- * Improvements to support for Reson 7k data.
- *
- * Revision 5.0  2004/06/18 04:06:05  caress
- * Adding support for segy i/o and working on support for Reson 7k format 88.
- *
- *
- *
- *
  */
 
 /* standard include files */
@@ -87,14 +32,12 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-/* GMT include files */
-#include "gmt.h"
-
 /* MBIO include files */
 #include "mb_status.h"
 #include "mb_format.h"
 #include "mb_define.h"
 #include "mb_segy.h"
+#include "mb_aux.h"
 
 /* local options */
 #define MBSEGYGRID_USESHOT		0
@@ -117,13 +60,6 @@
 /* NaN value */
 float	NaN;
 
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error);
 int get_segy_limits(int verbose,
 		char	*segyfile,
 		int	*tracemode,
@@ -147,7 +83,7 @@ int four1(float *data, int *n, int *isign);
 	stderr if verbose > 1) */
 FILE	*outfp;
 
-static char rcs_id[] = "$Id: mbsegygrid.c 2185 2014-05-11 06:34:36Z caress $";
+static char rcs_id[] = "$Id: mbsegygrid.c 2234 2015-03-05 07:41:54Z caress $";
 char program_name[] = "MBsegygrid";
 char help_message[] =  "MBsegygrid grids trace data from segy data files.";
 char usage_message[] = "MBsegygrid -Ifile -Oroot [-Ashotscale/timescale \n\
@@ -291,7 +227,7 @@ int main (int argc, char **argv)
 	segyfile[0] = '\0';
 
 	/* get NaN value */
-	GMT_make_fnan(NaN);
+	MB_MAKE_FNAN(NaN);
 
 	/* process argument list */
 	while ((c = getopt(argc, argv, "A:a:B:b:C:c:D:d:F:f:G:g:I:i:O:o:R:r:S:s:T:t:VvW:w:Hh")) != -1)
@@ -433,7 +369,7 @@ int main (int argc, char **argv)
 		}
 
 	/* print starting debug statements */
-	if (verbose >= 0)
+	if (verbose >= 2)
 		{
 		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
 		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
@@ -1020,8 +956,8 @@ igainstart,igainend,tmax,factor);*/
 						{
 						for (i=0;i<traceheader.nsamps;i++)
 							{
-							iy = iys + i / decimatey;
-							k = iy * ngridx + ix;
+							iy = (ngridy - 1) - (iys + i / decimatey);
+							k = ix * ngridy + iy;
 							if (iy >= iystart && iy <= iyend)
 								{
 								grid[k] += trace[i];
@@ -1043,7 +979,8 @@ igainstart,igainend,tmax,factor);*/
 							/* get the index of the sample location */
 							if (iyc >= iystart && iyc <= iyend)
 								{
-								k = iyc * ngridx + ix;
+								iy = (ngridy - 1) - iyc;
+								k = ix * ngridy + iy;
 								grid[k] += trace[i];
 								gridweight[k] += 1.0;
 								}
@@ -1099,7 +1036,8 @@ igainstart,igainend,tmax,factor);*/
 		}
 	strcpy(zlabel, "Trace Signal");
 	sprintf(title, "Seismic Grid from %s", segyfile);
-	status = write_cdfgrd(verbose, gridfile, grid,
+	status = mb_write_gmt_grd(verbose, gridfile, grid,
+		NaN, 
 		ngridx, ngridy,
 		xmin, xmax, ymin, ymax,
 		gridmintot, gridmaxtot, dx, dy,
@@ -1320,136 +1258,3 @@ int get_segy_limits(int verbose,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-/*
- * function write_cdfgrd writes output grid to a
- * GMT version 2 netCDF grd file
- */
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error)
-{
-	char	*function_name = "write_cdfgrd";
-	int	status = MB_SUCCESS;
-	struct GRD_HEADER grd;
-	double	w, e, s, n;
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
-#else
-	int	pad[4];
-#endif
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	char	remark[MB_PATH_MAXLINE];
-	char	*ctime();
-	char	*getenv();
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       outfile:    %s\n",outfile);
-		fprintf(outfp,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(outfp,"dbg2       nx:         %d\n",nx);
-		fprintf(outfp,"dbg2       ny:         %d\n",ny);
-		fprintf(outfp,"dbg2       xmin:       %f\n",xmin);
-		fprintf(outfp,"dbg2       xmax:       %f\n",xmax);
-		fprintf(outfp,"dbg2       ymin:       %f\n",ymin);
-		fprintf(outfp,"dbg2       ymax:       %f\n",ymax);
-		fprintf(outfp,"dbg2       zmin:       %f\n",zmin);
-		fprintf(outfp,"dbg2       zmax:       %f\n",zmax);
-		fprintf(outfp,"dbg2       dx:         %f\n",dx);
-		fprintf(outfp,"dbg2       dy:         %f\n",dy);
-		fprintf(outfp,"dbg2       xlab:       %s\n",xlab);
-		fprintf(outfp,"dbg2       ylab:       %s\n",ylab);
-		fprintf(outfp,"dbg2       zlab:       %s\n",zlab);
-		fprintf(outfp,"dbg2       titl:       %s\n",titl);
-		fprintf(outfp,"dbg2       argc:       %d\n",(int)argc);
-		fprintf(outfp,"dbg2       *argv:      %p\n",(void *)*argv);
-		}
-
-	/* inititialize grd header */
-	GMT_program = program_name;
-	GMT_grd_init (&grd, 1, argv, FALSE);
-	GMT_io_init ();
-	GMT_grdio_init ();
-	GMT_make_fnan (GMT_f_NaN);
-	GMT_make_dnan (GMT_d_NaN);
-
-	/* copy values to grd header */
-	grd.nx = nx;
-	grd.ny = ny;
-	grd.node_offset = 1; /* pixel registration */
-	grd.x_min = xmin;
-	grd.x_max = xmax;
-	grd.y_min = ymin;
-	grd.y_max = ymax;
-	grd.z_min = zmin;
-	grd.z_max = zmax;
-	grd.x_inc = dx;
-	grd.y_inc = dy;
-	grd.z_scale_factor = 1.0;
-	grd.z_add_offset = 0.0;
-	strcpy(grd.x_units,xlab);
-	strcpy(grd.y_units,ylab);
-	strcpy(grd.z_units,zlab);
-	strcpy(grd.title,titl);
-	strcpy(grd.command,"\0");
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,MB_PATH_MAXLINE);
-	sprintf(remark,"\n\tProjection: %s\n\tGrid created by %s\n\tMB-system Version %s\n\tRun by <%s> on <%s> at <%s>",
-		projection,program_name,MB_VERSION,user,host,date);
-	strncpy(grd.remark, remark, 159);
-
-	/* set extract wesn,pad */
-	w = 0.0;
-	e = 0.0;
-	s = 0.0;
-	n = 0.0;
-	for (i=0;i<4;i++)
-		pad[i] = 0;
-
-	/* write grid to GMT netCDF grd file */
-/*for (i=0;i<nx;i++)
-for (j=0;j<ny;j++)
-{
-k = j * nx + i;
-fprintf(outfp,"%d %d %d %f\n",i,j,k,grid[k]);
-}*/
-	GMT_write_grd(outfile, &grd, grid, w, e, s, n, pad, FALSE);
-
-	/* free GMT memory */
-	GMT_free ((void *)GMT_io.skip_if_NaN);
-	GMT_free ((void *)GMT_io.in_col_type);
-	GMT_free ((void *)GMT_io.out_col_type);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsegyinfo.c b/src/utilities/mbsegyinfo.c
index d89e804..a0acc45 100644
--- a/src/utilities/mbsegyinfo.c
+++ b/src/utilities/mbsegyinfo.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsegyinfo.c	6/2/2004
- *    $Id: mbsegyinfo.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbsegyinfo.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -18,28 +18,6 @@
  * Author:	D. W. Caress
  * Date:	June 2, 2004
  *
- * $Log: mbsegyinfo.c,v $
- * Revision 5.5  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.4  2008/05/24 19:40:42  caress
- * Applied a Gordon Keith fix.
- *
- * Revision 5.3  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.2  2004/10/06 19:10:53  caress
- * Release 5.0.5 update.
- *
- * Revision 5.1  2004/07/27 19:48:35  caress
- * Working on handling subbottom data.
- *
- * Revision 5.0  2004/06/18 04:06:05  caress
- * Adding support for segy i/o and working on support for Reson 7k format 88.
- *
- *
- *
- *
  */
 
 /* standard include files */
@@ -56,9 +34,6 @@
 #include "mb_define.h"
 #include "mb_segy.h"
 
-/* GMT include files */
-#include "gmt_nan.h"
-
 /* local options */
 #define	MAX_OPTIONS	25
 #define	MBLIST_CHECK_ON			0
@@ -70,10 +45,7 @@
 #define	MBLIST_SET_ON	1
 #define	MBLIST_SET_ALL	2
 
-/* NaN value */
-double	NaN;
-
-static char rcs_id[] = "$Id: mbsegyinfo.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbsegyinfo.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbsegylist.c b/src/utilities/mbsegylist.c
index 0f6e372..8d8575f 100644
--- a/src/utilities/mbsegylist.c
+++ b/src/utilities/mbsegylist.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsegylist.c	5/29/2004
- *    $Id: mbsegylist.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbsegylist.c 2251 2015-07-01 01:02:06Z caress $
  *
- *    Copyright (c) 2004-2014 by
+ *    Copyright (c) 2004-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -21,31 +21,6 @@
  * Author:	D. W. Caress
  * Date:	May 29, 2004
  *
- * $Log: mbsegylist.c,v $
- * Revision 5.6  2007/10/17 20:34:00  caress
- * Release 5.1.1beta11
- * Added decimation option.
- *
- * Revision 5.5  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.4  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.3  2005/06/04 05:19:04  caress
- * Fixed water depth calculation.
- *
- * Revision 5.2  2004/10/06 19:10:53  caress
- * Release 5.0.5 update.
- *
- * Revision 5.1  2004/07/27 19:48:35  caress
- * Working on handling subbottom data.
- *
- * Revision 5.0  2004/06/18 04:06:05  caress
- * Adding support for segy i/o and working on support for Reson 7k format 88.
- *
- *
- *
  *
  */
 
@@ -63,9 +38,6 @@
 #include "mb_define.h"
 #include "mb_segy.h"
 
-/* GMT include files */
-#include "gmt_nan.h"
-
 /* local options */
 #define	MAX_OPTIONS	25
 #define	MBLIST_CHECK_ON			0
@@ -86,7 +58,7 @@ int printsimplevalue(int verbose,
 	int ascii, int *invert, int *flipsign, int *error);
 int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error);
 
-static char rcs_id[] = "$Id: mbsegylist.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbsegylist.c 2251 2015-07-01 01:02:06Z caress $";
 
 /*--------------------------------------------------------------------*/
 
@@ -153,6 +125,7 @@ int main (int argc, char **argv)
 	double	navlon, navlat;
 	double	factor, sonardepth, waterdepth;
 	double	delay, interval;
+	double	seconds;
 
 	double	b;
 	int	format;
@@ -185,7 +158,7 @@ int main (int argc, char **argv)
 	decimate = 1;
 
 	/* get NaN value */
-	GMT_make_dnan(NaN);
+	MB_MAKE_DNAN(NaN);
 
 	/* process argument list */
 	while ((c = getopt(argc, argv, "AaD:d:G:g:I:i:L:l:O:o:VvWwZ:z:Hh")) != -1)
@@ -463,12 +436,13 @@ int main (int argc, char **argv)
 						break;
 					case 'J': /* time string */
 						mb_get_jtime(verbose,time_i,time_j);
+						seconds = time_i[5] + 0.000001 * time_i[6];
 						if (ascii == MB_YES)
 						    {
-						    printf("%.4d %.3d %.2d %.2d %.2d.%6.6d",
+						    printf("%.4d %.3d %.2d %.2d %9.6f",
 							time_j[0],time_j[1],
 							time_i[3],time_i[4],
-							time_i[5],time_i[6]);
+							seconds);
 						    }
 						else
 						    {
@@ -488,11 +462,12 @@ int main (int argc, char **argv)
 						break;
 					case 'j': /* time string */
 						mb_get_jtime(verbose,time_i,time_j);
+						seconds = time_i[5] + 0.000001 * time_i[6];
 						if (ascii == MB_YES)
 						    {
-						    printf("%.4d %.3d %.4d %.2d.%6.6d",
+						    printf("%.4d %.3d %.4d %9.6f",
 							time_j[0],time_j[1],
-							time_j[2],time_j[3],time_j[4]);
+							time_j[2],seconds);
 						    }
 						else
 						    {
@@ -579,11 +554,11 @@ int main (int argc, char **argv)
 						    }
 						break;
 					case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
+						seconds = time_i[5] + 1e-6 * time_i[6];
 						if (ascii == MB_YES)
-						    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%.2d.%.6d",
+						    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
 							time_i[0],time_i[1],time_i[2],
-							time_i[3],time_i[4],time_i[5],
-							time_i[6]);
+							time_i[3],time_i[4],seconds);
 						else
 						    {
 						    b = time_i[0];
@@ -596,16 +571,16 @@ int main (int argc, char **argv)
 						    fwrite(&b, sizeof(double), 1, stdout);
 						    b = time_i[4];
 						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[5] + 1e-6 * time_i[6];
+						    b = seconds;
 						    fwrite(&b, sizeof(double), 1, stdout);
 						    }
 						break;
 					case 't': /* yyyy mm dd hh mm ss time string */
+						seconds = time_i[5] + 1e-6 * time_i[6];
 						if (ascii == MB_YES)
-						    printf("%.4d %.2d %.2d %.2d %.2d %.2d.%.6d",
+						    printf("%.4d %.2d %.2d %.2d %.2d %9.6f",
 							time_i[0],time_i[1],time_i[2],
-							time_i[3],time_i[4],time_i[5],
-							time_i[6]);
+							time_i[3],time_i[4],seconds);
 						else
 						    {
 						    b = time_i[0];
@@ -618,7 +593,7 @@ int main (int argc, char **argv)
 						    fwrite(&b, sizeof(double), 1, stdout);
 						    b = time_i[4];
 						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[5] + 1e-6 * time_i[6];
+						    b = seconds;
 						    fwrite(&b, sizeof(double), 1, stdout);
 						    }
 						break;
diff --git a/src/utilities/mbsegypsd.c b/src/utilities/mbsegypsd.c
index c387822..d456b8a 100644
--- a/src/utilities/mbsegypsd.c
+++ b/src/utilities/mbsegypsd.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsegypsd.c	11/2/2009
- *    $Id: mbsegypsd.c 2183 2014-04-16 19:54:45Z caress $
+ *    $Id: mbsegypsd.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2009-2014 by
+ *    Copyright (c) 2009-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -34,9 +34,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-/* GMT include files */
-#include "gmt.h"
-
 /* FFTW include files */
 #include "fftw3.h"
 
@@ -45,6 +42,7 @@
 #include "mb_format.h"
 #include "mb_define.h"
 #include "mb_segy.h"
+#include "mb_aux.h"
 
 /* local options */
 #define MBSEGYPSD_USESHOT		0
@@ -57,13 +55,6 @@
 /* NaN value */
 float	NaN;
 
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error);
 int get_segy_limits(int verbose,
 		char	*segyfile,
 		int	*tracemode,
@@ -81,7 +72,7 @@ char	*getenv();
 	stderr if verbose > 1) */
 FILE	*outfp;
 
-static char rcs_id[] = "$Id: mbsegypsd.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[] = "$Id: mbsegypsd.c 2227 2015-02-05 21:12:31Z caress $";
 char program_name[] = "mbsegypsd";
 char help_message[] =  "mbsegypsd calculates the power spectral density function of each trace in a segy data file, \noutputting the results as a GMT grid file.";
 char usage_message[] = "mbsegypsd -Ifile -Oroot [-Ashotscale \n\
@@ -196,7 +187,7 @@ int main (int argc, char **argv)
 	segyfile[0] = '\0';
 
 	/* get NaN value */
-	GMT_make_fnan(NaN);
+	MB_MAKE_FNAN(NaN);
 
 	/* process argument list */
 	while ((c = getopt(argc, argv, "A:a:D:d:I:i:LlN:n:O:o:PpS:s:T:t:VvW:w:Hh")) != -1)
@@ -763,12 +754,13 @@ ix,iy,k,spsd[iy],wpsd[iy],ymax * iy / ngridy,grid[k]);*/
 	else
 		strcpy(zlabel, "Intensity/Hz");
 	sprintf(title, "Power Spectral Density Grid from %s", segyfile);
-	status = write_cdfgrd(verbose, gridfile, grid,
-		ngridx, ngridy,
-		xmin, xmax, ymin, ymax,
-		gridmintot, gridmaxtot, dx, dy,
-		xlabel, ylabel, zlabel, title,
-		projection, argc, argv, &error);
+	status = mb_write_gmt_grd(verbose, gridfile, grid,
+				NaN, 
+				ngridx, ngridy,
+				xmin, xmax, ymin, ymax,
+				gridmintot, gridmaxtot, dx, dy,
+				xlabel, ylabel, zlabel, title,
+				projection, argc, argv, &error);
 
 	/* output average power spectra */
 	if ((fp = fopen(psdfile, "w")) != NULL)
@@ -1006,136 +998,3 @@ int get_segy_limits(int verbose,
 	return(status);
 }
 /*--------------------------------------------------------------------*/
-/*
- * function write_cdfgrd writes output grid to a
- * GMT version 2 netCDF grd file
- */
-int write_cdfgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double zmin, double zmax, double dx, double dy,
-		char *xlab, char *ylab, char *zlab, char *titl,
-		char *projection, int argc, char **argv,
-		int *error)
-{
-	char	*function_name = "write_cdfgrd";
-	int	status = MB_SUCCESS;
-	struct GRD_HEADER grd;
-	double	w, e, s, n;
-#ifdef GMT_MINOR_VERSION
-	GMT_LONG	pad[4];
-#else
-	int	pad[4];
-#endif
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	char	remark[MB_PATH_MAXLINE];
-	char	*ctime();
-	char	*getenv();
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       outfile:    %s\n",outfile);
-		fprintf(outfp,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(outfp,"dbg2       nx:         %d\n",nx);
-		fprintf(outfp,"dbg2       ny:         %d\n",ny);
-		fprintf(outfp,"dbg2       xmin:       %f\n",xmin);
-		fprintf(outfp,"dbg2       xmax:       %f\n",xmax);
-		fprintf(outfp,"dbg2       ymin:       %f\n",ymin);
-		fprintf(outfp,"dbg2       ymax:       %f\n",ymax);
-		fprintf(outfp,"dbg2       zmin:       %f\n",zmin);
-		fprintf(outfp,"dbg2       zmax:       %f\n",zmax);
-		fprintf(outfp,"dbg2       dx:         %f\n",dx);
-		fprintf(outfp,"dbg2       dy:         %f\n",dy);
-		fprintf(outfp,"dbg2       xlab:       %s\n",xlab);
-		fprintf(outfp,"dbg2       ylab:       %s\n",ylab);
-		fprintf(outfp,"dbg2       zlab:       %s\n",zlab);
-		fprintf(outfp,"dbg2       titl:       %s\n",titl);
-		fprintf(outfp,"dbg2       argc:       %d\n",(int)argc);
-		fprintf(outfp,"dbg2       *argv:      %p\n",(void *)*argv);
-		}
-
-	/* inititialize grd header */
-	GMT_program = program_name;
-	GMT_grd_init (&grd, 1, argv, FALSE);
-	GMT_io_init ();
-	GMT_grdio_init ();
-	GMT_make_fnan (GMT_f_NaN);
-	GMT_make_dnan (GMT_d_NaN);
-
-	/* copy values to grd header */
-	grd.nx = nx;
-	grd.ny = ny;
-	grd.node_offset = 1; /* pixel registration */
-	grd.x_min = xmin;
-	grd.x_max = xmax;
-	grd.y_min = ymin;
-	grd.y_max = ymax;
-	grd.z_min = zmin;
-	grd.z_max = zmax;
-	grd.x_inc = dx;
-	grd.y_inc = dy;
-	grd.z_scale_factor = 1.0;
-	grd.z_add_offset = 0.0;
-	strcpy(grd.x_units,xlab);
-	strcpy(grd.y_units,ylab);
-	strcpy(grd.z_units,zlab);
-	strcpy(grd.title,titl);
-	strcpy(grd.command,"\0");
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,MB_PATH_MAXLINE);
-	sprintf(remark,"\n\tProjection: %s\n\tGrid created by %s\n\tMB-system Version %s\n\tRun by <%s> on <%s> at <%s>",
-		projection,program_name,MB_VERSION,user,host,date);
-	strncpy(grd.remark, remark, 159);
-
-	/* set extract wesn,pad */
-	w = 0.0;
-	e = 0.0;
-	s = 0.0;
-	n = 0.0;
-	for (i=0;i<4;i++)
-		pad[i] = 0;
-
-	/* write grid to GMT netCDF grd file */
-/*for (i=0;i<nx;i++)
-for (j=0;j<ny;j++)
-{
-k = j * nx + i;
-fprintf(outfp,"%d %d %d %f\n",i,j,k,grid[k]);
-}*/
-	GMT_write_grd(outfile, &grd, grid, w, e, s, n, pad, FALSE);
-
-	/* free GMT memory */
-	GMT_free ((void *)GMT_io.skip_if_NaN);
-	GMT_free ((void *)GMT_io.in_col_type);
-	GMT_free ((void *)GMT_io.out_col_type);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbset.c b/src/utilities/mbset.c
index 0c3328a..125a440 100644
--- a/src/utilities/mbset.c
+++ b/src/utilities/mbset.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbset.c	1/4/2000
- *    $Id: mbset.c 2210 2014-11-10 19:53:01Z caress $
+ *    $Id: mbset.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2000-2014 by
+ *    Copyright (c) 2000-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -153,7 +153,7 @@
 #include "mb_process.h"
 #include "mb_swap.h"
 
-static char rcs_id[] = "$Id: mbset.c 2210 2014-11-10 19:53:01Z caress $";
+static char rcs_id[] = "$Id: mbset.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbsslayout.c b/src/utilities/mbsslayout.c
index dbf0ba4..b6954b9 100644
--- a/src/utilities/mbsslayout.c
+++ b/src/utilities/mbsslayout.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsslayout.c	1/8/2014
- *    $Id: mbsslayout.c 2196 2014-07-14 05:52:06Z caress $
+ *    $Id: mbsslayout.c 2235 2015-03-22 15:21:55Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -23,7 +23,7 @@
  */
 
 /* source file version string */
-static char version_id[] = "$Id: mbsslayout.c 2196 2014-07-14 05:52:06Z caress $";
+static char version_id[] = "$Id: mbsslayout.c 2235 2015-03-22 15:21:55Z caress $";
 
 /* standard include files */
 #include <stdio.h>
@@ -2453,7 +2453,8 @@ dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
 						fprintf(sfp, "# Generate swath plot of sidescan file: %s\n", output_file);
 						fprintf(sfp, "mbm_plot -I %s -N -G5 -S -Pb -V -O %s_ssrawplot\n",
 							output_file, output_file);
-						fprintf(sfp, "%s_ssrawplot.cmd\n\n", output_file);
+						fprintf(sfp, "%s_ssrawplot.cmd $1\n", output_file);
+						fprintf(sfp, "convert -density 100 %s_ssrawplot.ps -trim -quality 75 %s_ssrawplot.jpg\n\n", output_file, output_file);
 						}
 		
 					/* define the filename */
@@ -3051,7 +3052,8 @@ fprintf(stderr,"III j:%d x:%7.2f l:%7.2f s:%6.2f\n",j,ossacrosstrack[j],ossalong
 		fprintf(sfp, "# Generate swath plot of sidescan file: %s\n", output_file);
 		fprintf(sfp, "mbm_plot -I %s -N -G5 -S -Pb -V -O %s_ssrawplot\n",
 			output_file, output_file);
-		fprintf(sfp, "%s_ssrawplot.cmd\n\n", output_file);
+		fprintf(sfp, "%s_ssrawplot.cmd $1\n", output_file);
+		fprintf(sfp, "convert -density 100 %s_ssrawplot.ps -trim -quality 75 %s_ssrawplot.jpg\n\n", output_file, output_file);
 		}
 
 	/* close plotting script file */
diff --git a/src/utilities/mbstripnan.c b/src/utilities/mbstripnan.c
index 9f27228..8381aef 100644
--- a/src/utilities/mbstripnan.c
+++ b/src/utilities/mbstripnan.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:    mbstripNaN.c        8/8/02
- *    $Id: mbstripnan.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbstripnan.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2002-2014 by
+ *    Copyright (c) 2002-2015 by
  *    Mike McCann (mccann at mbari.org)
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
diff --git a/src/utilities/mbsvplist.c b/src/utilities/mbsvplist.c
index a7d520e..d8e3030 100644
--- a/src/utilities/mbsvplist.c
+++ b/src/utilities/mbsvplist.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsvplist.c	1/3/2001
- *    $Id: mbsvplist.c 2183 2014-04-16 19:54:45Z caress $
+ *    $Id: mbsvplist.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2001-2014 by
+ *    Copyright (c) 2001-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -109,7 +109,7 @@ struct mbsvplist_svp_struct {
 	double	velocity[MB_SVP_MAX];
 };
 
-static char rcs_id[] = "$Id: mbsvplist.c 2183 2014-04-16 19:54:45Z caress $";
+static char rcs_id[] = "$Id: mbsvplist.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 
diff --git a/src/utilities/mbsvpselect.c b/src/utilities/mbsvpselect.c
index 41747ed..77af9ee 100644
--- a/src/utilities/mbsvpselect.c
+++ b/src/utilities/mbsvpselect.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsvpselect.c	03.03.2014
- *	$Id: mbsvpselect.c 2185 2014-05-11 06:34:36Z caress $
+ *	$Id: mbsvpselect.c 2247 2015-05-29 21:28:28Z caress $
  *
- *    Copyright (c) 2014-2014 by
+ *    Copyright (c) 2014-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -250,6 +250,7 @@ void mid_point(long double lat1,
 	long double lon2,
 	long double *lat3,
 	long double *lon3);
+void pause_screen(void);
 
 /* global variables */
 int counter_i_i2=0;
@@ -274,7 +275,7 @@ char sdBuffer[BUFSIZ];
 char buffer[BUFSIZ];		/* String to hold the file name */
 char buffer_2[BUFSIZ];
 
-static char version_id[] = "$Id: mbsvpselect.c 2185 2014-05-11 06:34:36Z caress $";
+static char version_id[] = "$Id: mbsvpselect.c 2247 2015-05-29 21:28:28Z caress $";
 
 /* ------------------------------------------------------------------- */
 
diff --git a/src/utilities/mbswplspreprocess.c b/src/utilities/mbswplspreprocess.c
index 40d3b2b..8ac0991 100644
--- a/src/utilities/mbswplspreprocess.c
+++ b/src/utilities/mbswplspreprocess.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbsxppreprocess.c	09/12/2013
- *    $Id: mbswplspreprocess.c 2185 2014-05-11 06:34:36Z caress $
+ *    $Id: mbswplspreprocess.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2005-2013 by
+ *    Copyright (c) 2005-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
diff --git a/src/utilities/mbtime.c b/src/utilities/mbtime.c
index 9dac315..fa90c5f 100644
--- a/src/utilities/mbtime.c
+++ b/src/utilities/mbtime.c
@@ -1,8 +1,8 @@
 /*--------------------------------------------------------------------
  *    The MB-system:	mbtime.c	6/5/2008
- *    $Id: mbtime.c 2175 2014-03-18 23:03:39Z caress $
+ *    $Id: mbtime.c 2227 2015-02-05 21:12:31Z caress $
  *
- *    Copyright (c) 2008-2014 by
+ *    Copyright (c) 2008-2015 by
  *    David W. Caress (caress at mbari.org)
  *      Monterey Bay Aquarium Research Institute
  *      Moss Landing, CA 95039
@@ -44,7 +44,7 @@
 #define MBTIME_INPUT_EPOCH	0
 #define MBTIME_INPUT_CALENDAR	1
 
-static char rcs_id[] = "$Id: mbtime.c 2175 2014-03-18 23:03:39Z caress $";
+static char rcs_id[] = "$Id: mbtime.c 2227 2015-02-05 21:12:31Z caress $";
 
 /*--------------------------------------------------------------------*/
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mbsystem.git



More information about the Pkg-grass-devel mailing list